From fe75b5c3f38cffc22d30db2f4e5b6acbac1125d9 Mon Sep 17 00:00:00 2001 From: cuz Date: Fri, 22 Nov 2002 23:50:45 +0000 Subject: [PATCH] Added LOWCODE and STARTUP segments git-svn-id: svn://svn.cc65.org/cc65/trunk@1600 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/c64/crt0.s | 16 ++++++++++++---- src/ld65/cfg/c64.cfg | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libsrc/c64/crt0.s b/libsrc/c64/crt0.s index 607f779be..92ef5bcf1 100644 --- a/libsrc/c64/crt0.s +++ b/libsrc/c64/crt0.s @@ -1,4 +1,4 @@ -; +; ; Startup code for cc65 (C64 version) ; ; This must be the *first* file on the linker command line @@ -15,19 +15,24 @@ .include "c64.inc" -.code +; ------------------------------------------------------------------------ +; Create an empty LOWCODE segment to avoid linker warnings + +.segment "LOWCODE" ; ------------------------------------------------------------------------ +; Place the startup code in a special segment. + +.segment "STARTUP" + ; BASIC header with a SYS call - .org $7FF .word Head ; Load address Head: .word @Next .word 1000 ; Line number .byte $9E,"2061" ; SYS 2061 .byte $00 ; End of BASIC line @Next: .word 0 ; BASIC end marker - .reloc ; ------------------------------------------------------------------------ ; Actual code @@ -103,6 +108,9 @@ L2: lda zpsave,x jmp RESTOR +; ------------------------------------------------------------------------ +; Data + .data zpsave: .res zpspace diff --git a/src/ld65/cfg/c64.cfg b/src/ld65/cfg/c64.cfg index 76babb39e..d2a349568 100644 --- a/src/ld65/cfg/c64.cfg +++ b/src/ld65/cfg/c64.cfg @@ -3,6 +3,8 @@ MEMORY { RAM: start = $7FF, size = $c801, define = yes, file = %O; } SEGMENTS { + STARTUP: load = RAM, type = wprot; + LOWCODE: load = RAM, type = wprot; CODE: load = RAM, type = wprot; RODATA: load = RAM, type = wprot; DATA: load = RAM, type = rw; -- 2.39.5