forked from mist64/msbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefines_v6502.s
59 lines (48 loc) · 800 Bytes
/
defines_v6502.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
; configuration
CONFIG_2A := 1
CONFIG_SCRTCH_ORDER := 2
; zero page
ZP_START0 = $00
ZP_START1 = $02
ZP_START2 = $0C
ZP_START3 = $62
ZP_START4 = $6D
;extra ZP variables
USR := GORESTART
; constants
STACK_TOP := $FA
SPACE_FOR_GOSUB := $3E
WIDTH := 40
WIDTH2 := 30
; memory layout
RAMSTART2 := $0400
MONCOUT:
sta $0200
rts
; input a character
; carry flag indicates if a key was pressed
; key will be in accumulator
MONRDKEY:
; wait for keyboard readiness
lda $0202
cmp #1
bne @no_key_pressed
; read keyboard
lda $0201
jsr MONCOUT ; echo
sec
rts
@no_key_pressed:
clc
rts
ISCNTC:
; TODO: is ctrl-c?
rts
SAVE:
LOAD:
; no other IO for this
rts
.segment "RESVEC"
NMI: .word $0000
RESET: .word COLD_START
IRQ: .word $0000