6502

From SizeCoding
Jump to: navigation, search

Introduction

Wanting to start sizecoding on a 6502 platform in this day and age can be tough.

6502.jpg

So here is a bit of help to get you started:

The 6502 processor

The 6502 processor can be seen as the 8-bit micro ARM chip. It has only has 3 registers (Accumulator, X and Y registers) and a handful of instructions to work with.

Adressing modes

To be added.

Zero page

When using the 6502 for sizecoding, you'll mostly be working from zeropage

6502 Based Platforms

Generic 6502 sinus table generator

	ldx #0
	ldy #$3f
make_sine:
value_lo
			lda #0
			clc
delta_lo
			adc #0
			sta value_lo+1
value_hi
			lda #0
delta_hi
			adc #0
			sta value_hi+1
 
			sta sintab+$c0,x
			sta sintab+$80,y
			eor #$7f
			sta sintab+$40,x
			sta sintab+$00,y
 
			lda delta_lo+1
			adc #8
			sta delta_lo+1
			bcc nothing
			inc delta_hi+1
nothing
			inx
			dey
			bpl make_sine

General 6502 Resources