svn commit: r352240 - in stable/11/stand/ficl: . softwords
Toomas Soome
tsoome at FreeBSD.org
Thu Sep 12 06:20:21 UTC 2019
Author: tsoome
Date: Thu Sep 12 06:20:20 2019
New Revision: 352240
URL: https://svnweb.freebsd.org/changeset/base/352240
Log:
MFC r351865, r351837:
ficl: add xemit word
ficl: add uIsGreater word (needed for xemit)
We need xemit to support userboot.so loading images from CURRENT.
Modified:
stable/11/stand/ficl/softwords/softcore.fr
stable/11/stand/ficl/words.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/stand/ficl/softwords/softcore.fr
==============================================================================
--- stable/11/stand/ficl/softwords/softcore.fr Thu Sep 12 00:33:01 2019 (r352239)
+++ stable/11/stand/ficl/softwords/softcore.fr Thu Sep 12 06:20:20 2019 (r352240)
@@ -199,6 +199,14 @@ set-current \ stop hiding words
a-addr 0 b-addr b-u strcat
;
+: xemit ( xchar -- )
+ dup 0x80 u< if emit exit then \ special case ASCII
+ 0 swap 0x3F
+ begin 2dup u> while
+ 2/ >r dup 0x3F and 0x80 or swap 6 rshift r>
+ repeat 0x7F xor 2* or
+ begin dup 0x80 u< 0= while emit repeat drop
+ ;
previous \ lose hidden words from search order
Modified: stable/11/stand/ficl/words.c
==============================================================================
--- stable/11/stand/ficl/words.c Thu Sep 12 00:33:01 2019 (r352239)
+++ stable/11/stand/ficl/words.c Thu Sep 12 06:20:20 2019 (r352240)
@@ -1930,6 +1930,18 @@ static void isGreater(FICL_VM *pVM)
return;
}
+static void uIsGreater(FICL_VM *pVM)
+{
+ FICL_UNS u1, u2;
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 2, 1);
+#endif
+ u2 = stackPopUNS(pVM->pStack);
+ u1 = stackPopUNS(pVM->pStack);
+ PUSHINT(FICL_BOOL(u1 > u2));
+ return;
+}
+
static void bitwiseAnd(FICL_VM *pVM)
{
CELL x, y;
@@ -4975,6 +4987,7 @@ void ficlCompileCore(FICL_SYSTEM *pSys)
dictAppendWord(dp, "type", type, FW_DEFAULT);
dictAppendWord(dp, "u.", uDot, FW_DEFAULT);
dictAppendWord(dp, "u<", uIsLess, FW_DEFAULT);
+ dictAppendWord(dp, "u>", uIsGreater, FW_DEFAULT);
dictAppendWord(dp, "um*", umStar, FW_DEFAULT);
dictAppendWord(dp, "um/mod", umSlashMod, FW_DEFAULT);
dictAppendWord(dp, "unloop", unloopCo, FW_COMPILE);
More information about the svn-src-stable
mailing list