Skip to content

Instantly share code, notes, and snippets.

@alastairhm
Last active December 3, 2020 09:25
Show Gist options
  • Save alastairhm/0fac5353653c093dcf5acdc7c621a803 to your computer and use it in GitHub Desktop.
Save alastairhm/0fac5353653c093dcf5acdc7c621a803 to your computer and use it in GitHub Desktop.
BBC Mode 7 character writes
\ Write characters to Mode 7 screen
\ Using Indirect Indexing
\ Using BeebASM assembler
oswrch = &FFEE
screen = &7C00
addr = &70
table = &80
ORG &2000
.start
FOR n, 0, 24, 1
PRINT n
LDA #LO(screen+(n*40))
STA table+(n*2)
LDA #HI(screen+(n*40))
STA table+1+(n*2)
NEXT
.mode
LDA #7 \ Change to Mode 7
JSR screenmode
LDY #4
.loop
LDA #48
STA (table+20), Y
DEY
BPL loop
.finish
RTS
.screenmode
PHA
LDA #22
JSR oswrch
PLA
JSR oswrch
RTS
.end
SAVE "MyCode", start, end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment