Trouble with opcodes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Trouble with opcodes

Post by Karlosoft »

Hi! A very easy and fast question: what is the complete hex code of mov Ev, Iv where Ev=AX and Iv is 12? Trying with nasm is completely not-usefull because it use the opcode mov AX, Iv that doesn't require MOD R/M byte.
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Trouble with opcodes

Post by Gigasoft »

C7 C0 12 00
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: Trouble with opcodes

Post by Karlosoft »

Thank you! The mem bits are empty?
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Trouble with opcodes

Post by Gigasoft »

Well, it's the register bits that are ignored. The memory bits are 11xxx000, meaning AX.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Trouble with opcodes

Post by thepowersgang »

Karlosoft wrote:Hi! A very easy and fast question: what is the complete hex code of mov Ev, Iv where Ev=AX and Iv is 12? Trying with nasm is completely not-usefull because it use the opcode mov AX, Iv that doesn't require MOD R/M byte.
For future reference, look at the end of Volume 2A of Intel Manuals for the mov instruction.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply