\ \ Last_change: KS 18.03.2013 19:50:20 \ \ MicroCore load screen to test GOTO cross-compilation. \ Only Forth also definitions hex [IFDEF] empty unpatch empty [ENDIF] Marker empty include gforth-config.fs \ Some System word (re)definitions for a more sympathetic environment include vhdl.fs \ simple VHDL interpreter for constants include ../uCore/constants.vhd include microcore.fs \ the cross-compiler include images.fs \ object code output files include disasm.fs \ the disassembler include constants.fs \ MicroCore Register addresses and bits new Target \ reset target compiler and go into target compilation mode 8 trap-addr code-origin 0 data-origin : ahead ( n -- ticks ) timer @ + ; : co1 ahead CALL co2 ADDR co2 dup ; : co2 dup co1 drop ADDR co1 ; : test recursive test drop ADDR co2 ; : test co1 recurse test dup ; : boot ( -- ) goto L1 Label L1 1 dup ?goto L1 0= ?goto L1 carry? ?goto L1 carry? 0= ?goto L1 ovfl? ?goto L1 ovfl? 0= ?goto L1 0< ?goto L1 0< 0= ?goto L1 call L1 goto L2 4 ahead ?goto L2 0= ?goto L2 carry? ?goto L2 carry? 0= ?goto L2 ovfl? ?goto L2 ovfl? 0= ?goto L2 0< ?goto L2 0< 0= ?goto L2 call L2 dup ; : dies 4 ahead Label L2 co1 GOTO co2 drop ; #reset USR: rst ( -- ) ['] boot nop BRANCH ;USR \ compile branch to TEST at reset vector location #isr USR: isr ( -- ) ints@ drop IRET ;USR #esr USR: esr ( -- ) r> 1- BRANCH ;USR \ retry instruction end \ Boot-file ..\uCore\boot_rom.VHD .( load_goto.fs written to boot_rom.vhd ) \ VHDL-file ..\uCore\program.VHD .( load_goto.fs written to program.vhd )