I'm currently looking to get an input from the user. This input should be in a string form but should be composed of numbers, like 1234. I don't understand the whole ASCII conversion thing. I do have user input here but don't understand the conversion from string to int. This is what I have so far:
msg: .ascii "Insert a number:"
.equ STDOUT,1
.equ WRITE,4
.equ EXIT,1
.equ STDIN,0
.equ READ,0
msg_end:
.equ len, msg_end - msg
.text
.globl _start
_start:
movl $WRITE, %eax #write to eax
movl $STDOUT, %ebx #print ebx
movl $msg, %ecx #move string to ecx
movl $len, %edx #length of string to edx
int $0x80
movl $READ, %eax #read
movl $STDIN, %ebx
movl %esp, %ecx #starting point
movl $6, %edx #max input we would have
int $0x80
movl $1, %ecx #counter ecx
_input: #subroutine to check when at the end of user input
xor %ebx, %ebx
movb (%esp), %bl
inc %esp #move on to the next char
inc %ecx #counter moves on by 1
cmp $0xa, %ebx #compare with \n
jne _input #if not loop back up
sub %ecx, %esp #start from the first input char
movl $WRITE, %eax #write to eax
movl $STDOUT, %ebx #print out
movl %ecx, %edx #pointer to edx
movl %esp, %ecx #length of input
int $0x80
movl $EXIT, %eax
int $0x80
Sorry for giving the entire code but I'm not sure exactly how to do this.