Aun soy novatillo en asm y muchos códigos son para practicar y memorizar la syscalls, paso de argumentos, etcétera.
;KHC
;Simple read keys
;indetectables.net
section .data
getMsg db 'Ingrese un numero:', 0h ;len = 18
showMsg db 'Ingresastesssss:', 0Ah ;len = 16
section .bss ;datos sin inicializar
obtenied resb 32 ;reservando 32 bytes
section .text
global _start
_start:
;llamada a sys_write
mov edx, 18 ;18 bytes
mov ecx, getMsg
mov ebx, 1 ;STDOUT
mov eax, 4 ;syscall (sys_write)
int 80h
;obteniendo datos
mov edx, 31 ;31 bytes
mov ecx, obtenied
mov ebx, 2 ;STDIN
mov eax, 3 ;syscall (sys_read)
int 80h
;mostrando datos
;mostrando mensaje
mov edx, 16 ;16 bytes
mov ecx, showMsg
mov ebx, 1 ;STDOUT
mov eax, 4 ;syscall (sys_write)
int 80h;
;mostrando datos obtenidos
mov edx, 31 ;31 bytes
mov ecx, obtenied
mov ebx, 1 ;STDOUT
mov eax, 4 ;sycall (sys_write)
int 80h
;saliendo...
mov ebx, 0
mov eax, 1
int 80h
Siempre es bien recibido algunos truquillos o consejos!