Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!orsvax1!pyrnj!caip!cbmvax!grr From: grr@cbmvax.cbm.UUCP (George Robbins) Newsgroups: net.micro.cbm Subject: Re: Commodore 64 Stack Message-ID: <114@cbmvax.cbmvax.cbm.UUCP> Date: Sat, 19-Apr-86 00:48:42 EST Article-I.D.: cbmvax.114 Posted: Sat Apr 19 00:48:42 1986 Date-Received: Mon, 21-Apr-86 02:48:36 EST References: <493@unccvax.unccvax.UUCP> <824@puff.UUCP> Reply-To: grr@cbmvax.UUCP (George Robbins) Distribution: net Organization: Commodore Technology, West Chester, PA Lines: 35 In article <824@puff.UUCP> lishka@puff.UUCP (Christopher Lishka) writes: >In article <493@unccvax.unccvax.UUCP>, jeh@unccvax.UUCP (Jeffrey Holman) writes: >> Can anyone tell me if there is a way to reset the stack pointer in ML? >> I want to move the location of the stack to some bigger area of memory for >> use in a possible compiler. I am afraid that this is impossible since I >> have been unable to find any reference to the stack pointer location in >> memory. >> Any info would be greatly appreciated!! > > As far as I know, the stack space for the 6502 microprocessors >(including the 6510, as in the C-64) has a strict limit of 256 bytes. I >believe it is located from $0100 to $01ff hex. This is so that the Stack >Pointer can fit within one byte. Not very useful, is it? What I suggest is >to reserve a couple bytes down in zero page for your own Stack Pointer and just >create your own stack. You could define macros for the 'push' and 'pop' >operations. OK, so it may not be as fast and efficient as an M.L. implemented >stack, but then again you would have a lot more memory than 256 bytes for stack >space. > Chri Lishka U.W Madison 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... The designers of the 6502 didn't plan on their little micro-computer chip being used the way it was, but things got a little out of control. The original programming card showed that an extended version would include a 16 bit stack pointer, but it never happened. -- 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)