-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.asm
More file actions
80 lines (60 loc) · 1.05 KB
/
main.asm
File metadata and controls
80 lines (60 loc) · 1.05 KB
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
[BITS 16]
jmp main
welcome_string db "This is my shitty ass OS that I'ma turn into pong! ", 2, 0
wait_string db "Press, like, literally any key to begin...", 0
%include "io.inc"
%include "pong.inc"
main:
mov cl, 0x3F
call clear
mov dh, 3
mov dl, 3
mov cl, 0x3F
mov si, welcome_string
call prints
mov dh, 3
mov dl, 4
mov si, wait_string
call prints
call get_char_wait
mov cl, 0x0F
call clear
.gameloop:
mov cl, 0x0F
call clear
call draw_all
mov cx, 50
call sleep
.getanother:
xor ax, ax
call get_char
cmp al, 0
je .end
cmp al, 'q'
je .lmove_bat1_up
cmp al, 'z'
je .lmove_bat1_down
cmp al, 'u'
je .lmove_bat2_up
cmp al, 'm'
je .lmove_bat2_down
jmp .end
.lmove_bat1_up:
call move_bat1_up
jmp .end
.lmove_bat1_down:
call move_bat1_down
jmp .end
.lmove_bat2_up:
call move_bat2_up
jmp .end
.lmove_bat2_down:
call move_bat2_down
jmp .end
.end:
call update_ball
jmp .gameloop
.stopeet:
hlt
jmp .stopeet
times 512*7-($-$$) db 0 ; just to fill up the floppy