Re: [cc65] Inserting Assembly Routines

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-11-26 13:28:27


On Tue, Nov 26, 2002 at 01:52:49AM +0100, MagerValp wrote:
> For my supercpu code I need two 24-bit zp pointers. Where would be a
> clean place to put them?

This is not an easy question, especially if you want to stay portable between
the platforms supported by the SCPU. The most portable solution would be to
use the new register variables:

        register char dummy[6];

This will save the current contents and make 6 bytes of zero page space
available. Problem with this approach is the overhead that goes with register
variables.

Currently, all platforms with the exception of GEOS have contignous zero page
locations. GEOS divides them into three chunks, but ptr1..4 do still live
together. So another solution would be to use ptr1/ptr2 for the first and
ptr3/ptr4 for the second zero page pointer (wasting one byte each time). This
would work for the C64, the C128 and for both using GEOS.

> Should I use my own area for them (I'm a fan
> of $5f and up) or can I count on ptr1..4 and tmp1..4 staying in the
> same locations between cc65 releases?

Why do you need them in the same location between releases? Just access them
by name, and let the linker move it to the right place.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
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 : 2002-11-26 13:28:40 CET