diff --git a/future/utf8.retro b/future/utf8.retro index 43053f9..bbdc7d4 100644 --- a/future/utf8.retro +++ b/future/utf8.retro @@ -1,3 +1,15 @@ +# UTF-8 Characters + +UTF-8 allows for characters to be one to four bytes long. Since Retro +is 32-bits internally, all characters can fit into a sincle entry on +the stack. These words will be used to pack and unpack the character +values. + +~~~ +:uc:pack (????n-c) ; +:uc:unpack (c-????n) ; +~~~ + # UTF-8 Strings Strings in Retro have been C-style null terminated sequences of ASCII @@ -19,14 +31,20 @@ Return the length (in utf8 characters or bytes) of a string. :us:length/bytes (a-n) a:length ; ~~~ +~~~ +~~~ + + Fetch a character from a string. ~~~ +:us:fetch (an-c) ; ~~~ Store a character into a string. ~~~ +:us:store (can-) ; ~~~ Tests. diff --git a/multicore.retro b/multicore.retro deleted file mode 100644 index 57c08b2..0000000 --- a/multicore.retro +++ /dev/null @@ -1,29 +0,0 @@ -# Multicore Support - -~~~ -:core #8000 io:scan-for io:invoke ; - -:core:init (n-) #0 core ; -:core:start (an-) #1 core ; -:core:pause (n-) #2 core ; -:core:pause-current #3 core ; -:core:resume (n-) #4 core ; -:core:rr (n-v) #5 core ; -:core:wr (vn-) #6 core ; -~~~ - -``` -'Done var - -:a [ @Done #100000 gt? [ core:pause-current ] if &Done v:inc $a c:put ] forever ; -:b [ $b c:put ] forever ; -:c [ $c c:put ] forever ; -:d [ @Done #50000 gt? [ core:pause-current ] if $d c:put ] forever ; - -#1 core:init &a #1 core:start -#2 core:init &b #2 core:start -#3 core:init &c #3 core:start -#4 core:init &d #4 core:start - -core:pause-current -```