-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.asm
123 lines (85 loc) · 2.5 KB
/
test.asm
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
111
112
113
114
115
116
117
118
119
120
121
122
123
extrn MAIN:FAR
extrn CHAT_MAIN:FAR
extrn MULTI_MAIN:FAR
public MAINGAMEDASH
.model large
.stack 100h
.data
SinglePlayer DB "Single Player (enter)$"
MultiPlayer DB "Multi Player (m)$"
Chat db "Chat (c)$"
Exit db "Exit (esc)$"
.code
SetCursor MACRO x, y
PUSH ax
PUSH dx
mov ah,2
mov dl, x
mov dh, y
int 10h
POP dx
POP ax
ENDM
CLEAR_SCREEN Proc NEAR
; Open graphical mode 13h (320x200, 256 colors)
push ax
push bx
mov al, 13h
mov ah, 0
int 10h
MOV AH,0bh
mov bx,00
int 10h
mov al, 03h
mov ah, 0
int 10h
pop bx
pop AX
ret
CLEAR_SCREEN endp
MAINGAMEDASH PROC FAR
mov ax, @data
mov ds, ax
CALL CLEAR_SCREEN
SetCursor 13, 5
mov ah, 9
LEA dx, SinglePlayer
int 21h
SetCursor 13, 7
mov ah, 9
LEA dx, MultiPlayer
int 21h
SetCursor 13, 9
mov ah, 9
LEA dx, Chat
int 21h
SetCursor 13, 11
mov ah, 9
LEA dx, Exit
int 21h
DashLoop:
mov ah, 0
int 16h
CMP al, 0Dh ;Enter
JE BEGIN_GAME
CMP al, 63h ;c
JE BEGIN_CHAT
cmp al, 'm'
JE BEGIN_MULTI
CMP al, 1Bh ;Esc
JE DashExit
JMP DashLoop
BEGIN_GAME:
CALL MAIN
JMP DashLoop
BEGIN_CHAT:
CALL CHAT_MAIN
JMP DashLoop
BEGIN_MULTI:
CALL MULTI_MAIN
JMP DashLoop
DashExit:
mov ah,4ch
int 21h
MAINGAMEDASH ENDP
END MAINGAMEDASH