init.s


; init.s

    .section reset

    .global my_reset
my_reset:

    clr r1                   ; r1=0 for avr-gcc

    ; initialize SP to top of SRAM.
    .equ    SPH ,0x3E
    .equ    SPL ,0x3D
    ldi     r24,0xff         ; trick AT90S8515 emulator 
    out     SPL,r24          ; set SP = 0xff
    out     SPH,r1

    rjmp main                ; call C routine


Back