Advertisement
Guest User

1

a guest
Mar 25th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. title input ouput
  2.  
  3. .model small
  4. .stack 64
  5. .data
  6.  
  7. inputqueue db 'Input a single digit integer: $'
  8. output db 'The integer is: $'
  9. hello db 'hello$'
  10. wa db 'zero$'
  11. uno db 'one$'
  12. dos db 'two$'
  13. tres db 'three$'
  14. quatro db 'four$'
  15. singko db 'five$'
  16. says db 'six$'
  17. site db 'seven$'
  18. otso db 'eight$'
  19. noybe db 'nine$'
  20. wabalu db 'Wa ko balu sa imo input!$'
  21. .code
  22. main proc far
  23.  
  24. mov ax, @data
  25. mov ds, ax
  26.  
  27. ;clear screen
  28. mov ax, 0600h
  29. mov bh, 0fh
  30. mov cx, 0000h
  31. mov dx, 184fh
  32. int 10h
  33.  
  34. ; first border gray
  35. mov ax, 0600h
  36. mov bh, 70h
  37. mov cx, 040bh
  38. mov dx, 083fh
  39. int 10h
  40.  
  41. ; box red
  42. mov ax, 0600h
  43. mov bh, 40h
  44. mov cx, 050ch
  45. mov dx, 073eh
  46. int 10h
  47.  
  48. ; set color
  49. mov bh, 4eh
  50. int 10h
  51.  
  52. ;set cursor position
  53. mov ah, 2
  54. mov dh, 6
  55. mov dl, 13
  56. mov bh, 0
  57. int 10h
  58.  
  59. ; print queue
  60. mov ah, 9
  61. lea dx, inputqueue
  62. int 21h
  63.  
  64.  
  65. ; second border gray
  66. mov ax, 0600h
  67. mov bh, 70h
  68. mov cx, 0c0bh
  69. mov dx, 103fh
  70. int 10h
  71.  
  72. ;box blue
  73. mov ax, 0600h
  74. mov bh, 10h
  75. mov cx, 0d0ch
  76. mov dx, 0f3eh
  77. int 10h
  78.  
  79. ; set color
  80. mov bh, 1eh
  81. int 10h
  82.  
  83. ;set cursor position
  84. mov ah, 2
  85. mov dh, 14
  86. mov dl, 13
  87. mov bh, 0
  88. int 10h
  89.  
  90. ; print queue
  91. mov ah, 9
  92. lea dx, output
  93. int 21h
  94.  
  95. ;set cursor to input box
  96. mov ah, 2
  97. mov dh, 6
  98. mov dl, 43
  99. mov bh, 0
  100. int 10h
  101.  
  102. ;input
  103. mov ah, 1
  104. int 21h
  105.  
  106. ;set to output box
  107. mov ah, 2
  108. mov dh, 14
  109. mov dl, 29
  110. mov bh, 0
  111. int 10h
  112.  
  113. ;switch
  114. cmp al, '0'
  115. je zero
  116. cmp al, '1'
  117. je one
  118. cmp al, '2'
  119. je two
  120. cmp al, '3'
  121. je three
  122. cmp al, '4'
  123. je four
  124. cmp al, '5'
  125. je five
  126. cmp al, '6'
  127. je six
  128. cmp al, '7'
  129. je seven
  130. cmp al, '8'
  131. je eight
  132. cmp al, '9'
  133. je nine
  134.  
  135. ;print not found
  136. mov ah, 9
  137. lea dx, wabalu
  138. int 21h
  139. jmp endprog
  140. zero:
  141. mov ah, 9
  142. lea dx, wa
  143. int 21h
  144. jmp endprog
  145. one:
  146. mov ah, 9
  147. lea dx, uno
  148. int 21h
  149. jmp endprog
  150. two:
  151. mov ah, 9
  152. lea dx, dos
  153. int 21h
  154. jmp endprog
  155. three:
  156. mov ah, 9
  157. lea dx, tres
  158. int 21h
  159. jmp endprog
  160. four:
  161. mov ah, 9
  162. lea dx, quatro
  163. int 21h
  164. jmp endprog
  165. five:
  166. mov ah, 9
  167. lea dx, singko
  168. int 21h
  169. jmp endprog
  170. six:
  171. mov ah, 9
  172. lea dx, says
  173. int 21h
  174. jmp endprog
  175. seven:
  176. mov ah, 9
  177. lea dx, site
  178. int 21h
  179. jmp endprog
  180. eight:
  181. mov ah, 9
  182. lea dx, otso
  183. int 21h
  184. jmp endprog
  185. nine:
  186. mov ah, 9
  187. lea dx, noybe
  188. int 21h
  189. endprog:
  190. ; end of program
  191. mov ax, 4c00h
  192. int 21h
  193.  
  194. main endp
  195. end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement