-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbank_3_human.asm
66 lines (56 loc) · 935 Bytes
/
bank_3_human.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
asect 0x00
# WRITE YOUR CODE HERE
START:
ldi r0, 0x0f
ldi r1, 0b00001000
st r0, r1
ldi r0, 0xF9
ld r0, r1
while
tst r1
stays z
ld r0, r1
wend
move r1, r2
dec r2
ld r2, r2
if
tst r2
is z
ldi r0, 0x0f
ldi r1, 0b01000001
st r0, r1
ldi r0, 0x0f
ldi r1, 0b00000000
st r0, r1
br START
fi
ldi r0, 0x1F
st r0, r1
ldi r0, 0x0f
ldi r1, 0b01000000
st r0, r1
# 0b00000000
# ^^^^^^^^
# ||||||||
# |||||||> Error
# ||||||> W\R to\from field
# |||||> Computing
# ||||> Waiting user action
# |||> Game stopped
# ||> Initializing memory
# |> Set button register to 0
# > Ready
ldi r0, 0x0f
ldi r1, 0b00000000
ldi r0, 4
br SWITCH_BANK
#перед попаданием в функцию в r0 должен быть адрес банки для перехода
#switch to 2 bank
asect 0xF7
SWITCH_BANK:
ldi r1, 0xff
st r1, r0
br 0
halt
end