FILEOPEN


execbase = 4
Read = -42
Open = -30
Close = -36
Mode_old = 1006
Mode_new = 1006
OpenLib = -408
CloseLib = -414

	
s:
	bsr	opendos
	bsr	openfile
	bsr	slut



opendos:
	move.l	execbase,a6
	lea	dosname,a1
	moveq	#0,d0
	jsr	OpenLib(a6)
	move.l	d0,dosbase
	rts


openfile:
	move.l	#1006,d2
	move.l	dosbase,a6
	move.l	filename,d1
	jsr	Open(a6)
	move.l	d0,filehd
	rts

	
slut:
closefile:
	move.l	dosbase,a6
	move.l	filehd,d1
	jsr	Close(a6)

closedos:
	move.l	dosbase,a1
	move.l	execbase,a6
	jsr	CloseLib(a6)
	rts
filehd:
	dc.l	0
	
filename:
	dc.b	'dh0:tstfile',0


dosname:
	dc.l	'dos.library',0

dosbase:
	dc.l	0