Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .MODEL SMALL
- .STACK 200H
- .DATA
- Text db "Baka coding desu$"
- ResultText db "$"
- .CODE
- START:
- mov ax, @DATA
- mov ds, ax
- lea dx, Text
- xor ax, ax
- mov ah, 09
- int 21h
- xor dx, dx
- xor si, si
- Parse_Text_loop:
- mov al, [Text + si]
- mov bx, si
- sub si, dx
- mov [ResultText + si], al
- mov si, bx
- cmp al, '$'
- je End_Parse_text_loop
- cmp al, 'g'
- jne Continue_parse_Text_loop
- mov ah, [Text + si + 1]
- cmp ah, '$'
- je Cmp_ah_n
- cmp ah, ' '
- jne Continue_parse_Text_loop
- Cmp_ah_n:
- mov ah, [Text + si - 1]
- cmp ah, 'n'
- jne Continue_parse_Text_loop
- mov ah, [Text + si - 2]
- cmp ah, 'i'
- jne Continue_parse_Text_loop
- mov bx, si
- sub si, dx
- mov [ResultText + si], ' '
- mov [ResultText + si - 1], 'd'
- mov [ResultText + si - 2], 'e'
- mov si, bx
- inc dx
- Continue_parse_Text_loop:
- inc si
- jmp Parse_Text_loop
- End_Parse_text_loop:
- ; ------ new line
- mov dl, 0dh
- mov ah, 02h
- int 21h
- mov dl, 0ah
- mov ah, 02h
- int 21h
- ; ------
- lea dx, ResultText
- xor ax, ax
- mov ah, 09
- int 21h
- mov ah, 4ch
- mov al, 00h
- int 21h
- END START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement