Skip to content

Instantly share code, notes, and snippets.

@kareiva
Last active October 19, 2021 04:27
Show Gist options
  • Save kareiva/b43af25d8bc1ae17abc87ddc38e0b862 to your computer and use it in GitHub Desktop.
Save kareiva/b43af25d8bc1ae17abc87ddc38e0b862 to your computer and use it in GitHub Desktop.
This code prints the flag of Lithuania on a 6502 chip's video memory
; Load colors to the stack
LDA #$00
PHA
LDA #$08
PHA
LDA #$05
PHA
LDA #$07
PHA
; Load pseudo video memory address into $f0
LDX #$80
STX $f0
LDX #$01
STX $f1
changecolor:
PLA
CMP #$00
BEQ end
; Move video memory pointer to the next region
LDX $f1
INX
STX $f1
paint:
STA ($f0), Y
INY
CPY #$00
BEQ changecolor
JMP paint
end:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment