Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- Start:
- mov ah, 09h
- mov dx, Condition
- int 21h
- mov ah, 09h
- mov dx, NewLine
- int 21h
- mov ah, 0ah
- mov dx, Buffer
- int 21h
- mov ah, 09h
- mov dx, NewLine
- int 21h
- checkLength:
- mov bh, [Buffer + 1]
- cmp bh, 7
- jb AnswerNo
- cmp bh, 9
- ja AnswerNo
- checkEqualSymb:
- mov bh, [Buffer + 5]
- cmp bh, [Buffer + 6]
- jne AnswerNo
- checkFifthLetters:
- or byte [Buffer + 6], 32
- cmp byte [Buffer + 6], 'a'
- jl AnswerNo
- cmp byte [Buffer + 6], 'z'
- jg AnswerNo
- checkNum:
- xor bh, bh
- mov bl, [Buffer + 1]
- sub bl, 2
- cmp byte[Buffer + bx], '0'
- jb AnswerNo
- cmp byte[Buffer + bx], '9'
- ja AnswerNo
- AnswerYes:
- mov ah, 09h
- mov dx, Yes
- int 21h
- jmp Exit
- AnswerNo:
- mov ah, 09h
- mov dx, No
- int 21h
- Exit:
- mov ah, 08h
- int 21h
- ret
- Condition:
- db "Enter your string (6 < length <= 9, 4th and 5th are equal, 5th - letter, symbol [length-3] - number ):$"
- NewLine db 13, 10, 24h
- No db "NO$"
- Yes db "YES$"
- Buffer db 10, 0, 10 dup(?)
Advertisement
Advertisement