![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2005
Location: Charlottesville, VA (rated #1 place to live)
Posts: 25
Rep Power: 0
![]() |
I've been programming for a while in Assembly, but have always for some reason been drawn to machine language. Not hex, but just pure binary. I've already taught myself a little from writing programs in assembly and running them through a Hex editor, but it would be helpful to have some reference. Does anyone know where I can get a list of Opcodes, or even a book entirely about Machine Language? I've already scoured the internet for information, but all I find is crud on number systems. I already know the basics (like I can write a program that displays your name and stuff), but it would help to have an authoritative reference to study from.
__________________
Cavear Emptor |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Just curious: does it really matter whether you code machine language in hex or binary? I mean, one can be translated to the other with minimal effort, and it's not like you can do things with binary that you can't with hex.
|
|
|
|
|
|
#3 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
I prefer the mnemonics as well, as it just simplifies things in my opinion. I did have a site, though, that seemed to have a bit of what you were asking with. Let me see if I can find it again.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Feb 2005
Location: Charlottesville, VA (rated #1 place to live)
Posts: 25
Rep Power: 0
![]() |
Again, there's not a huge reason I'd prefer to program in binay. I'm just curious how it works. Is it faster? Beginning Programming for Dummies says it is, but that's not exactly a manual on 80x86 architecture is it?
![]()
__________________
Cavear Emptor |
|
|
|
|
|
#5 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
It's execution speed wouldn't be any different, as the machine code would be the same, and coding and debugging it would be much harder.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5
![]() |
how would you write a program in binary?
i can understand hex, but binary, how would you write it? 001001010101010110100101010101010111011000011001010101001010101010100101010110000000000010101010101010101010100010100101000111001010101010100010101001010101 how would i write it? should i type this in a text editor and safe as what? like i said, i can understand how writing in hex works, i'm planning on learning it myself as well, but binary? that would be a real pain in the @ss.
__________________
http://www.white-scorpion.nl |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Feb 2005
Posts: 89
Rep Power: 4
![]() |
first,
there is no difference between writing in binary and asm, except one can be done about 100 times faster. it's cool that you want to learn the opcodes, but for a modern processor, it's just too much to memorize. in the end, you will end up typing in pseudo-asm and converting it to binary through a regexp script. i guess a person could learn the entire instruction set for something like PIC, because they are all short and there are less than 40 of them. but a pentium or a g3 is out of the question. and, if you wanted to write something in binary, i suppose you could just write it in a text editor, and write a script to output it in real binary to an .obj or .exe file. good lord that sounds tedious. or, you could save a blank file and edit it with a disk editor. that sounds like oodles of fun. as for an opcode reference, try to find the spec sheet for the processor you are using. try here. http://www.intel.com/design/pentium4.../index_new.htm this will give you everything you need to know about coding binary for the p4. commands a-m take up 580 pages. and all the opcodes are in hex. sorry, you'll have to convert in your head. ![]() |
|
|
|
|
|
#8 |
|
Hobbyist Programmer
Join Date: Dec 2004
Location: a cardboard box
Posts: 118
Rep Power: 5
![]() |
What kind of processor are you looking for a booklet for?
Its easier to just use mnuemonics. Its the exact same thing as using Hex or Binary when programming in Assembly, except its easier to write and debug. I've done some programs in Hex, and its a lot harder to determine what the heck went wrong.
__________________
... |
|
|
|
|
|
#9 |
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5
![]() |
i was afraid you would need a script to convert it, then it still isn't really machine language is it.
I'm mostly programming on the P4 (centrino). i think i could learn the opcodes pretty easily but i first need to learn more about the PE headers i think, since you would have to write them yourself as well.... thanks for the replies, i will study the opcodes ;_)
__________________
http://www.white-scorpion.nl |
|
|
|
|
|
#10 |
|
Newbie
Join Date: Feb 2005
Location: Charlottesville, VA (rated #1 place to live)
Posts: 25
Rep Power: 0
![]() |
I was just curious. We had an old Commodore 64 in our attic, and I programmed a bit of machine language on that. There weren't a ton of instructions, so it was pretty simple. The main thing I use machine language for is dissasembly. I like to collect (and write) viruses, so when I catch one I run it through a Hex Editor. Like I said above, I figured out basic instructions on my own, but it would be useful to have some reference.
__________________
Cavear Emptor |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|