Author Topic: Axe Parser  (Read 552236 times)

0 Members and 3 Guests are viewing this topic.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #705 on: May 31, 2010, 12:58:29 am »
Hah, wow if that isnt spaghetti code i dont know what it ;D I was jumping around with the find button to see if any of the Lbls called eachother in a loop or something.  Sometimes i was jumping around for 8 or more Lbls before i got to an end :P

Well more embedded subroutines certainly makes it nastier, but it saves space ;)
« Last Edit: May 31, 2010, 12:58:54 am by Runer112 »

_player1537

  • Guest
Re: Axe Parser
« Reply #706 on: May 31, 2010, 12:58:56 am »
basically, pushing/popping means this: (hope I do a good job) the calculator has a stack of hex numbers (like the ones you would recieve by doing "{L1}(r)" ) and when you "push" you are putting a numbers values onto the stack, like HL (or the main numbers you are using in axe).  HL get put onto the stack and saved for later use (like when you reach a "pop") when you pop it off the stack, it gets put in the place of whatever register (read: HL, the main number again) so that you can use it for math some more, however popping it off the stack gets rid of the number that was on it, so you can't continually pop and pop, or else you will run the stack down, and get the equivilent of a segfault (iirc) and the calc will crash.  I probably got ninja'd but oh well

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Parser
« Reply #707 on: May 31, 2010, 12:59:21 am »
Whenever you call a subroutine, you "push" the place its supposed to return to into the stack so it knows where to go back to in the code when it reaches the Return, which then "pops" the stack.  Also, I wasn't sure at the time of writing if he did use any assembly code which is why I was explaining it at a lower level.

Glad you found the error :)
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #708 on: May 31, 2010, 01:01:38 am »
Whenever you call a subroutine, you "push" the place its supposed to return to into the stack so it knows where to go back to in the code when it reaches the Return, which then "pops" the stack.  Also, I wasn't sure at the time of writing if he did use any assembly code which is why I was explaining it at a lower level.

Glad you found the error :)

When I'm finished with it I'll make sure to post my project. It's a really nice (albeit BIG) sprite editor that can store multiple sprites of either 8x8 or 16x16, and has support for hex entry and live hex display. :) That messed up subroutine was the delete sprite subroutine. After that I'll probably want to add move/copy commands and it'll pretty much be done. Until I get grayscale working.
« Last Edit: May 31, 2010, 01:03:27 am by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #709 on: May 31, 2010, 01:02:59 am »
I would rather use a lot of subroutines if I am gonna re-use pieces of code several times and it can save space. Otherwise, there's a lot of repetitive code.

Without sub-routines and sub-programs, stuff like this would be impossible. :P


Whenever you call a subroutine, you "push" the place its supposed to return to into the stack so it knows where to go back to in the code when it reaches the Return, which then "pops" the stack.  Also, I wasn't sure at the time of writing if he did use any assembly code which is why I was explaining it at a lower level.

Glad you found the error :)
aaah ok, thanks for explaining. Makes more sense now ^^

Quote
When I'm finished with it I'll make sure to post my project. It's a really nice (albeit BIG) sprite editor that can store multiple sprites of either 8x8 or 16x16, and has support for hex entry and live hex display
I,m glad you fixed it. Can't wait to see it in action :)

Also glad to see more and more Axe coders. I guess it was a good thing I work on that video x.x

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #710 on: May 31, 2010, 01:31:25 am »
Sprite deleting works now :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #711 on: May 31, 2010, 01:42:00 am »
Nice ^^

Feel free to start a new thread for your project btw, since it might easily get lost in this topic in a week or two (due to the high post rate) :P

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #712 on: May 31, 2010, 01:51:26 pm »
I'm just going to post this here for people who want to post more accurate-looking code. These are special characters to better represent calculator symbols:

Code: [Select]

L₁
L₂
L₃
L₄
L₅
L₆
θ
∆List



·



²
ʳ
▸Frac
▸Dec
« Last Edit: May 31, 2010, 01:54:49 pm by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #713 on: May 31, 2010, 01:57:15 pm »
I generally just use SourceCoder, but it can screw up small 2,3,4, etc for list tokens.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #714 on: May 31, 2010, 02:01:19 pm »
I just use TI's program editor that came with older versions of TI Connect 8)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #715 on: May 31, 2010, 02:03:09 pm »
Oh yeah that one, I never tried it personally so I can,t tell. In my early calc programming days, we used TI-Graph Link

Personally I prefer programmign on the calc, though. I type faster on it when programming in BASIC or Axe :P

Offline 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.
    • View Profile
Re: Axe Parser
« Reply #716 on: May 31, 2010, 02:05:26 pm »
Oh yeah that one, I never tried it personally so I can,t tell. In my early calc programming days, we used TI-Graph Link

Personally I prefer programmign on the calc, though. I type faster on it when programming in BASIC or Axe :P
I do the exact same thing. :D
(If only I got graphlink to work at home... )

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #717 on: May 31, 2010, 02:15:32 pm »
I like using TI ProgramEditor for a few reasons. Firstly, the program is always stored on your computer and you don't have to worry about it's safety. Secondly, running it through an emulator that you don't have any important data on and that can't become damaged is always nice. Thirdly, you can view indented code much more easily, which I always do to make the program more understandable. Fourthly, there's no taking a minute to scroll from one part to another in massive programs, which is helpful for projects such as the monstrous sprite editor I'm working on now, the compiled code of which just passed 7,000 bytes. Finally, it's easy to move around code. This often comes in handy when I realize I perform certain actions multiple times in the program and that I could save space by instead making that code into a subroutine and just calling it from those multiple places.

EDIT: In response to DJ's post below me, you know it only takes all of like 3 seconds to drag and drop the file to the emulator. :P
« Last Edit: May 31, 2010, 02:22:33 pm by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #718 on: May 31, 2010, 02:17:38 pm »
It probably depends of opinions. Personally I always liked to be able to almost instantly try my program rather than having to send it to an emu all the time. Again, it might be due to the fact the first 2.5 years I've programmed for calcs, I had no computer at home so I got used to program on calc.

That said, the long scrolling and the risks of RAM clears can be a bit annoying, though.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #719 on: May 31, 2010, 03:51:48 pm »
What is the best way to go about resizing an AppVar but not losing the data that was in it before? I'm pretty sure that the pointer to an AppVar doesn't necessarily stay the same between re-initializations, so I just copy all the data to L₁ and then copy it back to the new pointer, but that will end badly if the AppVar becomes larger than the free RAM at L₁.
« Last Edit: May 31, 2010, 03:53:26 pm by Runer112 »