-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup.asm
197 lines (188 loc) · 2.57 KB
/
startup.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
type(ML620909)
model large
romwindow 0, 08fffH
extrn code: _main
extrn code: _custom_break
public $$start_up
_$$SP EQU 0F000h
dw _$$SP
dw $$start_up
dw _BRK
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
dw _INT
_BRK:
b _custom_break
mov psw, #3
brk
_INT:
rti
_060EC:
PUSH LR
MOV ER2, ER0
TB 0F00AH.1
BNE _$L074
_$L00A:
DI
MOV ER0, #01H
ST ER0, 0F024H
MOV ER0, #00H
ST ER0, 0F022H
ST ER2, 0F020H
MOV R0, #01H
ST R0, 0F025H
MOV R0, #00H
ST R0, 0F014H
ST R0, 0F015H
MOV R2, #50H
MOV R3, #0A0H
ST R2, 0F008H
ST R3, 0F008H
MOV R0, #02H
ST R0, 0F009H
NOP
NOP
_$L044:
L R0, 0F042H
BNE _$L072
_$L04A:
MOV ER0, #0FH
ST ER0, 0F024H
MOV ER0, #00H
ST ER0, 0F022H
MOV R0, #9EH
MOV R1, #07H
ST ER0, 0F020H
MOV R0, #01H
ST R0, 0F025H
MOV R0, #00H
ST R0, 0F014H
ST R0, 0F015H
EI
_$L072:
POP PC
_$L074:
RB 0F00AH.1
BAL _$L00A
$$start_up:
MOV R0, #00H
ST R0, 0F000H
B _2F060
_2F060:
L R0, 0F058H
MOV R4, R0
BL _3DEDE
MOV R0, #40H
MOV R1, #06H
BL _060EC
MOV R0, #81H
ST R0, 0F00AH
MOV R0, #04H
ST R0, 0F030H
MOV R0, #03H
ST R0, 0F033H
MOV R0, #06H
ST R0, 0F034H
MOV R0, #17H
ST R0, 0F035H
MOV R0, #08H
ST R0, 0F036H
MOV R0, #00H
ST R0, 0F039H
MOV R0, #55H
ST R0, 0F031H
BL _entry
_3DEDE:
PUSH LR
MOV R0, #31H
ST R0, 0F00AH
MOV R0, #0F7H
ST R0, 0F028H
MOV R0, #32H
_$L010:
ADD R0, #-1H
CMP R0, #00H
BNE _$L010
MOV R0, #22H
ST R0, 0F010H
MOV R0, #00H
ST R0, 0F011H
ST R0, 0F012H
MOV R0, #03H
ST R0, 0F018H
MOV R0, #00H
ST R0, 0F058H
MOV R0, #00H
ST R0, 0F042H
MOV R0, #07H
ST R0, 0F03DH
MOV R0, #0C8H
MOV R1, #00H
_$L02E:
BL _060EC
MOV R0, #04H
ST R0, 0F030H
MOV R0, #07H
ST R0, 0F033H
MOV R0, #06H
ST R0, 0F034H
MOV R0, #17H
ST R0, 0F035H
MOV R0, #08H
ST R0, 0F036H
MOV R0, #00H
ST R0, 0F039H
MOV R0, #57H
ST R0, 0F031H
MOV R0, #12H
ST R0, 0F032H
MOV R0, #00H
ST R0, 0F220H
MOV R0, #7FH
ST R0, 0F221H
MOV R0, #00H
ST R0, 0F222H
MOV R0, #7FH
ST R0, 0F223H
MOV R0, #00H
ST R0, 0F224H
ST R0, 0F225H
MOV R0, #00H
ST R0, 0F048H
ST R0, 0F049H
MOV R0, #07H
ST R0, 0F04AH
MOV R0, #00H
ST R0, 0F04BH
MOV R0, #07H
ST R0, 0F04CH
MOV R0, #00H
ST R0, 0F04EH
MOV R0, #00H
ST R0, 0F041H
MOV R0, #80H
ST R0, 0F044H
MOV R0, #0FFH
ST R0, 0F045H
MOV R2, #00H
ST R2, 0F046H
POP PC
_entry:
b _main
;start your program here