Author Topic: Axe Parser  (Read 552516 times)

0 Members and 2 Guests are viewing this topic.

Offline Michael.3545

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +13/-7
    • View Profile
Re: Axe Parser
« Reply #915 on: July 01, 2010, 07:53:57 pm »
I just did some investigating with Calcsys.  L3 seems to point to 9872.  (All these values are hex)

Here is what is around that area on my calc:

Code: [Select]
27 bytes of empty space
9866: 00 FF 3E 8D
986A: 03 13 22 70
986E: 00 00 00 00
9872: 6A 98 00 00
all the rest of L3

So there is stuff from 9867 to 986D, but I have no idea what.  You would have written over 4 bytes of stuff on my calc.  Could Axe be using the space for something?

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 #916 on: July 01, 2010, 08:04:10 pm »
To answer these questions:

Code: [Select]
appErr1 equ 984Dh
appErr2 equ 985Ah
flashByte1 equ 9867h
flashByte2 equ 9868h
freeArcBlock equ 9869h
arcPage equ 986Bh
arcPtr equ 986Ch
appRawKeyHandle equ 9870h
appBackUpScreen equ 9872h

It looks like you'd be writing over something that sounds like it has to do with the rawkey hook so I don't know if that's necessarily safe.  Its entirely possible that these are just temporary variables that the OS uses but not for long term storage.  As long as Axe doesn't use any OS routines that use these temporary variables, it should be safe.  I have no idea what would use them though.
___Axe_Parser___
Today the calculator, tomorrow the world!

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 #917 on: July 01, 2010, 08:20:21 pm »
I personally would be careful,  still, though. We never know sometimes x.x

I personally try to take precautions to not go out of bounds.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Parser
« Reply #918 on: July 01, 2010, 10:09:57 pm »
Just saw the description for 0.3.2. Really want to update :(




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 #919 on: July 01, 2010, 10:11:06 pm »
I was a little too busy to write an example program before the release, I only got half way done, but I will release that in the routines section instead.  Its an automated sound loader and player that operates in the background using interrupts.  I'm probably forgetting to explain some of the new features, so don't hesitate to ask if you are confused about any wording in the commands list.

Oh yeah!  About the applications, to sign them, transfer them to the computer first.  The next step, I don't know an easy way to do, but what I did was open the app file in a hex editor, remove the garbage header stuff before the first colon, and the signature on the bottom which is hard to find, but it has all $FFs in it I think.  I don't really know the process that well myself, but maybe someone else can explain it.  You then have to save the file as a .hex and import it into Wapsign or rabbitsign to sign it.  Does anyone know of an program that can resign the app without having to go through this trouble?
___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 #920 on: July 01, 2010, 11:15:38 pm »
I'm having a bit of trouble displaying two-byte tokens. Does Axe use little-endian, but the operating system does not? Because I'm trying to read from program data, and to correctly read a two-byte token with the first byte (according to it's location in memory) at A, I cannot use {A}r but have to use {A}*256+{A+1}.

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 #921 on: July 01, 2010, 11:20:05 pm »
That's becasue you normally don't load a 2 byte token directly into a register pair.  Normally, the procedure is to read it as a one byte token, then you call a command that checks if that token is a 2 byte token (something I will add later).  Only then do you shift in the second byte.  That's how the OS does it anyway, I'm just using their routines, can't blame me for their stuff :P
___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 #922 on: July 01, 2010, 11:24:18 pm »
That's sort of how I'm doing it too:

Code: [Select]
 If {Q}sub(2T)
    Disp {Q}*256+{Q+1}▸DMS
    Q+2→Q
  Else
    Disp {Q}▸DMS
    Q+1→Q
  End

Subroutine 2T checks if the first byte is a two-byte token initializer. But is there an easier way to go about reading and displaying tokens sequentially like this?

EDIT: And on the topic of tokens and reading from programs, can anyone answer this: How can one tell where the end of a program is?
« Last Edit: July 02, 2010, 12:00:26 am by Runer112 »

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 #923 on: July 02, 2010, 12:07:50 am »
Hmmm... maybe I will reverse the order of the token then.  Its a relatively trivial thing to do in assembly but it would be more convenient in Axe.  Doe it work right with the Text() command?  That takes a pointer as an argument instead of the token itself.

And to read programs, you first read the size field of the program and then you'll know when you've reached the end.
« Last Edit: July 02, 2010, 12:08:48 am by Quigibo »
___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 #924 on: July 02, 2010, 12:25:07 am »
And to read programs, you first read the size field of the program and then you'll know when you've reached the end.

You mean the two bytes before the program start?

EDIT: Text() works fine, it handles both one-byte and two-byte tokens correctly, determining which kind is pointed to and correctly displaying it.

EDIT 2: Another question: Where are character/token small font sizes stored? Those would be nice to be able to access, even if manually for now, because I'm trying to print to the screen token by token and I'm wondering how the operating system handles advancing the pen correctly.
« Last Edit: July 02, 2010, 12:34:52 am by Runer112 »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Parser
« Reply #925 on: July 02, 2010, 12:34:45 am »
After GetCalc( is used to create a new program variable, does the Axe syntax return the first byte of the size field? In other words, does the following code store the size of prgmUNWISE (8) into Ans (sorry, I can't test anything for a while)?
Code: (Axe BASIC) [Select]
"prgmUNWISE"→Str1
GetCalc(Str1,8)
→Ans
« Last Edit: July 02, 2010, 12:39:49 am by Deep Thought »




Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #926 on: July 02, 2010, 12:35:40 am »
No, that would return the pointer to the start of the created data. Also, as far as I know Axe does not support creating programs with GetCalc() yet, only appvars.
« Last Edit: July 02, 2010, 12:39:21 am by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #927 on: July 02, 2010, 12:59:23 am »
Im not sure why everybody is having all these problems with 2 byte tokens vs 1 byte tokens.  Isnt there a BCall that reads directly from a memory location and gives you the token string, either 2 or 1 byte?  I know that i used such a BCall in my program editor so i know such a method exists.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Parser
« Reply #928 on: July 02, 2010, 01:02:50 am »
This is a bit off topic, but:
Program editor? Did you make an on-calc IDE? Can I have a link? :D




Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #929 on: July 02, 2010, 01:08:50 am »
I'm starting an on-calc Axe program editor, and the first part is displaying the program correctly, so I have to deal with tokens. With any luck I can get it to work and start adding features like sprite previews, subroutine/data collapsing, copy/paste, and maybe even real-time syntax checking.
« Last Edit: July 02, 2010, 01:09:09 am by Runer112 »