When I try to read from the keyboard a number of 2 digits and then try to print that number again on the screen it does not return the same value, but if I define the number myself if it works, what am I doing wrong?
segment .data
segment .bss
datos resb 2
aux resb 2
segment .text
global _start
_start:
;SYSCALL
mov eax, 3
mov ebx, 0
mov ecx, aux
mov edx, 2
int 0x80
mov edx, 0
;mov eax, 55 ; DEFINIENDO EL VALOR SI SE MUESTRA CORRECTAMENTE
mov eax, [aux]; USANDO EL VALOR ALMACENADO EN AUX NO SE MUESTRA CORRECTAMENTE
mov ecx, 10
; SE REALIZA UNA DIVISION ENTRE 10 PARA TRABAJAR CON NUMEROS DE 2 DIGITOS
div ecx
; SE LE SUMA AL RESIDUO Y AL COCIENTE '0' PARA PODER IMPRIMIR EN PANTALLA CADA UNO DE LOS DIGITOS
add eax, '0'
mov [datos+0], eax
add edx, '0'
mov [datos+1], edx
;SYSCALL
mov eax, 4
mov ebx, 0
mov ecx, datos
mov edx, 2
int 80h
_salir:
mov eax, 1
xor ebx, ebx
int 0x80
If someone could help me I would appreciate it