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

0 Members and 2 Guests are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: asmdream is waking up...
« Reply #15 on: May 04, 2011, 04:03:59 pm »
Here's a neat routine I made that is useful for streaming data from either Archive or RAM (if reading from Archive, it is assumed that the correct page is mapped into $4000 beforehand).
Code: [Select]
;To increase the pointer in HL, just call IncPointer
;For slightly faster throughput, use: inc l \ call z,IncPointerMSB
IncPointer:
    inc l
    ret nz
IncPointerMSB:
    inc h
    ret po
    push af
    in a,(6)
    inc a
    out (6),a
    ld a,h
    sub $40
    ld h,a
    pop af
    ret
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: asmdream is waking up...
« Reply #16 on: May 04, 2011, 06:04:05 pm »
I see one advantage this has over mimas: Tokens are smaller than straight ASCII, if you use the commands, not just letters. If you just use the tokens for space, A-z and numbers, then it will use more, I think. Plus, it's not like it hurts to have multiple progs available for the same purpose.

May I recommend having a marker at the beginning of the file, that makes it invalid as BASIC, and makes your assembler able to see it? just a thought.

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #17 on: May 04, 2011, 07:53:55 pm »
Hey guys...

@ Xeda112358 :
- about page spaning :
Thx 4 the answer =]
I wanted to be sure cause i already knew that group variables were (supposed to be) limited to 2 pages at max (meaning data location may be adjusted by the os if crossing a 3rd one).
- about inc file :
Well, that's one of my issues, since asmdream syntax is specific.
I'll take care of this when i'm sure the whole algo works.
I was thinking of building some kind of syntax converter but i won't forget your proposition if i encounter some issues =]

@ calc84maniac :
Thx 4 the routine =]
Mine is 2 bytes bigger but i think i'll leave it as it is for one reason :
It is called after pointer modifications (not only incrementations).
This saves lots of jumps, especially when you need to alter the pointer without accessing data.

@ willrandship :
- about tokens :
I already thought about it before starting the project but unfortunately, only 1-character tokens will be authorized.
Mainly because other ones may definitely not match the directives functions (custom would have been nice but no time for this).
Also, i didn't want the user to spend his life in menus or catalog.
In fact, except when using the token2ascii feature, all the needed tokens can be accessed without entering any menu, for efficiency purpose.
- about the marker :
Thx for reminding it to me !
I already thought about it but for an unknown reason, the idea vanished from my priority stack =]

Have to go... notepad is calling me =]
« Last Edit: May 04, 2011, 08:05:59 pm by the_mad_joob »

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: asmdream is waking up...
« Reply #18 on: May 04, 2011, 08:23:17 pm »
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)

Hey, that's pretty awesome. Good luck on this project (yeah, luck)! What do you think the final version'll be like (app, prgm)?
« Last Edit: May 04, 2011, 08:23:50 pm by Deep Thought »




Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #19 on: May 06, 2011, 06:30:38 pm »
@ Deep Thought :
And it's just the beginning =]
Dunno yet if it will be an app or prgm (have to succeed in creatin it first...).
To be honest, i dunno much about apps but it will mainly depend on :
- How much data is copied from flash to ram in the execution process (the less the better).
- If other programs may potentially be reallocated in the execution process.

Written about 500 bytes of routines today.
One of those is "line_size_multi", which is able to return the amount of ram that will be compiled by any type of data-output directive.
Haven't tested it yet, but had to code it, since label usage requires it.

An interesting thing to mention is that when you represent a part of the main algo structure on paper, it definitely matches the Sierpinski fractal =]
« Last Edit: May 06, 2011, 06:31:58 pm by the_mad_joob »

Ashbad

  • Guest
Re: asmdream is waking up...
« Reply #20 on: May 06, 2011, 07:10:09 pm »
I see one advantage this has over mimas: Tokens are smaller than straight ASCII, if you use the commands, not just letters. If you just use the tokens for space, A-z and numbers, then it will use more, I think. Plus, it's not like it hurts to have multiple progs available for the same purpose.

May I recommend having a marker at the beginning of the file, that makes it invalid as BASIC, and makes your assembler able to see it? just a thought.

That's how Mimas works ;)  each instruction is split into small tokens -- usually one for the instruction name, a few for the parameters.  In fact, he even condenses the ASCII so if you use mostly lowercase (iirc) letters, he makes them at 5/8ths to 3/4ths the size of what they were before.  However, you can try and best that by making it accept even smaller tokens ;)

good luck on this, joob!

Offline the_mad_joob

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

The word "mimas" seems to be quite redundant around =]
Remember this is my first "true" asm project on this hardware, so i hope you don't expect to see something better.
Keep in mind sources must be written using the built-in prgm editor so in some ways, there's a great chance some of you find it more restrictive than mimas.
Just think of it as an old-school alternative that may include some juicy features =]
« Last Edit: May 06, 2011, 09:17:20 pm by the_mad_joob »

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 #22 on: May 06, 2011, 10:57:32 pm »
Hehe, cool. When I was planning out the version I wanted to make, I was going to include things like using a→b if somebody didn't want to use "ld b,a" and a few other things like that. Also, are you going to make it so that the uppercase and lowercase letters are interchangeable? I know I tried using an on-calc assembler that only allowed lowercase and it was not only a pain, but it used about twice as much memory as it needed !_!

I wish you luck!

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: asmdream is waking up...
« Reply #23 on: May 06, 2011, 11:27:34 pm »
The word "mimas" seems to be quite redundant around =]

That's because Mimas is still the only real working on-calc assembler around :) Except for OTBP, but that's not practical for anything larger than a short script.
« Last Edit: May 06, 2011, 11:27:45 pm by Deep Thought »




Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #24 on: May 07, 2011, 12:33:27 am »
@ Xeda112358 :

Thx again =]
Lowercase tokens will be forbidden almost everywhere in sources and includes, for space purpose (and laziness i must confess).
The only places where you will be authorized to use them will be inside tok2ascii or tok2tok fields.
For example :   LD A,"n   will be recognized whereas   ld a,"N   will not.

@ Deep Thought :

Yeah, when i see how horrible (but not impossible) it is to code one, mimas must have been a great achievement for its author(s).
« Last Edit: May 07, 2011, 12:39:07 am 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 #25 on: May 09, 2011, 01:50:50 am »
After several nights of coding, we can now say progress has increased from 50 to 60% =]

Equate call & return routines finished (another dedicated stack was required).

I'm about to code a hard part of the project.
It's a loop which is supposed to return a 16-bit value from a complex expression which can be composed of straight values but also equates (which can themselves call other complex expressions and so on...).

Also, added a funky feature which will allow both basic and asmdream languages to cohabit in a single prgm.
Dunno if it will have a utility of any sort but added it since it was really easy to implement.
« Last Edit: May 09, 2011, 01:52:04 am by the_mad_joob »

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 #26 on: May 09, 2011, 03:59:38 am »
That sounds awesome! great job on the fast coding!
how many app pages is it now?
I'm not a nerd but I pretend:

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #27 on: May 09, 2011, 05:44:23 am »
@ aeTIos :
Terribly awesome =]
For now, it is a simple prgm of about 2,7K (I estimate the final size at about 4-5K).
Add to this the z80 file (~16K), and the ti8X+ file (not ready at all).

*****

Just finished some new routines...
It's official, complex nested equates are functionnal !
(Note : worked for the 1st time when tested ; definitely recommend wu tang for flawless coding =])

Btw, i need some advices from experienced coders about something :
The way i made it, everything can be referenced inside equate definitions, except for macro parameters and labels.
For macro params, i don't even think about it.
But, labels worry me a bit more.
Dyu think it would really be useful ?
In other words, dyu often use label referencing inside equate definitions ?
« Last Edit: May 09, 2011, 05:51:26 am by the_mad_joob »

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: asmdream is waking up...
« Reply #28 on: May 09, 2011, 07:22:05 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 =]

Great, will it include a disassembler or just a typer and assembler? Looks promising =D

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: asmdream is waking up...
« Reply #29 on: May 09, 2011, 07:40:51 am »
Wow... What a post rush =]

No disassembler.
Not even a typer.
Just a compiler which reads sources written directly using the os prgm editor.