Advertisement
apl-mhd

assembly lab

Jul 24th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. input:
  2. mov ah,1
  3. int 21h
  4. mov bh,al       ; input q
  5.  
  6.  
  7. cmp bh,'q'
  8.  JE quit
  9. cmp bh, 'Q'
  10.   JE quit
  11.  
  12. jmp inputChar
  13.  
  14.          
  15.  
  16.  
  17. inputChar:
  18.  
  19.  
  20. cmp bh,'a'
  21. JNGE printstar
  22.  
  23. cmp bh,'z'
  24. JNLE printstar
  25. jmp inputkq
  26.  
  27. jmp  printstar:
  28. jmp input   ; back to star if not A-Z
  29.          
  30.          
  31.  
  32. quit:
  33. hlt
  34.  
  35.  inputkq:
  36. mov ah,1
  37. int 21h
  38. mov bh,al  
  39.  
  40. cmp bh,'k'
  41. JNGE inputkq
  42.                       ;k-z
  43. cmp bh,'z'
  44. JNLE inputkq
  45. jmp chekcvo
  46.  
  47. jmp input
  48.  
  49.  
  50.  
  51. chekcvo:
  52. mov ah,1
  53. int 21h
  54. mov bh,al
  55.  
  56. cmp bh,'o'
  57. jE printv
  58.  
  59.  
  60. cmp bh,'u'
  61. jE printv
  62.  
  63.   jmp inputkq
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  printv:
  70.   mov ah,2        ; print vowel
  71. mov dl, bh
  72. int 21h
  73. jmp inputkq
  74.  
  75.  
  76.  
  77.  
  78.  
  79. printstar:
  80.  
  81.  
  82. mov cx,8
  83. mov ah, 2
  84. mov dl, '*'   ;display eight                  
  85. tp:
  86. int 21h
  87. loop tp
  88.  
  89.  
  90.  
  91.  
  92.  
  93. mov ah, 2
  94. mov dl, 0AH
  95. int 21h      ;display new line
  96.  
  97.  
  98. mov ah,2
  99. mov dl, 0DH
  100. int 21h
  101. jmp input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement