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
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
Advertisements
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
Is there an error in this question or solution?
