Re: [cc65] Pointers for Porting to New Target

Date view Thread view Subject view

From: Geoffrey Wossum (geoffrey_at_pager.net)
Date: 2003-10-28 23:14:17


On Tuesday 28 October 2003 01:20 pm, Ullrich von Bassewitz wrote:

> Yes. I would suggest using/modifying the linker config and startup code for
> one of the simpler platforms, for example the C16. If your code is in the
> ROM, you will also have to copy the initialized data from ROM to RAM. For
> most setups, the copydata routine (in common/copydata.s) will do the job,
> but you will have to call it from the startup code.

I had some questions about setting up the call return stack and the parameter, 
which were largely answered by this post:
http://www.cc65.org/mailarchive/2002-03/1172.html

However, in it you have the following code:

>	; Set the 6502 call stack as defined in the linker config
>        ldx     #<(__CALLSTACK_START__ + __CALLSTACK_SIZE__ - 1)
>        txs
>
>        ; Set the parameter stack as defined in the linker config
>        lda     #<(__PARMSTACK_START__ + __PARMSTACK_SIZE__)
>        sta     sp
>        lda     #>(__PARMSTACK_START__ + __PARMSTACK_SIZE__)
>        sta     sp+1

Shouldn't that be (__PARMSTACK_START__ + __PARMSTACK_SIZE__ - 1)?  

Thanks!
---
Geoffrey Wossum
Software Engineer
Long Range Systems - http://www.pager.net


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-10-28 23:21:13 CET