forked from scotws/LiaraForth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel_go65c816.asm
56 lines (46 loc) · 1.34 KB
/
kernel_go65c816.asm
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
; Basic hardware routines for Liara Forth: Emulator Version fo go65c816,
; taken as-is from code by
; Scot W. Stevenson <[email protected]>
; First version: 04. Jan 2017
; This version: 29. Jan 2017
; ===================================================================
; EMULATOR HOOKS
; Liara Forth only uses two hardware routines to make porting the code to
; other systems easier: put_chr and get_chr. These addresses are set up for use
; with the crude65816 emulator.
reset_hardware
nop
jmp start
; ===================================================================
; PUT_CHR
put_chr
php
.setas
sta $0df77
.setal
plp
rts
; ===================================================================
; GET_CHR
get_chr
php
lda #$0000
.setas
get_chr0
lda $0df75
beq get_chr0
.setal
plp
rts
; ===================================================================
; HAVE_CHR?
; Check if the receive buffer contains any data and return C=1 if there is
; some.
; TODO CURRENTLY DOESN'T WORK WITH EMULATION nor in go65c816
have_chr nop
.setas
lda $0df48
ror a
.setal
rts
; END