Re: [stella] DASM 'upgrade' in progress

Subject: Re: [stella] DASM 'upgrade' in progress
From: "Andrew Davie" <atari2600@xxxxxxxxxxxxx>
Date: Fri, 21 Mar 2003 19:54:43 +1100
> IMO using a macro for highly specialized tasks *might* be a better idea.
> And something like PIC "X.XX.XX." (and many, many more useful things!)
> be implemented as macro if we just extend the capabilities there a bit.

I totally agree with this.

If, for example, simple string-capability was added, which could do compares
on strings or characters, and select the nth character of a string, then all
of the requests for bit-defining pictures could be done with simple macros -
especially including Manuel's horizontal and vertical flipping.  The
assembler should as far as possible be machine/hardware independant.  I
believe, now, that PIC should be a macro.  Then, the space or dot or X or
whatever can be set by the user, as preferred.

Here's a first-pass at what a macro would look like to produce 8-bit wide
sprite picture data...


MAC PIC ;{1} is string
SINDEX SET 0                 ; index to {1}'s nth character
SBYTE SET 0                  ; output byte we're producing
    REPEAT {1}.LENGTH        ; {1}.LENGTH is the length of parameter 1, in
    #if {1}[SINDEX] = SOLID  ; get nth character of string, see if its an
'X'  (or whatever)
    .byte SBYTE              ; output data

To use the above, you'd go...

    PIC "X......X"

which should produce

    .byte %10000001   ; or equivalent :)

To Mirror, you'd just shift to the right (/2) and add 128 instead.
So that covers left/right mirroring!

To do vertical mirroring, you could wrap the above macro inside another
which did the lines in reverse-order by calling the PIC macro for the
parameters in reverse-order.  Similarly, it would be straightfoward to write
macros to do playfields with PF0/PF1/PF2 format, or packed, etc.

DASM already has string and character types, but doesn't (AFAIK) allow
comparisons and substrings.  If the assembler could have a simple substring
capability, and a character-comparison, and a length operator... then macros
could handle just about all of the stuff we've been talking about so far,
and it would be more a matter of building a macro library than inbuilding
'2600 knowledge into DASM (which is multi-platform, after all).

No special knowledge of pictures, or screen or playfield formats.  I think
this is the way to go.


PS: DASM is something I'm going to support - it's *NOT* something I'm going
to spend all my time maintaining!

Archives (includes files) at
Unsub & more at

Current Thread