	.section	.text
	.intel_syntax
	.global	put_line
put_line:
	push	%ebp
	mov	%ebp, %esp
	push	%ebx
	sub	%esp, 8			# Allocate space
	mov	%eax, 4			# Write system call
	mov	%ecx, [%ebp + 12]	# Copy address of string
	.ifdef	NetBSD
	push	[%ecx - 4]		# Length
	push	%ecx			# Put address of string on the stack
	push	[%ebp + 8]		# File descriptor
	push	0			# Extra double-word
	.else
	mov	%edx, [%ecx - 4]	# Length
	.endif
	mov	%ebx, [%ebp + 8]	# File descriptor
	int	128
	mov	%eax, 4			# Write system call
	mov	byte ptr [%ebp - 5], 10
	lea	%ecx, [%ebp - 5]	# Calculate address of new-line character
	.ifdef	NetBSD
	push	1			# Length of one
	push	%ecx			# Put address on the stack
	push	%ebx			# Put file descriptor on the stack
	push	0			# Extra double-word
	.else
	mov	%edx, 1			# Length of one
	.endif
	int	128
	pop	%ebx
	mov	%esp, %ebp		# Deallocate space
	pop	%ebp
	ret
