*Macros for use with the DOS library

* Contains
* MACRO	OpenFile	(FileName, Mode, [FileHandler])
* MACRO	CloseFile	(FileHandler)
* MACRO	ReadFile	(FileHandler, Buffer, Length)
* MACRO	DisplayTextCLI	(TextStartAddress, TextEndAddress)
* MACRO	GetCLIHandler	([CLIHandler])
* MACRO	DisplayTextCLIH	(CLIHandler, TextStartAddress, TextEndAddress)

	IFND	Open
Open	equ	-30
Close	equ	-36
Read	equ	-42
Input	equ	-54
Write	equ	-48
	ENDC

	IFND	MODE_OLDFILE
MODE_OLDFILE	equ	1005
MODE_NEWFILE	equ	1006
MODE_READWRITE	equ	1004
	ENDC

OpenFile	MACRO
	move.l	Dos_Base,a6
	move.l	\1,d1
	move.l	#\2,d2
	jsr	Open(a6)
	move.l	d0,\3
	ENDM

CloseFile	MACRO
	move.l	Dos_Base,a6
	move.l	\1,d1
	jsr	Close(a6)
	ENDM

ReadFile	MACRO
	move.l	Dos_Base,a6
	move.l	\1,d1
	move.l	\2,d2
	move.l	\3,d3
	jsr	Read(a6)
	ENDM

DisplayTextCLI	MACRO
	move.l	Dos_Base,a6
	jsr	Input(a6)
	move.l	d0,d1
	move.l	#\1,d2
	move.l	#\2-\1,d3
	jsr	Write(a6)
	ENDM

GetCLIHandler	MACRO
	move.l	Dos_Base,a6
	jsr	Input(a6)
	move.l	d0,\1
	ENDM

DisplayTextCLIH	MACRO
	move.l	Dos_Base,a6
	move.l	\1,d1
	move.l	#\2,d2
	move.l	#\3-\2,d3
	jsr	Write(a6)
	ENDM
