Advertisements
Advertisements
प्रश्न
A 16 bit number beginning with lower order byte is stored from memory location 7000H. Write a Assembly Language Program to find its two’s (2’s) compliment and stare the result beginning with lower order byte from memory location 7500H.
कोड लेखन
Advertisements
उत्तर
; 8085 Program to find 2's complement of a 16-bit number ; Input: 16-bit number at 7000H ; Output: 2's complement at 7500H and 7501H
Label Instructions Comments
LHLD 7000H ; Load HL from 7000H
MOV A, L ; Move L to Acc
CMA ; Complement Acc.
ADI 01H ; Add 1 to Acc.
STA 7500H ; Store A to 7500H
MOV A, H ; Move H to A
CMA ; Complement Acc.
ADC 00H ; Add 00H with carry
STA 7501H ; Store A to 7501H
HLT ; Stopshaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
