diff --git a/build.bat b/build.bat index 7828e6a..2064a36 100755 --- a/build.bat +++ b/build.bat @@ -1,2 +1,2 @@ -assemble.com < game.jrt +zipoff.com < game.jrt diff --git a/game.jrt b/game.jrt index 44cee71..42cafc5 100755 --- a/game.jrt +++ b/game.jrt @@ -1,9 +1,9 @@ -s" zipoff.jrt" loadfile s" text.jrt" loadfile key fill-page -nextline nextline nextline -t" Hello, inline assembler!" draw-text nextline -t" What a lovely day it is!" draw-text +( nextline nextline nextline ) +t" Hello, inline assembler!" draw-text ( nextline ) +( t" What a lovely day it is!" draw-text ) +terminate diff --git a/text.jrt b/text.jrt index 80e0e8e..f3b9bd0 100755 --- a/text.jrt +++ b/text.jrt @@ -18,17 +18,18 @@ NEXT 0 VAR, textpos -: textx textpos @ pagew % ; -: texty textpos @ pagew / ; -: textx! texty pagew * + textpos ! ; -: texty! pagew * textx + textpos ! ; -: nextline texty 1+ pagew * textpos ! ; +:t textx textpos @ pagew % ; +:t texty textpos @ pagew / ; +:t textx! texty pagew * + textpos ! ; +:t texty! pagew * textx + textpos ! ; +:t nextline texty 1+ pagew * textpos ! ; : PREP-TEXTCOPY-XY PREP-TEXTCOPY ADD SI textpos @+ ; :ASM draw-text ( s -- ) + INT 3 # MOV BX SI POP SI PREP-TEXTCOPY-XY diff --git a/zipoff.com b/zipoff.com new file mode 100755 index 0000000..eafd1a8 Binary files /dev/null and b/zipoff.com differ diff --git a/zipoff.jrt b/zipoff.jrt index f78156d..3df9e39 100755 --- a/zipoff.jrt +++ b/zipoff.jrt @@ -59,7 +59,8 @@ asm-com |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 @@ -90,7 +91,20 @@ s" coredefs.jrt" loadfile : FINISHCREATE tcomp| latest |tcomp codepointer cell + @ cell + !t ; : 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 +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 diff --git a/zipstub.seg b/zipstub.seg new file mode 100755 index 0000000..3105d9f Binary files /dev/null and b/zipstub.seg differ