Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: ZippyDee on April 09, 2011, 06:23:58 pm

Title: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: ZippyDee on April 09, 2011, 06:23:58 pm
So, people post Axe code all the time on the forums, and I began thinking that it would be nice to have an off-calc compiler for code like that. Then I realized that in order to do that the whole compiler would have to be replicated...so instead I thought it would be useful to have something that read through the code and stored the source in the token forms that the calculator uses, and saves that as a file that you can easily send to your calculator. This could also work in the opposite direction to read a file FROM the calculator and translate back into individual characters instead of tokens. Any thoughts? I was thinking of just making this with a java applet so it's easily accessible for cross platform use.

EDIT: I suppose this could be used for BASIC programs, too, if all it's doing is token-izing character strings.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: Binder News on April 09, 2011, 06:28:05 pm
You mean something like Source Coder?
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: Ashbad on April 09, 2011, 06:30:11 pm
Yeah, most people use sourcecoder for that ;)

However, if you could do of calc compiling to an assembly compiled program, that would be awesome :)
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: ZippyDee on April 09, 2011, 06:34:36 pm
What do you mean Ashbad? Like AXE to assembly?
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: SirCmpwn on April 09, 2011, 10:47:54 pm
I'm actually working on this for tiDE
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: Ashbad on April 09, 2011, 10:52:18 pm
What do you mean Ashbad? Like AXE to assembly?

Yeah, a compiler :)

And sir, I'm interested, can you explain it? (or add link)
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: alberthrocks on April 09, 2011, 11:07:55 pm
I'm actually working on something really similar in the form of an IRC bot. It's on a mini hiatus (it's in my head, just haven't gotten enough time to work on it). You can find this little guy at #thebot. The syntax, if you wish to play with it:
Code: [Select]
<AtomASM> z80asm Help | #z80asm [Assembler: spasm, brass, tasm] [Pastebin Source URL] [Output file name (like hellowrd.8xk, etc.)]
Pastebin to 8xp and back is being worked on, as well as integrating wxWabbitEmu into the mix to attempt Axe compiling! :)
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: SirCmpwn on April 09, 2011, 11:08:28 pm
And sir, I'm interested, can you explain it? (or add link)
Well, it isn't ready yet, but I'll run an emulator in the background (without showing the window) and send Axe and your source code to the emulator, then force all the keypresses needed to get it compiled, then dump the created file.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: ZippyDee on April 10, 2011, 07:02:06 am
Lol I guess that's one way to do it, SirCmpwn
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: SirCmpwn on April 10, 2011, 10:54:45 am
It's definitely the easiest way :P
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: Ashbad on April 10, 2011, 11:29:42 am
Indeed :) but hey, it should be fast, safe, and perfect, so I guess that would be the best way to go for that.  Plus, if it included that emulator for testing, that would make it even better.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: Michael_Lee on April 14, 2011, 12:25:34 am
I'm also working on a program that can tokenize and detokenize Axe files.
Currently, it can turn 8xp to Axe, and I'm almost finished with Axe to 8xp (obviously, not compiled).  I just need a few hours to work on getting checksums to work.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: willrandship on April 14, 2011, 01:44:08 am
Hmm, on that note, I have to wonder how hard an axe decompiler (to Axe source, not Asm) would be, considering the routines are fairly constant. Anything unrecognized could go to [HEX] as a backup.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: z80man on April 14, 2011, 01:50:16 am
Hmm, on that note, I have to wonder how hard an axe decompiler (to Axe source, not Asm) would be, considering the routines are fairly constant. Anything unrecognized could go to [HEX] as a backup.
It might not be that hard to do because most Axe routines are copy and pasted from the include file. The source would probably turn out differently, but it would still compile back the same.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: ZippyDee on April 14, 2011, 01:55:45 am
Anything unrecognized should compile to Asm( not [HEX] just in case...
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: willrandship on April 14, 2011, 01:57:02 am
And included sprites and picvars would prob. be problematic, since they just become hex, with a standard pointer.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: ZippyDee on April 14, 2011, 02:33:03 am
Indeed, I thought of that too. The program would have to recognize the difference between pointers and just numbers.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: Quigibo on April 14, 2011, 03:02:18 am
In the future, after 1.0.0 is released, I though of an idea of how I could bring Axe to the computer platform officially.

Instead of emulating Axe at the assembly level, I could write a compiler instead that takes z80 source code and converts it to C code or whatever language, compile that, add some fancy GUI stuff and an editor, and poof!  Done.

Low to high level language compilers are easy and don't have to be very efficient.  There is a very limited number of assembly instructions anyway and the actual z80 source only needs to be modified slightly for the different input output standards I would need.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: ZippyDee on April 14, 2011, 03:08:07 am
ooooooooooooooooooooooooooo
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: aeTIos on April 14, 2011, 03:09:25 am
^^ lol. It will be so freaking awesome, though. It means we can compile apps with more than 1 app page.
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: ZippyDee on April 14, 2011, 03:09:49 am
And sign them :D
Title: Re: Axe Off-Calc not-really-compiler (dunno what to call it)
Post by: Munchor on April 14, 2011, 06:02:44 am
In the future, after 1.0.0 is released, I though of an idea of how I could bring Axe to the computer platform officially.

Instead of emulating Axe at the assembly level, I could write a compiler instead that takes z80 source code and converts it to C code or whatever language, compile that, add some fancy GUI stuff and an editor, and poof!  Done.

Low to high level language compilers are easy and don't have to be very efficient.  There is a very limited number of assembly instructions anyway and the actual z80 source only needs to be modified slightly for the different input output standards I would need.

That seems like a good idea, hope you can ever make it. Someone else could make it too, but you'd have to release Axe source.