|
-
Apr 18th, 2002, 07:01 PM
#1
Thread Starter
Hyperactive Member
maybe a dumb question but worth asking
ok, op codes, yes the little hex numbers that represent everything in asm. like when you put mov ax, 21 or add ax,2 those have a hex value that represents them. Where can i find those op codes for either 80x86 286, 386, 486 586 hell any intel chip? And also, to make like say a .bin file or a .com file, would one just have to write those hex values to a disk? like say the command for mov ax, 2 was 45af02 would i just write the ascii charicater for 45, then af then 02? so if anyone has a website or a file that talks about either of that please let me know thank you.
-
Apr 18th, 2002, 09:12 PM
#2
Lively Member
for the opcodes
http://developer.intel.com/design/Pentium4/manuals/
download the second volume. Pretty big but it contains all you need to encode/decode.
For your other question, i think that for a com file you could write them directly. I'm not 100% sure about that.
I don't see any advantage over assembly to do this since it would be a real pain to calculate all the adresses
-
Apr 23rd, 2002, 08:49 AM
#3
NASM and other assemblers can compile to pure binary.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 23rd, 2002, 06:16 PM
#4
PowerPoster
for a COM file, you can insert machine code directly through a binary editor (although in my opinion you would be more than slightly insane to bother with it since that's what assembers do)
For an EXE file, you cannot do this or at least not in any reasonable amount of time. EXE files are not direct machine code but rather contain relocation information that allows a linker to turn them into machine code inserted into whatever area of memory is free. COM file are all designed to run starting at memory location 0x100, so they are absolute and don't have any relocation info.
By the way, on a significant linguistic issue, you have it backwards when you say "the little hex numbers that represent everything in asm". What actually is the case is that ASM code is a representation for machine code (which is binary, but which we represent by the hex shorthand that you refer to), thus the hex numbers do not represent ASM, but rather ASM represents the hex numbers, which in turn represent the binary numbers which are the only things that machines ever actually understand, regardless of the language that causes them to be generated, be it assembly, or C, or VB or whatever.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|