Skip to content

ml8/6502

Repository files navigation

Prerequisites

  • minipro: MacOS - brew install minipro
  • vasm
    • make CPU=6502 SYNTAX=oldstyle

Programming the EEPROM

python3 rom_image_writer.py
minipro -p AT28C256 -w rom.bin

Building with vasm

./bin/vasm -Fbin -o <FILE> -dotdir src.s

vasm syntax

  • 6502 assembly reference
  • # immediate
  • $ hexidecimal
  • .org $ADDR locate following at ADDR
  • .word $WORD write location at current addrress
  • LABEL: label

Address space

0000 - 3fff - RAM
6000 - 7fff - 65c22
6000 - 600f - 65c22 registers 0-15
8000 - ffff - EEPROM

Interrupts

  • IFR - flags, IER - enabled
  • IER - bit 7 is set/clear - set bit to 1 to set/clear interrupts
  • CA1, CA1, CB1, CB2 change in value triggers interrupt
  • Interrupt value is on I/O pins.
  • PCR register has CB1/2 control.

LCD Display

RS - Register select (0: instruction, 1: data); port PA7 RW - Read (1) / Write (0); port PA6 E - Enable: Start read/write; port PA5 D0-7 - Data

Interfacing with serial port

minicom -b 9600 -D /dev/cu.usbserial-0001 -8 -w

cc65 setup

Following these instructions

Code is in:

  • startup.s - initialize everything, call main
    • Port VIA setup, ACIA setup, and LCD setup to C
  • mem_map.s - constants for memory map
  • lcd.s - code for the LCD (port to C)
  • acia.s - code for the ACIA (port to C)

run_time.lib is a copy of the Watara Supervision runtime.

os/

TODO

  • interrupts? call to handle_char

About

6502 computer source

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors