Author Topic: asmdream is waking up...  (Read 22934 times)

0 Members and 1 Guest are viewing this topic.

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
asmdream is waking up...
« on: May 02, 2011, 05:18:00 am »
hey there...

I'm quite new to these forums but i thought it would be nice to share the thing around :

A few weeks ago, i digged out a project that was sleeping for too long.
It's called "asmdream" and is, in fact, an (other) on-calc asm compiler for the 8X+ series.
So, nothing revolutionnary, but it has its particularities (wanted to make something new).

The main challenge here was to make it able to convert token-based sources directly into machine code.
For the ease of use, i was forced to define a simplified syntax because of the large font usage and lack of readability of the tios prgm editor.
But don't worry, i made it very instinctive so we're not so far from tasm.

It is supposed to handle, at least :
- all z80 instructions (undocumented included)
- includes
- labels
- equates (nesting allowed)
- macros with parameters (nesting allowed)
- bases conversions : binary/decimal/hexadecimal/ascii/token
- arithmetic operators : positive/negative/addition/substraction
- read from flash (sources/includes)

For obvious reasons, i do my best to optimize it in favor of space (about 2K for now) but i'm still amazed how fast it does the job.
I work on it many hours per day but it's still hard to tell when it'll see the light (progress maybe around let's say... 50%).

I'll use this thread to post news and (hope not) ask for help.
Also, don't hesitate if you've some questions/suggestions.

cu around =]
« Last Edit: May 02, 2011, 05:33:03 am by the_mad_joob »

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: asmdream is waking up...
« Reply #1 on: May 02, 2011, 05:57:05 am »
Sounds awesome! I can't wait to see how it turns out! Also, welcome! :D [insert peanuts that you've almost definitely already received somewhere else...]
There's something about Tuesday...


Pushpins 'n' stuff...


Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: asmdream is waking up...
« Reply #2 on: May 02, 2011, 01:02:41 pm »
I hate to say this, but there's already something for this: Mimas
But, this sounds cool too! And the TI OS prog editor sounds also cool. Mimas is more like an IDE.

Hope this will be finished!
I'm not a nerd but I pretend:

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: asmdream is waking up...
« Reply #3 on: May 02, 2011, 01:53:02 pm »
Sounds awesome! I can't wait to see how it turns out! Also, welcome! :D [insert peanuts that you've almost definitely already received somewhere else...]





You have no idea how close I came to editing the peanuts into your post ;D

*Qwerty.55 always hits the Modify button instead of the Quote button...

Anyway, good luck the_mad_joob. It's a big project, so don't be afraid to ask for help if you need it.
« Last Edit: May 02, 2011, 01:55:14 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #4 on: May 02, 2011, 02:07:46 pm »
Already knew the existence of mimas but thx for the info =]
Didn't try it (yet) but that looks like a great option for now.

Like i said, i wanted to write my own for fun and challenge.

Don't know if mimas (or any other compiler) can do this but i intend to enlarge the way macros work to the maximum, including labels usage and parameters nesting.
If i succeed in this part of the code, the possibilities may be huge, like let's say, an easy way to create a high level programming language.
But, writing this kind of loops may be a true pain without anything to smoke...
Hopefully, i have prodigy =]

Thx for support guys...

P.S. : Some more peanuts ! Tradition sometimes has its good points =]
« Last Edit: May 02, 2011, 02:14:33 pm by the_mad_joob »

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: asmdream is waking up...
« Reply #5 on: May 02, 2011, 02:20:45 pm »
Heya and welcome on the forums if I did not welcome you already before. This seems interesting. Just keep in mind making an on-calc ASM compiler or IDE can be a bit hard at first, so if you are new to programming, this might be a challenging project. Regardless, good luck. I am curious what this project will include that Mimas is missing. :)

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #6 on: May 02, 2011, 02:29:57 pm »
Hey dj...

Writing source code directly from the tios and macros enhancements may be a good start =]
And yeah, that is my first "serious" z80 project but i'm already familiar with asm programming (hopefully).

Cu around...
« Last Edit: May 02, 2011, 02:30:39 pm by the_mad_joob »

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: asmdream is waking up...
« Reply #7 on: May 02, 2011, 02:37:51 pm »
Ah ok good to hear. I can't wait to see what you will come up with. Keep us updated! :D

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: asmdream is waking up...
« Reply #8 on: May 02, 2011, 09:46:25 pm »
Sounds nice!  Good luck.  :)
ld a, 0
ld a, a

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #9 on: May 03, 2011, 01:36:53 am »
Thx =]

Here's a summary of what's done for now :

*****

DISPLAY
title screen
main interface
status
basic error messages

KEY INPUT
basic actions
target source input

KERNEL
auto-detection of sources/includes locations (ram/flash)
sources/includes reading directly from flash
basic directives
can locate the matching equate definition from its call
can locate the matching macro definition from its call (even if it has some custom parameters)
complex token strings conversion (multiple bases and arithmetic operators mixed in a single expression)

MISC
z80 ops file matching asmdream syntax

*****

So, a lot of work to write all this but the worse is yet to come...

Anyway, i won't forget to share the news =]
« Last Edit: May 03, 2011, 01:49:40 am by the_mad_joob »

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: asmdream is waking up...
« Reply #10 on: May 03, 2011, 01:54:53 am »
I see. Good luck with the rest of the stuff!

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #11 on: May 03, 2011, 02:26:02 am »
Thx, but i'm afraid the word "luck" has no meaning in zilog world =]

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #12 on: May 03, 2011, 09:46:42 pm »
Yo...

Today, written mac_call & mac_return.
Those routines both allow jumps through sources & includes and increment/decrement a custom stack pointer.
This stack is used to backup calls & definitions pages/offsets before the jumps, in order for the nesting feature to be functional.
Also, it may later allow parameters passing =]
Imagine the possibilities with for example 3 nested macros, the 3rd one using the 1st one's parameters...

Have to do the same for equates now.
After that, i think i will have the necessary routines to code the part of the main which calculates the size of the output program and reserves it in ram (or displays an error if not enough available).

Btw, i have a little question.
If i create a huge basic program (data>16385 bytes more precisely) and then archive it, is there a chance that it will span more than 2 rom pages ?
I'm asking because if this is not the case, this could reduce the size of one of my routines a little bit (and additionally accelerate the reading of archived sources/includes).
« Last Edit: May 03, 2011, 11:27:40 pm by the_mad_joob »

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #13 on: May 04, 2011, 01:40:37 pm »
Modified mac_call a bit.
It now also includes a backup of the current program counter value.
This will allow the usage of local labels inside macros definitions =]

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: asmdream is waking up...
« Reply #14 on: May 04, 2011, 03:45:08 pm »
Since each page is 16384 bytes, technically if the program was 16386 bytes, it could use the last byte on one page, the whole next page, and the first byte on the following page...

By the way, I have a similar dead project that has all the bcalls and RAM equates in the regular ti83plus.inc file and I might be able to fix it up a little to suit your needs... no guarantees, though x.x That version used Celtic 3 to search for the name and return the address. I've been meaning to update it using other methods of programming that are geared more toward this kind of data crunching (BatLib BASIC).