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??
Regars,
Emod
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??
Regars,
Emod
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,
Emod!
Best Regards,
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.
http://www.wasm.ru/baixado.php?mode=tool&id=213
Look at modrm1op.exe
(D and W might be clicked to change the bits)
Look at modrm1op.exe
(D and W might be clicked to change the bits)
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!!
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!!
In the archive there is a little buggy version of modrm1op
Here is fixed one
http://www.wasm.ru/forum/index.php?action=vthread&forum=3&topic=8455
Here is fixed one
http://www.wasm.ru/forum/index.php?action=vthread&forum=3&topic=8455