1997-10-09 - Re: 6502 ML programming

Header Data

From: ghio@temp0133.myriad.ml.org (Matthew Ghio)
To: cypherpunks@cyberpass.net
Message Hash: 301797438c4a41d70ace666752a41d7cecc985fb4a11972e841a5bbeb2c5b363
Message ID: <199710090632.CAA06768@myriad>
Reply To: <199710090439.XAA16340@einstein.ssz.com>
UTC Datetime: 1997-10-09 06:56:33 UTC
Raw Date: Thu, 9 Oct 1997 14:56:33 +0800

Raw message

From: ghio@temp0133.myriad.ml.org (Matthew Ghio)
Date: Thu, 9 Oct 1997 14:56:33 +0800
To: cypherpunks@cyberpass.net
Subject: Re: 6502 ML programming
In-Reply-To: <199710090439.XAA16340@einstein.ssz.com>
Message-ID: <199710090632.CAA06768@myriad>
MIME-Version: 1.0
Content-Type: text/plain

Jim Choate <ravage@ssz.com> wrote:
> There in no 'DATA' construct in 6502 assembly.
> This is some sort of macro that either the assembler or programmer
> defined. All official Rockwell/Commodore [1] 6502 assembly mnemonics are
> three letter.

True, but most assemblers would let you insert static data into the object
file using various pseudo-ops like that.

> Idealy a jump table was created that had the various target addresses for
> your routines.

Oh, those were fun to debug too...

> The most efficient way to store data in 6502 is to put it in the first 256
> bytes of ram, then it could be called in no more than 2 clock cycles.

Actually that took three cycles.  One to fetch the opcode, one to fetch the
target address, and one to fetch the data byte.  If you wanted to do it in
two cycles, you had to write the data into the operand of the instruction
that loaded it (self-modifying code).