
Long_SIZEOF	equ	4
Word_SIZEOF	equ	2
Byte_SIZEOF	equ	1


;******************
;*** exec stuff ***
;******************

RTF_AUTOINIT	equ	1<<7
MEMF_PUBLIC	equ	1<<0
MEMF_CLEAR	equ	1<<16



;********************
;*** exec.library ***
;********************

Forbid			equ -132	; ()()
Permit			equ -138	; ()()
AllocMem		equ -198	; (byteSize,requirements)(d0/d1)
FreeMem			equ -210	; (memoryBlock,byteSize)(a1,d0)
Remove			equ -252	; (node)(a1)
CloseLibrary		equ -414	; (library)(a1)
OpenLibrary		equ -552	; (libName,version)(a1,d0)

;*******************
;*** dos.library ***
;*******************

Open			equ -30		; (name,accessMode)(d1/d2)
Close			equ -36		; (file)(d1)
Read			equ -42		; (file,buffer,length)(d1/d2/d3)
Write			equ -48		; (file,buffer,length)(d1/d2/d3)
Output			equ -60		; ()()


;__________________________________________________________


INITBYTE	MACRO	; &offset,&value
		IFLE	(\1)-255	;If offset <=255
		DC.B	$a0,\1		;use byte offset
		DC.B	\2,0
		MEXIT			;exit early
		ENDC
		DC.B	$e0,0
		DC.W	\1
		DC.B	\2,0
		ENDM

INITWORD	MACRO	; &offset,&value
		IFLE	(\1)-255	;If offset <=255
		DC.B	$90,\1		;use byte offset
		DC.W	\2
		MEXIT			;exit early
		ENDC
		DC.B	$d0,0
		DC.W	\1
		DC.W	\2
		ENDM

INITLONG	MACRO	; &offset,&value
		IFLE	(\1)-255	;If offset <=255
		DC.B	$80,\1		;use byte offset
		DC.L	\2
		MEXIT			;exit early
		ENDC
		DC.B	$c0,0
		DC.W	\1
		DC.L	\2
		ENDM

;__________________________________________________________




UNUSED		equ	0
NODEUSED	equ	1
NODEUNUSED	equ	2
LEAFLINKED	equ	3		;leaf already is linked somewhere in
					;the tree
LEAFUNLINKED	equ	4		;leaf is not yet linked to any node
					;in the tree
ROOTNODE	equ	5


LEFTSUBTREE	equ	0		;indicates that this node is at the
					;left  branch of it's parent
RIGHTSUBTREE	equ	1		;indicates that this node is at the
					;right branch of it's parent
NODIRECTION	equ	-1		;for root node only

NOLISTLINKYET	equ	-1


