[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.

Question
[x]
Attachment Details

Trying to print a caracter

Asked by tirengarfio1 in Assembly Programming Language

Tags: 8086 assembly

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
[+][-]03/16/08 02:21 AM, ID: 21136248Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/16/08 06:14 AM, ID: 21136787Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/16/08 06:21 AM, ID: 21136807Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/16/08 07:37 AM, ID: 21137029Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/16/08 07:45 AM, ID: 21137054Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/16/08 09:35 AM, ID: 21137389Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/16/08 03:49 PM, ID: 21138887Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20100308-EE-VQP-140 / EE_QW_2_20070628
Your technology problems solved.
Close See Plans and Pricing. Try it FREE for 30 days.