Re: TIB: Faster Getkey??? (was GetKey)


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

Re: TIB: Faster Getkey??? (was GetKey)




In a message dated 12/5/98 1:13:34 AM Central Standard Time,
sandia@rocler.qc.ca writes:

> I figure that's because with the REPEAT the calc jumps right to the
>  memory address of the beginning of the loop (wich was stored in the
>  stack) when it hits the END instead of searching the prog for a label,
>  that's why I keep telling people to try to avoid GOTOs entirely. Am I
>  right in assuming that in a large program, it takes even longer to
>  find the label? If so It could make even more of a difference in a
>  10Kb prog. Or maybe when the program is started, the memory address of
>  all the labels is stored in some kind of table or list and GOTO checks
>  this table for the mem address to jump to. Does anyone know?
>  
>  But then, is a routine with subprograms as fast as  the prog I wrote
>  before? I'd think not because I believe it checks a Variable
>  Allocation Table or something for the Memory address of the program to
>  call. I think I remember reading something like that somewhere a while
>  back, but I'd appreciate it if someone could tell me if I'm right. I
>  would try it out myself, but I don't have a calculator for the
>  weekend(left it in school:-( ).
>  
>  I just got totally obsessed with finding the fastest getkey routine
>  possible (maybe "least slow" would be a better term *L*)
>  
>  Ok, remember, this is just speculation, I could be totally off.
>  
TI-8x (minus 89) store all program variables in a linked list of linked lists;
the first list has the names of the progs and the inside lists are the
programs themselves, tokenized.  Untokenized they appear as pointers to
arrays.  This means that to call a subprogram the calc has to step through the
list of progs on your calc.  This doesn't take much time, but if you have lots
of little progs and the subprogram is last, it might be signifigant.  BTW, if
you don't understand the linked list just ask and I'll try and explain.  It's
advanced OOP programming stuff.
PJC II