diff options
author | DJ Delorie <dj@redhat.com> | 2015-01-16 22:21:34 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2015-01-16 22:21:34 +0000 |
commit | 70e52cba1b27fe65dc743b44bb73dc1a5c718bbe (patch) | |
tree | 0fcaa64a3af83dd1d81ae49b4b3128d2916bc5bb /libgloss/rl78/crt0.S | |
parent | a62dbcd6e03ff182e7d36ea60d953f447db72d62 (diff) | |
download | cygnal-70e52cba1b27fe65dc743b44bb73dc1a5c718bbe.tar.gz cygnal-70e52cba1b27fe65dc743b44bb73dc1a5c718bbe.tar.bz2 cygnal-70e52cba1b27fe65dc743b44bb73dc1a5c718bbe.zip |
* rl78/crt0.S: Initialize .saddr. Avoid using SEL.
* rl78/rl78-sim.ld: Add .saddr/.frodata section.
* rl78/rl78.ld: Likewise.
* rl78/rl78-sim.ld: Make room for virtual register banks.
* rl78/rl78.ld: Likewise.
* rl78/vregs.h: New.
* rl78-sys.h: Use it.
* rl78/swrite.S: New.
* rl78/Makefile.in: Build it.
* rl78/write.c: Use it.
Diffstat (limited to 'libgloss/rl78/crt0.S')
-rw-r--r-- | libgloss/rl78/crt0.S | 66 |
1 files changed, 28 insertions, 38 deletions
diff --git a/libgloss/rl78/crt0.S b/libgloss/rl78/crt0.S index d5a07df90..fbba093a3 100644 --- a/libgloss/rl78/crt0.S +++ b/libgloss/rl78/crt0.S @@ -147,55 +147,45 @@ _start: ;; block move to initialize .data - ;; we're copying from 00:[_romdatastart] to 0F:[_datastart] - ;; and our data is not in the mirrored area. mov es, #0 - - sel rb0 ; bank 0 - movw hl, #__datastart - movw de, #__romdatastart - sel rb1 ; bank 1 - movw ax, #__romdatacopysize - shrw ax,1 -1: + movw bc, #__romdatacopysize +1: + movw ax, bc cmpw ax, #0 bz $1f - decw ax - sel rb0 ; bank 0 - movw ax, es:[de] - movw [hl], ax - incw de - incw de - incw hl - incw hl - sel rb1 + decw bc + decw bc + movw ax, es:__romdatastart[bc] + movw __datastart[bc], ax br $1b -1: - sel rb0 ; bank 0 +1: + + mov es, #0 + movw bc, #__romsaddrcopysize +1: + movw ax, bc + cmpw ax, #0 + bz $1f + decw bc + decw bc + movw ax, es:__romsaddrstart[bc] + movw __saddrstart[bc], ax + br $1b +1: ;; block fill to .bss - sel rb0 ; bank 0 - movw hl, #__bssstart + movw bc, #__bsssize movw ax, #0 - sel rb1 ; bank 1 - movw ax, #__bsssize - shrw ax,1 -1: - cmpw ax, #0 +1: + cmpw ax, bc bz $1f - decw ax - sel rb0 ; bank 0 - movw [hl], ax - incw hl - incw hl - sel rb1 + movw __bssstart[bc], ax + decw bc + decw bc br $1b -1: - sel rb0 ; bank 0 - - +1: call !!__rl78_init |