Ensamblador - Ayuda Programa Pila

 
Vista:

Ayuda Programa Pila

Publicado por Carlos (1 intervención) el 19/12/2021 17:28:58
Buenas, estoy haciendo un programa el cual me pide x repeticiones y segun el numero de repeticiones que le diga me imprime un mensaje pidiendome un numero, tantas veces como el numero de repeticiones, para despues imprimirme los numeros escritos. Ejemplo:
¿Cuantas repeticiones?
2
¿Dime un numero?
4
¿Dime un numero?
8
Resultado:84

Esto es lo que tengo de codigo, agradeceria mucho vuestra ayuda, gracias.

global _start
section .text

_start:
;Mensaje
mov eax, 4
mov ebx, 1
mov ecx, mensaje_rep
mov edx, length_rep
int 80h

;Entrada
mov eax, 3
mov ebx, 0
mov ecx, bucle
mov edx, 4
int 80h
_bucle:
;Mensaje
mov eax, 4
mov ebx, 1
mov ecx, mensaje_num
mov edx, length_num
int 80h

;Entrada
mov eax, 3
mov ebx, 0
mov ecx, numero
mov edx, 4
int 80h
jmp _bucle

section .data
mensaje_rep: db '¿Cuantas repeticiones?', 0x0A
length_rep: equ $-mensaje_rep

mensaje_num: db 'Dime un numero entre (0-9):', 0x0A
length_num: equ $-mensaje_num
section .bss
numero resb 4
bucle resb 4
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder