\ job.fs
\
\ At this point - external scripts have modified the gforth path
\ statement and setup the host com port for talking to the project
\ development board. Next is "loading" gforth with all the tools
\ used to build and debug myforth projects. But first three
\ variables that set the location of the rom in the project:
\ removed from common/config.fs and project dependent!
$400 constant start  \ Reset vector.  Bootloader at $0000.
$403 constant rom-start  \ Start of code, no interrupts reserved.
$10000 constant target-size

\ now load the support/debug files for gforth
\ should be project independent - 8051 general files.
include common/loader.fs

\ now load the project board/chip specific support files
include chip/sfr120.fs
include chip/bootloader120.fs
rom-start org

\ Choose an interpreter.
 1 constant tethered    \ Tethered Target
-1 constant standalone  \ Standalone Target

tethered [if]
	include amr/tether.fs
[else]	include myforth/standalone.fs
[then]

\ --- Then load the application --- /
include myforth/debug.fs  \ Comes before application, useful tools.

\ now set the xbr and assign pins - defines init-hdwre ...
include set120xbr.fs            \ default hardware setup for 120 chips
include ram_tools.fs            \ tools for extended ram access, display
include get_temp.fs             \ stock get temperature routines

include main.fs                 \ main functions to interface with PC
include common/interactive.fs   \ Should come _after_ application for efficiency.

\ --- Finally patch the reset vector --- /

\ Turnkey or interactive.
0 [if]  \ turnkeyed with go
         start interrupt : cold stacks init-hdwre go ;
[else]  \ testing with quit
        start interrupt : cold stacks init-hdwre quit ;
[then]

tethered [if]  \ For interactive testing, entering numbers.
	:m # number emit-s m;
	:m ## [ dup 8 rshift $ff and swap $ff and ] # # m;
[else]	headers ] here [ dict org heads ##p! org ]
[then]

report
save
[ .( Host stack= ) .s cr
