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 ; Stopshaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
