|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by tirengarfio1 in Assembly Programming Language
Hi,
at first, the code i attach prints a "$" symbol. Then, when i push the up arrow key it should print another "$" above the first one, but it prints TWO. Why?
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).
Assembly 8086
Bye
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
|
DOSSEG
.MODEL SMALL
.STACK 100h
.DATA
.CODE
INICIO:
mov ax, @data
mov ds, ax
mov ax,03h ; Peticion para limpiar pantalla
int 10h
;funcion de la interrupcion que nos permite posicionarnos
mov ah,02h ; colocar el cursor en una posicion definida
mov dh,0Ah ; fila
mov dl,026h ; columna
int 10h ; interrupcion de video
mov dl, 024h ; Escribo el caracter "$"
mov ah, 06h
int 21h
bucle:
mov ah, 08h ; Leo un caracter del teclado sin reproducirlo en la pantalla.
int 21h
cmp al, 18h ; Compruebo si el caracter pulsado es la flecha hacia arriba.
je arriba
arriba:
mov ah, 02h ; Colocar el cursor en una posicion definida
sub dh, 1
mov dl, 026h ; columna
mov bh,0 ; pagina de video activa generalmente la cero
int 10h
mov dl, 024h
mov ah, 06h
int 21h
jmp bucle
FIN:
mov ah, 4ch
int 21h
end INICIO
|
20100308-EE-VQP-140 / EE_QW_2_20070628