Professional Documents
Culture Documents
Abhinav Gupta
19074001
CSE(IDD)
Code:
start: nop
LHLD 2500H ;Stores 13 at 2500h in L register and 00 and 2501h in H register
XCHG ;Exchanges the content of H and L register pair with D and E register pair
LDA 2502H ;Load second number in accumulator i.e A = 14
LXI H,0000H ;Initial product in HL = 00
MVI C,08H ;Count=08 in register C
up: DAD H ;adds the content of H and L register to itself
RAL ;Rotate Accumulator to left by 1 bit.
jnc down ;if case of no carry then jump
DAD D ;stores product by adding H and L register with D and E registers
down: DCR C ;Decrement Count
JNZ up ;Jump until C=0
SHLD 2503H
;2503h and 2504h address will hold the solution
;It copies the data from H and L
;L goes to 2503h and H goes to 2504h
hlt ;Terminate Program Execution
Code: