Table of Contents
6502 Setup
Various pre-requisites
Vim Syntax Highlighting
To get better syntax highlighting for 6502 assembler I found a vim syntax file asmM6502.vim
https://github.com/jestin/asmM6502.vim
This was saved as ~/.vim/syntax/asmM6502.vim
To make sure assembler source code used the 6502 syntax add:
autocmd BufRead,BufNewFile *.s,*.asm,*.inc set filetype=asmM6502
to ~/.vimrc
Vim in action
Assembler compiler VASM
To compile source to machine-code suitable for blowing onto EEPROM use the vasm
compiler
It's possible to self-compile VASM
by downloading the source-code from:
http://sun.hasenbraten.de/vasm/
but there are ready made binaries here, specifically for the 6502 old-style binaries:
http://www.compilers.de/vasm.html
Use the link at the foot of the page:
http://www.ibaug.de/vasm/vasm6502.zip
Download, unzip (extracts the files needed into ../vasm6502_oldstyle/linux/
)
sudo cp ./vasm6502_oldstyle/linux/* /usr/local/bin
Add an alias to ~/.bashrc
alias vasm='vasm6502_oldstyle -Fbin -dotdir'
for the most used options
To compile a source file to a binary a.out
file:
vasm hello_world.s
gm4slv@laptop:~/6502 $ vasm hello_world.s vasm 1.8h (c) in 2002-2019 Volker Barthelmann vasm 6502 cpu backend 0.8 (c) 2002,2006,2008-2012,2014-2018 Frank Wille vasm oldstyle syntax module 0.13f (c) 2002-2018 Frank Wille vasm binary output module 1.8a (c) 2002-2009,2013,2015,2017 Volker Barthelmann seg8000(acrwx1): 143 bytes segfffc(acrwx1): 4 bytes
Inspect the hexcode in the binary file hexdump
gm4slv@laptop:~/6502 $ hexdump -C a.out 00000000 a2 ff 9a a9 ff 8d 02 60 a9 e0 8d 03 60 a9 38 20 |.......`....`.8 | 00000010 63 80 a9 0e 20 63 80 a9 06 20 63 80 a9 01 20 63 |c... c... c... c| 00000020 80 a2 00 bd 32 80 f0 07 20 79 80 e8 4c 23 80 4c |....2... y..L#.L| 00000030 2f 80 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 00 |/.Hello, world!.| 00000040 48 a9 00 8d 02 60 a9 40 8d 01 60 a9 c0 8d 01 60 |H....`.@..`....`| 00000050 ad 00 60 29 80 d0 ef a9 40 8d 01 60 a9 ff 8d 02 |..`)....@..`....| 00000060 60 68 60 20 40 80 8d 00 60 a9 00 8d 01 60 a9 80 |`h` @...`....`..| 00000070 8d 01 60 a9 00 8d 01 60 60 20 40 80 8d 00 60 a9 |..`....`` @...`.| 00000080 20 8d 01 60 a9 a0 8d 01 60 a9 20 8d 01 60 60 00 | ..`....`. ..``.| 00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00007ff0 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 |................| 00008000
minipro EEPROM programmer
An open source project minipro
to use the TI866 USB EEPROM programmer under Linux
git clone https://gitlab.com/DavidGriffith/minipro.git cd minipro make sudo make install
to burn an EEPROM
minipro -p AT28C256 -w a.out
— John Pumford-Green 10/08/22 13:50
Further Information
- Sept' 2022 : Moved to CA65 assembler.