.import initlib, donelib
.import zerobss, push0
.import _main
+ .import __RAM_START__, __RAM_SIZE__ ; Linker generated
.include "c64.inc"
.include "../cbm/cbm.inc"
ora #$06 ; Enable kernal+I/O, disable basic
sta $01
- lda #<$D000
+ lda #<(__RAM_START__ + __RAM_SIZE__)
sta sp
- lda #>$D000
+ lda #>(__RAM_START__ + __RAM_SIZE__)
sta sp+1 ; Set argument stack ptr
; Call module constructors
L1: lda ptr2
ora ptr2+1 ; count zero?
beq L9
- jsr BASIN
+ dec ptr2
+ bne L1a
+ dec ptr2+1
+L1a: jsr BASIN
ldy #0
sta (ptr1),y ; save char
inc ptr1