2022-09-15 14:56:12 +02:00
|
|
|
Blocks allow for a simple storage subsystem. In the smaller ilo
|
|
|
|
and napia based systems, they are mandatory and are the primary
|
|
|
|
means of data and code storage
|
|
|
|
|
|
|
|
Under RetroForth/nga, this is optional, but is enabled by
|
|
|
|
default.
|
2022-06-02 19:49:17 +02:00
|
|
|
|
|
|
|
The exposed word set is compact:
|
|
|
|
|
|
|
|
block:set-file (s-)
|
|
|
|
block:read (na-)
|
|
|
|
block:write (na-)
|
|
|
|
|
|
|
|
~~~
|
|
|
|
{{
|
2023-12-09 19:49:47 +01:00
|
|
|
:block:invoke DEVICE:BLOCKS io:scan-for io:invoke ;
|
2022-06-02 19:49:17 +02:00
|
|
|
---reveal---
|
2023-04-12 02:34:17 +02:00
|
|
|
:block:read (na-) #0 block:invoke ;
|
|
|
|
:block:write (na-) #1 block:invoke ;
|
2022-09-15 14:56:12 +02:00
|
|
|
:block:set-file (s-) #2 block:invoke ;
|
2022-06-02 19:49:17 +02:00
|
|
|
}}
|
|
|
|
~~~
|
2023-01-26 23:29:37 +01:00
|
|
|
|
|
|
|
# Source Data
|
|
|
|
|
|
|
|
~~~
|
|
|
|
'interface/blocks.retro s:dedup
|
2023-04-12 02:34:17 +02:00
|
|
|
dup 'block:read d:lookup d:source store
|
|
|
|
dup 'block:write d:lookup d:source store
|
2023-01-26 23:29:37 +01:00
|
|
|
dup 'block:set-file d:lookup d:source store
|
|
|
|
drop
|
|
|
|
~~~
|