~crc_/retroforth

03659963d617d7e9b1eccb9f6245890cd323f0ea — crc 2 months ago 758e87b
fix stack comments for block words (thanks to @maleza@merveilles.town for reporting this)

FossilOrigin-Name: 799dcc805fbe086e4a21feff40077e914b68176ed10b8b8dd1ce01ed4103a898
M doc/Glossary-Concise.txt => doc/Glossary-Concise.txt +8 -8
@@ 361,13 361,13 @@ Execute q against x, then execute q against y.
binary                    D: -  A: -  F: -
Set `Base` to binary.

block:read                D: an-  A: -  F: -
block:read                D: na-  A: -  F: -
Read 1024 cells from block n in the block storage into memory at address a.

block:set-file            D: s-  A: -  F: -
Set the file name of the block storage device.

block:write               D: an-  A: -  F: -
block:write               D: na-  A: -  F: -
Save the 1024 cells at address a to block n in the block storage.

buffer:add                D: n-  A: -  F: -


@@ 1105,25 1105,25 @@ Compare n1 and n2. Return `TRUE` if n1 is less than n2, or `FALSE` otherwise.
lteq?                     D: nn-f  A: -  F: -
Compare n1 and n2. Return `TRUE` if n1 is less than or equal to n2, or `FALSE` otherwise.

mem:alloc                 D: n-n  A: -  F: -
mem:alloc                 D: n-nn  A: -  F: -
Use malloc to allocate memory. Returns a double cell pointer to this memory.

mem:cell+                 D: nn-n  A: -  F: -
mem:cell+                 D: nnn-n  A: -  F: -
Return address of next cell. Uses a double cell pointer on the stack.

mem:fetch                 D: nn-n  A: -  F: -
Fetch value from malloc'd memory region. Address is a double cell value.

mem:fetch-double          D: nn-nn  A: -  F: -
mem:fetch-double          D: nn-n  A: -  F: -
Fetch a double cell value from a malloc memory region.

mem:free                  D: n-  A: -  F: -
mem:free                  D: nn-  A: -  F: -
Fre a malloc'd region of memory. Pass a double cell pointer to the memory to free.

mem:resize                D: mn-  A: -  F: -
mem:resize                D: mmn-  A: -  F: -
Resize a malloc'd memory area.

mem:store                 D: xn-  A: -  F: -
mem:store                 D: xnn-  A: -  F: -
Store a value into a malloc'd memory region. Uses a double cell pointer for the address.

mod                       D: nm-o  A: -  F: -

M doc/Glossary-Names-and-Stack.txt => doc/Glossary-Names-and-Stack.txt +2 -2
@@ 119,9 119,9 @@ bi                        D: xqq-?  A: -  F: -
bi*                       D: xyqq-?  A: -  F: -
bi@                       D: xyq-?  A: -  F: -
binary                    D: -  A: -  F: -
block:read                D: an-  A: -  F: -
block:read                D: na-  A: -  F: -
block:set-file            D: s-  A: -  F: -
block:write               D: an-  A: -  F: -
block:write               D: na-  A: -  F: -
buffer:add                D: n-  A: -  F: -
buffer:empty              D: -  A: -  F: -
buffer:end                D: -a  A: -  F: -

M doc/Glossary.html => doc/Glossary.html +2 -2
@@ 905,7 905,7 @@
<p>Set `Base` to binary.</p>
<table><tr><td><b>Class:</b> </td><td>class:word</td></tr><tr><td><b>Namespace:</b> </td><td>a</td></tr><tr><td><b>Interface Layer:</b> </td><td>all</td></tr></table><hr/>
<h2>block:read</h2>
<div style='margin-left: 1em;'><p><b>Data:</b> an-<br>
<div style='margin-left: 1em;'><p><b>Data:</b> na-<br>
<b>Addr:</b> -<br>
<b>Float:</b> -</p>
</div>


@@ 919,7 919,7 @@
<p>Set the file name of the block storage device.</p>
<table><tr><td><b>Class:</b> </td><td>class:word</td></tr><tr><td><b>Namespace:</b> </td><td>block</td></tr><tr><td><b>Interface Layer:</b> </td><td>rre</td></tr></table><hr/>
<h2>block:write</h2>
<div style='margin-left: 1em;'><p><b>Data:</b> an-<br>
<div style='margin-left: 1em;'><p><b>Data:</b> na-<br>
<b>Addr:</b> -<br>
<b>Float:</b> -</p>
</div>

M doc/Glossary.txt => doc/Glossary.txt +2 -2
@@ 1404,7 1404,7 @@ Class: class:word | Namespace: a | Interface Layer: all

block:read

  Data:  an-
  Data:  na-
  Addr:  -
  Float: -



@@ 1426,7 1426,7 @@ Class: class:word | Namespace: block | Interface Layer: rre

block:write

  Data:  an-
  Data:  na-
  Addr:  -
  Float: -


M doc/words.tsv => doc/words.tsv +2 -2
@@ 119,9 119,9 @@ bi	xqq-?	-	-	Execute q1 against x, then execute q2 against a copy of x.			class:
bi*	xyqq-?	-	-	Execute q1 against x and q2 against y.			class:word	    #10 #20 [ #2 * ] [ #10 / ] bi*	{n/a}	global	all	
bi@	xyq-?	-	-	Execute q against x, then execute q against y.			class:word	    #10 #20 [ #3 * ] bi@	{n/a}	global	all	
binary	-	-	-	Set `Base` to binary.			class:word	{n/a}	{n/a}	a	all	
block:read	an-	-	-	Read 1024 cells from block n in the block storage into memory at address a.			class:word	{n/a}	{n/a}	block	rre	
block:read	na-	-	-	Read 1024 cells from block n in the block storage into memory at address a.			class:word	{n/a}	{n/a}	block	rre	
block:set-file	s-	-	-	Set the file name of the block storage device.			class:word	{n/a}	{n/a}	block	rre	
block:write	an-	-	-	Save the 1024 cells at address a to block n in the block storage.			class:word	{n/a}	{n/a}	block	rre	
block:write	na-	-	-	Save the 1024 cells at address a to block n in the block storage.			class:word	{n/a}	{n/a}	block	rre	
buffer:add	n-	-	-	Append a value to the current buffer.			class:word	{n/a}	{n/a}	buffer	all	
buffer:empty	-	-	-	Reset the current buffer to an empty state.			class:word	{n/a}	{n/a}	buffer	all	
buffer:end	-a	-	-	Return a pointer to the current end of the active buffer.			class:word	{n/a}	{n/a}	buffer	all	

M vm/nga-c/image.c => vm/nga-c/image.c +34 -12
@@ 10,22 10,22 @@
#define CELL_MAX LLONG_MAX - 1
#endif
#endif
CELL ngaImageCells = 25967;
CELL ngaImage[] = { 1793,25920,25908,25966,202301,415,387,1247,1535,0,11116,0,10,1,10,2,10,3,10,
CELL ngaImageCells = 26411;
CELL ngaImage[] = { 1793,25920,26366,26410,202301,415,387,1247,1535,0,11116,0,10,1,10,2,10,3,10,
                       4,10,5,10,6,10,7,10,8,10,11,10,12,10,13,10,14,10,15,10,
                       16,10,17,10,18,10,19,10,20,10,21,10,22,10,23,10,24,10,25,68223234,
                       1,2575,85000450,1,656912,135,180,268505089,65,64,285281281,0,65,2063,10,101384453,0,9,10,68485378,
                       1,2575,85000450,1,656912,163,180,268505089,65,64,285281281,0,65,2063,10,101384453,0,9,10,68485378,
                       255,18350338,8,255,1045,18350338,16,255,1045,352393217,24,255,10,268289,-24,68229121,-16,68229121,-8,2577,
                       2049,58,25,459011,99,524546,99,302256641,1,10,16974595,0,50529798,10,25,524547,118,50529798,10,17108738,
                       1,251790353,101777669,1,17565186,109,524545,113,66,167838467,-1,134287105,3,61,659457,3,459023,130,2049,58,
                       25,2049,130,1793,137,2049,137,117506307,0,130,0,524545,28,135,168820993,0,149,1642241,149,134283523,
                       13,135,1793,130,524545,2049,130,1793,130,16846593,149,163,180,1793,66,16846593,149,135,180,1793,
                       66,7,10,659713,1,659713,2,659713,3,659713,4,659713,5,1793,194,17108737,3,2,524559,130,
                       2049,130,2049,130,524545,0,130,524545,0,130,2049,144,1048838,2,1642241,10,7,522,1247,167841793,
                       66,7,10,659713,1,659713,2,659713,3,659713,4,659713,5,1793,26175,17108737,3,2,524559,130,
                       2049,130,2049,130,524545,0,130,524545,0,130,2049,144,1048838,2,1642241,10,7,25156,1247,167841793,
                       216,11,17826049,0,216,2,15,25,524546,190,134287105,217,118,2305,218,459023,226,134287361,217,221,
                       659201,216,10,659969,7,2049,58,25,17694978,58,242,9,84152833,48,319750404,241,117507601,244,184618754,45,
                       25,16974851,-1,168886532,1,134284289,1,257,134284289,0,244,660227,32,0,0,115,105,103,105,108,
                       58,100,0,285278479,274,6,2576,524546,104,1641217,1,167838467,271,2049,286,2049,282,524545,274,236,
                       58,105,0,285278479,274,6,2576,524546,104,1641217,1,167838467,271,2049,286,2049,282,524545,274,236,
                       17826050,273,0,2572,2563,2049,264,1793,156,459023,156,1793,312,17760513,168,3,192,8,251727617,3,
                       2,2049,182,16,168820993,-1,149,2049,182,2575,2049,236,17563906,0,326,9,1793,156,285282049,3,
                       2,134287105,149,323,524545,1793,130,16846593,3,0,130,8,659201,3,524545,28,135,17043201,3,13,


@@ 73,8 73,8 @@ CELL ngaImage[] = { 1793,25920,25908,25966,202301,415,387,1247,1535,0,11116,0,10
                       101,0,1171,92,168,502,6385574852,112,97,99,107,0,1181,78,168,502,6954102567431,117,110,112,
                       97,99,107,0,1191,186,168,502,7572226160734292,100,58,115,111,117,114,99,101,0,1203,188,
                       168,502,6953375310887,100,58,104,97,115,104,0,1217,387,168,502,-3366153855364863819,101,114,114,58,110,
                       111,116,102,111,117,110,100,0,100,114,111,112,0,0,99,101,0,118,101,0,
                       0,116,114,111,45,117,110,105,120,46,114,101,116,114,111,0,117,110,100,0,
                       111,116,102,111,117,110,100,0,105,109,97,103,101,58,115,97,118,101,0,103,
                       101,0,65,68,77,69,46,114,101,116,114,111,0,0,111,0,117,110,100,0,
                       99,107,101,116,115,46,0,50,46,49,47,83,79,67,75,69,84,83,46,109,
                       100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,


@@ 170,7 170,7 @@ CELL ngaImage[] = { 1793,25920,25908,25966,202301,415,387,1247,1535,0,11116,0,10
                       110,58,105,110,99,0,659713,1,10,3114,3139,168,16180,210720197721,110,58,100,101,99,0,
                       659969,1,10,3128,3158,168,16180,8246617666422322998,110,58,98,101,116,119,101,101,110,63,0,67503109,
                       1793,3166,67503109,67503109,2049,3106,10,1,3161,2049,2241,11,10,3142,3187,168,16180,249861296566813883,83,99,
                       111,112,101,76,105,115,116,0,25364,25765,10,3172,3198,168,16180,5864091,123,123,0,2049,
                       111,112,101,76,105,115,116,0,26268,26322,10,3172,3198,168,16180,5864091,123,123,0,2049,
                       1576,2,1,3187,2049,61,16,10,3190,3225,168,16180,-6305314778776785742,45,45,45,114,101,118,101,
                       97,108,45,45,45,0,2049,1576,1,3187,2049,3125,16,10,3207,3241,168,16180,5864159,125,
                       125,0,1,3187,2049,58,4,15,11,1793,3255,3841,3187,4097,2,10,1,3250,1793,3281,


@@ 228,7 228,7 @@ CELL ngaImage[] = { 1793,25920,25908,25966,202301,415,387,1247,1535,0,11116,0,10
                       10,4239,4297,156,16180,-4600587576916820603,84,101,109,112,83,116,114,105,110,103,115,0,32,4280,
                       4317,156,16180,7474516786580364824,84,101,109,112,83,116,114,105,110,103,77,97,120,0,512,4298,
                       4331,168,16180,229440420829967,83,84,82,73,78,71,83,0,2049,1545,3841,4297,3841,4317,19,18,
                       10,4318,4353,156,0,0,67,117,114,114,101,110,116,0,8,10,4340,4370,168,0,
                       10,4318,4353,156,0,0,67,117,114,114,101,110,116,0,22,10,4340,4370,168,0,
                       0,115,58,112,111,105,110,116,101,114,0,3841,4353,3841,4317,19,2049,4331,17,10,
                       4355,4391,168,0,0,115,58,110,101,120,116,0,1,4353,2049,3864,3841,4353,3841,4297,
                       11,1793,4407,1,0,4097,4353,10,1,4402,9,10,4318,4423,168,16180,6953962777192,115,58,116,


@@ 526,7 526,7 @@ CELL ngaImage[] = { 1793,25920,25908,25966,202301,415,387,1247,1535,0,11116,0,10
                       2229,2049,3125,10,1,10217,2049,2449,2049,415,10,10093,10266,168,16180,8246849872898570441,115,58,101,118,
                       97,108,117,97,116,101,0,2049,10158,2049,5573,2049,10158,2,2049,10182,2049,10215,10,10250,
                       10286,156,0,0,76,80,0,0,10278,10298,156,0,0,73,110,100,101,120,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,10287,10340,168,0,0,110,101,120,116,
                       0,3841,10286,1,10298,17,2049,3864,10,10330,10358,168,0,0,112,114,101,112,0,1,
                       10286,2049,3864,1,0,3841,10286,1,10298,17,16,10,10348,10381,168,0,0,100,111,110,


@@ 1309,4 1309,26 @@ CELL ngaImage[] = { 1793,25920,25908,25966,202301,415,387,1247,1535,0,11116,0,10
                       110,0,1,25874,2049,8246,2049,10761,10,25822,25920,168,25939,6953744547860,108,105,115,116,101,110,
                       0,3841,25376,1793,25927,2049,25834,10,1,25924,2049,74,2049,25760,2049,25778,1,25931,7,10,
                       105,110,116,101,114,102,97,99,101,47,114,101,116,114,111,45,117,110,105,120,
                       46,114,101,116,114,111,0,0 };
                       46,114,101,116,114,111,0,25908,25979,156,0,229441520490121,83,111,117,114,99,101,115,0,
                       1,26216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,25966,26119,168,0,6953711201841,107,110,111,119,110,63,0,
                       2,1,25979,2049,9003,10,26107,26136,168,0,210716136861,105,110,100,101,120,0,1,25979,4,
                       2049,9320,1,25979,4,2049,9140,10,26125,26159,168,0,6953974036516,114,101,99,111,114,100,0,
                       2049,4500,2,1,25979,2049,3864,3841,25979,1,25979,17,16,10,1793,26214,2049,15559,2049,26119,
                       1793,26184,2049,26136,10,1,26181,1793,26191,2049,26159,10,1,26188,2049,66,1793,26204,1,192,
                       1,2,17,8,10,1,26197,2049,2229,2049,1576,2049,186,16,10,1,26175,100,105,99,
                       116,45,119,111,114,100,115,45,108,105,115,116,105,110,103,46,102,111,114,116,
                       104,0,25908,26254,168,26216,229461403550098,100,58,119,111,114,100,115,0,1793,26263,2049,190,2049,
                       10761,2049,10731,10,1,26256,2049,8491,10,26241,26286,168,26216,-3502157631813457253,100,58,119,111,114,100,
                       115,45,119,105,116,104,0,2049,1977,2049,5573,1793,26317,2049,190,2,2049,1977,2049,5286,
                       1793,26306,2049,10761,2049,10731,10,1,26301,1793,26312,3,10,1,26310,2049,66,10,1,26292,
                       2049,8491,10,26268,26343,168,26216,2818131571306626127,100,105,115,112,108,97,121,45,105,102,45,108,
                       101,102,116,0,2,2049,1977,2049,5519,1793,26355,2049,10761,2049,10731,10,1,26350,1793,26361,
                       3,10,1,26359,2049,66,10,26268,26394,168,26216,2947807019553410009,100,58,119,111,114,100,115,45,
                       98,101,103,105,110,110,105,110,103,45,119,105,116,104,0,2049,1977,2049,5573,1793,
                       26405,2049,190,2049,26343,10,1,26400,2049,8491,10,0 };