### Author Topic: Routines  (Read 296218 times)

0 Members and 1 Guest are viewing this topic.

#### meishe91

• Super Ninja
• LV11 Super Veteran (Next: 3000)
• Posts: 2946
• Rating: +115/-11
##### Re: Routines
« Reply #330 on: June 17, 2010, 03:29:08 am »
That is really cool.
Spoiler For Spoiler:

For the 51st time, that is not my card! (Magic Joke)

#### Quigibo

• The Executioner
• CoT Emeritus
• LV11 Super Veteran (Next: 3000)
• Posts: 2031
• Rating: +1075/-24
##### Re: Routines
« Reply #331 on: June 22, 2010, 03:23:00 am »
8.8 Fixed Point Multiplication:

Inputs:
Argument 1 = First 8.8 number
Argument 2 = Second 8.8 number
Output:
Result of the multiplication

Code: [Select]
:Lbl ML:r1/32768 xor (r2/32768)→r3:abs(r1)→r1:abs(r2)→r2:r1/256*(r2^256)+(r2/256*(r1^256))+(r2^256*(r1^256)/256)+(r1/256*(r2/256)*256)→r1:If r1/32768 xor r3:‾r1:Return:End:r1:Return
Ever wanted to graph a complete Mandelbrot Set on your calculator in less than a minute?  Now, you can!
Don't bother zooming in though.  8 bit decimal resolution is not too great.  The screenshot is 25 iterations by the way.
« Last Edit: June 22, 2010, 03:25:41 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

#### souvik1997

• Guest
##### Re: Routines
« Reply #332 on: June 22, 2010, 07:43:05 am »
That is really fast.

#### calcdude84se

• Needs Motivation
• LV11 Super Veteran (Next: 3000)
• Posts: 2272
• Rating: +78/-13
• Wondering where their free time went...
##### Re: Routines
« Reply #333 on: June 22, 2010, 10:18:21 am »
Nice, that's pretty fast.
*calcdude goes off to write a 16.16 multiplication routine.
If I succeed, I'll post it here.
Edit: Nevermind, this seems rather difficult to do in pure Axe, if not impossible, since Axe can't return 4 bytes, nor can it multiply two words efficiently to give a four-byte result. Maybe in a later version...
« Last Edit: June 22, 2010, 10:54:08 am by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
I'll put it online when it does something.

#### calc84maniac

• eZ80 Guru
• Coder Of Tomorrow
• LV11 Super Veteran (Next: 3000)
• Posts: 2912
• Rating: +471/-17
##### Re: Routines
« Reply #334 on: June 22, 2010, 11:11:31 am »
/32768 is probably more optimized as /256*2/256

Edit:
It might be better to do
r1□r2->r3
and
If r1□r3<<0

Edit2:
Whoops, didn't notice that /32768 was on the auto-ops list. Ignore my original comment.
« Last Edit: June 22, 2010, 11:18:59 am by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

#### DJ Omnimaga

• Clacualters are teh gr33t
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55942
• Rating: +3154/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: Routines
« Reply #335 on: June 22, 2010, 12:59:45 pm »
mhmm interesting. I don't know much about that stuff, though , I wonder how slow is a TI-BASIC one?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

#### SirCmpwn

• Guest
##### Re: Routines
« Reply #336 on: June 22, 2010, 01:29:30 pm »
I don't know about a TI Basic version, DJ.
Quigibo, that is sweet!  Can you make the sin, cos, and tan routine work with this?  Cause you would make me a very happy person if you could.  (Remember my perspective 3D demo?)

#### ztrumpet

• The Rarely Active One
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5712
• Rating: +364/-4
• If you see this, send me a PM. Just for fun.
##### Re: Routines
« Reply #337 on: June 23, 2010, 11:33:16 am »
Awesome!  Nice job on this.
If I'm wrong, please correct me!
Unfinished Projects:
 Elmgon 14% Basic Movement Demo Homescreen Game Pack 80% Basic Latest Release Cube Droid Saves the Galaxy 65% Axe Demo Detonate 70% Axe
Completed Projects:
Exodus | Midnight |Drifter | Axe Snake | Jump! | Factory Theta | Spider | Plot Drop | Papi Jump | Numb3rs | Nibbler | Boost | Duel Tile Map Editor | Homescreen Map Editor | Key Group Check | Oasis

#### DJ Omnimaga

• Clacualters are teh gr33t
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55942
• Rating: +3154/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: Routines
« Reply #338 on: June 27, 2010, 02:08:17 pm »
Since not everyone absolutely wants to install Celtic III to turn their program into appvar or vice-versa, it would be nice if somebody wrote a small routine (ASM or hybrid) to do so or at least a small tutorial on how to do it in CalcSys (preferably the small routine, so people don't need to install CalcSys either, which can take a lot of memory for when you are developping stuff on a regular 83+). It would be handy until Quigibo adds support for storing data inside programs, as for now Axe only stores to Appvars
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

#### Deep Toaster

• So much to do, so much time, so little motivation
• LV13 Extreme Addict (Next: 9001)
• Posts: 8217
• Rating: +758/-15
##### Re: Routines
« Reply #339 on: June 27, 2010, 07:54:09 pm »
I still haven't figured out what the plot style tokens do. What does the bitwise AND, OR, and XOR mean? Are they different from the logic tokens?

#### calc84maniac

• eZ80 Guru
• Coder Of Tomorrow
• LV11 Super Veteran (Next: 3000)
• Posts: 2912
• Rating: +471/-17
##### Re: Routines
« Reply #340 on: June 27, 2010, 07:57:25 pm »
I still haven't figured out what the plot style tokens do. What does the bitwise AND, OR, and XOR mean? Are they different from the logic tokens?
At this point, the compiler does not make a huge distinction between them (the logic tokens do an 8-bit bitwise operation instead of 16-bit to reduce code size). Basically, each bit in the binary values are ANDed, ORed, or XORed together. It's like doing the operation on two 16-element lists in TI-Basic.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

#### Deep Toaster

• So much to do, so much time, so little motivation
• LV13 Extreme Addict (Next: 9001)
• Posts: 8217
• Rating: +758/-15
##### Re: Routines
« Reply #341 on: June 27, 2010, 08:16:01 pm »
Oh, thanks. So right now, the plot style tokens work basically the same way, except it uses 16-bit?

#### DJ Omnimaga

• Clacualters are teh gr33t
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55942
• Rating: +3154/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: Routines
« Reply #342 on: June 27, 2010, 11:08:40 pm »
I still haven't figured out what the plot style tokens do. What does the bitwise AND, OR, and XOR mean? Are they different from the logic tokens?
plot style tokens? What are those?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

#### Runer112

• Project Author
• LV11 Super Veteran (Next: 3000)
• Posts: 2289
• Rating: +639/-31
##### Re: Routines
« Reply #343 on: June 28, 2010, 01:01:05 am »
I still haven't figured out what the plot style tokens do. What does the bitwise AND, OR, and XOR mean? Are they different from the logic tokens?
plot style tokens? What are those?

EXP1·EXP2
EXP1+EXP2
EXP1☐EXP2   Returns respectively the bitwise "and", "or", and "xor" of the two expressions. These are the plot style tokens.

#### DJ Omnimaga

• Clacualters are teh gr33t
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55942
• Rating: +3154/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: Routines
« Reply #344 on: June 28, 2010, 03:38:17 am »
oh, that I remember now.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)