2 ; Startup code for cc65 (supervision version)
4 ; This must be the *first* file on the linker command line
10 .import initlib, donelib, copydata
12 .import __RAM_START__, __RAM_SIZE__ ; Linker generated
14 .include "zeropage.inc"
15 .include "supervision.inc"
17 .export _sv_irq_timer_counter, _sv_irq_dma_counter
18 .export _sv_nmi_counter
22 _sv_irq_dma_counter: .byte 0
23 _sv_irq_timer_counter: .byte 0
24 _sv_nmi_counter: .byte 0
34 lda #>(__RAM_START__ + __RAM_SIZE__)
35 sta sp+1 ; Set argument stack ptr
36 stz sp ; #<(__RAM_START__ + __RAM_SIZE__)
46 and #SV_IRQ_REQUEST_TIMER
49 inc _sv_irq_timer_counter
52 and #SV_IRQ_REQUEST_DMA
55 inc _sv_irq_dma_counter
66 ; removing this segment gives only a warning
71 ; now the 32kbyte image can reside in the top of 64kbyte, 128kbyte roms