[stella] Question about DASM

Andrew Davie atari2600 at taswegian.com
Fri Mar 28 09:00:43 CDT 2008


OK, so a temporary fix for this: use a macro

 MAC ALIGNM ; @1=boundary, @2=value
	REPEAT {1} - ( ( * + {1} ) & ( {1} - 1 ))
	.byte {2}
	REPEND
 ENDM


Usage examples:
  ALIGNM 256,-1  ; pad to next 256 byte boundary, fill with -1
  ALIGNM $400,$20  ; pad to next 1K boundary, fill with 32

Relatively untested, but it seems to work OK.
Relies on power-of-two boundary usage (ie: 32, 64, 128, 256, 512, 1K, etc)

Cheers
A




> -----Original Message-----
> From: stella-bounces at atari2600.org [mailto:stella-bounces at atari2600.org]
> On Behalf Of Peter H. Fröhlich
> Sent: Saturday, March 29, 2008 12:41 AM
> To: Atari 2600 programming list
> Subject: Re: [stella] Question about DASM
> 
> Hi all,
> 
> On Mar 28, 2008, at 4:29 AM, mathys66 at bluewin.ch wrote:
> 
> > It's using the wrong argument for the fill value. If you assemble
> > the piece of code below you'll find that the memory
> > is filled with 0x17 (=23), which is the alignment value. That's why
> > you're seeing all zeroes inserted when you align to
> > a 256 byte boundary - the fill value is in this case 256 & 255 == 0.
> 
> Ah, Thomas is fast! :-) When I looked at the code, I thought this
> might be the case, but since I didn't understand the SYMBOL data
> structure yet, I wasn't sure. :-/ Good job! I'll make a note of this
> to fix later.
> 
> Cheers,
> Peter
> --
> Peter H. Froehlich <><><><><><> http://www.cs.jhu.edu/~phf/
> OpenPGP: ABC2 9BCC 1445 86E9 4D59  F532 A8B2 BFAE 342B E9D9
> 
> _______________________________________________
> Stella mailing list
> Stella at atari2600.org
> http://atari2600.org/mailman/listinfo/stella





More information about the Stella mailing list