[cc65] assembler hello world

From: mog <mog-lists1rldn.net>
Date: 2011-09-14 00:25:01
Hi everyone

I am trying to get a hello world working for my apple ii and cant seem
to get past linking step.  below is my code and compile chain. I am using
ca65 V2.13.9 - (C) Copyright 1998-2011 Ullrich von Bassewitz
ld65 V2.13.9 - (C) Copyright 1998-2009, Ullrich von Bassewitz

hello.s:
-----------------------------------------------------------
.import __STARTUP_LOAD__, __BSS_LOAD__ ; Linker generated

.segment "EXEHDR"
.addr __STARTUP_LOAD__ ; Start address
.word __BSS_LOAD__ - __STARTUP_LOAD__ ; Size

.segment "RODATA"
MSG: .ASCIIZ "Hello, world!"

.segment "STARTUP"

LDA #$8D ; next line
JSR $FDED
LDX #0
LDA MSG,X ; load initial char
@LP: ORA #$80
JSR $FDED ; cout
INX
LDA MSG,X
BNE @LP
LDA #$8D ; next line
JSR $FDED
JMP $03D0 ; warm start
----------------------------------------------------------

Makefile:
----------------------------------------------------------
all:
	ca65 -t apple2 hello.s
	ld65 -t apple2 -o hello hello.o
	cp ../cc65.dsk ./
	java -jar ../ac.jar -cc65 cc65.dsk hello B < hello
----------------------------------------------------------
it fails on the linker with

ld65: Warning: [builtin config](43): Segment `LOWCODE' does not exist
ld65: Warning: [builtin config](43): Segment `ZPSAVE' does not exist
ld65: Warning: [builtin config](43): Segment `INIT' does not exist
Unresolved external `__STARTUP_LOAD__' referenced in:
  hello.s(4)
  hello.s(5)
ld65: Error: 1 unresolved external(s) found - cannot create output file

-- 
Matthew O'Gorman
xim: mog@rldn.net
email: mog@rldn.net
site: http://blog.rldn.net
/***********************************************/
/* The truth is rarely pure, and never simple. */
/*                 -- Oscar Wilde              */
/***********************************************/

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Sep 14 00:25:17 2011

This archive was generated by hypermail 2.1.8 : 2011-09-14 00:25:21 CEST