Re: [stella] Time To Get Serious

Subject: Re: [stella] Time To Get Serious
From: Glenn Saunders <cybpunks@xxxxxxxxxxxx>
Date: Thu, 15 Mar 2001 22:40:11 -0800
Pete, your best bet is not to write your first 2600 program from scratch but to take How to Draw a Playfield and start modifying it.

How to Draw a Playfield sets up all the housekeeping chores for you so you can focus on the details of the kernel. For simple games it's probably never necessary to ever alter the basic program flow that How to Draw establishes. It's a great template to use.

One thing that's a little hard to think about when using an assembler is how it partially hides where things in memory are. To some degree you want to have precise control over where your code is assembled to, but you also don't want to have to calculate all the addresses by hand. Assembler is cool because it has constructs that make it feel more like a higher level language (equates and labels being similar to variables and function names) to give it greater readability, but at the same time, you can't divorce yourself from knowing exactly where the code ends up.

For instance, with assembler you can just JSR to a label. The assembler translates that into the address at assembly time. However, with a branch, the 6502 only allows you to deviate from the branch address by +/- 128 bytes. So you have to break up your code in such a way that your target function doesn't wind up "out of reach" of the branch. I haven't had that problem yet but I'm sure it's a pain with larger programs, leading some people to use JMP instead.

So if you write a program that tries to get the 6502 to do something it can't, the assembler is going to fail on you with an error message and you are going to wonder why because the code LOOKS okay on the surface.

LSB and MSB:

"For example, two-byte binary numbers can be stored in big endian format (MSB LSB) or in little endian format (LSB MSB), where MSB is the most significant byte and LSB is the least significant byte. If you wanted to store the number 1 as a two-byte binary number, then you could write it with the most significant byte first (00000000 00000001), where the left-most zero represents 2^15, or with the least significant byte first (00000001 00000000), where the left-most zero represents 2^7. Depending on the way your application interprets binary numbers, you may read (00000001 00000000) as 1, or you may read it as 256."

- Archives (includes files) at Unsub & more at

Current Thread