Re: [cc65] First release candidate available

From: Per Olofsson <>
Date: 2009-09-29 16:54:10
OK, I tested svn 4277 with a project that uses a custom crt0.s, and
ran into problems:

Invader:rpg pelle$ make
ld65  -C rpg.cfg -m --dbgfile rpg.dbg -Ln rpg.sym -o rpg.prg
crt0.o main.o irq.o kbd.o rnd.o div.o str_from_int_asm.o console.o
gfx.o time.o time_since.o anim.o map.o map_create_zone.o
map_creature.o map_load.o map_location.o map_names.o map_object.o
map_view.o tile.o tileset.o view_buf.o view_buf_render.o view.o
fov_buf.o fov.o fov_asm.o loader.o town.o creature.o resources.o
resource_data.o game.o status.o err.o cmd_common.o cmd_prompt.o
cmd_name.o cmd_zoom.o world.o world_cmd_move.o zone.o zone_cmd_move.o
location.o location_cmd_move.o location_cmd_attack.o file_load.o
file_tab.o exodecrunch.o ../lib/uloadm3.lib
ld65: Warning: Duplicate external identifier: `_exit'
ld65: Error: Missing memory area assignment for segment `ZPSAVE'
make: *** [rpg.prg] Error 1
Invader:rpg pelle$ l rpg.prg
-rw-r--r--  1 pelle  staff  13881 29 Sep 16:37 rpg.prg
Invader:rpg pelle$

First of all the failed linking still creates a (broken) prg file. I
would expect it not to create an output file if it fails.

I assume that this is related to the startup code being moved into the
library, but no map file is created so it's hard to tell what's going
on. This is my crt0.s:

	.export _exit
	.importzp sp, spsave
	.import zerobss
	.import callmain
	.import __RAM_START__, __RAM_SIZE__

	.segment "STARTUP"

	.word init		; load address
	jsr zerobss

;	tsx
;	stx spsave		; Save the system stack ptr

	lda #<(__RAM_START__ + __RAM_SIZE__)
	sta sp
	lda #>(__RAM_START__ + __RAM_SIZE__)
	sta sp+1		; Set argument stack ptr

	jmp callmain

	lda #3
:	sta $d020
	eor #8
	bne :-

I added the magic .export __STARTUP__:absolute = 1 (is this documented
somewhere?), which took care of crt0, but something is still
requesting a ZPSAVE segment. Any ideas?
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Sep 29 16:54:17 2009

This archive was generated by hypermail 2.1.8 : 2009-09-29 16:54:19 CEST