Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Sep 2019 15:06:30 +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: r351865 - head/stand/ficl/softwords
Message-ID:  <201909051506.x85F6UxK027736@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Thu Sep  5 15:06:30 2019
New Revision: 351865
URL: https://svnweb.freebsd.org/changeset/base/351865

Log:
  ficl: add xemit word
  
  While emit will output one byte on screen, the xemit will output xchar.
  
  See: http://forth-standard.org/standard/xchar/XEMIT

Modified:
  head/stand/ficl/softwords/softcore.fr

Modified: head/stand/ficl/softwords/softcore.fr
==============================================================================
--- head/stand/ficl/softwords/softcore.fr	Thu Sep  5 15:01:24 2019	(r351864)
+++ head/stand/ficl/softwords/softcore.fr	Thu Sep  5 15:06:30 2019	(r351865)
@@ -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
 



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