-
Notifications
You must be signed in to change notification settings - Fork 0
/
MACRO.INC
110 lines (81 loc) · 1.93 KB
/
MACRO.INC
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ MACRO ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Setup_Video MACRO
MOV AH,0FH ; Setting Up Video
INT 10H
CMP AL,3
JZ SHORT Vinit_1
MOV AX,3
INT 10H
Vinit_1:
MOV AX,Int_Data
MOV GS,AX
MOV AH,3
XOR BH,BH ; Get cursor position
INT 10H
SHL DL,1
MOV AL,DH
CBW
CWDE
MOV EBX,EAX
SHL EAX,7
SHL EBX,5
ADD EBX,EAX
MOV AL,DL
CBW
CWDE
ADD EBX,EAX
MOV PosXY,EBX
MOV CursorX,DL ; Save cursor position
MOV AH,1 ; Set No Cursor
MOV CX,2000H
INT 10H
ENDM
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Setup_irq MACRO master,slave
MOV AL,11H ; Set IRQ0..IRQ7 to master
OUT 20H,AL ; 1
JMP $ + 2
MOV AL,master
OUT 21H,AL ; 2
JMP $ + 2
MOV AL,4H
OUT 21H,AL ; 3
JMP $ + 2
MOV AL,1H
OUT 21H,AL ; 4
JMP $ + 2
MOV AL,11H ; Set IRQ8..IRQF to slave
OUT 0A0H,al
JMP $ + 2
MOV AL,slave
OUT 0A1H,AL
JMP $ + 2
MOV AL,2H
OUT 0A1H,AL
JMP $ + 2
MOV AL,1H
OUT 0A1H,AL
JMP $ + 2
ENDM
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
RMSetup_Cursor MACRO
MOV AX,Int_Data
MOV GS,AX
MOV EAX,PosXY
MOV CL,CursorX ; GET posizione cursore PM
; CL X
SHR CL,1
MOV CH,160
DIV CH ; AL Y
MOV DH,AL ; Put position to DOS
MOV DL,CL
MOV AH,2
XOR BH,BH
INT 10H
MOV AH,1 ; Put visible Cursor
MOV CX,0607H
INT 10H
ENDM
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ