x86 Instruction Format

Programming, for all ages and all languages.
Post Reply
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

x86 Instruction Format

Post 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.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Post 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!
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

Thanks, but is there anyway to determine the modrm status based on the opcode's bits?
Last edited by Alboin on Thu Aug 30, 2007 12:09 pm, edited 1 time in total.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Have you looked at opcode maps? Try if you see a pattern :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply