Re: Who remembers about the floating point calculator?

2009-02-01 Thread Frode Tennebø
On Saturday 31. January 2009, Andrew Collier wrote:
 Hi,

 AS you may know, if you CALL a machine code routine with some
 parameters, they are pushed onto the ROM's floating point calculator
 stack. I'm trying to use this, but having some difficulty getting the
 numbers back out again. Can anyone spot what's going wrong?

Since no one else has come to the rescue I'll give it a shot from 20 
years old memory.  The sequence seems right at first glance, I would 
therefore look at something external.  first thing to check is that you 
are not using bank D and that interrupts are disabled.  Then check that 
it is indeed 32768 and 81920 which are stored on the stack initially.

Sorry if this seems obvious, but without knowing more I'm just guessing 
here.

 -Frode
-- 
^ Frode Tennebø | email: fr...@tennebo.com | fr...@irc ^
|  with Standard.Disclaimer; use Standard.Disclaimer;  |


Re: Who remembers about the floating point calculator?

2009-02-01 Thread Andrew Collier


On 1 Feb 2009, at 13:00, Frode Tennebø wrote:


On Saturday 31. January 2009, Andrew Collier wrote:

Hi,

AS you may know, if you CALL a machine code routine with some
parameters, they are pushed onto the ROM's floating point calculator
stack. I'm trying to use this, but having some difficulty getting the
numbers back out again. Can anyone spot what's going wrong?


Since no one else has come to the rescue I'll give it a shot from 20
years old memory.  The sequence seems right at first glance, I would
therefore look at something external.  first thing to check is that  
you
are not using bank D and that interrupts are disabled.  Then check  
that

it is indeed 32768 and 81920 which are stored on the stack initially.



Hi,

Thanks, I've found the problem now. What I'd forgotten was that you  
get two FPC stack entries for each parameter - the first describes the  
type (which allows for CALL statements with string arguments) and this  
is what was coming out as 0xc0 every time.


Cheers,
Andrew

--
 ---   Andrew Collier 
   http://www.intensity.org.uk/ ---
  --