duskos

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

commit c10cd2388522692ed345eeb65f62bc2ab02e6cdd
parent 280c5e9980ffaae136afbbcbec12daedd78d8946
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Tue, 20 Jun 2023 17:56:16 -0400

rpi: fix maybeword EOF handling

Previous logic was simply broken.

Diffstat:
Mfs/xcomp/arm/rpi/kernel.fs | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs @@ -240,6 +240,10 @@ pc \ we have a nonzero lblnextword. r0=src mov) rTOP rd) r2 rm) ,) lblmoverange abs>rel b) ,) +pc to L1 \ EOF + mov) rTOP rd) 0 i) ,) + popret, exit, + xcode maybeword ( -- str-or-0 ) xdup, lblnextword r0 pc@>reg, @@ -249,6 +253,8 @@ xcode maybeword ( -- str-or-0 ) pc wcall, in< xnip, + cmp) rTOP rn) 0 i) ,) + L1 abs>rel b) le) ,) cmp) rTOP rn) SPC i) ,) ( pc ) abs>rel b) le) ,) \ rTOP=first non-ws mov) r6 rd) 0 i) ,) @@ -258,10 +264,10 @@ xcode maybeword ( -- str-or-0 ) str) rTOP rd) r5 rn) 8b) 1 +i) pre) !) ,) wcall, in< xnip, + cmp) rTOP rn) 0 i) ,) + L1 abs>rel b) le) ,) cmp) rTOP rn) SPC i) ,) ( pc ) abs>rel b) gt) ,) - add) rTOP rdn) 1 i) f) ,) - return) z) ,) \ rTOP is zero? we had a -1 and we're EOF lblcurword rTOP pc>reg, str) r6 rd) rTOP rn) 8b) ,) popret, exit,