Advertisement
Vladislav8653

lab 2

Mar 28th, 2023
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. org 100h
  2. Start:
  3. mov ah, $09
  4. mov dx, Meeting
  5. int 21h
  6.  
  7. mov ah, 0Ah
  8. mov dx, Input
  9. int 21h
  10.  
  11. mov ah, $09
  12. mov dx, NewStr
  13. int 21h
  14.  
  15. mov cl, [Input + 2]
  16. cmp cl, [Input + 4]
  17. jne False
  18.  
  19. mov cl, [Input + 1]
  20. cmp cl, 4
  21. jl False
  22. cmp cl, 7
  23. jg False
  24.  
  25. mov dl, [Input + 1]
  26. mov dh, 0
  27. mov di, dx
  28.  
  29. mov cl, [Input + 1 + di]
  30. cmp cl, 41h
  31. jl False
  32. cmp cl, 5Ah
  33. jg False
  34.  
  35.  
  36. mov ch, [Input + 2]
  37. cmp ch, 48
  38. jl False
  39. cmp ch, 57
  40. jg False
  41.  
  42. jmp True
  43.  
  44. Meeting:
  45. db "Program checks your string by some static parametrs.", 10, 13, 'Enter a string:', 10, 13, '$'
  46.  
  47. NewStr:
  48. db 10, 13, '$'
  49.  
  50. Input:
  51. db 8, 0, 10 dup(?), '$' ; 8 = 7 ìàêñ äëèíà
  52.  
  53. True:
  54. mov ah, 09h
  55. mov dx, MSGYES
  56. int 21h
  57. jmp Final
  58.  
  59. False:
  60. mov ah, 09h
  61. mov dx, MSGNO
  62. int 21h
  63. jmp Final
  64.  
  65. MSGNO:
  66. db 'InCorrect$'
  67.  
  68. MSGYES:
  69. db 'Correct$'
  70.  
  71. Final:
  72. mov ah, 08h
  73. int 21h
  74.  
  75. ret
  76.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement