Author Topic: An Asm( routine request  (Read 3995 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
An Asm( routine request
« 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.
« Last Edit: October 08, 2010, 07:48:27 pm by Deep Thought »




Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: An Asm( routine request
« Reply #1 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)


Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: An Asm( routine request
« Reply #2 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!




Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: An Asm( routine request
« Reply #3 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

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: An Asm( routine request
« Reply #4 on: October 08, 2010, 09:18:30 pm »
Heh, didn't plan that :D