w rite an asm code fragment that performs the indicated task or function: copy t
ID: 3577930 • Letter: W
Question
write an asm code fragment that performs the indicated task or function:copy the higher order 4 bits from the AL register and the lower order 4 bits from the AH register into the DL register. use only the logical instructions write an asm code fragment that performs the indicated task or function:
copy the higher order 4 bits from the AL register and the lower order 4 bits from the AH register into the DL register. use only the logical instructions
copy the higher order 4 bits from the AL register and the lower order 4 bits from the AH register into the DL register. use only the logical instructions
Explanation / Answer
Explanation:
You would need to shift the bits left and right, the new spaces are filled with 0 when its moved back into the place. In the end you move the lower 4 bits into the regster, you can add the higher ones to it and vice versa...
CODE:
MOV DL, 0 ;clearing the DL register
SHR AL, 4 ;clearing the lower 4 bits of AL register
SHL AL, 4 ;this step moves everything back
SHL AH,4 ;this step clears the lower 4 bits of the AH register
SHR AH,4 ;Reset or move everything back
MOV DL,AH ;here we are moving the lower 4 bits into DL
ADD DL, AL ; Now we are adding the higher 4 bits into DL
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.