Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INCLUDE "EMU8086.INC" ; WE INCLUDE THE FUNTION TO USE NEW LINE
- .MODEL SMALL ; IN THIS COURSE ALL MODEL ARE SMALL
- .STACK 100H ; WE ALWAYS USE STACK 100H
- .DATA ; DATA SEGMENT, IF THERE IS NO DATA WE CAN TAKE BLANK OR REMOVE IT
- .CODE
- MAIN PROC ; MAIN CODE START HERE
- ;AS DATA SEGMENT IS BLANK WE DO NOT NEED PROGRAMME SEGMENT PREFIX
- MOV AH,2 ; WE USE THIS TO PRINT SINGLE CHARACTER
- MOV DL,'?' ; TO PRINT WE MUST MOVE THE CHARACTER TO DL
- INT 21H ; IT WILL INTRUPT THE WORK. THAT MENAS PAUSE THE CODE AND DO WORK WHAT SAY ( INT 21H = interrupt handler 0x21 )
- MOV AH,1 ; WE USE THIS TO TAKE INPUT
- INT 21H ; INTURPT THE COMMAND
- MOV BL,AL ; IF WE TAKE ANY INPUT IT GOES TO AL, SO WE MOVE AL TO BL. NOW THE INPUT DIGIT IS IN BL, ONE MORE THING L = 8 BIT AND X = 16 BIT. SO WE CAN NOT
- ; MOVE AL = BX, WE CAN USE AX TO BX, BUT NOT AL TO BX
- ; IN MOV THE VALUE OF SECOND VARIABLE WILL TRANASFERED INTO FIRST VARIABLE
- PRINTN "" ; WE USE THIS TO TAKE A NEW LINE
- MOV AH,2 ; WE SE THIS TO PRINT OUR OUTPUT, THIS FUNNTION ARE USED TO PRINT
- MOV DL,BL ; TO PRINT WE MUST USE DL, SO WE TRANSFER THE VALUE BL TO DL TO PRINT... IF WE PREVIOUSLY USE BX.. HERE WE USE DX,BX
- INT 21H ; INTRUPT THIS COMMAND
- MOV AX,4CH ; TERMINATED THE CODE AND EXIT
- INT 21H
- MAIN ENDP
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement