मराठी
महाराष्ट्र राज्य शिक्षण मंडळएचएससी विज्ञान (संगणक विज्ञान) इयत्ता १२ वी

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 - Computer Science 2

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           ; Stop
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2024-2025 (July) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×