Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PAGE 60,132
- TITLE asm (exe) MOV and ADD operation
- .Model small
- .stack 64
- .data
- msg db 13,10,13,10,13,10,13,10,10,10,10,10,9,9,' Input a single digit integer: $'
- numOne db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is ONE!$'
- numTwo db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is TWO!$'
- numThree db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is THREE!$'
- numFour db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is FOUR!$'
- numFive db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is FIVE!$'
- numSix db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is SIX!$'
- numSeven db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is SEVEN!$'
- numeight db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is EIGHT!$'
- numNine db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is NINE!$'
- numZero db 13,10,13,10,13,10,13,10,10,10,10,9,9,' The integer is Zero!$'
- .code
- MAIN PROC FAR
- ;--------ClearSscreen
- mov ax,02
- mov bx,03
- int 10h
- MOV AH,06H
- MOV AL,00H ;full screen
- ; cursor
- mov ax, 0600h
- int 10h
- ;------------------------color--------------------
- ;---grey
- MOV BH,70h ; set color,
- MOV CX,0610h; (top,left)
- MOV DX,0a3bh ;(bottom,right)
- INT 10H
- ;---red
- MOV BH,4eh ; set color,
- MOV CX,0711h; (top,left)
- MOV DX,093ah ;(bottom,right)
- INT 10H
- ;---grey
- MOV BH,70h ; set color,
- MOV CX,0d10h; (top,left)
- MOV DX,113bh ;(bottom,right)
- INT 10H
- ;---yellow
- MOV BH,42h ; set color,
- MOV CX,0e11h; (top,left)
- MOV DX,103ah ;(bottom,right)
- INT 10H
- ;-------Read Input Number---------------
- MOV AX,@data
- mov DS,AX
- lea dx,msg
- mov ah,9h
- int 21h
- mov ah,1h
- int 21h
- ;------------------------text---------------------
- ; (if else)
- cmp al,'1'
- je jmpOne
- cmp al,'2'
- je jmpTwo
- cmp al,'3'
- je jmpThree
- cmp al,'4'
- je jmpFour
- cmp al,'5'
- je jmpFive
- cmp al,'6'
- je jmpSix
- cmp al,'7'
- je jmpSeven
- cmp al,'8'
- je jmpEight
- cmp al,'9'
- je jmpNine
- cmp al,'0'
- je jmpZero
- jmp exit
- ;------------Jump----------------
- jmpOne:
- mov ah,9
- lea dx,numOne
- int 21h
- jmp exit
- jmpTwo:
- mov ah,9
- lea dx,numTwo
- int 21h
- jmp exit
- jmpThree:
- mov ah,9
- lea dx,numThree
- int 21h
- jmp exit
- jmpFour:
- mov ah,9
- lea dx,numFour
- int 21h
- jmp exit
- jmpFive:
- mov ah,9
- lea dx,numFive
- int 21h
- jmp exit
- jmpSix:
- mov ah,9
- lea dx,numSix
- int 21h
- jmp exit
- jmpSeven:
- mov ah,9
- lea dx,numSeven
- int 21h
- jmp exit
- jmpEight:
- mov ah,9
- lea dx,numEight
- int 21h
- jmp exit
- jmpNine:
- mov ah,9
- lea dx,numNine
- int 21h
- jmp exit
- jmpZero:
- mov ah,9
- lea dx,numZero
- int 21h
- jmp exit
- ;---------Exit--------------------
- exit:
- mov ah,4ch
- int 21h
- main ENDP
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement