Archelon msp430 Assembler     Version 1.55 2004/01/08      File C:\DATA\MOOS\RFIO\firmware\cstart.asm      Page 1

                     1 ; @(#) cstart.asm 1.7 02/11/08 14:09:38 @(#) 
                     2 ;
                     3 ;  C startup
                     4 ;
                     5 ;
                     6 ; set reset interrupt vector to point to cstart
                     7 ;
                     8     .pseg reset_vector,abs=0xfffe
                     9 
fffe 0000           10     .data cstart
                    11 
                    12 ;
                    13 ; C runtime startup code
                    14 ;
                    15     .pseg cstartup$code
                    16 
                    17     .global cstart
                    18     .global __main_returned
                    19 
                    20     .extern __rominit
                    21     .extern _main
                    22     .extern __max_ram0_
                    23 cstart:
0000 40b25a800120   24     mov #0x5a80,&0x120 ; turn off watchdog timer
0006 40310001       25     mov #__max_ram0_ + 1,sp ; set stack to max ram address + 1
000a 12b00000       26     call #__rominit ; initialize RAM from ROM
000e 12b00000       27     call #_main     ; run the C program
                    28 __main_returned:
0012 3fff           29     jmp __main_returned ; loop forever if main returns
                    30 ;
                    31 ; provide a null initialization descriptor, in case there is no 
                    32 ; RAM initialization required, so we don't get complaints from
                    33 ; the linker when trying to link rominit, which will refer
                    34 ; to the initialization descriptor segment.
                    35 ;
                    36     .iseg _idesc
0000 0000           37     .data 0
0002 0000           38     .data 0
0004 0000           39     .data 0
