Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .MODEL SMALL ; use memory model
- .STACK 100H ; reserves 100h bytes for stack
- .CODE ; starts code segment
- START:
- ;set nic 1st(A) ,2nd(B) ,3rd(C) numbers to AL,BL,CL registers
- MOV AL, 5
- MOV BL, 5
- MOV CL, 0
- FINDX:
- ADD BL, AL ; ADD 1st and 2nd number / result is in the BL
- MOV DL,BL ; save result in DL
- RESETXY:
- MOV BL, 5 ; BL has changed.reset it's value back to 5
- FINDY:
- MUL BL ; multiply AL(1st number) with BL(2nd number); y=A*B
- OPTABLE:
- XOR DL, AL ; XOR DL with AL and save it to DL
- SHL DL,1 ; shift result by 1 bit
- DONE:
- MOV AL, DL ; move final result to AL
- MOV AH, 4CH ; Select exit function
- INT 21H ; Call the interrupt to exit
- END START
Advertisement
Add Comment
Please, Sign In to add comment