Presentation is loading. Please wait.

Presentation is loading. Please wait.

Program.(08) Write a program Divide 5 by 2 and display answer value and remainder value. 1 Store 5 into AL 2 Store BL into 2 3Divide AL Into BL 4Store.

Similar presentations


Presentation on theme: "Program.(08) Write a program Divide 5 by 2 and display answer value and remainder value. 1 Store 5 into AL 2 Store BL into 2 3Divide AL Into BL 4Store."— Presentation transcript:

1 Program.(08) Write a program Divide 5 by 2 and display answer value and remainder value. 1 Store 5 into AL 2 Store BL into 2 3Divide AL Into BL 4Store AL into Ans 5Store AH into Remainder 6Display ANS, Remainder value. 7Stop program Start Display ANS, Remainder End REMAINDER = AH AL = 5 BL=2 ANS= AL / BL

2 .model small.stack 100h.data ANS db 0 REM db 0.code Main proc MOV AX,@DATA MOV DS,AX MOV AL,5 MOV BL,2 DIV BL MOV ANS,AL MOV REM,AH ADD ANS,30H ADD REM,30H MOV AH,2 MOV DL,ANS INT 21H MOV DL,REM INT 21H MOV AH,4CH INT 21H Main Endp End main Example Program

3 .model small.stack 100h.data msg1 db 0ah,0dh,"Enter Number in No1 : $" msg2 db 0ah,0dh,"Enter Number in No2 : $" res db 0ah,0dh,“Divide answer is : " No1 db ? symole1 db " /" No2 db ? symbole2 db "=" Ans db ? remmes db " and Remainder is " rem db ?,"$".code Main proc mov ax,@data mov ds,ax mov ah,9 lea dx,msg1 int 21h mov ah,1 int 21h sub al,30h mov No1,al mov ah,9 lea dx,msg2 int 21h mov ah,1 int 21h sub al,30h mov No2,al mov ax,0 mov al,No1 div No2 mov Ans,al mov rem,ah

4 add Ans,30h add No1,30h add No2,48 add rem,48 mov ah,9 lea dx,res int 21h mov ah,4ch int 21h main endp end main


Download ppt "Program.(08) Write a program Divide 5 by 2 and display answer value and remainder value. 1 Store 5 into AL 2 Store BL into 2 3Divide AL Into BL 4Store."

Similar presentations


Ads by Google