mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-11-16 19:48:56 +01:00
small cleanups, remove redundant file
FossilOrigin-Name: e3bff1685f168692bc4a1239ebd44c66c9e35442bcf41efe0399b8e806824a8b
This commit is contained in:
parent
ad077a2ca8
commit
bcd5c92b9c
2 changed files with 18 additions and 29 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
```
|
Loading…
Reference in a new issue