Advertisement
Tarikul_Islam

Microprocessor LAB3

Nov 25th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. .model small
  2. .stack 100h
  3. .data
  4. input_string db 'We are DUET Students','$'
  5. show db 'No Upper Letter',10,13,'$'
  6.  
  7. .code
  8. main proc
  9. mov ax,@data;
  10. mov ds,ax;
  11.  
  12.  
  13. mov ah,09
  14. ;; lea dx,input_string
  15. ; mov di,offset input_string
  16. mov dx,offset input_string
  17. int 21h
  18.  
  19. mov ah,02
  20. mov dl,10
  21. int 21h
  22. mov dl,13
  23. int 21h
  24.  
  25.  
  26. mov di,offset input_string
  27.  
  28. Check_small:
  29. cmp [di],'$'
  30. je no_upper_letter
  31.  
  32. cmp [di],97
  33. jge lower_case
  34.  
  35. jmp check_space
  36. ;jmp Check_first_upper_case
  37.  
  38.  
  39. check_space:
  40. cmp [di],32
  41. je space
  42. jmp Check_first_upper_case
  43.  
  44. space:
  45. inc di
  46. jmp check_small
  47.  
  48. lower_case:
  49. inc di
  50. jmp Check_small
  51.  
  52.  
  53.  
  54. Check_first_upper_case:
  55. cmp [di],'$'
  56. je last ; if got "$" then go to last label and end
  57.  
  58. cmp [di],90
  59. jle First_upper
  60. inc di
  61. jmp Check_first_upper_case
  62.  
  63. again:
  64. cmp [di],'$'
  65. je last ; if got "$" then go to last label and end
  66.  
  67. cmp [di],90
  68. jle Last_upper_case
  69. inc di
  70. jmp again
  71.  
  72. First_upper:
  73. cmp [di],65
  74. jge First_upper_case
  75. inc di
  76. jmp Check_first_upper_case
  77.  
  78.  
  79. First_upper_case:
  80. mov ah,02
  81. mov dl,[di]
  82. int 21h
  83. inc di
  84. jmp again;
  85.  
  86.  
  87. Last_upper_case:
  88.  
  89.  
  90. cmp [di],65
  91. jge print
  92. inc di
  93.  
  94. jmp again
  95.  
  96. print:
  97.  
  98. mov bl,[di]
  99. ;mov ah,02
  100. ; int 21h
  101. inc di
  102.  
  103. jmp again
  104.  
  105.  
  106. no_upper_letter:
  107. mov ah,02
  108. mov dl,10
  109. int 21h
  110. mov dl,13
  111. int 21h
  112.  
  113. mov dx,offset show
  114. mov ah,09
  115. int 21h
  116. jmp last
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. last:
  125. mov ah,02
  126. mov dl,10
  127. int 21h
  128. mov dl,13
  129. int 21h
  130. mov dl,bl
  131. int 21h
  132. mov ah,4ch
  133. int 21h
  134.  
  135.  
  136. main endp
  137. end main
  138. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement