Join us on Discord!
You can help CodeWalrus stay online by donating here.

Some super crappy Axe code...

Started by p2, August 24, 2016, 11:41:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

E37

#90
 >:D More things! (Updating my huge post as always) @p2

"Hacking" Axe
[spoiler]
I have seen people asking for a function in Axe to return X number of times.
Runer said he wouldn't add something to do that.
Here is how to do it anyway! (there is a couple cases where things could go wrong - this "doesn't work" if it is called from inside a function that needs commas like Text(arg1,arg2,arg3) )
Asm(E1C9)
What? That's all? Yes. repeat the E1 for how many times you want to return. If you wanted to The above example would return from the subroutine and return from the one that called that.
If you return too many times (like returning twice while not in a subroutine) bad things will happen. I'm not entirely sure what, but it starts with a simple crash and can get worse from there.

How to make it work from inside a function with commas:
[spoiler]
For each comma before the function, add another E1. If the call is the 3rd argument, add two E1's.
[/spoiler]

How to return and jump to a label:
LLabel:Asm(D1E3C9)
Make sure the label is preceded by the little L for the address of the label. Again, you will need to add extra D1's to compensate for commas or to return multiple times.

[/spoiler]

(I seriously need to find a better place to put this)
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

c4ooo

Hacky but very useful. Although, to be fair to runer112, if you need this in your code you should orgonize your code more with functions and stuff :P

Powered by EzPortal