Advertisements
Advertisements
Question
Write an Assembly Language Program to take the 2's complement of an 8-bit number stored at 3301H. Store the result at the memory location 3302H
Solution
Label | Mnemonics | Comment |
LXI H, 3301H MOV A, M CMA INR A INX H MOV M, A RST 1.0 |
; Load HL with 3301 H ; Get no. in Acc ; Complement given number ; Increment A reg. By 1 to get 2’s complement ; Increment HL pair ; Place result in 3302 H ; Restart |
shaalaa.com
Instruction Set and Programming of 8085
Is there an error in this question or solution?