Reputation: 739
I need to translate the Assembler command MOV BL,[ALPHA]
into machine code of intels 8086 processor. Therefore, ALPHA is an 1 Byte variable at the 11th Position of the Data Segment, which is already loaded in the DS
Register.
I already translated MOV AL,[ALPHA]
in another task I've got. Here I found the MOV AL/AX,addr
in the instruction set table so I could translate the whole thing into 1010|0000 1010|0000
or A0 10
in machine code.
I tend to use MOV r/m1,r/m2
of the instruction set table, but I am not 100% sure because I got problems when selecting the r/m
part. Since this is the preparation for an exam I would be really happy if someone could help :)
Upvotes: 1
Views: 2681
Reputation: 58762
That must be a strange instruction set table because there is no mov r/m1,r/m2
(you can't have two memory references). Better try the official intel one. What you need is mov r8, r/m8
. The encoding for that is 8A /r
. Using Table 2-1. 16-Bit Addressing Forms with the ModR/M Byte you can see that operand BL
with a 16 bit displacement disp16
means a modrm byte of 1E
followed by 16 bit displacement, so the complete instruction is 8A 1E 0A 00
. You can verify that with an assembler:
8A1E0A00 mov bl, [10]
PS: It's unclear what offset you really want, but I trust you can fill in the correct one.
Upvotes: 5