	.section	.text
	.intel_syntax
	.global	get
	.type	get, @function
get:
	push	%ebp
	mov	%ebp, %esp
	push	%ebx
	sub	%esp, 8			# Allocate space
	mov	%eax, 3			# Read system call
	mov	%ebx, [%ebp + 8]	# Write to file descriptor
	lea	%ecx, [%ebp - 4]	# Pass address of character
	mov	%edx, 1			# Read one byte
	int	128
	cmp	%eax, 0
	jns	get.return_byte		# Return character if its unsigned
	jmp	get.end			# Return the error number
get.return_byte:
	mov	%eax, [%ebp - 4]
	movzb	%eax, %al		# Return the first byte
get.end:
	pop	%ebx
	mov	%esp, %ebp		# Deallocate space
	pop	%ebp			# Leave
	ret
