# ------------------------------------------------------------------
# newline.s
#	Send a newline character to standard output.
# Returns number of characters written.
# ..................................................................
# calling sequence:
#	call	newline	
# ..................................................................
# author: David Bozarth - 9 May 2004
# modified 12 May 2004
# ------------------------------------------------------------------
STDOUT = 1
TRUE = 1
FALSE = 0
WORD = 4
#
# Stack frame
stkTop = basePtr		# top-of-stack marker
basePtr = 0
rtnAddr = basePtr + WORD

	.data
strNewl:
	.string "\n"
	
	.text
	.align	WORD
	.globl	newline

newline:
	pushl	%ebp			# save caller's base pointer
	movl	%esp, %ebp		# establish our base pointer
	addl	$stkTop, %esp		# allocate local variables

	pushl	$strNewl
	call	writeStr
	addl	$WORD, %esp
	
allDone:
	# return value is in eax
	movl	%ebp, %esp		# restore stack pointer
	popl	%ebp			# restore caller's base pointer
	ret
