Encode the instructions in the following assembly language program fragment into
ID: 3852095 • Letter: E
Question
Encode the instructions in the following assembly language program fragment into 8086- family machine code. Assume first instruction is placed starting at an offset address of 0000h. Show the methodology of converting each instruction. Checking your work with a listing file is permissible. Mov bh, 0 Sub si, 6a Mov di, 23cdh Add cx, 16f Label 1: Mov al, (si) or a1, 30h Cmp bh, 1 Jz Label3 Test a1, 36h Jnz Label2 Mov a1, ' ' Jmp Label3 Label2: Mov bh, 1 Label3: Mov [di], al Dec si Dec byte ptr [di] Jle Label4 Mul di Label4: Loop Label1Explanation / Answer
MOV bh, 0
SUB si,6a
MOV di, 23cdh
ADD cx,16f
Label1:
MOV al,[si]
Or al,30h
CMP bh,l
Jz Label3
Test al,36h
Jnz Label2
MOV al,' '
Jmp Label3
Label2 :
Mov bh,l
Label3:
MOV [di],al
Dec si
Dec byte ptr [di]
Cmp cx,3d
Jle Label4
Mul di
Label4:
Loop Label1
CALL PRINT_NUM
RET
DEFINE_PRINT_NUM
END
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.