Freescale recommends: LDHX #RAMLAST+1 TXS at the start of the reset handler for 9s08gb micros so that stack will use high ram, freeing up zero page for direct addressing. How this messes up simple minded single-byte X-indexed addressing as a command like: LDA junk,X now uses H:X for the index. For the GB32, H=0x08. Short of clearing H (CLRH) and using zero page for stack, is there a clean way to use high stack and still maintain the simple 8-bit indexing mode. TIA. Steve. -- Steven D. Swift, novatech@eskimo.com, http://www.novatech-instr.com NOVATECH INSTRUMENTS, INC. P.O. Box 55997 206.301.8986, fax 206.363.4367 Seattle, Washington 98155 USA
Freescale 9s08gb stack and indexing
Started by ●April 30, 2006
Reply by ●April 30, 20062006-04-30
"Steven Swift" <novatech@eskimo.com> wrote in message news:e32on0$6rb$1@eskinews.eskimo.com...> > Freescale recommends: > > LDHX #RAMLAST+1 > TXS > > at the start of the reset handler for 9s08gb micros so that stack will > use high ram, freeing up zero page for direct addressing. > > How this messes up simple minded single-byte X-indexed addressing as a > command like: > > LDA junk,X > > now uses H:X for the index. For the GB32, H=0x08. > > Short of clearing H (CLRH) and using zero page for stack, is there > a clean way to use high stack and still maintain the simple 8-bit > indexing mode.H is not related to the stack pointer. CLRH and use page 0 for data and the stack will continue to be happy at page non-0. Bill
Reply by ●May 1, 20062006-05-01
S08 parts have many extended 16bit stack instructions that make the code as easy as page zero date stack frames. There is a code size hit of 1 byte as is all non page zero references. w.. Steven Swift wrote:> Freescale recommends: > > LDHX #RAMLAST+1 > TXS > > at the start of the reset handler for 9s08gb micros so that stack will > use high ram, freeing up zero page for direct addressing. > > How this messes up simple minded single-byte X-indexed addressing as a > command like: > > LDA junk,X > > now uses H:X for the index. For the GB32, H=0x08. > > Short of clearing H (CLRH) and using zero page for stack, is there > a clean way to use high stack and still maintain the simple 8-bit > indexing mode. > > TIA. > > Steve. > > -- > Steven D. Swift, novatech@eskimo.com, http://www.novatech-instr.com > NOVATECH INSTRUMENTS, INC. P.O. Box 55997 > 206.301.8986, fax 206.363.4367 Seattle, Washington 98155 USA
Reply by ●May 4, 20062006-05-04
"Bill A." <bill_ct@y_a_h_o_o.com> writes:>"Steven Swift" <novatech@eskimo.com> wrote in message >news:e32on0$6rb$1@eskinews.eskimo.com... >> >> Freescale recommends: >> >> LDHX #RAMLAST+1 >> TXS >> >> at the start of the reset handler for 9s08gb micros so that stack will >> use high ram, freeing up zero page for direct addressing. >> >> How this messes up simple minded single-byte X-indexed addressing as a >> command like: >> >> LDA junk,X >> >> now uses H:X for the index. For the GB32, H=0x08. >> >> Short of clearing H (CLRH) and using zero page for stack, is there >> a clean way to use high stack and still maintain the simple 8-bit >> indexing mode.>H is not related to the stack pointer. CLRH and use page 0 for data and the >stack will continue to be happy at page non-0.>BillThanks. I was confused by the debugger returning a different value for: lda junk,x ;junk in zero page, x=0, H= #RAMLAST+1 and clrh lda junk,x Steve. -- Steven D. Swift, novatech@eskimo.com, http://www.novatech-instr.com NOVATECH INSTRUMENTS, INC. P.O. Box 55997 206.301.8986, fax 206.363.4367 Seattle, Washington 98155 USA