Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: nikitouzz on June 24, 2013, 08:48:15 pm

Title: Funny axe code !
Post by: nikitouzz on June 24, 2013, 08:48:15 pm
I have found random on thing tape it code :

THIS CODE FREEZE THE CALCULATOR !

:.AAA
:getcalc("appvC",2316)→A
:fill(A,0,2316)

compile in noshelle and execute it code then.... appared on the screen your TI and your OS version :p

someone can explain me ?

PS : I use the 1.1.2 version off Axe !
Title: Re: Funny axe code !
Post by: Juju on June 24, 2013, 08:55:08 pm
So you're creating an appvar of length 2316, then write 0 bytes at byte 2316 (which is outside the var), hmmm, interesting.
Title: Re: Funny axe code !
Post by: nikitouzz on June 24, 2013, 08:56:55 pm
the reaction of this code is interestly ^^
Title: Re: Funny axe code !
Post by: Builderboy on June 24, 2013, 11:31:11 pm
The Axe Documentation states that 0 is not a valid size for the Fill argument. 
Title: Re: Funny axe code !
Post by: aeTIos on June 25, 2013, 12:39:21 am
Then why doesn't the axe compiler check for that?
Title: Re: Funny axe code !
Post by: Builderboy on June 25, 2013, 12:55:37 am
There are a million different ways to crash your calc by giving bad arguments to Axe commands, but it's quite difficult to catch them all.  You could definitely check for zero in the case when it is a constant defined, but then you would still run into trouble when it is a variable, which leaves the behavior inconsistent and possibly undesirable.  In the end I imagine it's just really low on the priority list of things to do for Axe.
Title: Re: Funny axe code !
Post by: Streetwalrus on June 25, 2013, 03:16:08 am
That's actually writing 0 times the /byte/ 2316 at address A. :P And yeah, 0 is not a valid size.
Title: Re: Funny axe code !
Post by: Matrefeytontias on June 25, 2013, 03:59:45 am
It's writing 2316 to the 0 bytes (65536 in fact, that's why Axe says 0 is not a valid size) after A. But I have no idea why it does what you say it does.
Title: Re: Funny axe code !
Post by: Hayleia on June 25, 2013, 07:45:02 am
Then why doesn't the axe compiler check for that?
And why don't programs always check if the user read the readme before running ?

More seriously, that could be a feature for a computer compiler, but here, the compiler works on calc, and already has enough work to do on a 6MHz processor to compile programs in a reasonable time so I guess it is better for it not to check if the user made something that was said in the documentation to crash.
Title: Re: Funny axe code !
Post by: willrandship on June 25, 2013, 09:10:08 am
It's true. Also, sometimes you want to do some crazy stuff in Axe. If the compiler always checked for perfect syntax, there would be a great deal of stuff you couldn't do.
Title: Re: Funny axe code !
Post by: DJ Omnimaga on June 25, 2013, 12:33:48 pm
Then why doesn't the axe compiler check for that?
And why don't programs always check if the user read the readme before running ?
I made such program before for two of my games and it's available in the downloads section as a standalone, but it's written in BASIC, so it would have to be converted to ASM in order to be useable in Axe. :P Even in BASIC it works kinda great, because it checks if a list == 0 before running the game, so the first time you start it, it asks the user a password that is located near the end of the install instructions inside the readme. If you type an incorrect password, it says RTFM, and if you enter it successfully it never asks you again (unless you delete the LN00B list)
Title: Re: Funny axe code !
Post by: Hayleia on June 25, 2013, 12:40:28 pm
Then why doesn't the axe compiler check for that?
And why don't programs always check if the user read the readme before running ?
I made such program before for two of my games and it's available in the downloads section as a standalone, but it's written in BASIC, so it would have to be converted to ASM in order to be useable in Axe. :P Even in BASIC it works kinda great, because it checks if a list == 0 before running the game, so the first time you start it, it asks the user a password that is located near the end of the install instructions inside the readme. If you type an incorrect password, it says RTFM, and if you enter it successfully it never asks you again (unless you delete the LN00B list)
Lol, not bad. I guess that what could also be done in a program with a save feature is, in pseudo-code:

If savegame doesn't exist
   Ask for the password in the readme
   If wrong password
      Display "RTFM"
      End The Game
   Else
      Create the savegame
   End
End

I also thought about another solution, that is not oncalc this time: rename everything in the zip, including extensions, with absolutely unclear names, except the readme. Then the user only has the possibility to read the readme that would reveal what file has to be renamed in. The only reason why I didn't do that is because Windows stupidly hides extensions so noobs would have a hard time renaming files to their extensions.
Title: Re: Funny axe code !
Post by: DJ Omnimaga on June 25, 2013, 12:47:49 pm
Yeah that can be another solution as well. However you have to make sure that the linking software people will use is not stupid enough to auto-rename the programs to your newly-created random names when sent on-calc. I know that normally, each program has one internal name of 8 characters, plus a second name for the filename on the computer, but I am unsure if every linking software makes the difference.
Title: Re: Funny axe code !
Post by: Eiyeron on August 09, 2013, 07:43:35 am
Another funny code!
Code: [Select]
Asm(C7)RAM CLEARED! (iirc)
Title: Re: Funny axe code !
Post by: Streetwalrus on August 09, 2013, 08:00:33 am
Asm(C9)... but nothing happens ! (see what I did there :P).