duskos

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

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

Make (br) and (?br) into opwrite words

Diffstat:
Mboot.fs | 11++++++-----
Mxcomp.txt | 4++--
2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/boot.fs b/boot.fs @@ -1,16 +1,17 @@ : immediate current 1- dup c@ $80 or swap c! ; : ['] ' litn ; immediate : compile ' litn ['] litcall litcall ; immediate -: if compile (?br) here 4 allot ; immediate +: [compile] ' litcall ; immediate +: if [compile] (?br) here 4 allot ; immediate : then here swap ! ; immediate -: else compile (br) here 4 allot here rot ! ; immediate +: else [compile] (br) here 4 allot here rot ! ; immediate : begin here ; immediate -: again compile (br) , ; immediate -: until compile (?br) , ; immediate +: again [compile] (br) , ; immediate +: until [compile] (?br) , ; immediate : \ begin in< LF = until ; immediate \ hello, this is a comment! : ," begin in< dup '"' = if drop exit then c, again ; -: S" compile (br) here 4 allot here ," tuck here -^ swap +: S" [compile] (br) here 4 allot here ," tuck here -^ swap here swap ! swap litn litn ; immediate : foo S" hello" ; : S= \ sa1 sl1 sa2 sl2 -- f diff --git a/xcomp.txt b/xcomp.txt @@ -49,8 +49,6 @@ create in( value LNSZ 64 value in> 6144 \ where boot.fs starts create 'curword ," xxxxxx" -: (br) r> @ >r ; -: (?br) if r> 4 + >r else r> @ >r then ; : quit _rs0 _br_ lblmain : abort _ps0 quit : 2drop drop drop ; @@ -150,6 +148,8 @@ opwriter A>r A>r opwriter r>A r>A opwriter exit exit opwriter execute execute +opwriter (br) _br_ +opwriter (?br) _cbr_ lblmain: 0 'curword 5 + c! interpret bye : _ lblcurrent: ; lblhere: