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

Write an Assembly Language Program to subtract two one-byte data stored at memory locations CO30H and CO31H. Store the absolute difference at memory location CO32Н. - Computer Science 2

Advertisements
Advertisements

प्रश्न

Write an Assembly Language Program to subtract two one-byte data stored at memory locations CO30H and CO31H. Store the absolute difference at memory location CO32Н.

कोड लेखन
Advertisements

उत्तर

 Label             Mnemonics                 Comments

        LXI H, C030H    ; Set H-L pointer to C030H
        MOV A, M        ; Move 1st no. in Accumulator
        INX H           ; Increment H-L pair
        SUB M           ; Subtract 2nd no. from 1st no.
        JP GO           ; If positive result, jump to GO
        MOV A, M        ; Move 2nd no. in ACC
        DCX H           ; Decrement H-L pair
        SUB M           ; Subtract 1st no. from 2nd no.
GO      STA C032H       ; Store result in C032H
        HLT             ; Stop
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2023-2024 (July) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×