I need to write names from keyboard and then display them, one on each line. They should be displayed with an index before of them. For example if I write the names elena and maria the should be displayed as 1.elena 2.maria
I tried adding a counter variable but I have some errors when I try to run the program in DosBox. Can someone help me? Here is my clean label that is outputting the names:
lista:
mov dx, offset nume
print_names:
push dx
mov dl, 13 ; carriage return
mov ah, 02h
int 21h
mov dl, 10 ; linefeed
mov ah, 02h
int 21h
pop dx
mov dx, offset index
mov ah, 9
int 21h
inc byte ptr index
mov dx, offset nume
mov ah, 09h
int 21h
; (*)
add dx, 5 + 1
cmp dx, numePointer ; check if the current name is the last one
jb print_names
jmp bucla ; return to main loop