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
This commit is contained in:
Toomas Soome 2019-09-05 15:06:30 +00:00
parent d15e810db9
commit 938cae327c

View File

@ -199,6 +199,14 @@ set-current \ stop hiding words
a-addr 0 b-addr b-u strcat 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 previous \ lose hidden words from search order