\ job.fs for Test410
\ project to develop native bootloader for the 410 chip
\ test by blinking the dev board's LED

\ --- Customize first --- /

include sfr410.fs
include bootloader410.fs
rom-start org

\ ADuC841
\ 220 constant default-TH1
\ target-image rom-start 0 fill  \ nop
\ :m init-serial 
\	$52 # SCON #!  default-TH1 # TH1 #!  $80 # PCON ior! 
\	$20 # TMOD #!  6 .TCON set  m;

\ amrGadget
:m init-serial  m;  \ Done by the bootloader.

\ Choose an interpreter.
tethered [if]  \ Chosen in config.fs
	include tether.fs
[else]	include standalone.fs
[then]

\ --- Then load the application --- /
include debug.fs  \ Comes before application, useful tools.
\ include main.fs
include blinkit.fs
include interactive.fs  \ Should come _after_ application for efficiency.

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

0 [if]	\ Turnkeyed with go.
	start interrupt : cold stacks init-serial go ;
[else]	\ Testing with quit.
	start interrupt : cold stacks init-serial 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]
