source: rtems/c/src/lib/libbsp/avr/avrtest/start/start.S @ 858ea06c

4.104.11
Last change on this file since 858ea06c was 858ea06c, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 20, 2008 at 3:39:04 PM

2008-11-20 Joel Sherrill <joel.sherrill@…>

  • .cvsignore, ChangeLog?, Makefile.am, README, bsp_specs, configure.ac, preinstall.am, console/console-io.c, include/.cvsignore, include/bsp.h, start/start.S, startup/linkcmds, tools/.cvsignore, tools/Makefile.am, tools/configure.ac, tools/runtest.in: New files.
  • Property mode set to 100644
File size: 1.2 KB
Line 
1
2#define SPL 0x3d
3#define SPH 0x3e
4#define SREG 0x3f
5#define RAMPZ 0x3b
6
7#define RAMEND (64 * 1024)
8
9/*
10        .weak   __stack
11        .set    __stack, RAMEND - 1
12*/
13
14        .weak   __heap_end
15        .set    __heap_end, 0
16
17
18        .section .vectors,"ax",@progbits
19        .global __vectors
20        .func   __vectors
21__vectors:
22__reset:
23        jmp     __init
24        .endfunc       
25
26        .section .init0,"ax",@progbits
27        .weak   __init
28;       .func   __init
29__init:
30       
31        .section .init2,"ax",@progbits
32        clr     r1
33        out     0x3f, r1
34        ldi     r28,lo8(__stack)
35        ldi     r29,hi8(__stack)
36        out     SPH, r29
37        out     SPL, r28
38
39        /* Only for >64K devices with RAMPZ, replaces the default code
40           provided by libgcc.S which is only linked in if necessary.  */
41
42        .section .init4,"ax",@progbits
43        .global __do_copy_data
44__do_copy_data:
45        .global __do_clear_bss
46__do_clear_bss:
47#if 0
48        ldi     r17, hi8(__data_end)
49       
50        ldi     r26, lo8(__data_start)
51        ldi     r27, hi8(__data_start)
52       
53        ldi     r30, lo8(__data_load_start)
54        ldi     r31, hi8(__data_load_start)
55        ldi     r16, hh8(__data_load_start)
56        out     RAMPZ, r16
57
580:     
59        cpi     r26, lo8(__data_end)
60        cpc     r27, r17
61        breq    1f
62       
63        elpm    r0, Z+
64        st      X+, r0
65        rjmp    0b
661:     
67#endif
68
69        .section .init9,"ax",@progbits
70        call    boot_card
71        jmp     exit
72;       .endfunc
73
74        .global exit
75        .func   exit
76exit:   out 0x2f, r0
77        .endfunc
78
79        .global abort
80        .func   abort
81abort:  out 0x29, r0
82        .endfunc
Note: See TracBrowser for help on using the repository browser.