Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!orsvax1!pyrnj!caip!cbmvax!daveh From: daveh@cbmvax.cbm.UUCP (Dave Haynie) Newsgroups: net.micro.cbm Subject: Re: Commodore 64 Stack Message-ID: <122@cbmvax.cbmvax.cbm.UUCP> Date: Mon, 21-Apr-86 17:38:34 EST Article-I.D.: cbmvax.122 Posted: Mon Apr 21 17:38:34 1986 Date-Received: Wed, 23-Apr-86 22:28:26 EST References: <493@unccvax.unccvax.UUCP> <824@puff.UUCP> <114@cbmvax.cbmvax.cbm.UUCP> Reply-To: daveh@cbmvax.UUCP (Dave Haynie) Distribution: net Organization: Commodore Technology, West Chester, PA Lines: 24 In article <114@cbmvax.cbmvax.cbm.UUCP> grr@cbmvax.UUCP (George Robbins) writes: >Another alternative, and this is really gross, is to have the program call >a routine that checks the stack size, and if it's almost full, copy most of >it to another page, and then reset the stack. This obviously requires some >careful housekeeping, but can be made to work. It has been used on the C128, >where there's all that memory just waiting to be used... > >-- >George Robbins - now working with, uucp: {ihnp4|seismo|caip}!cbmvax!grr >but no way officially representing arpa: cbmvax!grr@seismo.css.GOV >Commodore, Engineering Department fone: 215-431-9255 (only by moonlite) There's actually absolutely no reason what so ever to do something like that on the C128. It has MMU registers which allow the stack (and zero page) to be located anywhere in the 128K memory. Its still limited to 256 bytes, but any machine language routine that decides it needs more stack memory can save the current SP, reset the SP, and change the pointer, of course changing every thing back before RTSing. Not as great as having a 16 bit pointer, but much more sensible than copying over 256 bytes every time you want a larger stack. -- Dave Haynie {inhp4,allegra,seismo}!cbmvax!daveh When the going gets tough, the weird turn pro