s1 segment
fn1 db 'hello.txt',0
fn2 db 'world.txt',0
fh1 dw ?
fh2 dw ?
buf1 db ?
buf2 db ?
test1dx dw ?
test1ax dw ?
strerror db 'error',0dh,0ah,24h
strmatch db 'match',0dh,0ah,24h
strnotmatch db 'not match',0dh,0ah,24h
s1 ends
s3 segment stack
dw 10 dup(?)
top label word
s3 ends
s2 segment
assume cs:s2,ds:s1,ss:s3
main proc near
mov ax,s1
mov ds,ax
mov ax,s3
mov ss,ax
lea sp,top
lea dx,fn1
mov al,0
mov ah,3dh
int 21h
jc error
mov fh1,ax
lea dx,fn2
mov al,0
mov ah,3dh
int 21h
jc error
mov fh2,ax
mov bx,fh1
mov al,2
fn1 db 'hello.txt',0
fn2 db 'world.txt',0
fh1 dw ?
fh2 dw ?
buf1 db ?
buf2 db ?
test1dx dw ?
test1ax dw ?
strerror db 'error',0dh,0ah,24h
strmatch db 'match',0dh,0ah,24h
strnotmatch db 'not match',0dh,0ah,24h
s1 ends
s3 segment stack
dw 10 dup(?)
top label word
s3 ends
s2 segment
assume cs:s2,ds:s1,ss:s3
main proc near
mov ax,s1
mov ds,ax
mov ax,s3
mov ss,ax
lea sp,top
lea dx,fn1
mov al,0
mov ah,3dh
int 21h
jc error
mov fh1,ax
lea dx,fn2
mov al,0
mov ah,3dh
int 21h
jc error
mov fh2,ax
mov bx,fh1
mov al,2