Re: [stella] Time To Get Serious

Subject: Re: [stella] Time To Get Serious
From: Erik Mooney <emooney@xxxxxxxxxxxxxxxx>
Date: Fri, 16 Mar 2001 02:45:29 -0500
On Thu, 15 Mar 2001 16:09:44 -0800 (PST), you wrote:

>I put the processor I want (6502) in the text file to
>become a program, right at the very beginning, right?

For the framework like this, refer to one of the existing sources like How
to Draw a Playfield, like Glenn said.  (That was Nick Bensema's work, and
was what really kicked off this whole group.  Is he still lurking?)

>How do I, in the program, establish where in memory
>things are?  I notice disassembled code uses ORG
>$F000, which is where I expect it starts the program. 
>Do I, say, ORG $F999 later in the program is that is
>where I want ROM data like character shapes to go, or
>is there another command?

You can use an ORG directive anytime you want to specify the address for
something to start.  I used it to start tables evenly on page boundaries
so that I make sure not to get the index-over-page-boundary cycle penalty.

>Is the byte command what I use to start the program? 
>I have to reread the manual on this point, but if I
>recall correctly, the Atari goes to $FFFE and $FFFF
>first.  The line where the program commands start goes
>here, last half of the address first ($00 then $F0). 
>I establish what part of memory the assembler is
>creating data for, then use byte to put those numbers
>in there, right?

Again, refer to How/Playfield.  Address $FFFC must contain a 16-byte
address (LSB first).  At powerup, the 2600 sets the program counter to
that 16-byte address.  Most commonly, that will be $F000 to start
executing code from the beginning of your ROM.

>What does LSB, MSB order mean?

Glenn covered that.

>Is the format option where I set the assembler to
>either just pump out the code (giving me an accurate
>figure on the amount of memory the program uses) or
>fill any memory spaces left with zeroes giving the
>nice even 4K or whatever numbers?

It will just pump out the code.  However, you're required to have two
bytes for the startup vector at $FFFC, so the resulting binary will be at
least 4094 bytes (assuming you ORG $F000 at the beginning.)  Put two junk
bytes right after those two (I think $FFFE is the BRK vector for the 2600,
which isn't needed for games), and your binary will come out as 4096
bytes, which is what the emulators and Makewav/Playbin expect.

DASM sets unused bytes in the binary to $FF, which mimics the behavior of
real PROM/EEPROM burners.

Archives (includes files) at
Unsub & more at

Current Thread