Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Hot_Dog on December 11, 2010, 11:44:58 pm

Title: DelAllocFPS without B_CALLs
Post by: Hot_Dog on December 11, 2010, 11:44:58 pm
I'm trying to avoid the use of B_CALL routines whenever possible.  In Correlation, I have the following:

ld hl, 2
B_CALL _DelAllocFPS
res numOP1,(iy+ParsFlag2)

or 1
ret


What are the steps I need to take to replace this with a non-b_call function?  I don't need code, just what to do.
Title: Re: DelAllocFPS without B_CALLs
Post by: FloppusMaximus on December 12, 2010, 12:28:10 am
If you're dealing with the parser, I'm not sure how much of a speedup you can really expect to get by avoiding B_CALLs.  But anyway...

I assume by DelAllocFPS you mean DeallocFPS.  That routine is very, very simple: it multiplies the input by 9, then subtracts that value from the current (FPS).  It doesn't check that there are actually that many entries allocated on the FPS.  So you could simply do
Code: [Select]
ld hl, (FPS)
ld de, -18
add hl, de
ld (FPS), hl

(Depending on the situtation, it might be good to verify that you're not popping past the start of the FPS, but the OS routines don't do that.)