include qlib.inc
include dos.inc
include string.inc
include stdio.inc
include process.inc
.data
buf db 256 dup (0)
db 0
h dw ?
siz dd ?
.code
main proc
callp print,"Test file IO...\n Dump 1st 256 bytes of file.asm:\n"
callp open,"file.asm",0
mov h,ax
.if eax==ERROR
callp printf,"Failed open\n"
call abort
.endif
callp filelength,h
mov siz,eax
callp read,h,offset buf,256
callp close,h
callp printf,offset buf
callp printf,"\n Size=%d",siz
ret
main endp
end