mirror of
https://github.com/mgcaret/of816.git
synced 2024-05-28 14:41:27 +00:00
getting ready for the Neon816
This commit is contained in:
parent
2a2a826f40
commit
9e53bf4532
16
platforms/Neon816/Neon816.l
Normal file
16
platforms/Neon816/Neon816.l
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
FEATURES {
|
||||||
|
STARTADDRESS: default = $8000;
|
||||||
|
}
|
||||||
|
|
||||||
|
MEMORY {
|
||||||
|
ROM: start = $8000, size = $7800, file = %O;
|
||||||
|
ZP: start = $0000, size = $100;
|
||||||
|
}
|
||||||
|
|
||||||
|
SEGMENTS {
|
||||||
|
FStartup: load=ROM,type=ro;
|
||||||
|
FSystem: load=ROM, type=ro;
|
||||||
|
FCode: load=ROM, type=ro, optional=yes;
|
||||||
|
ZEROPAGE: load=ZP, type=bss;
|
||||||
|
}
|
||||||
|
|
40
platforms/Neon816/Neon816.s
Normal file
40
platforms/Neon816/Neon816.s
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
.p816
|
||||||
|
.a16
|
||||||
|
.i16
|
||||||
|
.include "macros.inc"
|
||||||
|
.import _Forth_initialize
|
||||||
|
.import _Forth_ui
|
||||||
|
.import _system_interface
|
||||||
|
|
||||||
|
.pushseg
|
||||||
|
.segment "FStartup"
|
||||||
|
.proc startup
|
||||||
|
clc
|
||||||
|
xce
|
||||||
|
rep #SHORT_A|SHORT_I
|
||||||
|
lda #$0300 ; direct page for Forth
|
||||||
|
tcd
|
||||||
|
lda #.hiword($020000) ; top of dictionary memory
|
||||||
|
pha
|
||||||
|
lda #.loword($020000)
|
||||||
|
pha
|
||||||
|
lda #.hiword($010000) ; bottom of dictionary
|
||||||
|
pha
|
||||||
|
lda #.loword($010000)
|
||||||
|
pha
|
||||||
|
lda #$0300 ; first usable stack cell (relative to direct page)
|
||||||
|
pha
|
||||||
|
lda #$0100 ; last usable stack cell+1 (relative to direct page)
|
||||||
|
pha
|
||||||
|
lda #$09FF ; return stack first usable byte
|
||||||
|
pha
|
||||||
|
lda #.hiword(_system_interface)
|
||||||
|
pha
|
||||||
|
lda #.loword(_system_interface)
|
||||||
|
pha
|
||||||
|
jsl _Forth_initialize
|
||||||
|
jsl _Forth_ui
|
||||||
|
brk
|
||||||
|
.byte $00
|
||||||
|
.endproc
|
||||||
|
.popseg
|
14
platforms/Neon816/README.md
Normal file
14
platforms/Neon816/README.md
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Nein816
|
||||||
|
|
||||||
|
This is a port to Lenore Byron's [Neon816](https://hackaday.io/project/164325-neon816)
|
||||||
|
system. To build it, change to the platform directory and run
|
||||||
|
build.sh. Right now, this does not produce a working Forth because I don't know
|
||||||
|
how to interact with the hardware just yet. That being siad, it will
|
||||||
|
output a binary named "forth" that isn't suitable for anything, just yet.
|
||||||
|
|
||||||
|
Details about how to buld it for RAM/ROM/whatnot will be forthcoming.
|
||||||
|
|
||||||
|
## Port Features
|
||||||
|
|
||||||
|
Hopefully this section will be filled up with stuff that works like Lenore's
|
||||||
|
Forth. See the [Neon816 Manual](https://cdn.hackaday.io/files/1643257030480800/sysmanual.pdf)
|
7
platforms/Neon816/build.sh
Executable file
7
platforms/Neon816/build.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e -x
|
||||||
|
ca65 -I ../../inc Neon816.s -l Neon816.lst
|
||||||
|
../../build.sh Neon816
|
||||||
|
ld65 -C Neon816.l -S 0x8000 Neon816.o ../../forth.o -m forth.map -o forth
|
||||||
|
ls -l forth
|
||||||
|
|
2
platforms/Neon816/platform-config.inc
Normal file
2
platforms/Neon816/platform-config.inc
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
; nothing here yet!
|
||||||
|
|
94
platforms/Neon816/platform-lib.s
Normal file
94
platforms/Neon816/platform-lib.s
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
; Platform support library for Neon816
|
||||||
|
;
|
||||||
|
|
||||||
|
cpu_clk = 14000000
|
||||||
|
|
||||||
|
.proc _system_interface
|
||||||
|
;wdm 3
|
||||||
|
phx
|
||||||
|
asl
|
||||||
|
tax
|
||||||
|
jmp (table,x)
|
||||||
|
table: .addr _sf_pre_init
|
||||||
|
.addr _sf_post_init
|
||||||
|
.addr _sf_emit
|
||||||
|
.addr _sf_keyq
|
||||||
|
.addr _sf_key
|
||||||
|
.addr _sf_fcode
|
||||||
|
.addr _sf_reset_all
|
||||||
|
.endproc
|
||||||
|
.export _system_interface
|
||||||
|
|
||||||
|
.proc _sf_success
|
||||||
|
lda #$0000
|
||||||
|
tay
|
||||||
|
clc
|
||||||
|
rtl
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
.proc _sf_fail
|
||||||
|
ldy #.loword(-21)
|
||||||
|
lda #.hiword(-21)
|
||||||
|
sec
|
||||||
|
rtl
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
.proc _sf_pre_init
|
||||||
|
plx
|
||||||
|
jmp _sf_success ; we'll see what we need to do
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
.proc _sf_post_init
|
||||||
|
plx
|
||||||
|
jmp _sf_success
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
.proc _sf_emit
|
||||||
|
plx ; get forth SP
|
||||||
|
jsr _popay ; grab the top item
|
||||||
|
phx ; and save new SP
|
||||||
|
; TODO: interact with the hardware here
|
||||||
|
plx
|
||||||
|
jmp _sf_success
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
.proc _sf_keyq
|
||||||
|
ldy #$0000 ; anticipate false
|
||||||
|
; TODO: interact with the hardware here, set y to FFFF if char available
|
||||||
|
tya
|
||||||
|
plx
|
||||||
|
jsr _pushay
|
||||||
|
jmp _sf_success
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
.proc _sf_key
|
||||||
|
; TODO: interact with hardware, wait for char, get it into Y
|
||||||
|
lda #$0000
|
||||||
|
plx
|
||||||
|
jsr _pushay
|
||||||
|
jmp _sf_success
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
.proc _sf_fcode
|
||||||
|
.if include_fcode
|
||||||
|
ldy #.loword(list)
|
||||||
|
lda #.hiword(list)
|
||||||
|
.else
|
||||||
|
lda #$0000
|
||||||
|
tay
|
||||||
|
.endif
|
||||||
|
plx
|
||||||
|
jsr _pushay
|
||||||
|
jmp _sf_success
|
||||||
|
.if include_fcode
|
||||||
|
list:
|
||||||
|
.dword 0
|
||||||
|
.endif
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
; TODO....
|
||||||
|
.proc _sf_reset_all
|
||||||
|
plx
|
||||||
|
jmp _sf_fail
|
||||||
|
.endproc
|
2
platforms/Neon816/platform-words.s
Normal file
2
platforms/Neon816/platform-words.s
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
; Platform support dictionary words for Neon816
|
||||||
|
|
Loading…
Reference in New Issue
Block a user