megadrive_test1
view src/startup.s @ 5:f99eab59e7dc
clarified the C code by using VDP macros
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 01 Feb 2017 14:40:19 +0200 |
parents | 909c22dc18d2 |
children | 862f8a034cae |
line source
1 .text
2 .extern main
4 .global start
5 start:
6 | copy .data section from ROM to RAM
7 move.l #_data_lma, %a0
8 move.l #_data_start, %a1
9 move.l #_data_end, %a2
10 cmp.l %a1, %a2
11 beq.s 1f | skip data copy if the section is empty
12 0: move.l (%a0)+, (%a1)+
13 cmp.l %a1, %a2
14 bne.s 0b
15 1:
17 | zero the .bss section
18 move.l #_bss_start, %a0
19 move.l #_bss_end, %a1
20 cmp.l %a0, %a1
21 beq.s 1f | skip bss zeroing if the section is empty
22 0: clr.l (%a0)+
23 cmp.l %a0, %a1
24 bne.s 0b
25 1:
26 jsr main
27 stop #0x2700