Learning how to write assembly language for the 6502 microprocessor.
The 6502 is an 8-bit microprocessor designed by MOS Technology in 1975. It's low cost enabled many affordable home PC's to be built. It can be found in devices such as the Atari, Commodore, and NES.
- Code Injection Modifies memory and executes it as a command.
- Ben Eater 6502 Files written for Ben Eater's Video Tutorial.
The assembler converts assembly language into machine code, resulting in a bin
file, often put onto a ROM
chip that the CPU retrieves its instructions from.
- Web: 6502 Assembler
- Remove comments from asm file
- Windows: Use asm6 executable in ./tools/asm6. View readme
- Command:
.\tools\asm6\asm6.exe .\src\code-injection\main.asm
- Creates
.\src\code-injection\main.bin
to put on your ROM. - Fork A fork of loopy asm6 assembler asm6f
- Command:
- Mac/Windows/Linux: vasm - a portable and retargetable assembler
This project contains asm
files written in assembly language using the 6502 instruction set. Syntax highlighting makes it easier to view the file by applying color to specific commands and values.
- Atom: Install the language-6502asm package for syntax highlighting on
.asm
files.
A hex editor is useful for viewing and editing bin
files created by the assembler.
- Web: File to hex converter
- Windows: Hex Editor Pro
- PowerShell:
format-hex -Path .\src\code-injection\main.bin
- Web virtual 6502
- Ignores entry specified at 0xFFFB, 0xFFFC. Starts at address 0x0000
I'm following Ben Eater's tutorial videos on YouTube for two of his kits.
- 6502 Computer Kit
- Kit 1: Clock module.
- Astable 555 timer - 8-bit computer clock - part 1
- Monostable 555 timer - 8-bit computer clock - part 2
- Bistable 555 - 8-bit computer clock - part 3
I've punched in machine code for:
This is my first experience writing in assembly language directly. In the past I've written machine language out on paper and flipped switches to enter programs manually for an 1802, and emulated 8080 CPU chips. I've only worked out the assembly in reverse afterwards while writing documentation on an 8800. Note that my Light Switch program on GitHub was published within a markdown file rather than an asm
file.
I grew up with, and still have an Atari 400 with 16k of ram. I was unfamiliar with how to write to it in machine language. I am repairing it and hope one day to write programs in assembly. In the mean time, I've purchased a few chips on ebay and a 6502 kit.