Hi infinity08,
>> Do you mean two $'s next to each other, or above each other ?
I meant two $'s one above each other.
Anyway, I attach my new code with your advises but now it only writes a $ above the first one when i push the up arrow key or the down arroy key. And when it writes that second $ it doesn't write any more $'s when i press again the arrow keys.
Main Topics
Browse All Topics





by: Infinity08Posted on 2008-03-16 at 02:21:04ID: 21136248
>> Then, when i push the up arrow key it should print another "$" above the first one, but it prints TWO.
Do you mean two $'s next to each other, or above each other ?
>> My other problem: I would like it only prints the "$" when i press the up arrow key (now it prints "$" for any key i press).
This part :
cmp al, 18h ; Compruebo si el caracter pulsado es la flecha hacia arriba.
je arriba
arriba:
So, you jump to arriba if you find a certain character, but if the character is different, you still continue at the arriba position. You need to add a bit of extra code :
cmp al, 18h ; Compruebo si el caracter pulsado es la flecha hacia arriba.
je arriba
; <--- code to handle other key goes here
jmp bucle ; go to the beginning of the loop again
arriba:
Btw, why don't you read the next character at the beginning of the loop ?
mov dl, 024h
mov ah, 06h
int 21h