; MULTIPLY TWO NUMBERS TOGETHER, STORE IN MEMORY AT 00H ; MULTIPLICATION IS NOTHING MORE THAN REPEATED ADDITION JMP START N1: EQU 05H ; MULTIPLICAND N2: EQU 03H ; MULTIPLIER N3: EQU 00H ; MEMORY LOCATION TO STORE RESULT START: LXI H,N3 ; H AS MEMORY POINTER TO OUTPUT LOCATION 00H MVI C,0 ; CLEAR C MOV B,C ; CLEAR B MOV A,B ; CLEAR A MVI C,N2 ; MOVE N2 INTO C, THIS IS OUR COUNTER ADD: MOV B,A ; STORE A IN B MVI A,00H ; STORE 00H IN A CMP C ; COMPARE C TO A MOV A,B ; PUT B BACK INTO A JZ END ; IF C == 0 JUMP TO END ADI N1 ; ADD N1 TO A DCR C ; DECREMENT C JMP ADD ; JUMP TO ADD END: STA N3 ; STORE A HLT ; HALT