हिंदी

A 16 bit number beginning with lower order byte is stored from memory location 7000H. Write an assembly language program to find its two’s (2's) compliment and stare the result beginning with lower

Advertisements
Advertisements

प्रश्न

A 16 bit number beginning with lower order byte is stored from memory location 7000H. Write an 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 to 7000H
MOV A,L            ; Move L to Acc
CMA                ; Complement Acc.
ADI 014            ; Add 1 to Acc.
STA 7500H          ; Store A to 7500 H
MOV A, H           ; Move H to A
CMA                ; Complement Acc.
ACT 00H            ; Add 00H with carry
STA >501H          ; Store A to 7501H
HLT                ; Stop
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (July) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×