Code:
; PROGRAM TO DIVIDE TWO 8 BIT NUMBERS
.MODEL SMALL
.DATA
REM DB 0
QUO DB 0
.CODE
MOV AX , 26 ; Dividend is always AX and greater than divisor
MOV BL , 5 ; Divisor
DIV BL ; Divide 26/5
MOV QUO , AH ; Moving Quotient from AH to QUO variable
MOV REM , AL ; Moving Quotient from AL to REM variable
MOV AH , 4CH ; EXIT
INT 21H
END
; PROGRAM TO DIVIDE TWO 8 BIT NUMBERS
.MODEL SMALL
.DATA
REM DB 0
QUO DB 0
.CODE
MOV AX , 26 ; Dividend is always AX and greater than divisor
MOV BL , 5 ; Divisor
DIV BL ; Divide 26/5
MOV QUO , AH ; Moving Quotient from AH to QUO variable
MOV REM , AL ; Moving Quotient from AL to REM variable
MOV AH , 4CH ; EXIT
INT 21H
END
Output:
2 Comments
Click here for CommentsThank You So much
ReplyLife Saver Atharva Bro....
Reply