Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 23rd, 2005, 3:52 PM   #1
Christian_Rosenkreuz_777
Newbie
 
Join Date: Feb 2005
Location: Charlottesville, VA (rated #1 place to live)
Posts: 25
Rep Power: 0 Christian_Rosenkreuz_777 is on a distinguished road
Question Machine Language

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
Christian_Rosenkreuz_777 is offline   Reply With Quote
Old Feb 23rd, 2005, 5:51 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 23rd, 2005, 6:05 PM   #3
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Feb 23rd, 2005, 9:28 PM   #4
Christian_Rosenkreuz_777
Newbie
 
Join Date: Feb 2005
Location: Charlottesville, VA (rated #1 place to live)
Posts: 25
Rep Power: 0 Christian_Rosenkreuz_777 is on a distinguished road
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
Christian_Rosenkreuz_777 is offline   Reply With Quote
Old Feb 23rd, 2005, 10:00 PM   #5
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Feb 24th, 2005, 6:41 AM   #6
lepricaun
Hobbyist Programmer
 
lepricaun's Avatar
 
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5 lepricaun is on a distinguished road
how would you write a program in binary?

i can understand hex, but binary, how would you write it?
001001010101010110100101010101010111011000011001010101001010101010100101010110000000000010101010101010101010100010100101000111001010101010100010101001010101
would this be something like my first hello world program?
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
lepricaun is offline   Reply With Quote
Old Feb 24th, 2005, 3:33 PM   #7
brkstf
Programmer
 
brkstf's Avatar
 
Join Date: Feb 2005
Posts: 89
Rep Power: 4 brkstf is on a distinguished road
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.
brkstf is offline   Reply With Quote
Old Feb 24th, 2005, 7:21 PM   #8
Xero
Hobbyist Programmer
 
Join Date: Dec 2004
Location: a cardboard box
Posts: 118
Rep Power: 5 Xero is on a distinguished road
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.
__________________
...
Xero is offline   Reply With Quote
Old Feb 25th, 2005, 12:49 PM   #9
lepricaun
Hobbyist Programmer
 
lepricaun's Avatar
 
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5 lepricaun is on a distinguished road
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
lepricaun is offline   Reply With Quote
Old Mar 9th, 2005, 4:59 PM   #10
Christian_Rosenkreuz_777
Newbie
 
Join Date: Feb 2005
Location: Charlottesville, VA (rated #1 place to live)
Posts: 25
Rep Power: 0 Christian_Rosenkreuz_777 is on a distinguished road
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
Christian_Rosenkreuz_777 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:07 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC