Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Deep Toaster on October 08, 2010, 07:46:14 pm

Title: An Asm( routine request
Post by: Deep Toaster on October 08, 2010, 07:46:14 pm
For one reason or another, XDE needs a routine that can search backwards for the first 0 (in other words, length( but searching backwards). I don't understand completely how length( itself works. Can anyone write one for me? TiA (no, the other one)!

And a length(XX)r would be a nice feature for Axe, btw. Just an informal feature request :)

EDIT: Actually, never mind. I just realized I have Calcsys. Sorry to bug everyone.

EDIT2: If anyone wants, I can post the routine here.
Title: Re: An Asm( routine request
Post by: nemo on October 08, 2010, 07:54:46 pm
can't this be written in axe?
Code: [Select]
.called as sub(LEN,[starting location])
.returns # of bytes from the starting location to the next 0 data element going backwards, not including the byte at the pointer itself.
.if you want to include the byte at the pointer itself, change 0->C to 1->C.
Lbl LEN
0->C
While {C-1->C+r1}
End
abs(C)
Title: Re: An Asm( routine request
Post by: Deep Toaster on October 08, 2010, 07:59:09 pm
Yeah, but I figured an actual routine would be a lot faster. It's just 7 bytes!
Title: Re: An Asm( routine request
Post by: yunhua98 on October 08, 2010, 08:20:10 pm
am I the only one who was reminded of xLib xLib Revolution when I saw "(XX)r" ?  :P
Title: Re: An Asm( routine request
Post by: Deep Toaster on October 08, 2010, 09:18:30 pm
Heh, didn't plan that :D