Write Alp to Find 2'S Complement of a 16 Bit Number Stored in De Pair. Store Result in Hl Pair. - Computer Science 2

Advertisements
Advertisements

Write ALP to find 2's complement of a 16 bit number stored in DE Pair. Store result in HL Pair.

Advertisements

Solution

Mnemonics Comment
Opcode Operand
MOV A, E ; Copy E content to Accumulator
CMA ; Compliment Accumulator
MOV L, A ; Copy Accumulator to L Register
MOV A, D ; Copy D content to Accumulator
CMA ; Compliment Accumulator
MOV H, A ; Copy Acc. to HL Pair
INX H ; Increment HL pair by 1
RST 1.0 ; Restart
Concept: Instruction Set and Programming of 8085
  Is there an error in this question or solution?
2014-2015 (March)

APPEARS IN

Share
Notifications



      Forgot password?
Use app×