Last active
October 19, 2021 04:27
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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