Changes

Jump to: navigation, search

6502 Emulator Example Code

633 bytes added, 11:02, 4 March 2020
Fill the Bitmapped Display
ldy #$00 ; index
lda #$07 ; colour code
loop: sta ($10),y ; store colour
== Place a Message on the Character Display ==
 
=== Without using the ROM routines ===
define SCREEN $f000
text:
dcb "6","5","0","2",32,"w","a","s",32,"h","e","r","e",".",00
 
=== Using the ROM routines ===
 
; ROM routines
define SCINIT $ff81 ; initialize/clear screen
define CHRIN $ffcf ; input character from keyboard
define CHROUT $ffd2 ; output character to screen
define SCREEN $ffed ; get screen size
define PLOT $fff0 ; get/set cursor coordinates
jsr SCINIT
ldy #$00
char: lda text,y
beq done
jsr CHROUT
iny
bne char
done: brk
text:
dcb "6","5","0","2",32,"w","a","s",32,"h","e","r","e",".",00
== Type on the Screen ==
; let the user type on the first page of character screen
; has blinking cursor!
; does not use ROM routines
; backspace works (non-destructive), arrows/ENTER don't

Navigation menu