Advertisement
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:
- ; evaluate A-B*C
- MOV DL,AL ;save AL(A) to DL
- MOV AL,BL ;save BL(B) to AL
- MUL CL ;multiply AL(B) and CL(C) :B*C
- SUB DL, AL ;substract DL(A) from AL :A-B*C
- ; reset AL , BL back to initial values
- MOV AL, 5
- MOV BL, 5
- FINDY:
- ; evaluate A+B-C
- SUB BL, CL ;substarct BL from CL :B-C
- ADD AL, BL ;add AL and BL :A+(B-C)
- OPTABLE:
- XOR DL,AL ;xor DL and AL :X xor Y
- SHL DL,1 ;shift result by 1 bit
- DONE:
- MOV AL, DL
- MOV AH, 4CH ;Select exit function
- INT 21H ;Call the interrupt to exit
- END START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement