Date : Sat, 18 Mar 2006 17:07:56 +0100
From : John Kortink <kortink@...>
Subject: Re: 1MHZ SCSI/ATA board
On Sat, 18 Mar 2006 12:53:20 +0000 (GMT), Greg Cook wrote:
>On Thu, 16 Mar 2006 10:44:23 +0100, John Kortink <kortink@...>
>wrote:
>
>[... using stack as workspace ...]
>
>> I use it all the time in my code. It is an essential
>> technique, to use the stack for all transient memory
>> needs. Instead of (ab)using fixed locations.
>
>Appropriate in places, but evidently the Postscript thing doesn't sit
>comfortably on the 6502. It's a choice of last resort really.
Depends on the task in hand. If you can't use main
memory, you kind of have to. If you're allowed to
use main memory (e.g. by talking with the service
calls that allocate &E00 and up memory) it's still
best avoided to maximize user memory. Otherwise,
of course, feel free ... But we do have a memory
challenged system here.
There's also the added advantage (of using stack
memory) of troublefree recursion and re-entrancy.
>[...]
>
>And John's used it cannily in GoMMC, I notice. His patch for Acorn DFS
>replaces the hardware accesses with a routine that stuffs loads of
>state on the stack and dashes off, via OSWORD &B0, to the GoMMC ROM
>where there's room for code to unpack it all.
>
>Also the MOS does stack-bashing in the extended vector code at &FF51,
>which allows paged ROMs to hook the OS vectors into their routines.
Yes, that's a positively nasty piece of code.
>(I disassembled enough of the GoMMC code to allow EDOS to send FDC
>accesses to it. Had to use more of the jump table offsets, love the
>hash technique ;-) Sadly, *CAT failed with a BRK at &0406, I couldn't
>figure out how and when to make GoMMC put the handler there. As John
>says, "Y = &FF : do NOT use. do not EVER use.")
And I meant it. ;-)
John Kortink
--
Email : kortink@...
Homepage : http://www.inter.nl.net/users/J.Kortink
GoMMC, the ultimate BBC B/B+/Master storage system :
http://web.inter.nl.net/users/J.Kortink/home/hardware/gommc