Advertisement
THOMAS_SHELBY_18

Lab2

Mar 1st, 2024
331
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
6502 TASM/64TASS 1.31 KB | Source Code | 0 0
  1.         org 100h
  2. Start:
  3.         mov ah, 09h
  4.         mov dx, Condition
  5.         int 21h
  6.  
  7.         mov ah, 09h
  8.         mov dx, NewLine
  9.         int 21h
  10.  
  11.         mov ah, 0ah
  12.         mov dx, Buffer
  13.         int 21h
  14.  
  15.         mov ah, 09h
  16.         mov dx, NewLine
  17.         int 21h
  18.  
  19. checkLength:
  20.  
  21.         mov bh, [Buffer + 1]
  22.         cmp bh, 7
  23.         jb AnswerNo
  24.         cmp bh, 9
  25.         ja AnswerNo
  26.  
  27. checkEqualSymb:
  28.  
  29.         mov bh, [Buffer + 5]
  30.         cmp bh, [Buffer + 6]
  31.         jne AnswerNo
  32.  
  33. checkFifthLetters:
  34.  
  35.         or byte [Buffer + 6], 32
  36.  
  37.         cmp byte [Buffer + 6], 'a'
  38.         jl AnswerNo
  39.  
  40.         cmp byte [Buffer + 6], 'z'
  41.         jg AnswerNo
  42.  
  43. checkNum:
  44.  
  45.         xor bh, bh
  46.         mov bl, [Buffer + 1]
  47.         sub bl, 2
  48.  
  49.         cmp byte[Buffer + bx], '0'
  50.         jb AnswerNo
  51.  
  52.         cmp byte[Buffer + bx], '9'
  53.         ja AnswerNo
  54.  
  55. AnswerYes:
  56.  
  57.         mov ah, 09h
  58.         mov dx, Yes
  59.         int 21h
  60.         jmp Exit
  61.  
  62. AnswerNo:
  63.         mov ah, 09h
  64.         mov dx, No
  65.         int 21h
  66. Exit:
  67.         mov ah, 08h
  68.         int 21h
  69.  
  70.         ret
  71.  
  72. Condition:
  73.         db "Enter your string (6 < length <= 9, 4th and 5th are equal, 5th - letter, symbol [length-3] - number ):$"
  74.  
  75. NewLine db 13, 10, 24h
  76. No      db "NO$"
  77. Yes     db "YES$"
  78. Buffer  db 10, 0, 10 dup(?)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement