2 ; Startup code for cc65 (supervision version)
6 .export __STARTUP__ : absolute = 1 ; Mark as startup
9 .import initlib, donelib, copydata
11 .import __RAM_START__, __RAM_SIZE__ ; Linker generated
13 .include "zeropage.inc"
14 .include "supervision.inc"
16 .export _sv_irq_timer_counter, _sv_irq_dma_counter
17 .export _sv_nmi_counter
21 _sv_irq_dma_counter: .byte 0
22 _sv_irq_timer_counter: .byte 0
23 _sv_nmi_counter: .byte 0
33 lda #>(__RAM_START__ + __RAM_SIZE__)
34 sta sp+1 ; Set argument stack ptr
35 stz sp ; #<(__RAM_START__ + __RAM_SIZE__)
45 and #SV_IRQ_REQUEST_TIMER
48 inc _sv_irq_timer_counter
51 and #SV_IRQ_REQUEST_DMA
54 inc _sv_irq_dma_counter
65 ; removing this segment gives only a warning
70 ; now the 32kbyte image can reside in the top of 64kbyte, 128kbyte roms