Difference: MicroSdBlocks (75 vs. 76)

Revision 762021-05-08 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 356 to 356
 0:/fsr ok.
Added:
>
>
path .str" test.tmp[RET] ok.
fil path FA_WRITE FA_OPEN_ALWAYS + f_open .[RET] 0 ok.
fil stdout ![RET]
hook-emit @  ' fs-emit hook-emit !  ls -l[RET]
hook-emit ! [RET] ok.
fil f_close .[RET] 0 ok.
cat test.tmp[RET]

drw-         0 2021-03-06T14:36:40 man
drw-         0 2021-03-06T14:36:40 fsr
-rwa      7219 2021-03-06T14:04:12 README.md
drw-         0 2021-03-26T18:47:12 boot
drw-         0 2021-04-18T17:40:14 etc
drw-         0 2021-03-06T14:36:40 home
-rwa         0 2000-01-01T00:11:12 test.tmp
 ok.
hook-emit !   ok.

: >file ( addr c-addr -- addr )
  swap dup stdout ! swap
  FA_WRITE FA_OPEN_ALWAYS + f_open drop
  hook-emit @  
  ['] fs-emit hook-emit !
;


: >term ( addr -- )
  hook-emit ! 
  stdout @ f_close drop
;

: <file ( addr c-addr -- addr )
  swap dup stdin ! swap
  FA_READ f_open drop
  hook-key @  
  ['] fs-key hook-key !
;

: <term ( addr -- )
  hook-key ! 
  stdin @ f_close drop
;
 
Added:
>
>
 

Data Structures

Line: 640 to 686
 
str0term     ( c-addr len -- )          make Forth string null-terminated, be sure the buffer is long enough to accept an additional 0 character.
strlen       ( c-addr -- c-addr len )   calculate the length of a C string, Forth string compatible

Changed:
<
<
.str" ( c-addr "text" -- ) copy string into buffer
>
>
.str" ( c-addr "text" -- ) copy string into buffer. String is null-terminated
 s0" ( "text" -- c-addr len ) Compiles a 0-terminated string and gives back its address and length when executed .( ( "text) -- ) Mecrisp's ." is working only in compile mode
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback