Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80203 > unrolled thread
| Started by | françai s <romapera15@gmail.com> |
|---|---|
| First post | 2014-11-04 13:45 -0300 |
| Last post | 2014-11-06 09:24 -0800 |
| Articles | 13 — 11 participants |
Back to article view | Back to comp.lang.python
[OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? françai s <romapera15@gmail.com> - 2014-11-04 13:45 -0300
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? Grant Edwards <invalid@invalid.invalid> - 2014-11-04 17:05 +0000
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? Rustom Mody <rustompmody@gmail.com> - 2014-11-04 09:37 -0800
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? sjmsoft@gmail.com - 2014-11-04 10:06 -0800
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? sohcahtoa82@gmail.com - 2014-11-04 10:24 -0800
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? "ast" <nomail@invalid.com> - 2014-11-04 19:51 +0100
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? sohcahtoa82@gmail.com - 2014-11-04 11:24 -0800
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? Cameron Simpson <cs@zip.com.au> - 2014-11-05 17:39 +1100
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? Chris Angelico <rosuav@gmail.com> - 2014-11-05 18:09 +1100
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? Dan Stromberg <drsalists@gmail.com> - 2014-11-05 16:04 -0800
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? Grant Edwards <invalid@invalid.invalid> - 2014-11-04 19:46 +0000
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? Tobiah <toby@tobiah.org> - 2014-11-04 11:29 -0800
Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? mbg1708@planetmail.com - 2014-11-06 09:24 -0800
| From | françai s <romapera15@gmail.com> |
|---|---|
| Date | 2014-11-04 13:45 -0300 |
| Subject | [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? |
| Message-ID | <mailman.15457.1415119763.18130.python-list@python.org> |
I intend to write in lowest level of computer programming as a hobby. It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? What is the lowest level of programming computers that you can write ? Is binary code? Is hex code? Is another machine code? Honestly do not know if it is true that there is another machine code beyond the binary and hex code. Is Assembly?
[toc] | [next] | [standalone]
| From | Grant Edwards <invalid@invalid.invalid> |
|---|---|
| Date | 2014-11-04 17:05 +0000 |
| Message-ID | <m3b10u$4e3$1@reader1.panix.com> |
| In reply to | #80203 |
On 2014-11-04, françai s <romapera15@gmail.com> wrote:
> I intend to write in lowest level of computer programming as a hobby.
>
> It is true that is impossible write in binary code,
No. You can write in binary if you want. If I were going to do
something like that I'd pick a CPU like a PDP11 with a nice simple,
regular, orthogonal instruction set. That will minimize the amount of
stuff you'll need to memorize. The MSP430 isn't bad either.
> the lowest level of programming that you can write is in hex code?
Hex is just a shorthand notation for binary where a group of 4 bits is
represented by a single character 0-9,A-F, but it's the exact same
"code":
binary hex
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
> What is the lowest level of programming computers that you can write ?
>
> Is binary code?
> Is hex code?
They're the same thing. I supposed I could write in hex/binary if I
really wanted to. I did it once or twice in the distant past, but
it's not something I'd consider fun.
The lowest language I actually write code in is assembly.
> Is another machine code? Honestly do not know if it is true that
> there is another machine code beyond the binary and hex code.
> Is Assembly?
Assembly is small a step up from binary, where you enter keywords that
are translated directly into binary using a simple lookup table. You
still have to know all about the CPU's instructions, registers, modes,
and so on the same as you do when writing in binary -- you just don't
have to memorize exactly which bit patterns are used for which
instructions.
On many CPUs there is another layer below "binary" and that's the
microcode that runs on the actual CPU gates. The microcode is a
little program that interprets the "binary" code that you're talking
about writing. The only people that write microcode are the design
engieers where the CPU was designed.
If you really want to write in "binary", you should probably first
learn to program in assembly language as a way to understand the the
CPU and it's instruction set and addressing modes. The assmebler will
still do all sorts of bookkeeping and keep track of memory addresses
for you so that when you insert or remove an instruction you don't
have to manually adjust the addresses for the entire rest of the
program.
--
Grant Edwards grant.b.edwards Yow! A dwarf is passing out
at somewhere in Detroit!
gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Rustom Mody <rustompmody@gmail.com> |
|---|---|
| Date | 2014-11-04 09:37 -0800 |
| Message-ID | <9dad69d7-6d9c-4ed1-9b2b-d8573b5aa581@googlegroups.com> |
| In reply to | #80203 |
On Tuesday, November 4, 2014 10:19:36 PM UTC+5:30, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of programming computers that you can write ? > > Is binary code? > > Is hex code? > > Is another machine code? Honestly do not know if it is true that there > is another machine code beyond the binary and hex code. > > Is Assembly? Machines of earlier years had something called microprogramming below the machine language level. After the advent of RISC machines (ie for the last 20 years or so) this is not available to a 'normal' user. [Where by 'normal' user I mean someone who is not an employee of Intel for example]. Classic book for this is Tanenbaum's Structured computer organization. Then below this is a bunch of layers (very remote from programming) which electronics folks deal with going upto the solid-state physics of silicon
[toc] | [prev] | [next] | [standalone]
| From | sjmsoft@gmail.com |
|---|---|
| Date | 2014-11-04 10:06 -0800 |
| Message-ID | <fde36d6a-7d4d-4801-a5a5-f0d3a7d78565@googlegroups.com> |
| In reply to | #80203 |
Grant's statements are correct and his advice is sound. I would not waste my time writing machine code, even as a hobby (and not even if your other hobbies include juggling chain saws). It's too time-consuming, tedious, bug-prone, and eyeglass-prescription-enhancing. Programming in assembly language will show you how the machine really works, and is challenging enough for almost anyone. And it will help you truly appreciate a powerful high-level language like Python. I've written much assembly language, on two different architectures, over the past 35 years, and I'm glad I did. But these days I work in assembly language only when necessary (legacy code). Give me Python any day! Cheers, Steve J. Martin
[toc] | [prev] | [next] | [standalone]
| From | sohcahtoa82@gmail.com |
|---|---|
| Date | 2014-11-04 10:24 -0800 |
| Message-ID | <e5c95792-f81f-42b4-9996-5545f560781d@googlegroups.com> |
| In reply to | #80203 |
On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of programming computers that you can write ? > > Is binary code? > > Is hex code? > > Is another machine code? Honestly do not know if it is true that there > is another machine code beyond the binary and hex code. > > Is Assembly? I can't think of any reason why someone would WANT to program in binary/hex machine code. If you want to program in a language that is as close to the metal as you can get, just learn Assembly. It will save you many headaches, especially if you're planning on writing for x86 CPUs. The number of opcodes is absurd without even getting into 64-bit instructions, SSE, etc.
[toc] | [prev] | [next] | [standalone]
| From | "ast" <nomail@invalid.com> |
|---|---|
| Date | 2014-11-04 19:51 +0100 |
| Message-ID | <5459203a$0$12772$426a74cc@news.free.fr> |
| In reply to | #80214 |
<sohcahtoa82@gmail.com> a écrit dans le message de news:e5c95792-f81f-42b4-9996-5545f560781d@googlegroups.com... On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: >I can't think of any reason why someone would WANT >to program in binary/hex machine code. It happens if you design yourself a specialized microcoded machine, also known as a number cruncher and you dont want to developp assembly tools to program it. So you have to fill a memory with 0 and 1 It's sometimes the work of electronic engineers, chip designers.
[toc] | [prev] | [next] | [standalone]
| From | sohcahtoa82@gmail.com |
|---|---|
| Date | 2014-11-04 11:24 -0800 |
| Message-ID | <39ed3434-2d1c-4d74-b20d-db8b346f1c7d@googlegroups.com> |
| In reply to | #80217 |
On Tuesday, November 4, 2014 10:51:53 AM UTC-8, ast wrote: > <sohcahtoa82> a écrit dans le message de > news:e5c95792-f81f-42b4-9996-5545f560781d@googlegroups.com... > On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: > > > >I can't think of any reason why someone would WANT > >to program in binary/hex machine code. > > It happens if you design yourself a specialized microcoded > machine, also known as a number cruncher and you dont > want to developp assembly tools to program it. So you > have to fill a memory with 0 and 1 > It's sometimes the work of electronic engineers, chip > designers. Well, yeah, that's pretty obvious, but I think that's a bit outside the scope of this discussion. The OP didn't mention designing a chip.
[toc] | [prev] | [next] | [standalone]
| From | Cameron Simpson <cs@zip.com.au> |
|---|---|
| Date | 2014-11-05 17:39 +1100 |
| Message-ID | <mailman.15479.1415169574.18130.python-list@python.org> |
| In reply to | #80225 |
On 04Nov2014 11:24, sohcahtoa82@gmail.com <sohcahtoa82@gmail.com> wrote: >On Tuesday, November 4, 2014 10:51:53 AM UTC-8, ast wrote: >> <sohcahtoa82> a écrit dans le message de >> news:e5c95792-f81f-42b4-9996-5545f560781d@googlegroups.com... >> On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: >> >I can't think of any reason why someone would WANT >> >to program in binary/hex machine code. >> >> It happens if you design yourself a specialized microcoded >> machine, also known as a number cruncher and you dont >> want to developp assembly tools to program it. So you >> have to fill a memory with 0 and 1 >> It's sometimes the work of electronic engineers, chip >> designers. > >Well, yeah, that's pretty obvious, but I think that's a bit outside the scope of this discussion. The OP didn't mention designing a chip. Bah! He asked if there were lower levels than binary. Ergo: chip design! (And microcode, the intermediate layer. Or one of the layers, depending where you draw the line.) Should we stop before we reach the quantum foam of spacetime? Cheers, Cameron Simpson <cs@zip.com.au>
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-11-05 18:09 +1100 |
| Message-ID | <mailman.15481.1415171401.18130.python-list@python.org> |
| In reply to | #80225 |
On Wed, Nov 5, 2014 at 5:39 PM, Cameron Simpson <cs@zip.com.au> wrote: > Bah! He asked if there were lower levels than binary. Ergo: chip design! > (And microcode, the intermediate layer. Or one of the layers, depending > where you draw the line.) Should we stop before we reach the quantum foam of > spacetime? Certainly not. We keep going below electrons, and find ourselves in Quantumland. It's like Wonderland, only... uhh... actually, it's just like Wonderland. Pick up a book called "Alice in Quantumland" by Robert Gilmore - it's worth reading. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Dan Stromberg <drsalists@gmail.com> |
|---|---|
| Date | 2014-11-05 16:04 -0800 |
| Message-ID | <mailman.15522.1415232275.18130.python-list@python.org> |
| In reply to | #80225 |
On Tue, Nov 4, 2014 at 10:39 PM, Cameron Simpson <cs@zip.com.au> wrote: > Bah! He asked if there were lower levels than binary. Ergo: chip design! > (And microcode, the intermediate layer. Or one of the layers, depending > where you draw the line.) Should we stop before we reach the quantum foam of > spacetime? Last I heard, Intel (and others?) had stopped using microcode, to get a performance boost. That means CPU's are not field-updatable in the event of a problem, but most people would just buy another computer anyway.
[toc] | [prev] | [next] | [standalone]
| From | Grant Edwards <invalid@invalid.invalid> |
|---|---|
| Date | 2014-11-04 19:46 +0000 |
| Message-ID | <m3baf0$s97$1@reader1.panix.com> |
| In reply to | #80217 |
On 2014-11-04, ast <nomail@invalid.com> wrote:
>
><sohcahtoa82@gmail.com> a écrit dans le message de
> news:e5c95792-f81f-42b4-9996-5545f560781d@googlegroups.com...
> On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote:
>
>
>>I can't think of any reason why someone would WANT
>>to program in binary/hex machine code.
>
> It happens if you design yourself a specialized microcoded
> machine, also known as a number cruncher and you dont
> want to developp assembly tools to program it.
It only takes a couple hours to write a half decent two-pass absolute
assembler in Python. I've done it. There are also generic assember
toolkits/frameworks available. Doing real work in binary is insane.
I know people _think_ they're're only going to spend an hour writing
"just this one" program in binary, so it's not worth spending a few
hours developing tools. IME, they're always wrong.
> So you have to fill a memory with 0 and 1
>
> It's sometimes the work of electronic engineers, chip designers.
--
Grant Edwards grant.b.edwards Yow! Did I say I was
at a sardine? Or a bus???
gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Tobiah <toby@tobiah.org> |
|---|---|
| Date | 2014-11-04 11:29 -0800 |
| Message-ID | <fO96w.418799$JH1.219637@fx08.iad> |
| In reply to | #80203 |
On 11/04/2014 08:45 AM, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of programming computers that you can write ? > > Is binary code? > > Is hex code? My first computers at home were Z80 powered Timex's. I tried writing video games in BASIC, but the machines were to slow to animate anything at reasonable speeds. I knew about machine language from a high-school computer course (using and Apple IIe). I bought a book on the Z80, and started reading. My Z80 manual showed each 8-bit instruction's anatomy in Hex and binary. Some of the instructions used several bits to denote some aspect of the instruction. I got some graph paper, and started coding that way, using one square per bit, and one line per byte. I translated all the binary by brain into integer, and used BASIC programs to 'poke' the bytes into memory then execute at the starting address. This was all quite educational and extremely tedious. Eventually, when I found out that assemblers existed, I wrote a crude one in BASIC, and found that to be a luxury. Later when I got an Atari 800, and the assembler cartridge I actually wrote a working two player Tron type game in assembly. Having delved into all of this, I'd like to echo the sentiments of a previous poster, that assembly is really the place to start for a low level language. You get all of the control of machine language, with far less of the headaches. Depending on what you want out of your hobby, if a working program that is of some use is one of those things, then start with assembly. If you just want to geek out and write a program that can guess a number between 1 and 100 by using graph paper, then sure, go for binary writing.
[toc] | [prev] | [next] | [standalone]
| From | mbg1708@planetmail.com |
|---|---|
| Date | 2014-11-06 09:24 -0800 |
| Message-ID | <2aa4c06d-bcd9-4b74-8ff0-8e10c55c2986@googlegroups.com> |
| In reply to | #80203 |
On Tuesday, 4 November 2014 16:49:36 UTC, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of programming computers that you can write ? > > Is binary code? > > Is hex code? > > Is another machine code? Honestly do not know if it is true that there > is another machine code beyond the binary and hex code. > > Is Assembly? If you want a really brilliant (and simple) book about the process of designing, structuring and building programs in assembly language, I'd recommend finding a copy of a book called A Programmer's Notebook written by David M Cortesi. The context is out of date (8080/Z-80 assembly programs for CP/M), but the overall structure of each chapter is brilliant: the development of decent designs, followed by a discussion of possible approaches to programming, followed by a detailed discussion of the development of the assembly language, and finally a final assembly code listing. One advantage of this book is that the 8080/Z-80 instruction set and the interface to CP/M are both relatively simple to grasp (compared with modern CPUs and modern OSs). That said, the lessons from this book translate to any assembly programming task. Good luck.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web