duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

commit 88e7c18958f704b6960817229227c22c87b2e85a
parent e13c611c2b603461deeb49986d93e097ea17a37a
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Wed,  1 Jun 2022 13:51:40 -0400

Move a bunch of words from core to boot.fs

Diffstat:
Mboot.fs | 19++++++++++++++++++-
Mxcomp.txt | 19+------------------
2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/boot.fs b/boot.fs @@ -20,7 +20,24 @@ begin 2dup word S= until 2drop ; : ( S" )" waitw ; immediate ( hello, another comment! ) +: psdump scnt not if exit then + scnt >A begin dup .x spc> >r scnt not until + begin r> scnt A> = until ; +: .S ( -- ) + S" SP " stype scnt .x spc> S" RS " stype rcnt .x spc> + S" -- " stype stack? psdump ; +: lntype ( ptr c -- ptr+1 f ) + dup bs? if ( ptr c ) + drop dup in( > if 1- BS emit then spc> BS emit 0 + else ( ptr c ) \ non-BS + dup SPC < if drop dup in) over - 0 fill 1 else + tuck emit c!+ dup in) = then then ; +: rdln S" ok" stype nl> in( begin key lntype until drop nl> ; +: rdln<? ( -- c-or-0 ) + in> in) < if in> c@+ swap to in> else 0 then ; +: rdln< ( -- c ) rdln<? ?dup not if + rdln in( to in> SPC then ; : rdln$ ['] rdln< to in< ['] rdln<? to in<? in) to in> 'curword 6 0 fill ; -: init prompt rdln$ ; +: init S" Dusk OS" stype rdln$ ; init diff --git a/xcomp.txt b/xcomp.txt @@ -85,17 +85,6 @@ lblhex: ," 0123456789abcdef" : in) in( 64 + ; : bs? BS over = swap $7f = or ; : ws? SPC <= ; -: lntype ( ptr c -- ptr+1 f ) - dup bs? if ( ptr c ) - drop dup in( > if 1- BS emit then spc> BS emit 0 - else ( ptr c ) \ non-BS - dup SPC < if drop dup in) over - 0 fill 1 else - tuck emit c!+ dup in) = then then ; -: rdln S" ok" stype nl> in( begin key lntype until drop nl> ; -: rdln<? ( -- c-or-0 ) - in> in) < if in> c@+ swap to in> else 0 then ; -: rdln< ( -- c ) rdln<? ?dup not if - rdln in( to in> SPC then ; : boot< in> c@+ swap to in> ; alias in<? boot< alias in< boot< @@ -149,12 +138,6 @@ alias in< boot< : ; 0 to compiling ; immediate : : entry xtcomp ; : stack? scnt 0< if S" stack underflow" stype abort then ; -: psdump scnt not if exit then - scnt >A begin dup .x spc> >r scnt not until - begin r> scnt A> = until ; -: .S ( -- ) - S" SP " stype scnt .x spc> S" RS " stype rcnt .x spc> - S" -- " stype stack? psdump ; : run1 ( -- ) \ interpret next word word parse not if curword find not if (wnf) then execute stack? then ; @@ -167,6 +150,6 @@ opwriter A>r A>r opwriter r>A r>A opwriter exit exit opwriter execute execute -: prompt lblcurrent: S" Dusk OS" stype ; lblmain: 0 'curword 5 + c! interpret bye +: _ lblcurrent: ; lblhere: