Write assembly language insuuctions to perform each of the following tasks:i. Set register CX equal to zero (0).ii. Save the content of the memory location pointed by the.register BX in registerAX.iii. Test the contents of register AX and yariable A.iv. Branch to the label TEST if the content of register AX is greater than or equal tothe content of variable A.v. Add one (01) to register CX.vi. Compare the content of register CX with the value ten (10). Label the instructionas TEST.vii. Branch to the label OUT if the content of register CX is equal to ten (10).
Question
Write assembly language insuuctions to perform each of the following tasks:i. Set register CX equal to zero (0).ii. Save the content of the memory location pointed by the.register BX in registerAX.iii. Test the contents of register AX and yariable A.iv. Branch to the label TEST if the content of register AX is greater than or equal tothe content of variable A.v. Add one (01) to register CX.vi. Compare the content of register CX with the value ten (10). Label the instructionas TEST.vii. Branch to the label OUT if the content of register CX is equal to ten (10).
Solution
i. Set register CX equal to zero (0): MOV CX, 0
ii. Save the content of the memory location pointed by the register BX in register AX: MOV AX, [BX]
iii. Test the contents of register AX and variable A: CMP AX, A
iv. Branch to the label TEST if the content of register AX is greater than or equal to the content of variable A: JGE TEST
v. Add one (01) to register CX: INC CX
vi. Compare the content of register CX with the value ten (10). Label the instruction as TEST: CMP CX, 10 JE OUT
vii. Branch to the label OUT if the content of register CX is equal to ten (10): OUT: ; Your code here
Similar Questions
Write assembly language instructions to perform the following tasks:I. Set the register AX equal to zero.11. Add the content of the memory location pointed by the registerBX to the register AX.
Write assembly language instructions to perform the following tasks:I. Set the register AX equal to zero.11. Add the content of the memory location pointed by the registerBX to the register AX.lll. Test the contents of mem01y locations X and Y.
Write assembly language instructions to perform the following tasks:I. Set the register AX equal to zero.
Consider an instructionADD R1 , R2. ( Add the contents of Register R2 to the contents of Register R1)Give the steps (micro operations) involved in the execution of an above given instruction.
Branch to the label OUT if the content of register CX is equal to ten (10).
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.