Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Xeda112358 on August 10, 2011, 05:49:12 pm

Title: ASMComp
Post by: Xeda112358 on August 10, 2011, 05:49:12 pm
I am surprised that I have not mentioned this before, here... Anywho, a while ago I started a small project called ASMComp for crazy fools like myself or those who do not have access to their computers all the time. What it is is a tool for developing in assembly on the calc. Until recently, the only feature was to allow for commented code.

Here is what this version has or lacks:
-I haven't added back in commenting for some reason (laziness?)
-You can use equate files
-You cannot define equates yet (other than labels)
-You can use labels
-You can use token strings

So to take directly from the readme, this is an example of code, currently:
Code: [Select]
     :[FWAHAHA
     :.5EQU
     :AsmPrgm
     :EF[HOMEUP]
     :EF[CLRSCRNFULL]
     :21[MESSAGE]
     :EF[PUTPS]
     :210000
     :115F3F
     :EF[INVERTRECT]
     :C9
     :Lbl MESSAGE
     :02"HI"
     :End
The nice part is that this doesn't automatically include the BB6Dh header for asm programs and the code can be output to non-program vars. I plan to add in the ability to do simple math such as (3+[MESSAGE]) as well as add in variables (like 3->A), the ability to define 1 or 2 byte equates (or maybe multi-byte equates), add in If statements to control what sections of code get compiled, and all sorts of other goodies. I imagine code looking something like this:
Code: [Select]
:[MEOW       ;The type and name of the output file
:.5EQU        ;The equates file to use
:=1 COM1     ;Sets an equate for COM0
:=1 COM2     ;Sets an equate for COM1
:=0 COM3     ;Sets an equate for COM2
:AsmPrgm      ;This makes a header for the assembly program
:EF[RCLANS]
:EF[CONVOP1]
:B720{COM1prgm}     ;uses relative jump
:EF[CLRLCDFULL]C9
:Lbl COM1prgm
:If 1=COM1
: 3D20{COM2prgm}
: EF[HOMEUP]
: C9
:Lbl COM2prgm
:If 1=COM2
: 3D20{COM3prgm}
: 3E02D310C9
:Lbl COM3prgm
:If 1=COM3            ;The following chunk of code is not included since COM3=0
: 3D20{END}
: 3E03D310C9
:Lbl END
:C9
:End

So what do y'all think? Is this project worth my attention?
Title: Re: ASMComp
Post by: AngelFish on August 10, 2011, 05:50:25 pm
I think it's definitely worth your attention.
Title: Re: ASMComp
Post by: Xeda112358 on August 10, 2011, 05:53:24 pm
Cool, thanks :) It is taking a bit of a backseat and more so, now that I have finally figured out how to make brass compile apps. Now I can start working on adding features to BatLib again XD Still, I might add in this program to BatLib if I still need to fill up a lot of space.
Title: Re: ASMComp
Post by: Hot_Dog on August 10, 2011, 08:34:52 pm
Welcome back Xeda! :)  I definitely think this is worth it, as long as you have fun working on it.  Remember, you must have fun or we'll start to worry about you ;)
Title: Re: ASMComp
Post by: Deep Toaster on August 10, 2011, 11:52:55 pm
Welcome back Xeda! :)  I definitely think this is worth it, as long as you have fun working on it.  Remember, you must have fun or we'll start to worry about you ;)
Yep, it's a job requirement for working at "Texas Instruments (just kidding, of course not)" :P

Anyway, welcome back! I do think it's worth your attention, partly because it seems to be a really small but useful program (697 bytes!).
Title: Re: ASMComp
Post by: Xeda112358 on August 11, 2011, 10:06:01 am
Anyway, welcome back! I do think it's worth your attention, partly because it seems to be a really small but useful program (697 bytes!).
Huh, for some reason I thought it was bigger... Must have been another project, I guess. Anywho, this is really only meant to be a distraction for me, but it has proven useful to me when I am away from home without a computer. I have an equate file with all the RAM equates and bcalls found in Brandon W's ti83plus.inc, but unfortunately I haven't gotten around to handling files over 16384 bytes :D
...Actually, I just checked and that appears to be the sample equate file I uploaded x.x I guess I will have to fix the code up to handle that, then

Also, I should note that equate files and the source can be in archive. I should also note that only one equate file will be active at a time, but anywhere in the code you can load a new equate file.
Title: Re: ASMComp
Post by: TIfanx1999 on August 12, 2011, 09:02:09 am
Sounds like a cool side project. I'd be something nice to mess with when you feel like taking a break from your other projects. =)
Title: Re: ASMComp
Post by: Xeda112358 on December 10, 2011, 07:41:19 pm
Necroupdate? Anyways, I haven't really done much except add in some error catching. I broke the ability to compile from archive, so I am not going to release this version yet, but here is a screeny :)

As a note, the program I am compiling in the screenie is just a code that jumps into a program at an offset of 4 with the error "OH CRAP!" just for fun. That is a 3 factorial, by the way. :P
Title: Re: ASMComp
Post by: the_mad_joob on December 12, 2011, 11:55:42 pm
Looks promising...
The syntax is a bit old-school but i definitely like it =]
Long life to hexa-coderz !
Title: Re: ASMComp
Post by: Xeda112358 on December 13, 2011, 04:08:16 pm
:D My issue was that I programmed in hex a lot, but I figured automating the process of computing labels would make my life easier XD. Then I thought "What about other people using this?" And then I added commenting (still not reinstated), equate support, and text conversion.
Title: Re: ASMComp
Post by: the_mad_joob on December 13, 2011, 07:12:09 pm
Yeah, that can save many brain cycles =]
Title: Re: ASMComp
Post by: Xeda112358 on December 28, 2011, 11:48:24 pm
Hooray for updates, and this time I have a bunch of useful features. The size is over 1000 bytes, but I have already found it to be useful for the purposes I intended. So here are the new aspects:
-It now can calculate relative jumps and will catch errors if it is out of range
-Up to 50 equate files can be loaded
-You can now define equates in the source using the scientific notation "E"
-1 byte equates are now supported

I have also included equate files for all the bcalls documented by BrandonW (except the rets, DoNothings, and xorA) as well as all the RAM equates documented plus 1 that is documented by me >.>
And then there is the equate file for MirageOS and ION equates as well as Grammer equates. I have an example program using Grammer equates, too.
Title: Re: ASMComp
Post by: DJ Omnimaga on December 29, 2011, 01:13:29 am
Nice to see you again Xeda :). This is kinda interesting. Hopefully it's useful to you and a few others. :)
Title: Re: ASMComp
Post by: Xeda112358 on December 29, 2011, 01:18:25 am
Thanks :) It probably is not useful to anybody else, but it is good coding experience! Plus I have almost finished the part that will convert mnemonics to hex so then it might actually be useful as a full compiler. Hopefully it will be under 2000 bytes for a full compiler that includes easy hex support for folks like me :)
Title: Re: ASMComp
Post by: DJ Omnimaga on December 29, 2011, 01:25:16 am
The small size would actually be a good plus for some people, since some are really picky about size x.x
Title: Re: ASMComp
Post by: ralphdspam on December 29, 2011, 02:13:33 am
It looks really nice, but the hex kinda scares me.  D:
Title: Re: ASMComp
Post by: Aes_Sedia5 on December 29, 2011, 04:14:15 am
I would use this quite often if it can do what i think it does. Combine many opcodes and branch using ANS to decide what bit to run, i need this!
Title: Re: ASMComp
Post by: ZippyDee on December 29, 2011, 05:02:27 am
This is awesome. Seriously. Keep it up. When I started ASM, I started with hex (which was really stupid of me, so I was very confused and had lots of ram clears at first) And this is actually just about what my syntax looked like as I was coding until I counted bytes for relative jumps, etc, which this does for you (yay) so I can see myself using this for sure!
Title: Re: ASMComp
Post by: Xeda112358 on December 29, 2011, 08:57:17 am
@Aes_Sedia5: I am not sure if it does that... (I am not sure, really)

One thing that I have been very strongly thinking of is including aspects of a programming language. So for example, you could have variables that you could store to and If conditionals to decide which pieces of code from the source get used and whatnot. I have been really toying with the idea of creating a version of this for Grammer using the AsmComp( token since Grammer already has a full parser that I could hook into.
Title: Re: ASMComp
Post by: the_mad_joob on December 29, 2011, 05:13:59 pm
Like the way it looks =]
Title: Re: ASMComp
Post by: Aes_Sedia5 on December 30, 2011, 04:34:13 am
It would be nice if that worked xeda. Either way it looks cool