gnupic: Any way to address the stack?


Previous by date: 8 Nov 2004 04:16:43 +0000 Re: PICs on Linux, Ryan Underwood
Next by date: 8 Nov 2004 04:16:43 +0000 Re: Any way to address the stack?, Snail Instruments
Previous in thread:
Next in thread: 8 Nov 2004 04:16:43 +0000 Re: Any way to address the stack?, Snail Instruments

Subject: Any way to address the stack?
From: David McNab ####@####.####
Date: 8 Nov 2004 04:16:43 +0000
Message-Id: <418EF321.20903@rebirthing.co.nz>

Hi,

Is there any way to access the hardware return stack on PIC 16F873A?

In other words, to get the value of the current stack pointer, as well 
as read (and possibly also write) the contents of the 8 stack levels 
themselves?

I ask, because I'm looking at ways of implementing a software 
call/return stack, and thus eliminating the ceiling of 8 call levels.

As it is, a software call/return stack would be inefficient, because it 
would require something like:

      movlw    low(return_address)
      movwf    return_address_low
      movlw    high(return_address)
      goto     sw_stack_call
return_address
      ...

This comes to 4 words per call, which will rapidly bloat out the 
application.

If there were a way to 'hack' the return stack, I could cut this to one 
word per call.

Just asking, on the possibility that one of the 'unimplemented' FSRs (or 
some other hack) might let me access the stack.

Thoughts?
-- 
Cheers
David

Previous by date: 8 Nov 2004 04:16:43 +0000 Re: PICs on Linux, Ryan Underwood
Next by date: 8 Nov 2004 04:16:43 +0000 Re: Any way to address the stack?, Snail Instruments
Previous in thread:
Next in thread: 8 Nov 2004 04:16:43 +0000 Re: Any way to address the stack?, Snail Instruments


Powered by ezmlm-browse 0.20.