XC!+

( xchar xc-addr1 -- xc-addr2 )

Stores the xchar at xc-addr1. xc-addr2 points to the first memory location after the stored xchar.

Implementation:

: XC!+ ( xchar xc-addr -- xc-addr' )
   OVER $80 U< IF TUCK C! CHAR+ EXIT THEN \ special case ASCII
   >R 0 SWAP $3F
   BEGIN 2DUP U> WHILE
     2/ >R DUP $3F AND $80 OR SWAP 6 RSHIFT R>
   REPEAT $7F XOR 2* OR R>
   BEGIN OVER $80 U< 0= WHILE TUCK C! CHAR+ REPEAT NIP
;

ContributeContributions