Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; reverse 5 input
- INCLUDE "EMU8086.INC" ; this function is used to take new line
- .MODEL SMALL ; IN THIS COURSE ALL MODEL ARE SMALL
- .STACK 100H ; WE ALWAYS USE STACK 100H
- .DATA ; DATA SEGMENT
- SN_NUM1 DB ? ; assign a variable where store first input
- SN_NUM2 DB ? ; same second input
- SN_NUM3 DB ? ; same third
- SN_NUM4 DB ? ; fourth input
- SN_NUM5 DB ? ; fifth input
- .CODE
- MAIN PROC ; MAIN CODE START HERE
- MOV AH,1 ; this function is used to take single bit input
- MOV SN_NUM1,AL ; we move the input input num1
- INT 21H ; this will take input
- MOV SN_NUM2,AL
- INT 21H
- MOV SN_NUM3,AL
- INT 21H
- MOV SN_NUM4,AL
- INT 21H
- MOV SN_NUM5,AL ; by the same process we take our 5 input
- INT 21H
- PRINTN "" ; this function is used to give a new line
- MOV AH,2 ; this ah,2 is used to print signle input
- MOV DL,SN_NUM5 ; as we want reverse we first print num5
- INT 21H ; this will print number 5
- MOV DL,SN_NUM4
- INT 21H
- MOV DL,SN_NUM3
- INT 21H
- MOV DL,SN_NUM2
- INT 21H
- MOV DL,SN_NUM1 ; same process we print all input by reverse num5,num4,num3,num2,num1
- INT 21H
- MOV AX,4CH ; TERMINATED THE CODE AND EXIT
- INT 21H
- MAIN ENDP
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement