; pass the address of the root of the binary tree in a5.
; _npt is the routine that I use to print a node of the tree
;      since the address is on the stack, it must be retreived.
;      When the print routine is called, however the return 
;      address within the calling rouine is pushed onto the stack.
;      The address of the desired node to print can be found
;      by using the following instruction:
;                             move.l	4(sp),a0
; WARNING: the larger the binary tree that you are dealing with,
;          the more stack space you will need, so be careful
;          because the stack grows towards your program. 
; Print the binary tree in an in-order traversal
PrintTree
	move.l	(a5),-(sp)
	tst.l	(sp)
	beq	_ept
	move.l	(sp),a5
	addq.l	#8,a5
	jsr	PrintTree
	bsr	_npt
	move.l	(sp),a5
	addq.l	#4,a5
	jsr	PrintTree
_ept	tst.l	(sp)+		
	rts
; please feel free to use and modify the above code as you wish.
; address any question and/or questions to KINGD.
; The above code was painfully devised by Darren James King with
; inspiration from Mike Gabrielson's article 'Binary Tree 
; Manipulation on the 8080' from Dr. Dobbs, issue 30.
