Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DOSSEG
- .MODEL TINY
- .STACK 100h
- .DATA
- inputFile DB 'input.txt',0
- outputFile DB 'output.txt',0
- text DB 2000 DUP('$')
- ;message DB 10,13,'I fucking hate ASSembler! Godawful stinky crap! How is it even possible to create such a disgusting and filthy piece of shit?! What kind of moron you should be to even imagine how all these meaningless push and pops can work?! Nonsense!',10,13,'$'
- .CODE
- .386
- ; basic shit
- mov ax, @Data
- mov ds, ax
- mov es, ax
- ; creating new file
- mov ah, 3Ch
- mov cx, 0
- lea dx, outputFile
- int 21h
- ; opening file
- mov ah, 3Dh
- mov al, 0
- lea dx, inputFile
- int 21h
- jc error_no_file
- mov si, ax
- ; reading
- lea dx, text
- reading_file:
- mov ax, 3F00h
- mov bx, si
- mov cx, 1
- int 21h
- inc dx
- cmp ax, 1
- je reading_file
- ; show string
- ;mov ah, 9
- ;lea dx, text
- ;int 21h
- ; main part
- mov dx, 0 ;
- mov bx, OFFSET text
- iter:
- cmp dx, 0 ;
- je met ;
- add bx, 1
- met: ;
- mov dx, 1 ;
- mov al, [bx]
- cmp al, 40h
- jbe nextword
- cmp al, 4Dh
- jbe print
- cmp al, 60h
- jbe nextword
- cmp al, 6Dh
- jbe print
- jmp nextword
- print:
- mov ah, 2
- mov dl, al
- int 21h
- cmp al, 20h
- jz iter
- mov ah, 21h
- znaki:
- cmp [bx + 1], ah
- jz printprobel
- add ah, 1
- cmp ah, 30h
- jbe znaki
- add bx, 1
- mov al, [bx]
- cmp al, 13
- jz cancel
- jmp print
- nextword:
- cmp al, 20h
- jz iter
- add bx, 1
- mov al, [bx]
- cmp al, 13
- jz cancel
- jmp nextword
- printprobel:
- mov ah, 2
- mov dl, 20h
- int 21h
- jmp iter
- cancel:
- mov ah, 2
- mov dl, 10
- int 21h
- mov ah, 4ch
- int 21h
- error_no_file:
- mov dl, 1
- mov ah, 2
- int 21h
- mov ah, 4ch
- int 21h
- END
Add Comment
Please, Sign In to add comment