retroforth/nga-c/extend.retro
crc c41dab370e some experimental vm and tooling stuff (nga-c)
FossilOrigin-Name: 4024b2d35d4e5d0ae3a15c14f497569120c527882edbf055e79726f200e8c322
2021-04-08 19:51:34 +00:00

21 lines
404 B
Forth
Executable file

~~~
{{
'FID var
:write-byte (n-) @FID file:write ;
:mask (n-) #255 and ;
:write-cell (n-)
dup mask write-byte
#8 shift dup mask write-byte
#8 shift dup mask write-byte
#8 shift mask write-byte ;
---reveal---
:image:save (s-)
file:open-for-writing !FID
#0 here [ fetch-next write-cell ] times drop
@FID file:close ;
}}
'retro.nga image:save
~~~