Page 1 of 1

x86 Instruction Format

Posted: Wed Aug 29, 2007 5:26 pm
by Alboin
Does anyone know how the code in this post (Not on this forum.) works? There's no mention of anything like it in either the Intel or AMD manuals, and I haven't been able to find anything substantial on the web.

I understand how the modrm\sib bits work and all with the prefixes, but my main problem comes when trying to determine if there is a modrm byte or not.

Thanks.

Posted: Thu Aug 30, 2007 4:23 am
by hailstorm
I don't have the intel manuals at hand either, but I know that the instruction-code itself specifies whether it is followed by a modrm or not. For example, code 0x00 (I think it is a adc?) requires a modrm byte, while 0x04 (adc al, ib) requires an immediate byte.

Hope this helps:
http://pdos.csail.mit.edu/6.828/2005/re ... 6/appa.htm

Greets!

Posted: Thu Aug 30, 2007 9:11 am
by Alboin
Thanks, but is there anyway to determine the modrm status based on the opcode's bits?

Posted: Thu Aug 30, 2007 11:06 am
by Combuster
Have you looked at opcode maps? Try if you see a pattern :wink: