Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2019 18:05:33 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352454 - head/stand/forth
Message-ID:  <201909171805.x8HI5XRM031566@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Tue Sep 17 18:05:33 2019
New Revision: 352454
URL: https://svnweb.freebsd.org/changeset/base/352454

Log:
  loader: provide u> and xemit words if needed
  
  We have external interpreter (userboot.so) which may be lagging behind
  with updates and may be missing u> xemit words.

Modified:
  head/stand/forth/loader.4th

Modified: head/stand/forth/loader.4th
==============================================================================
--- head/stand/forth/loader.4th	Tue Sep 17 17:44:50 2019	(r352453)
+++ head/stand/forth/loader.4th	Tue Sep 17 18:05:33 2019	(r352454)
@@ -27,6 +27,29 @@
 
 only forth definitions
 
+\ provide u> if needed
+s" u>" sfind [if] drop [else]
+	drop
+: u>
+	2dup u< if 2drop 0 exit then
+	swap u< if -1 exit then
+	0
+;
+[then]
+
+\ provide xemit if needed
+s" xemit" sfind [if] drop [else]
+	drop
+: xemit
+	dup 0x80 u< if emit exit then
+	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
+;
+[then]
+
 s" arch-i386" environment? [if] [if]
 	s" loader_version" environment?  [if]
 		11 < [if]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909171805.x8HI5XRM031566>