From 1c80c7f2fc08f72bc20d01b12756070b13b230df Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Sun, 13 Jun 2021 14:01:13 +1000 Subject: [PATCH] documentation fixes --- adoc/p_args.adoc | 10 ++++++---- adoc/p_dsp.adoc | 13 +++++++++++++ adoc/p_rbpn.adoc | 4 ++-- adoc/p_read_stream_line.adoc | 15 +++++++++++++++ reference.adoc | 4 ++++ wordindex.adoc | 2 ++ 6 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 adoc/p_dsp.adoc create mode 100644 adoc/p_read_stream_line.adoc diff --git a/adoc/p_args.adoc b/adoc/p_args.adoc index 825ca35..ca3eef6 100644 --- a/adoc/p_args.adoc +++ b/adoc/p_args.adoc @@ -10,7 +10,8 @@ Data stack: ( -- p[argv** argc] ) "ARGS" is a value word that holds a pointer to the command line data block which consists of a count cell followed by that many asciiz -pointers and then a 0 cell. +pointers and then a 0 cell. That is next followed by the environment +as a number of asciiz pointers and a 0 cell. ==== .the command line argument block @@ -18,8 +19,9 @@ pointers and then a 0 cell. ---- ARGS -> 8 bytes: count of non-zero asciiz pointers following 8 bytes: command name string - 8 bytes: first argument string - 8* ... - 8 zero + 8* bytes: argument strings + 8 bytes: zero cell + 8* bytes: envirnment strings + 8 bytes: zero cell ---- ==== diff --git a/adoc/p_dsp.adoc b/adoc/p_dsp.adoc new file mode 100644 index 0000000..5c94c4a --- /dev/null +++ b/adoc/p_dsp.adoc @@ -0,0 +1,13 @@ +// stack.asm: WORD p_dsp, 'D[n]',fasm + +anchor:p_dsp[] + +=== Word: D[n] + +.... +Data stack: ( n -- a ) +.... + +"D[n]" is a function word that pushes the address for the n:th cell of +the data stack onto the data stack. + diff --git a/adoc/p_rbpn.adoc b/adoc/p_rbpn.adoc index 55071e2..9c3a5e3 100644 --- a/adoc/p_rbpn.adoc +++ b/adoc/p_rbpn.adoc @@ -8,8 +8,8 @@ anchor:p_rbpn[] Data stack: ( n -- a ) .... -"R[n]" is a function word that pushes the address for the n:th cell on -the top return stack value onto the data stack. +"R[n]" is a function word that pushes the address for the n:th cell of +the return stack onto the data stack. ==== .Defintion concept for R[n] diff --git a/adoc/p_read_stream_line.adoc b/adoc/p_read_stream_line.adoc new file mode 100644 index 0000000..43c56d6 --- /dev/null +++ b/adoc/p_read_stream_line.adoc @@ -0,0 +1,15 @@ +// stdio.asm: WORD p_read_stream_line,'READ-STREAM-LINE' + +anchor:p_read_stream_line[] + +=== Word: READ-STREAM-LINE + +.... +Data stack: ( stream -- n ) +.... + +"READ-STREAM-LINE" is a function word that gets the next line from the +given stream buffer into PAD and returns number of characters. If the +stream is backed by a file descriptor, the stream buffer is refilled +from there as needed, by a SYS_READ call when more characters are +needed. diff --git a/reference.adoc b/reference.adoc index c4b5120..1d9f60e 100644 --- a/reference.adoc +++ b/reference.adoc @@ -35,6 +35,8 @@ include::adoc/p_Wcomma.adoc[] include::separator.adoc[] include::adoc/p_Dcomma.adoc[] include::separator.adoc[] +include::adoc/p_dsp.adoc[] +include::separator.adoc[] include::adoc/p_cfa2tfa.adoc[] include::separator.adoc[] include::adoc/p_Cget.adoc[] @@ -241,6 +243,8 @@ include::adoc/p_rbpn.adoc[] include::separator.adoc[] include::adoc/p_read_stream_char.adoc[] include::separator.adoc[] +include::adoc/p_read_stream_line.adoc[] +include::separator.adoc[] include::adoc/p_read_word.adoc[] include::separator.adoc[] include::adoc/p_realloc.adoc[] diff --git a/wordindex.adoc b/wordindex.adoc index 5a6aa43..e59bfaa 100644 --- a/wordindex.adoc +++ b/wordindex.adoc @@ -50,6 +50,7 @@ xref:p_gtR[>R] {nbsp} xref:p_Rget[R@] {nbsp} xref:p_Rgt[R>] {nbsp} <> {nbsp} +<> {nbsp} xref:data_stack[DATA-STACK] {nbsp} xref:return_stack[RETURN-STACK] {nbsp} @@ -143,6 +144,7 @@ xref:p_program_version[PROGRAM_VERSION] {nbsp} xref:p_quit[QUIT] {nbsp} xref:p_read_stream_char[READ-STREAM-CHAR] {nbsp} +xref:p_read_stream_char[READ-STREAM-LINE] {nbsp} xref:p_read_word[READ-WORD] {nbsp} xref:p_realloc[REALLOC] {nbsp} xref:p_return[RETURN] {nbsp} -- 2.39.2