1
0
mirror of https://github.com/mgcaret/of816.git synced 2024-09-11 19:57:26 +00:00
of816/platforms/Neon816/Neon816.s

80 lines
2.1 KiB
ArmAsm
Raw Normal View History

2019-11-21 02:22:11 +00:00
.p816
.a16
.i16
.include "macros.inc"
2019-12-01 08:41:06 +00:00
.include "./Neon816-hw.inc"
2019-11-21 02:22:11 +00:00
.import _Forth_initialize
.import _Forth_ui
.import _system_interface
2019-12-01 05:09:35 +00:00
; Bank Map from FB posting by Lenore:
; 00 Bank Mapper (16 blocks of 4k each, configured via MMU)
; 08-0F Bus Controller Peripherals
; - 08 0000-003F MMU
; -- 00: 0-3 Unused, 4-7: Upper RAM bits
; -- 01: Bank
; - 09 FDC
; 10-1F Internal Bus Bridge
; 20-27 Flash ROM
; 28-3F Reserved for Flash
; 30-3F Reserved for Expansion Flash
; 40-47 Video RAM
; 48-7F Reserved for VRAM
; 80-87 RAM 1
; 88-8F RAM 2
; 90-FF Reserved for RAM
2019-11-21 02:22:11 +00:00
.pushseg
.segment "FStartup"
.proc startup
clc
xce
rep #SHORT_A|SHORT_I
2019-12-01 05:09:35 +00:00
.a16
.i16
; MMU setup, maybe. Found at page $FF in Neon bank 0
ldx #$001C
lda #$8000
2019-12-01 08:41:06 +00:00
: sta f:NeonMMU,x
2019-12-01 05:09:35 +00:00
dex
dex
bpl :-
; NeonFORTH does this, presumably to initialize the serial port
sep #SHORT_A ; not necessary unless we were already native & long
.a8
lda #$8D
2019-12-01 08:41:06 +00:00
sta f:SERctrlA
2019-12-01 05:09:35 +00:00
lda #$06
2019-12-01 08:41:06 +00:00
sta f:SERctrlB
2019-12-01 05:09:35 +00:00
lda #$00
2019-12-01 08:41:06 +00:00
sta f:SERctrlC
2019-12-01 05:09:35 +00:00
rep #SHORT_A|SHORT_I
.a16
.i16
lda #$0000 ; direct page for Forth
2019-11-21 02:22:11 +00:00
tcd
2019-12-01 05:09:35 +00:00
lda #.hiword($0A0000) ; top of dictionary memory
2019-11-21 02:22:11 +00:00
pha
2019-12-01 05:09:35 +00:00
lda #.loword($0A0000)
2019-11-21 02:22:11 +00:00
pha
2019-12-01 05:09:35 +00:00
lda #.hiword($090000) ; bottom of dictionary
2019-11-21 02:22:11 +00:00
pha
2019-12-01 05:09:35 +00:00
lda #.loword($090000)
2019-11-21 02:22:11 +00:00
pha
2019-12-01 05:09:35 +00:00
lda #$0200 ; first usable stack cell (relative to direct page)
2019-11-21 02:22:11 +00:00
pha
lda #$0100 ; last usable stack cell+1 (relative to direct page)
pha
2019-12-01 05:09:35 +00:00
lda #$03FF ; return stack first usable byte
2019-11-21 02:22:11 +00:00
pha
lda #.hiword(_system_interface)
pha
lda #.loword(_system_interface)
pha
jsl _Forth_initialize
jsl _Forth_ui
brk
.byte $00
.endproc
.popseg