-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbank_1_main.asm
92 lines (84 loc) · 1.05 KB
/
bank_1_main.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
asect 0x00
br MAIN
#BEGIN OF DISPLAY DRAW
WRITE_TO_FIELD:
ldi r0, 0x0f
ldi r1, 0b00000010
st r0, r1
ldi r0, 0x0D
while
tst r0
stays pl
ldi r1, 0x10
add r0, r1
ld r1, r1
ldi r2, 0x10
or r2, r1
push r0
ld r0, r0
ldi r2, 0xfe
st r2, r0
ldi r2, 0xfc
st r2, r1
ldi r1, 0
st r2, r1
pop r0
dec r0
wend
ldi r0, 0x0f
ldi r1, 0b00000000
st r0, r1
rts
CHANGE_QUEUE_OF_PLAYER:
ldi r0, 0xFB
ld r0, r0
if
tst r0
is z
ldi r0, 0x1E
ld r0, r0
dec r0
dec r0
if
tst r0
is z
ldi r1, 3
else
ldi r1, 2
fi
ldi r0, 0x1E
st r0, r1
else
ldi r0, 0xFB
ldi r1, 0
st r0, r1
fi
rts
MAIN:
ldi r0, 0x0E
ld r0, r0
#Память только была инициализирвоана?
jsr WRITE_TO_FIELD
jsr CHANGE_QUEUE_OF_PLAYER
#кто-то выйграл?
ldi r0, 0xF8
ld r0, r0
if
tst r0
is nz
ldi r0, 0x0f
ldi r1, 0b00010000
st r0, r1
halt
fi
#загрузка id банки перехода
ldi r0, 0x1e
ld r0, r0
br CHANGE
#halt
asect 0xF7
CHANGE:
ldi r1, 0xff
st r1, r0
br 0
end