Code:
; Program to substract two 16 bit numbers
.MODEL SMALL
.STACK 100
.CODE
MOV AX , 8900H ; Load 1st num
MOV BX , 7C60H ; Load 2nd num
SUB AX , BX ; Substract BX from AX
MOV DX , AX ; Store contain of AX into DX
MOV AH , 2 ; Service routine to print contain of DX
INT 21H
MOV AH , 4CH ; Service Routine to Exit
INT 21H
END
Ouput:
; Program to substract two 16 bit numbers
.MODEL SMALL
.STACK 100
.CODE
MOV AX , 8900H ; Load 1st num
MOV BX , 7C60H ; Load 2nd num
SUB AX , BX ; Substract BX from AX
MOV DX , AX ; Store contain of AX into DX
MOV AH , 2 ; Service routine to print contain of DX
INT 21H
MOV AH , 4CH ; Service Routine to Exit
INT 21H
END