Can anybody help me? I'm trying to build an Assembler but I don't get it what a ModR/M Byte is and how it is used.. I've read the Intel Manual 20 Times.. but I cannot figure it out..

If i have a simple instruction like
mov eax,ecx = mov r/m32,reg32
Opcode = 89h

The next thing are the registers are:
eax = 000
ecx = 001

And now comes the ModRM Byte?? is this right? and how do i figure out which is used?? and when it is used??

Posted on 2005-01-20 06:21:39 by Emod
Posted on 2005-01-20 08:24:29 by SpooK
Thanks spook it was a very good info.. however i noticed that I'm doing all the stuff wrong not only this.. Has anybody got some resources on how to write a tiny x86 assembler?? I don't like theese big projects like nasm or fasm (they are very good but hard to learn from). I cannot handle them.. and the resources posted on this board (example: ADK) are also too big? isn't there a simple resource which teaches the basics? i googled for months now but didn't find a simple tiny assembler or something.. must it be that big for start???

Best Regards,
Posted on 2005-01-20 13:59:44 by Emod
I've always found The Complete Pentium Instruction Set Table as a pretty useful guide to begin with. Mix that with Mr. Hyde's "Writing Your Own Assembler" tutorials and you should have a pretty good basis on making your assembler.
Posted on 2005-01-20 14:30:28 by SpooK
Look at modrm1op.exe
(D and W might be clicked to change the bits)
Posted on 2005-01-20 16:23:23 by The Svin
Hey Spook thanks for the opcode list.. it is a very clear one!
But i already got all the opcodes before. ;) thanks anyway!

The Svin, theese are genius tools thats just what i needed many many thanks for that info!!
Posted on 2005-01-20 18:55:20 by Emod
In the archive there is a little buggy version of modrm1op
Here is fixed one
Posted on 2005-01-21 01:21:36 by The Svin