Re: A83: Floating Point Stack


[Prev][Next][Index][Thread]

Re: A83: Floating Point Stack




Here try this, made this in like a coupla minutes so if you got problems
then oh well. Btw, this will let you push up to 28 entries, go above
that and you'll get incorret results, blame 8 bit subtraction.

#define LSBofStck $83
FPSP .db 0

FPPushOP1:
   ld hl,FPSP
   ld a,(hl)
   ld bc,9
   add a,c
   ld (hl),a
   ld e,a
   ld d,LSBofStck
   ld hl,op1
   ldir
   ret

FPPopOP1:
   ld hl,FPSP
   ld a,(hl)
   ld bc,9
   sub c
   ld (hl),a
   ld l,a
   ld h,LSBofStck
   ld de,op1
   ldir
   ret

Ted21@aol.com wrote:
> 
> I have been working more on my math programs and I was wondering if anyone
> can help me with the Floating Point Stack.  I have the following:
> 
> #define FPmov(from,to)  ld hl,from
> #define / ld de,to
> #define / call FPmov_asm
> 
> FPmov_asm:
>     ld bc,9
>     ldir
>     ret
> 
> and now I would like to be able to create an FPpush and an FPpop.  I know
> about _pushop1/_popop1 and would prefer not use them.  I really want it to
> pretty much be like this:
>    FPpush(var)     ;var is pushed onto the stack;
>    FPpop(var)      ;the next piece of the stack it popped into var
> 
> If you can help, I'll appreciate it.
> 
> Ted

-- 
Scott "_Wrath_" Dial
wrath@calc.org
ICQ#3608935
TimeCity Co-Lead Developer, AI - www.timecity.org
Member of TCPA - tcpa.calc.org


References: