Re: [cc65] Linker config for assembler users

From: <silverdr1wfmh.org.pl>
Date: 2010-11-15 00:36:05
On 2010-11-14, at 17:49, Ullrich von Bassewitz wrote:

>>        .word 1970 + (.time / 31557600)
> 
> Nice:-) I'm usually using .version here, but your idea is also charming.

:-) I combine both plus more in.

My generic "basicstub.i" looks like:

***************************************************
.define CURRENT_YEAR	1970 + .TIME / 31557600
.define COPYRIGHT_NOTICE	.concat("(C)", .string(STARTING_YEAR), "-", .string(CURRENT_YEAR), " SILVER DREAM !")

	.word basicstub
basicstub:
	.word _nextline					; pointer to next BASIC line
	.word CURRENT_YEAR				; line number (calculated year)
	.byte $9e					; token for SYS command
	.byte <(((main / 1000) .mod 10) + $30)		; SYS address
	.byte <(((main / 100 ) .mod 10) + $30)
	.byte <(((main / 10  ) .mod 10) + $30)
	.byte <(((main       ) .mod 10) + $30)
	.byte ":"
	.byte $8f					; token for REM
	.byte $14, $14, $14, $14, $0d			; hide REM keyword on listing and move to next line
	.byte $0d					; move to next line
	.byte PROGRAM_NAME, $20, VERSION_TAG, $0d
	.byte COPYRIGHT_NOTICE, $0d
	.byte $00
_nextline:
	.word $0000					; double zero means no more lines.
****************************************************
and the program specific include defines what's needed, e.g. sdpard64.i looks like:

.define STARTING_YEAR		2005
.define PROGRAM_NAME		"SDPARD64"
.define VERSION_TAG		"V0.7.4"

-- 
SD!----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Nov 15 00:36:12 2010

This archive was generated by hypermail 2.1.8 : 2010-11-15 00:36:15 CET