		.nolist

;; Starter macros for the p6temp.asm program

;; Display a null terminated string that is stored in memory
;;    Verifies that the operand is a memory reference; uses
;;    Irvine's library to display

showstring	macro	first
		push	dx
		if ((opattr first) and 0002h) eq 0
			echo		Operand must be a memory reference
			.err
			exitm
		endif
		mov		dx, offset first
		call	Writestring
		pop		dx
	endm


;; Display a double word unsigned integer that is held in the operand
;;    Verifies that the operand is not already EAX, then moves
;;    the value there for Irvine's library routine

shownumber	macro	first
		push	eax
		push	bx
		mov		bx, 10
		ifdif <first>,<eax>
			mov		eax, first
		endif
		call	Writelong
		pop		bx
		pop		eax
	endm


;; Outputs a carriage return and line feed
;;    Uses Irvine's library routine

newline	macro
		call	crlf
	endm

		.list
