1
0
mirror of https://github.com/mgcaret/of816.git synced 2024-11-15 02:04:52 +00:00
of816/platforms/W65C816SXB/W65C816SXB.s
2019-07-01 10:33:44 -07:00

52 lines
1.3 KiB
ArmAsm

.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
.if 1 ; SXB as it comes
lda #.hiword($7000) ; top of dictionary memory
pha
lda #.loword($7000)
pha
lda #.hiword($0A00) ; bottom of dictionary
pha
lda #.loword($0A00)
pha
.else ; special SXB with RAM expansion
lda #.hiword($020000) ; top of dictionary memory
pha
lda #.loword($020000)
pha
lda #.hiword($010000) ; bottom of dictionary
pha
lda #.loword($010000)
pha
.endif
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