<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 26 Dec 2008 22:43:27 +0100
From   : kortink@... (John Kortink)
Subject: Using stack page for temp vars

On 26 Dec 2008 17:03:16 +0000, jgh@... wrote:

>[...]
>
>For instance:
> 
>TSX:TXA:SEC:SBC #32:TAX:TXS  :\ Reserve 32 bytes on the stack
> 
>\ &100,X to &11F,X accesses space on the stack

Actually, &101,X to &120,X at this stage. The
6502 stack is an empty, descending stack. I.e.
INX first if you want to address it as &100,X
to &11F,X.

>TSX:TXA:CLC:ADC #32:TAX:TXS  :\ Release 32 bytes on the stack
> 
>You mustn't trample on any MOS workspace, as you will interfere
>with the MOS's working. However, there is a way of being able to
>use some more zero-page space.
> 
>&00-&7F is reserved for the current language. A transient command
>can use some of this *IF* *AND* *ONLY* *IF* you ensure it is
>preserved across the call. Languages are foreground applications,
>and so language workspace therefore will only change in the
>foreground when the language code is executing.

Theoretically it's still unsure whether or not
interrupt routines will be using it in the same
way (although it would then take two of them
interfering with each other to cause mayhem).

And when the Tube is running, part of &00-&7F
is permanently in use by the tube routines.


John Kortink

-- 

Email    : kortink@...         
Homepage : http://www.inter.nl.net/users/J.Kortink

GoMMC, the ultimate BBC B/Master/Electron storage system :
http://web.inter.nl.net/users/J.Kortink/home/hardware/gommc
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>