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
12 .import __STACKSIZE__ ; 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__ + __STACKSIZE__)
35 ldx #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
37 stx sp+1 ; Set argument stack ptr
47 and #SV_IRQ_REQUEST_TIMER
50 inc _sv_irq_timer_counter
53 and #SV_IRQ_REQUEST_DMA
56 inc _sv_irq_dma_counter
67 ; Removing this segment gives only a warning.
72 ; Now, the 32Kbyte image can reside in the top of 64Kbyte and 128Kbyte ROMs.