First commit ~0,10
This commit is contained in:
146
INT_KEY/INT_KEY.ASM
Normal file
146
INT_KEY/INT_KEY.ASM
Normal file
@ -0,0 +1,146 @@
|
||||
|
||||
_TEXT SEGMENT BYTE PUBLIC 'CODE'
|
||||
|
||||
ASSUME CS:_TEXT
|
||||
|
||||
PUBLIC DIR_MEM_TECLA
|
||||
|
||||
DIR_MEM_TECLA DD 0
|
||||
|
||||
PUBLIC VECTOR_TECLADO
|
||||
|
||||
VECTOR_TECLADO DD 0
|
||||
|
||||
PUBLIC GUARDA_VECTORES
|
||||
|
||||
GUARDA_VECTORES PROC NEAR
|
||||
PUSH AX
|
||||
PUSH BX
|
||||
PUSH ES
|
||||
MOV AH,35h ;Guarda el vector del teclado.
|
||||
MOV AL,09h
|
||||
INT 21h
|
||||
MOV WORD PTR CS:[VECTOR_TECLADO],BX
|
||||
MOV WORD PTR CS:[VECTOR_TECLADO+2],ES
|
||||
POP ES
|
||||
POP BX
|
||||
POP AX
|
||||
RET
|
||||
GUARDA_VECTORES ENDP
|
||||
|
||||
PUBLIC _SET_VECTORES
|
||||
|
||||
_SET_VECTORES PROC NEAR
|
||||
CALL GUARDA_VECTORES
|
||||
PUSH BP
|
||||
MOV BP,SP
|
||||
PUSH AX
|
||||
PUSH DS
|
||||
PUSH DX
|
||||
PUSH SI
|
||||
|
||||
LDS SI,[BP+4]
|
||||
MOV WORD PTR CS:[DIR_MEM_TECLA],SI
|
||||
MOV WORD PTR CS:[DIR_MEM_TECLA+2],DS
|
||||
|
||||
MOV DX,OFFSET CS:TECLADO
|
||||
MOV AX,_TEXT
|
||||
MOV DS,AX
|
||||
MOV AL,09h
|
||||
MOV AH,25h
|
||||
INT 21h ;Cambia el vector del teclado.
|
||||
|
||||
POP SI
|
||||
POP DX
|
||||
POP DS
|
||||
POP AX
|
||||
POP BP
|
||||
RET
|
||||
_SET_VECTORES ENDP
|
||||
|
||||
PUBLIC _UNSET_VECTORES
|
||||
|
||||
_UNSET_VECTORES PROC NEAR
|
||||
PUSH BP
|
||||
MOV BP,SP
|
||||
PUSH AX
|
||||
PUSH DS
|
||||
PUSH DX
|
||||
|
||||
MOV DX,WORD PTR CS:[VECTOR_TECLADO]
|
||||
MOV AX,WORD PTR CS:[VECTOR_TECLADO+2]
|
||||
MOV DS,AX
|
||||
MOV AL,09h
|
||||
MOV AH,25h
|
||||
INT 21h ;Repone el vector del teclado.
|
||||
|
||||
POP DX
|
||||
POP DS
|
||||
POP AX
|
||||
POP BP
|
||||
RET
|
||||
_UNSET_VECTORES ENDP
|
||||
|
||||
PUBLIC TECLADO
|
||||
|
||||
TECLADO PROC FAR
|
||||
PUSH AX
|
||||
PUSH BX
|
||||
PUSH DS
|
||||
PUSH SI
|
||||
LDS SI,CS:[DIR_MEM_TECLA]
|
||||
IN AL,60h
|
||||
MOV AH,AL
|
||||
IN AL,61h
|
||||
OR AL,10000000b
|
||||
OUT 61h,AL
|
||||
AND AL,01111111b
|
||||
OUT 61h,AL
|
||||
MOV AL,AH
|
||||
MOV BL,AL
|
||||
MOV BH,00h
|
||||
AND BX,007Fh
|
||||
CMP AL,00h
|
||||
JE TECLEADO
|
||||
CMP AL,0E0h
|
||||
JE TECLEADO
|
||||
CMP AL,0F0h
|
||||
JE TECLEADO
|
||||
CMP BYTE PTR [SI],0E0h ;<3B>ltima tecla
|
||||
JNE NO_DOBLE
|
||||
ADD BX,128
|
||||
NO_DOBLE: TEST AL,80h
|
||||
JZ NO_SOLT
|
||||
MOV BYTE PTR [BX+SI],0
|
||||
JMP TECLEADO
|
||||
NO_SOLT: MOV BYTE PTR [BX+SI],1
|
||||
TECLEADO: MOV [SI],AL ;<3B>ltima tecla
|
||||
LDS SI,CS:[DIR_MEM_TECLA]
|
||||
MOV BYTE PTR [SI+84],0
|
||||
MOV BYTE PTR [SI+85],0
|
||||
MOV AL,[SI+42]
|
||||
OR AL,[SI+54]
|
||||
CMP AL,1
|
||||
JNE NO_IMPR_PANT
|
||||
CMP BYTE PTR [SI+55],1
|
||||
JNE NO_IMPR_PANT
|
||||
MOV BYTE PTR [SI+84],1
|
||||
NO_IMPR_PANT: MOV AL,[SI+29]
|
||||
OR AL,[SI+157]
|
||||
CMP AL,1
|
||||
JNE NO_PAUSA
|
||||
CMP BYTE PTR [SI+69],1
|
||||
JNE NO_PAUSA
|
||||
MOV BYTE PTR [SI+85],1
|
||||
NO_PAUSA: MOV AL,20h
|
||||
OUT 20h,AL
|
||||
POP SI
|
||||
POP DS
|
||||
POP BX
|
||||
POP AX
|
||||
IRET
|
||||
TECLADO ENDP
|
||||
|
||||
_TEXT ends
|
||||
|
||||
end
|
107
INT_KEY/INT_KEY.H
Normal file
107
INT_KEY/INT_KEY.H
Normal file
@ -0,0 +1,107 @@
|
||||
#define t_esc 1
|
||||
#define t_1 2
|
||||
#define t_2 3
|
||||
#define t_3 4
|
||||
#define t_4 5
|
||||
#define t_5 6
|
||||
#define t_6 7
|
||||
#define t_7 8
|
||||
#define t_8 9
|
||||
#define t_9 10
|
||||
#define t_0 11
|
||||
#define t_? 12
|
||||
#define t_back 14
|
||||
#define t_tab 15
|
||||
#define t_q 16
|
||||
#define t_w 17
|
||||
#define t_e 18
|
||||
#define t_r 19
|
||||
#define t_t 20
|
||||
#define t_y 21
|
||||
#define t_u 22
|
||||
#define t_i 23
|
||||
#define t_o 24
|
||||
#define t_p 25
|
||||
// [ 26
|
||||
#define t_mas 27
|
||||
#define t_enter 28
|
||||
#define t_ctrl_izq 29
|
||||
#define t_a 30
|
||||
#define t_s 31
|
||||
#define t_d 32
|
||||
#define t_f 33
|
||||
#define t_g 34
|
||||
#define t_h 35
|
||||
#define t_j 36
|
||||
#define t_k 37
|
||||
#define t_l 38
|
||||
//#define t_<74> 39
|
||||
// acent_o
|
||||
// <20>
|
||||
#define t_shift_izq 42
|
||||
// <20>
|
||||
#define t_z 44
|
||||
#define t_x 45
|
||||
#define t_c 46
|
||||
#define t_v 47
|
||||
#define t_b 48
|
||||
#define t_n 49
|
||||
#define t_m 50
|
||||
#define t_coma 51
|
||||
#define t_pto 52
|
||||
#define t_menos 53
|
||||
#define t_shift_der 54
|
||||
#define t_por_num 55
|
||||
#define t_alt_izq 56
|
||||
#define t_space 57
|
||||
#define t_bmay 58
|
||||
#define t_f1 59
|
||||
#define t_f2 60
|
||||
#define t_f3 61
|
||||
#define t_f4 62
|
||||
#define t_f5 63
|
||||
#define t_f6 64
|
||||
#define t_f7 65
|
||||
#define t_f8 66
|
||||
#define t_f9 67
|
||||
#define t_f10 68
|
||||
#define t_bnum 69
|
||||
#define t_bdesp 70
|
||||
#define t_7n 71
|
||||
#define t_8n 72
|
||||
#define t_9n 73
|
||||
#define t_menos_num 74
|
||||
#define t_4n 75
|
||||
#define t_5n 76
|
||||
#define t_6n 77
|
||||
#define t_mas_num 78
|
||||
#define t_1n 79
|
||||
#define t_2n 80
|
||||
#define t_3n 81
|
||||
#define t_0n 82
|
||||
#define t_pto_num 83
|
||||
#define t_impr_pant 84
|
||||
#define t_pausa 85
|
||||
// <>
|
||||
#define t_f11 87
|
||||
#define t_f12 88
|
||||
// Saltamos hasta 156
|
||||
#define t_intro_num 156
|
||||
#define t_ctrl_der 157
|
||||
// Saltamos hasta 180
|
||||
#define t_dividir 180
|
||||
#define t_alt_der 183
|
||||
// Saltamos a 197
|
||||
#define t_inicio 197
|
||||
#define t_arriba 198
|
||||
#define t_repag 199
|
||||
#define t_izquierda 201
|
||||
#define t_derecha 203
|
||||
#define t_fin 205
|
||||
#define t_abajo 206
|
||||
#define t_avpag 207
|
||||
#define t_ins 208
|
||||
#define t_sup 209
|
||||
|
||||
//unsigned char tecla[512]; // t_abla de det_ecciones del teclado
|
||||
|
Reference in New Issue
Block a user