Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!orsvax1!pyrnj!caip!lll-crg!lll-lcc!qantel!ihnp4!ihuxf!cuda From: cuda@ihuxf.UUCP (Mike Nelson) Newsgroups: net.micro.cbm Subject: Re: Commodore 64 Stack Message-ID: <2869@ihuxf.UUCP> Date: Thu, 24-Apr-86 08:28:35 EDT Article-I.D.: ihuxf.2869 Posted: Thu Apr 24 08:28:35 1986 Date-Received: Sun, 27-Apr-86 05:42:04 EDT References: <493@unccvax.unccvax.UUCP> <641@nicmad.UUCP> Distribution: net Organization: AT&T Bell Laboratories Lines: 36 > 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. > > If I remember the processor correctly, the stack pointer is actually coded > into the chip program, making it non-movable. > -- > > ihnp4------\ > harvard-\ \ > Mr. Video seismo!uwvax!nicmad!brown > topaz-/ / > decvax------/ It really is movable or else it wouldn't work very well as a stack pointer. :) I haven't messed much with my computer lately but it should be fairly easy to manipulate even though probably not directly writeable. The stack exists in the 1st page of memory where a page is 256 bytes. 0 page is used extensively by the operating system. Several tests would have to be performed. First, I don't know if the pops are volatile, destroying the memory as it is read. I doubt it. Next try to find where the stack is by pushing values on the stack and testing for those values through the range of the stack. Then perform the appropriate number of pops or pushes to arrive at the address you wish. If you wish to push over data without erasing it you would probably have to read the particular location and push that data back in the same spot. If all else fails, drag out your handy laser and etch you a data path and read command into the 6510. Good luck. Mike Nelson