6502 Assembly Language
Been trying to relearn 6502 assembly language for fun, its a lot faster and easier than the first time on actual hardware when I was a teenager.
Been using a book I picked up from eBay Discovering BBC Micro Machine Code by A.P. Stephenson
Using BeebAsm assembler on my Mac with a BBC Micro emulator, rather than build in BBC BASIC one.
You can find my code at Github https://github.com/alastairhm/beebasm
This example draws a line of zeros to Mode 7, see screenshot below.
\ Write characters to Mode 7 screen
\ Using Indirect Indexing
\ Using BeebASM assembler
oswrch = &FFEE
screen = &7C00+80
addr = &70
ORG &2000
.start
LDA #7 \ Change to Mode 7
JSR screenmode
LDA #LO(screen)
STA addr
LDA #HI(screen)
STA addr+1
LDY #39
.loop
LDA #48
STA (addr), Y
DEY
BPL loop
.finish
RTS
.screenmode
INCLUDE "../lib/screenmode.asm"
.end
SAVE "MyCode", start, end