global _start

section .data
prompt: db "Enter your digit: "
output: db 0ah,"You digit is "
exc: db "!",0ah
end:

section .bss
digit: resb 1

section .text

_start:
	; your code goes here
; print prompt
mov eax,prompt
mov ebx,output
call print

; read user input
mov eax,3
mov ebx,0 ; i know i know you should use xor
mov ecx,digit
mov edx,1
int 80h ; lmao i forgot to add this at first

; print output prompt and user input
mov eax,output
mov ebx,exc
call print

mov eax,digit
mov ebx,eax
inc ebx
call print

mov eax,exc
mov ebx,end
call print

	jmp		exit

exit:
	mov		eax, 01h		; exit()
	xor		ebx, ebx		; errno
	int		80h

print:
mov ecx,eax
sub ebx,eax
mov edx,ebx
mov eax,4
mov ebx,1
int 80h
ret
