diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/xstormy16/below100.S | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.target/xstormy16/below100.S')
-rw-r--r-- | gcc/testsuite/gcc.target/xstormy16/below100.S | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/xstormy16/below100.S b/gcc/testsuite/gcc.target/xstormy16/below100.S new file mode 100644 index 000000000..27faa2ef4 --- /dev/null +++ b/gcc/testsuite/gcc.target/xstormy16/below100.S @@ -0,0 +1,188 @@ +/****************************************************************** +*** *** +*** crt0 for __BELOW100__ attribute test with SID *** +*** *** +******************************************************************/ + + /*************************************/ + /** Interrupt vectors at 0x8000 **/ + /*************************************/ + .section .int_vec,"ax" + .global _start + .align 1 +_start: + jmpf _int_reset + //jmpf _int_basetimer + //jmpf _int_timer0 + //jmpf _int_timer1 + //jmpf _int_irq_4 + //jmpf _int_irq_5 + //jmpf _int_port0 + //jmpf _int_port1 + //jmpf _int_irq_8 + //jmpf _int_irq_9 + //jmpf _int_irq_a + //jmpf _int_irq_b + //jmpf _int_irq_c + //jmpf _int_irq_d + //jmpf _int_irq_e + //jmpf _int_irq_f + /*************************************/ + /** reset code **/ + /*************************************/ + .text +_int_reset: + /*************************************/ + /** setup stack pointer **/ + /*************************************/ + mov sp,#__stack + /*************************************/ + /** zero .bss section **/ + /*************************************/ + mov r0,#__bss_start + mov r1,#__bss_end + mov r2,#0 +1: mov.w (r0++),r2 + blt r0,r1,1b + /*************************************/ + /** copy inital value for .data **/ + /*************************************/ + mov r1,#__data_start + mov r3,#__data_end + mov r0,#@lo(__rdata) + mov r8,#@hi(__rdata) +2: movf.w r2,(r0++) + bnz r0,#0,3f + add r8,#1 +3: mov.w (r1++),r2 + blt r1,r3,2b + /*************************************/ + /** call hardware init routine **/ + /*************************************/ + callf _hwinit + /*************************************/ + /** call initializaton routines **/ + /*************************************/ + callf _init + /*************************************/ + /** setup fini routines to be **/ + /** called from exit **/ + /*************************************/ + mov r2,#@fptr(_fini) + callf atexit + /*************************************/ + /** call main() with empty **/ + /** argc/argv/envp **/ + /*************************************/ + mov r2,#0 + mov r3,#0 + mov r4,#0 + callf main + /*************************************/ + /** return from main() **/ + /*************************************/ + callf exit + /*************************************/ + /** should never reach this code **/ + /*************************************/ + jmpf _start + /*************************************/ + /** default h/w initialize routine **/ + /** and default _init/_finit for **/ + /** -nostartfiles option **/ + /*************************************/ + .globl _hwinit + .weak _hwinit +_hwinit: + .globl _init + .weak _init +_init: + .globl _fini + .weak _fini +_fini: + ret + +/****************************************************************** +******************************************************************* +*** *** +*** Chip information data for LC59_32K *** +*** Written by T.Matsukawa *** +*** *** +******************************************************************* +******************************************************************/ + + /*************************************/ + /** Define convenient macros **/ + /*************************************/ +#define BCD(x) (((x)/10)%10)*0x10+((x)%10) +#define BCD4(x) BCD((x)/100),BCD(x) +#define BCD6(x) BCD((x)/10000),BCD((x)/100),BCD(x) + /*************************************/ + /** Define memory sizes **/ + /*************************************/ +#define RAM_SIZE 0x7E00 +#define ROM_SIZE 0x78000 +#define VRAM_SIZE 0x0000 +#define VRAM_ROW 0 +#define VRAM_COLUMN 0 +#define CGROM_SIZE 0x0000 +#define PROTECT_SIZE 0x0000 + + /*************************************/ + /** section ".chip_info" **/ + /*************************************/ + .section .chip_info,"a" + .space 0xb8,0x00 + /*************************************/ + /** B8-BB : User option address **/ + /*************************************/ + .word 0x00000 + .global __reset_vector +#if 0x00000==0 + .equ __reset_vector,0x08000 +#else + .equ __reset_vector,0x00000 +#endif + /*************************************/ + /** BC-BF : Flash Protect address **/ + /*************************************/ +#if PROTECT_SIZE==0 + .word 0x00000000 +#else + .word 0x08000+ROM_SIZE-PROTECT_SIZE +#endif + /*************************************/ + /** C0-CF : Fixed string **/ + /*************************************/ +1: .ascii "CHIPINFORMATION" +2: .space (0x10-(2b-1b)),0x00 + /*************************************/ + /** D0-DF : Chipname **/ + /*************************************/ +1: .ascii "LC59_32K" +2: .space (0x10-(2b-1b)),0x00 + /*************************************/ + /** E0-E1 : Format version(BCD4) **/ + /*************************************/ + .byte 0x10, 0x00 + .space 6, 0x00 + /*************************************/ + /** E8-F5 : Memory sizes **/ + /*************************************/ + .byte BCD4(ROM_SIZE/1024) + .byte BCD6(RAM_SIZE) + .byte BCD6(VRAM_SIZE) + .byte BCD4(VRAM_ROW) + .byte BCD4(VRAM_COLUMN) + .byte BCD4(CGROM_SIZE/1024) + .space 3, 0x00 + /*************************************/ + /** F9 : Package type **/ + /*************************************/ + .byte 0xff + .space 6, 0x00 + + /*************************************/ + /** In order to link BIOS in library**/ + /*************************************/ + .equ dummy,__bios_entry |