zipoff.com as a standalone Forth executable, with stub
This commit is contained in:
parent
6521a2127b
commit
b751763331
8
game.jrt
8
game.jrt
|
@ -1,9 +1,9 @@
|
||||||
s" zipoff.jrt" loadfile
|
|
||||||
s" text.jrt" loadfile
|
s" text.jrt" loadfile
|
||||||
|
|
||||||
key fill-page
|
key fill-page
|
||||||
nextline nextline nextline
|
( nextline nextline nextline )
|
||||||
t" Hello, inline assembler!" draw-text nextline
|
t" Hello, inline assembler!" draw-text ( nextline )
|
||||||
t" What a lovely day it is!" draw-text
|
( t" What a lovely day it is!" draw-text )
|
||||||
|
terminate
|
||||||
|
|
||||||
|
|
||||||
|
|
11
text.jrt
11
text.jrt
|
@ -18,17 +18,18 @@
|
||||||
NEXT
|
NEXT
|
||||||
|
|
||||||
0 VAR, textpos
|
0 VAR, textpos
|
||||||
: textx textpos @ pagew % ;
|
:t textx textpos @ pagew % ;
|
||||||
: texty textpos @ pagew / ;
|
:t texty textpos @ pagew / ;
|
||||||
: textx! texty pagew * + textpos ! ;
|
:t textx! texty pagew * + textpos ! ;
|
||||||
: texty! pagew * textx + textpos ! ;
|
:t texty! pagew * textx + textpos ! ;
|
||||||
: nextline texty 1+ pagew * textpos ! ;
|
:t nextline texty 1+ pagew * textpos ! ;
|
||||||
|
|
||||||
: PREP-TEXTCOPY-XY
|
: PREP-TEXTCOPY-XY
|
||||||
PREP-TEXTCOPY
|
PREP-TEXTCOPY
|
||||||
ADD SI textpos @+ ;
|
ADD SI textpos @+ ;
|
||||||
|
|
||||||
:ASM draw-text ( s -- )
|
:ASM draw-text ( s -- )
|
||||||
|
INT 3 #
|
||||||
MOV BX SI
|
MOV BX SI
|
||||||
POP SI
|
POP SI
|
||||||
PREP-TEXTCOPY-XY
|
PREP-TEXTCOPY-XY
|
||||||
|
|
BIN
zipoff.com
Executable file
BIN
zipoff.com
Executable file
Binary file not shown.
18
zipoff.jrt
18
zipoff.jrt
|
@ -59,7 +59,8 @@ asm-com
|
||||||
|
|
||||||
|tcomp
|
|tcomp
|
||||||
|
|
||||||
: DEF tcomp| new-word latest wordname lastlabel ! |tcomp $DOFAR , target , ;
|
: DEF asm-com tcomp| new-word latest wordname lastlabel ! |tcomp $DOFAR , target , ;
|
||||||
|
: :asm asm-here new-word here cell + , ;
|
||||||
|
|
||||||
s" coredefs.jrt" loadfile
|
s" coredefs.jrt" loadfile
|
||||||
|
|
||||||
|
@ -90,7 +91,20 @@ s" coredefs.jrt" loadfile
|
||||||
: FINISHCREATE tcomp| latest |tcomp codepointer cell + @ cell + !t ;
|
: FINISHCREATE tcomp| latest |tcomp codepointer cell + @ cell + !t ;
|
||||||
: DOES> target lit ' FINISHCREATE , ' return , tcomp| ; immediate
|
: DOES> target lit ' FINISHCREATE , ' return , tcomp| ; immediate
|
||||||
|
|
||||||
: t" target begin key dup [ key " lit ] != while >t repeat ;
|
: t" target begin key dup [ key " lit ] != while >t repeat 0 >t drop ;
|
||||||
|
|
||||||
s" logic.jrt" loadfile
|
s" logic.jrt" loadfile
|
||||||
|
|
||||||
|
var comfilename
|
||||||
|
|
||||||
|
: readcom ( filename ) open 0x100 target!
|
||||||
|
begin dup fgetc dup EOF != while >t repeat drop close ;
|
||||||
|
|
||||||
|
:init comfilename @ readcom ;
|
||||||
|
|
||||||
|
: writeenv ( comfile wrapper -- )
|
||||||
|
swap comfilename !
|
||||||
|
dup type cr writeself
|
||||||
|
comfilename @ dup type cr writecom ;
|
||||||
|
|
||||||
|
here s", zipstub.seg" s" zipoff.com" writeenv
|
||||||
|
|
BIN
zipstub.seg
Executable file
BIN
zipstub.seg
Executable file
Binary file not shown.
Loading…
Reference in a new issue