Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- d_seq segment
- filenamein db 'D:\file1.txt', 0
- buf dw 100 dup (?)
- blen dw 100
- handle dw 0
- filenameout db 'D:\file2.txt',0
- descr dw ?
- d_seq ends
- s_seq segment
- db 256 dup (?)
- s_seq ends
- c_seq segment
- assume cs:c_seq, ss:s_seq, ds:d_seq
- start:
- mov ax, d_seq
- mov ds, ax
- mov ax, ss
- mov ss, ax
- mov AH, 3dh
- mov AL, 0
- mov DX, offset filenamein
- int 21h
- mov handle, AX
- mov AH, 3fh
- mov BX, handle
- mov DX, offset buf ;
- mov CX, 100
- int 21h
- mov DI, offset buf ;
- mov BX, 100 ;
- mov byte ptr [DI+BX], '$'
- mov AH, 9 ;
- mov DX, offset buf
- int 21h
- xor dx, dx
- xor ah, ah
- mov ah, 2
- mov dl, 0dh
- int 21h
- mov DX, offset buf
- mov bx, dx
- xor ch, ch
- mov cl, [bx]
- mov dx, bx
- @@next:
- mov al, [bx]
- cmp al, 'a'
- jb @@skip
- cmp al, 'A'
- jb @@skip
- cmp al, 'z'
- ja @@skip
- cmp al, 'Z'
- jbe @@save
- @@save:
- xor byte ptr [bx], 20h
- @@skip:
- inc bx
- loop @@next
- mov byte ptr [bx],'$'
- mov ah, 09h
- int 21h
- ;----------------------------------------------------------
- xor dx, dx
- mov ah,3Ch ;Create File
- xor cx,cx
- lea dx,filenameout
- int 21h
- mov descr,ax
- mov ah,3Dh ;Open File
- mov al,2
- lea dx,filenameout
- int 21h
- mov descr,ax
- xor ax,ax
- mov al,100
- cbw
- mov bp,ax
- xor ax,ax
- mov bx,descr
- call write
- mov ah,3Eh ;Close File
- mov bx,descr
- int 21h
- mov ax,4C00h
- int 21h
- write:
- xor cx,cx
- mov ah,40h ;Record File
- mov cx,bp
- lea dx,buf
- mov cx, 65
- int 21h
- int 20h
- c_seq ends
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement