Created
September 26, 2018 02:27
-
-
Save topherPedersen/cd3896be8112b5562a18a88eb1dfd9f6 to your computer and use it in GitHub Desktop.
"hello, world" in 6502 Assembly Language for the Atari 2600 (Code Example from "Making Games for the Atari 2600" by Steven Hugg)
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
processor 6502 | |
include "vcs.h" | |
include "macro.h" | |
seg Code | |
org $f000 ; start code at $f000 | |
Start sei ; disable interrupts | |
cld ; disable BCD math mode | |
ldx #$ff ; init stack pointer to $FF | |
txs ; transfer X register to S register | |
lda #0 ; set A register to zero | |
ldx #$ff ; set X to #$ff | |
ZeroZP sta $0,X ; store A register at address ($0 + X) | |
dex ; decrement X by one | |
bne ZeroZP ; branch until X is zero | |
; Make Background Red | |
lda #$30 ; load value into A ($30 is deep red) | |
sta COLUBK ; store A into background color register | |
jmp Start ; goto start of program | |
org $fffc | |
.word Start ; reset vector at $fffc | |
.word Start ; interrupt vector at $fffe (unused in VCS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment