filename | test/crt0.s |
changeset | 185:6755a04c447f |
author | nkeynes |
date | Tue Jan 01 05:48:06 2008 +0000 (16 years ago) |
branch | lxdream-mmu |
permissions | -rw-r--r-- |
last change | Add configure and command-line parameters to perform IO tracing |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/test/crt0.s Tue Jan 01 05:48:06 2008 +00001.3 @@ -0,0 +1,119 @@1.4 + .section .text1.5 + .global start1.6 + .global ___exit1.7 + .global _atexit1.8 +start:1.9 + mov.l setup_cache_k,r01.10 + mov.l p2_mask,r11.11 + or r1,r01.12 + jmp @r01.13 + nop1.14 +setup_cache:1.15 + mov.l ccr_addr,r01.16 + mov.w ccr_data,r11.17 + mov.l r1,@r01.18 + mov.l start_2_k,r01.19 + nop1.20 + nop1.21 + nop1.22 + nop1.23 + nop1.24 + nop1.25 + nop1.26 + jmp @r01.27 + nop1.28 +start_2:1.29 + mov.l old_stack_k,r141.30 + mov.l r15,@r141.31 + mov.l old_pr_k,r141.32 + sts pr,r151.33 + mov.l r15,@r141.34 + mov.l stack_k,r151.35 +1.36 + ! zero out bss1.37 + mov.l edata_k,r01.38 + mov.l end_k,r11.39 + mov #0,r21.40 +start_l:1.41 + mov.l r2,@r01.42 + add #4,r01.43 + cmp/ge r0,r11.44 + bt start_l1.45 +1.46 +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY)1.47 + mov.l set_fpscr_k, r11.48 + jsr @r11.49 + mov #0,r41.50 + lds r3,fpscr1.51 +#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) */1.52 +1.53 + ! call the mainline1.54 + mov.l main_k,r01.55 + jsr @r01.56 + or r0,r01.57 +1.58 + ! call exit1.59 + mov r0,r41.60 + mov.l exit_k,r01.61 + jsr @r01.62 + or r0,r01.63 +1.64 +___exit:1.65 + mov.l old_pr_k,r141.66 + mov.l @r14,r151.67 + lds r15,pr1.68 + mov.l old_stack_k,r141.69 + mov.l @r14,r151.70 + rts1.71 + nop1.72 +1.73 +_atexit:1.74 + rts1.75 + nop1.76 +1.77 + .align 41.78 +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)1.79 +set_fpscr_k:1.80 + .long ___set_fpscr1.81 +#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(SH4_SINGLE_ONLY) */1.82 +stack_k:1.83 + .long _stack1.84 +edata_k:1.85 + .long _edata1.86 +end_k:1.87 + .long _end1.88 +main_k:1.89 + .long _main1.90 +exit_k:1.91 + .long _exit1.92 +1.93 +old_stack_k:1.94 + .long _old_stack1.95 +old_pr_k:1.96 + .long _old_pr1.97 +1.98 +_old_stack:1.99 + .long 01.100 +_old_pr:1.101 + .long 01.102 +1.103 +setup_cache_k:1.104 + .long setup_cache1.105 +start_2_k:1.106 + .long start_21.107 +p2_mask:1.108 + .long 0xa00000001.109 +ccr_addr:1.110 + .long 0xff00001c1.111 +ccr_data:1.112 + .word 0x090b1.113 +1.114 + .align 41.115 +1.116 +#ifdef __ELF__1.117 + .section .stack,"aw"1.118 +#else1.119 + .section .stack1.120 +#endif1.121 +! _stack: .long 0xdeaddead1.122 +
.