Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: Michael Pang on March 03, 2015, 04:17:56 pm

Title: copy command not working with expression as size
Post by: Michael Pang on March 03, 2015, 04:17:56 pm
why does this corrupt my ti84s ram?
Code: [Select]
1->A
Copy(L3,X+2,A)
while this works
Code: [Select]
Copy(L3,X+2,1)
much thanks! Btw I have 1.1.2
Title: Re: copy command not working with expression as size
Post by: Sorunome on March 03, 2015, 04:19:22 pm
What's the other code around it?
Title: Re: copy command not working with expression as size
Post by: Michael Pang on March 03, 2015, 04:27:33 pm
I'm trying to make a file compression program which will be useless but fun :)
I have an integer B, A bytes in L3 and N bytes in Y that I need to store to a new appvar.
Code: [Select]
GetCalc(L2,A+N+2)->X
B->{X}[sup]r[/sup]
and then the previous code.
Title: Re: copy command not working with expression as size
Post by: Sorunome on March 03, 2015, 04:47:48 pm
What's at L2? You know you could just, like, GetCalc("appvMYAPPV",A+N+2)
What is the result of X? As in, is it Non-Zero?
Title: Re: copy command not working with expression as size
Post by: Michael Pang on March 03, 2015, 04:51:51 pm
L2 contains the string for the new appv. It's copied and modified from the OS's str1.
X is 42000 something
Title: Re: copy command not working with expression as size
Post by: Digital on March 03, 2015, 04:53:53 pm
the lists in axe point to different areas of the calcs memory. maybe this is the reason why it crashes your calc.
Title: Re: copy command not working with expression as size
Post by: Sorunome on March 03, 2015, 05:01:07 pm
So your code is this?

Code: [Select]
1->A
1->N
GetCalc(L2,A+N+2)->X
B->{X}r
Copy(L3,X+2,A)
Title: Re: copy command not working with expression as size
Post by: Michael Pang on March 03, 2015, 05:04:20 pm
Well, like I said the entire program works fine if I change the size parameter to a constant. So I suspect something is wrong with the parser. For example, the app variable doesn't copy properly if I delete it and then create it shortly afterward with getcalc, but if I move the delvar earlier in the program it works. Without the DelVar, it doesn't copy at all - just overwrites with 0's. I think this might have something to do with memory latency if it's non-blocking, or just a corrupt copy of axe.
Title: Re: copy command not working with expression as size
Post by: Sorunome on March 03, 2015, 05:05:54 pm
Which version of Axe do you use? The newest one? 1.2.2a
Title: Re: copy command not working with expression as size
Post by: Michael Pang on March 03, 2015, 05:09:36 pm
So your code is this?

Code: [Select]
1->A
1->N
GetCalc(L2,A+N+2)->X
B->{X}r
Copy(L3,X+2,A)

there's other stuff before and after, but yes. I've commented out and recompiled wihtout copy command and it works as expected. I've even tried replacing copy with a for loop and everything works (just a bigger file size)

Version is 1.1.2. I probably should have tried updating before all this :p
Title: Re: copy command not working with expression as size
Post by: Sorunome on March 03, 2015, 05:10:25 pm
So your code is this?

Code: [Select]
1->A
1->N
GetCalc(L2,A+N+2)->X
B->{X}r
Copy(L3,X+2,A)

there's other stuff before and after, but yes. I've commented out and recompiled wihtout copy command and it works as expected. I've even tried replacing copy with a for loop and everything works (just a bigger file size)

Version is 1.1.2. I probably should have tried updating before all this :p
Probably :P
If you are looking for the link https://www.omnimaga.org/the-axe-parser-project/latest-updates-%28***do-not-post-here!***%29/msg364694/#msg364694 (https://www.omnimaga.org/the-axe-parser-project/latest-updates-%28***do-not-post-here!***%29/msg364694/#msg364694)
Title: Re: copy command not working with expression as size
Post by: Michael Pang on March 03, 2015, 05:29:04 pm
Amazing, it worked! Thanks so much :D
Title: Re: copy command not working with expression as size
Post by: Sorunome on March 03, 2015, 05:31:04 pm
Glad I could help! Hoping in seeing some topic for a great game/utility/program soon, hehe :P
Title: Re: copy command not working with expression as size
Post by: Michael Pang on March 03, 2015, 05:50:49 pm
I do actually have a lot of random programs that I've made over the past two years in high school. Started out with math programs in ti-basic, then I found axe and started making games and stuff. Too bad I never really finished making a full game with menus and levels and all, since I'd always just write the core engine and then move on to something else :)

If anyone's interested, I could upload axe source for checkers, connect 4, or reversi (most of the code is AI). I also have a neat birds-eye POV second- person shooter.