I am trying to figure out how to encode the instruction MOV DS, AX
, but I am confused from the opcode table as follows:
Is MOV DS all one byte, or is MOV one byte, DS the second, and the AX the third?
Is the table implying that the binary value of the source register prefix DS is 011? If so, how would I encode it as part of the whole instruction?
I can not understand how the tables make sense by the way they're listed; they should be more specific! Can anyone straighten this out?
I just want to move the value from the AX register to the data segment, DS. No sites perfectly explains how encoding of registers within opcodes work exactly, or relocation.
All the tables come from http://ref.x86asm.net, and it's very vague, unclear, unspecific, and undetailed.
I would like to know if there's any 100% detailed, perfectly explained tutorials on how encoding of each byte, values for each register, address truncation, offset, etc. works in binary, and how to encode it all the correct way.