~crc_/retroforth

51ec526a914a80577c4aed808cf237ffa6d9f6df — crc 5 days ago 56762ed
begin work to support unsigned math in retro/nga-c on unix

FossilOrigin-Name: 10b022b0f686fec959385f28290fd53c736b70d63afccc6737e17c053773fd12
2 files changed, 22 insertions(+), 7 deletions(-)

M vm/nga-c/image.c
M vm/nga-c/retro.c
M vm/nga-c/image.c => vm/nga-c/image.c +20 -6
@@ 10,8 10,8 @@
#define CELL_MAX LLONG_MAX - 1
#endif
#endif
CELL ngaImageCells = 16421;
CELL ngaImage[] = { 1793,16082,16377,16420,202110,405,377,1150,1535,0,10,1,10,2,10,3,10,4,10,
CELL ngaImageCells = 16713;
CELL ngaImage[] = { 1793,16082,16669,16712,202110,405,377,1150,1535,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,161,178,268505089,63,62,285281281,0,63,2063,10,101384453,0,9,10,68485378,255,18350338,


@@ 20,7 20,7 @@ CELL ngaImage[] = { 1793,16082,16377,16420,202110,405,377,1150,1535,0,10,1,10,2,
                       101777669,1,17565186,107,524545,111,64,167838467,-1,134287105,3,59,659457,3,459023,128,2049,56,25,2049,
                       128,1793,135,2049,135,117506307,0,128,0,524545,26,133,168820993,0,147,1642241,147,134283523,11,133,
                       1793,128,524545,2049,128,1793,128,16846593,147,161,178,1793,64,16846593,147,133,178,1793,64,7,
                       10,659713,1,659713,2,659713,3,659713,4,1793,16130,17108737,3,2,524559,128,2049,128,2049,128,
                       10,659713,1,659713,2,659713,3,659713,4,1793,16422,17108737,3,2,524559,128,2049,128,2049,128,
                       524545,0,128,2049,142,168820998,2,15345,1150,167841793,206,9,17826049,0,206,2,15,25,524546,186,
                       134287105,207,116,2305,208,459023,216,134287361,207,211,659201,206,10,659969,7,2049,56,25,17694978,58,
                       232,9,84152833,48,319750404,231,117507601,234,184618754,45,25,16974851,-1,168886532,1,134284289,1,247,134284289,0,


@@ 171,7 171,7 @@ CELL ngaImage[] = { 1793,16082,16377,16420,202110,405,377,1150,1535,0,10,1,10,2,
                       0,659713,1,10,3130,3153,166,14919,110,58,100,101,99,0,659969,1,10,3143,3171,166,
                       14919,110,58,98,101,116,119,101,101,110,63,0,67503109,1793,3179,67503109,67503109,2049,3122,10,
                       1,3174,2049,2203,11,10,3156,3199,166,14919,83,99,111,112,101,76,105,115,116,0,
                       16231,16309,10,3185,3209,166,14919,123,123,0,2049,1573,2,1,3199,2049,59,16,10,3202,
                       16523,16601,10,3185,3209,166,14919,123,123,0,2049,1573,2,1,3199,2049,59,16,10,3202,
                       3235,166,14919,45,45,45,114,101,118,101,97,108,45,45,45,0,2049,1573,1,3199,
                       2049,3140,16,10,3218,3250,166,14919,125,125,0,1,3199,2049,56,4,15,11,1793,3264,
                       3841,3199,4097,2,10,1,3259,1793,3290,3841,3199,1793,3285,1,2,983567,1,3199,2049,3140,


@@ 219,7 219,7 @@ CELL ngaImage[] = { 1793,16082,16377,16420,202110,405,377,1150,1535,0,10,1,10,2,
                       4114,154,14919,84,101,109,112,83,116,114,105,110,103,115,0,32,4098,4133,154,14919,
                       84,101,109,112,83,116,114,105,110,103,77,97,120,0,512,4115,4146,166,14919,83,
                       84,82,73,78,71,83,0,2049,1544,3841,4114,3841,4133,19,18,10,4134,4167,154,0,
                       67,117,114,114,101,110,116,0,2,10,4155,4183,166,0,115,58,112,111,105,110,
                       67,117,114,114,101,110,116,0,14,10,4155,4183,166,0,115,58,112,111,105,110,
                       116,101,114,0,3841,4167,3841,4133,19,2049,4146,17,10,4169,4203,166,0,115,58,110,
                       101,120,116,0,1,4167,2049,3701,3841,4167,3841,4114,11,1793,4219,1,0,4097,4167,10,
                       1,4214,9,10,4134,4234,166,14919,115,58,116,101,109,112,0,2,2049,102,2049,3140,


@@ 832,4 832,18 @@ CELL ngaImage[] = { 1793,16082,16377,16420,202110,405,377,1150,1535,0,10,1,10,2,
                       114,100,115,45,108,105,115,116,105,110,103,46,102,111,114,116,104,0,16231,16404,
                       166,16352,100,58,119,111,114,100,115,45,98,101,103,105,110,110,105,110,103,45,
                       119,105,116,104,0,2049,1953,2049,5346,1793,16415,2049,186,2049,16329,10,1,16410,2049,8364,
                       10,0 };
                       10,1793,16445,2049,14765,2049,4308,1793,16435,1,188,1,2,17,8,10,1,16428,2049,2192,
                       2049,1573,2049,184,16,10,1,16422,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,16377,16484,166,16447,100,58,119,
                       111,114,100,115,0,1793,16493,2049,186,2049,10213,2049,10185,10,1,16486,2049,8364,10,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,16472,16540,166,16498,100,58,119,111,114,100,115,45,119,105,116,104,
                       0,2049,1953,2049,5346,1793,16571,2049,186,2,2049,1953,2049,4849,1793,16560,2049,10213,2049,10185,
                       10,1,16555,1793,16566,3,10,1,16564,2049,64,10,1,16546,2049,8364,10,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,16523,16621,166,16576,100,105,115,112,108,97,121,45,105,102,45,108,101,102,
                       116,0,2,2049,1953,2049,5294,1793,16633,2049,10213,2049,10185,10,1,16628,1793,16639,3,10,
                       1,16637,2049,64,10,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,16523,16696,166,16644,100,58,119,111,114,100,
                       115,45,98,101,103,105,110,110,105,110,103,45,119,105,116,104,0,2049,1953,2049,
                       5346,1793,16707,2049,186,2049,16621,10,1,16702,2049,8364,10,0 };

M vm/nga-c/retro.c => vm/nga-c/retro.c +2 -1
@@ 162,7 162,7 @@ CELL memory[IMAGE_SIZE + 1];      /* The memory for the image          */
#define TORS cpu[active].address[cpu[active].rp]  /* Top item on address stack */

struct NgaCore {
  CELL sp, rp, ip, active;        /* Stack & instruction pointers      */
  CELL sp, rp, ip, active, u;     /* Stack & instruction pointers      */
  CELL data[STACK_DEPTH];         /* The data stack                    */
  CELL address[ADDRESSES];        /* The address stack                 */
#ifdef ENABLE_MULTICORE


@@ 230,6 230,7 @@ void init_core(CELL x) {
  cpu[x].rp = 0;
  cpu[x].ip = 0;
  cpu[x].active = 0;
  cpu[x].u = 0;
  for (y = 0; y < STACK_DEPTH; y++) { cpu[x].data[y] = 0; };
  for (y = 0; y < ADDRESSES; y++) { cpu[x].address[y] = 0; };
  for (y = 0; y < 24; y++) { cpu[x].registers[y] = 0; };