~crc_/retroforth

45f3f7931e3e8b21195fff04b104f3432786a06d — crc 5 days ago 8f5241b
initial unsigned support is working

FossilOrigin-Name: 1853c8a951e005c9ea4d923a8ffbc3394d2554c9cca71d97afb7ffb387bea3d6
5 files changed, 127 insertions(+), 105 deletions(-)

M GNUmakefile
M Makefile
A interface/unsigned.retro
M vm/nga-c/image.c
M vm/nga-c/retro.c
M GNUmakefile => GNUmakefile +2 -0
@@ 26,6 26,7 @@ ENABLED += -DENABLE_SCRIPTING
ENABLED += -DENABLE_SIGNALS
ENABLED += -DENABLE_MULTICORE
# ENABLED += -DENABLE_FFI
ENABLED += -DENABLE_UNSIGNED

ENABLED += -DNEEDS_STRL



@@ 40,6 41,7 @@ DEVICES += interface/scripting.retro
DEVICES += interface/sources.retro
# DEVICES += interface/multicore.retro
DEVICES += interface/deprecated.retro
DEVICES += interface/unsigned.retro

all: build


M Makefile => Makefile +2 -0
@@ 22,6 22,7 @@ ENABLED += -DENABLE_SCRIPTING
ENABLED += -DENABLE_SIGNALS
ENABLED += -DENABLE_MULTICORE
ENABLED += -DENABLE_FFI
ENABLED += -DENABLE_UNSIGNED

DEVICES ?=
DEVICES += interface/floatingpoint.retro


@@ 33,6 34,7 @@ DEVICES += interface/scripting.retro
# DEVICES += interface/sockets.retro
DEVICES += interface/sources.retro
DEVICES += interface/multicore.retro
DEVICES += interface/unsigned.retro
DEVICES += interface/deprecated.retro

all: build

A interface/unsigned.retro => interface/unsigned.retro +13 -0
@@ 0,0 1,13 @@
# Unsigned Numbers

~~~
:unsigned:+ (nn-n) #8101 io:scan-for io:invoke \ad...... ;
:unsigned:- (nn-n) #8101 io:scan-for io:invoke \su...... ;
:unsigned:* (nn-n) #8101 io:scan-for io:invoke \mu...... ;
:unsigned:/mod (nn-nn) #8101 io:scan-for io:invoke \di...... ;
:unsigned:eq? (nn-f) #8101 io:scan-for io:invoke \eq...... ;
:unsigned:-eq? (nn-f) #8101 io:scan-for io:invoke \ne...... ;
:unsigned:lt? (nn-f) #8101 io:scan-for io:invoke \lt...... ;
:unsigned:gt? (nn-f) #8101 io:scan-for io:invoke \gt...... ;
:unsigned:shift (nn-n) #8101 io:scan-for io:invoke \sh...... ;
~~~

M vm/nga-c/image.c => vm/nga-c/image.c +83 -101
@@ 10,8 10,8 @@
#define CELL_MAX LLONG_MAX - 1
#endif
#endif
CELL ngaImageCells = 17005;
CELL ngaImage[] = { 1793,16082,16961,17004,202110,405,377,1150,1535,0,10,1,10,2,10,3,10,4,10,
CELL ngaImageCells = 16644;
CELL ngaImage[] = { 1793,16305,16600,16643,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,8 20,8 @@ CELL ngaImage[] = { 1793,16082,16961,17004,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,16714,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,
                       10,659713,1,659713,2,659713,3,659713,4,1793,16353,17108737,3,2,524559,128,2049,128,2049,128,
                       524545,0,128,2049,142,168820998,2,15568,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,
                       234,660227,32,0,0,115,105,103,105,108,58,105,0,285278479,264,6,2576,524546,102,1641217,


@@ 171,7 171,7 @@ CELL ngaImage[] = { 1793,16082,16961,17004,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,
                       16815,16893,10,3185,3209,166,14919,123,123,0,2049,1573,2,1,3199,2049,59,16,10,3202,
                       16454,16532,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,16961,17004,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,26,10,4155,4183,166,0,115,58,112,111,105,110,
                       67,117,114,114,101,110,116,0,2,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,


@@ 501,7 501,7 @@ CELL ngaImage[] = { 1793,16082,16961,17004,202110,405,377,1150,1535,0,10,1,10,2,
                       2049,6884,4,1793,9756,2,2049,102,2049,2774,1,405,1,15,2049,64,10,1,9744,2049,
                       2192,2049,3140,10,1,9737,2049,2495,2049,405,10,9625,9785,166,14919,115,58,101,118,97,
                       108,117,97,116,101,0,2049,9680,2049,5346,2049,9680,2,2049,9703,2049,9735,10,9770,9804,
                       154,0,76,80,0,0,9797,9815,154,0,73,110,100,101,120,0,0,11,0,0,
                       154,0,76,80,0,0,9797,9815,154,0,73,110,100,101,120,0,0,12,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,9805,9856,166,0,110,101,120,116,0,3841,9804,1,
                       9815,17,2049,3701,10,9847,9873,166,0,112,114,101,112,0,1,9804,2049,3701,1,0,


@@ 767,98 767,80 @@ CELL ngaImage[] = { 1793,16082,16961,17004,202110,405,377,1150,1535,0,10,1,10,2,
                       15076,166,15105,99,111,114,101,58,114,101,97,100,47,114,101,103,0,1,5,2049,
                       14943,10,15058,15100,166,15105,99,111,114,101,58,119,114,105,116,101,47,114,101,103,
                       0,1,6,2049,14943,10,105,110,116,101,114,102,97,99,101,47,109,117,108,116,
                       105,99,111,114,101,46,114,101,116,114,111,0,15081,15143,166,0,115,58,115,112,
                       108,105,116,0,2049,6884,10,15131,15168,166,0,115,58,115,112,108,105,116,45,111,
                       110,45,115,116,114,105,110,103,0,2049,6917,10,15146,15192,166,0,115,58,99,111,
                       110,116,97,105,110,115,45,99,104,97,114,63,0,2049,4645,10,15171,15218,166,0,
                       115,58,99,111,110,116,97,105,110,115,45,115,116,114,105,110,103,63,0,2049,
                       4849,10,15195,15244,166,0,97,58,99,111,110,116,97,105,110,115,45,115,116,114,
                       105,110,103,63,0,2049,8862,10,15221,15262,166,0,97,58,105,110,100,101,120,45,
                       111,102,0,2049,9097,10,15247,15287,166,0,97,58,105,110,100,101,120,45,111,102,
                       45,115,116,114,105,110,103,0,2049,9134,10,15265,15305,166,0,115,58,105,110,100,
                       101,120,45,111,102,0,2049,4578,10,15290,15330,166,0,115,58,105,110,100,101,120,
                       45,111,102,45,115,116,114,105,110,103,0,2049,5066,10,15308,15341,166,16101,84,73,
                       66,0,1,7,15,10,15333,15360,166,16101,105,109,97,103,101,58,115,97,118,101,
                       0,1,1000,2049,10112,2049,10094,10,15345,15377,166,0,101,100,105,116,63,0,2,1793,
                       15384,1,8,11,10,1,15380,1793,15392,1,127,11,10,1,15388,2049,2216,22,10,15367,
                       15409,166,0,103,97,116,104,101,114,0,2049,15377,1,15,1,3957,2049,64,10,15398,
                       15428,166,0,99,121,99,108,101,0,2049,10428,2049,2181,4,8,2049,2684,25,3,2049,
                       15409,1,15428,7,10,15345,15460,166,16101,112,97,114,115,101,45,117,110,116,105,108,
                       0,1793,15472,2049,4261,2049,4053,2049,15428,771,2049,3921,10,1,15462,2049,4078,10,15444,15487,
                       166,16101,115,58,103,101,116,0,1793,15509,1793,15495,1,13,11,10,1,15491,1793,15503,
                       1,10,11,10,1,15499,2049,2216,22,10,1,15489,2049,15460,10,15477,15524,166,16101,99,
                       108,101,97,114,0,2049,4281,92,94,91,50,74,92,94,91,48,59,48,72,0,
                       1,15526,2049,8127,2049,10213,10,15514,15557,154,16101,78,111,69,99,104,111,0,0,15546,
                       15566,154,0,69,79,84,0,0,15558,15580,154,0,73,103,110,111,114,105,110,103,
                       0,0,15567,15595,166,0,105,103,110,111,114,105,110,103,63,0,3841,15580,10,15581,
                       15610,166,0,118,101,114,115,105,111,110,0,3841,4,1,100,20,10,15598,15626,166,
                       0,100,111,110,101,63,0,2,4097,15566,1793,15635,1,13,11,10,1,15631,1793,15643,
                       1,10,11,10,1,15639,1793,15651,1,32,11,10,1,15647,2049,2256,22,22,10,15616,
                       15667,166,0,101,111,108,63,0,3841,15566,1793,15675,1,13,11,10,1,15671,1793,15683,
                       1,10,11,10,1,15679,2049,2216,22,10,15658,15700,166,0,118,97,108,105,100,63,
                       0,2,2049,102,2049,2843,10,15689,15720,166,0,99,104,101,99,107,45,101,111,102,
                       0,2,1793,15727,1,-1,11,10,1,15723,1793,15735,1,4,11,10,1,15731,2049,2216,
                       22,1793,15745,2049,10493,10,1,15742,9,10,15706,15756,166,0,98,115,0,2049,4032,1,
                       2,2049,2713,1793,15768,2049,3982,3,10,1,15764,9,2049,3982,3,10,15749,15788,166,0,
                       99,104,101,99,107,45,98,115,0,2,1793,15795,1,8,11,10,1,15791,1793,15803,
                       1,127,11,10,1,15799,2049,2216,22,1793,15813,2049,15756,10,1,15810,9,10,15775,15827,
                       166,0,99,104,101,99,107,0,2049,15720,2049,15788,10,15817,15846,166,0,99,104,97,
                       114,97,99,116,101,114,0,2049,10428,2,2049,3957,10,15832,15863,166,0,98,117,102,
                       102,101,114,0,1793,15873,2049,15341,2049,4053,8,2049,3921,10,1,15865,2049,4078,10,15852,
                       15893,166,0,114,101,97,100,45,116,111,107,101,110,0,1793,15909,1793,15904,2049,15846,
                       2049,15827,2049,15626,10,1,15897,2049,2445,10,1,15895,2049,15863,2049,4391,10,15878,15926,166,
                       0,105,110,112,117,116,0,2049,15893,2049,15700,10,15916,15943,166,0,112,114,111,99,
                       101,115,115,0,2049,15595,1793,15961,771,2049,15667,1793,15957,1,15580,2049,3764,10,1,15952,
                       9,10,1,15947,2049,2890,1,405,1,15,2049,64,10,15546,15979,178,16101,47,47,0,
                       2049,14828,1,15580,2049,3750,10,15972,15997,166,16101,98,97,110,110,101,114,0,2049,15610,
                       2049,4281,82,69,84,82,79,32,49,50,32,40,37,110,46,37,110,41,92,110,
                       0,1,16001,2049,8127,2049,10213,2049,10285,2049,1544,2049,10285,18,2049,1544,2049,4281,37,110,
                       32,77,97,120,44,32,37,110,32,85,115,101,100,44,32,37,110,32,70,114,
                       101,101,92,110,0,1,16037,2049,8127,2049,10213,10,15986,16082,166,16101,108,105,115,116,
                       101,110,0,3841,15557,1793,16089,2049,15997,10,1,16086,2049,72,2049,15926,2049,15943,1,16093,
                       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,1793,16153,2049,14765,2049,4308,1793,16143,1,188,1,
                       2,17,8,10,1,16136,2049,2192,2049,1573,2049,184,16,10,1,16130,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,16071,16192,166,16155,100,58,119,111,114,100,115,0,1793,16201,2049,186,2049,10213,2049,
                       10185,10,1,16194,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,16180,16248,166,16206,100,58,119,111,
                       114,100,115,45,119,105,116,104,0,2049,1953,2049,5346,1793,16279,2049,186,2,2049,1953,
                       2049,4849,1793,16268,2049,10213,2049,10185,10,1,16263,1793,16274,3,10,1,16272,2049,64,10,
                       1,16254,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,16231,16329,166,16284,100,105,115,112,108,97,
                       121,45,105,102,45,108,101,102,116,0,2,2049,1953,2049,5294,1793,16341,2049,10213,2049,
                       10185,10,1,16336,1793,16347,3,10,1,16345,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,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,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,111,114,101,46,114,101,116,114,111,0,15081,15146,166,0,117,110,115,105,
                       103,110,101,100,58,43,0,1,8101,2049,10112,2049,10094,17,10,15131,15169,166,0,117,
                       110,115,105,103,110,101,100,58,45,0,1,8101,2049,10112,2049,10094,18,10,15154,15192,
                       166,0,117,110,115,105,103,110,101,100,58,42,0,1,8101,2049,10112,2049,10094,19,
                       10,15177,15218,166,0,117,110,115,105,103,110,101,100,58,47,109,111,100,0,1,
                       8101,2049,10112,2049,10094,20,10,15200,15243,166,0,117,110,115,105,103,110,101,100,58,
                       101,113,63,0,1,8101,2049,10112,2049,10094,11,10,15226,15269,166,0,117,110,115,105,
                       103,110,101,100,58,45,101,113,63,0,1,8101,2049,10112,2049,10094,12,10,15251,15294,
                       166,0,117,110,115,105,103,110,101,100,58,108,116,63,0,1,8101,2049,10112,2049,
                       10094,13,10,15277,15319,166,0,117,110,115,105,103,110,101,100,58,103,116,63,0,
                       1,8101,2049,10112,2049,10094,14,10,15302,15346,166,0,117,110,115,105,103,110,101,100,
                       58,115,104,105,102,116,0,1,8101,2049,10112,2049,10094,24,10,15327,15366,166,0,115,
                       58,115,112,108,105,116,0,2049,6884,10,15354,15391,166,0,115,58,115,112,108,105,
                       116,45,111,110,45,115,116,114,105,110,103,0,2049,6917,10,15369,15415,166,0,115,
                       58,99,111,110,116,97,105,110,115,45,99,104,97,114,63,0,2049,4645,10,15394,
                       15441,166,0,115,58,99,111,110,116,97,105,110,115,45,115,116,114,105,110,103,
                       63,0,2049,4849,10,15418,15467,166,0,97,58,99,111,110,116,97,105,110,115,45,
                       115,116,114,105,110,103,63,0,2049,8862,10,15444,15485,166,0,97,58,105,110,100,
                       101,120,45,111,102,0,2049,9097,10,15470,15510,166,0,97,58,105,110,100,101,120,
                       45,111,102,45,115,116,114,105,110,103,0,2049,9134,10,15488,15528,166,0,115,58,
                       105,110,100,101,120,45,111,102,0,2049,4578,10,15513,15553,166,0,115,58,105,110,
                       100,101,120,45,111,102,45,115,116,114,105,110,103,0,2049,5066,10,15531,15564,166,
                       16324,84,73,66,0,1,7,15,10,15556,15583,166,16324,105,109,97,103,101,58,115,
                       97,118,101,0,1,1000,2049,10112,2049,10094,10,15568,15600,166,0,101,100,105,116,63,
                       0,2,1793,15607,1,8,11,10,1,15603,1793,15615,1,127,11,10,1,15611,2049,2216,
                       22,10,15590,15632,166,0,103,97,116,104,101,114,0,2049,15600,1,15,1,3957,2049,
                       64,10,15621,15651,166,0,99,121,99,108,101,0,2049,10428,2049,2181,4,8,2049,2684,
                       25,3,2049,15632,1,15651,7,10,15568,15683,166,16324,112,97,114,115,101,45,117,110,
                       116,105,108,0,1793,15695,2049,4261,2049,4053,2049,15651,771,2049,3921,10,1,15685,2049,4078,
                       10,15667,15710,166,16324,115,58,103,101,116,0,1793,15732,1793,15718,1,13,11,10,1,
                       15714,1793,15726,1,10,11,10,1,15722,2049,2216,22,10,1,15712,2049,15683,10,15700,15747,
                       166,16324,99,108,101,97,114,0,2049,4281,92,94,91,50,74,92,94,91,48,59,
                       48,72,0,1,15749,2049,8127,2049,10213,10,15737,15780,154,16324,78,111,69,99,104,111,
                       0,0,15769,15789,154,0,69,79,84,0,0,15781,15803,154,0,73,103,110,111,114,
                       105,110,103,0,0,15790,15818,166,0,105,103,110,111,114,105,110,103,63,0,3841,
                       15803,10,15804,15833,166,0,118,101,114,115,105,111,110,0,3841,4,1,100,20,10,
                       15821,15849,166,0,100,111,110,101,63,0,2,4097,15789,1793,15858,1,13,11,10,1,
                       15854,1793,15866,1,10,11,10,1,15862,1793,15874,1,32,11,10,1,15870,2049,2256,22,
                       22,10,15839,15890,166,0,101,111,108,63,0,3841,15789,1793,15898,1,13,11,10,1,
                       15894,1793,15906,1,10,11,10,1,15902,2049,2216,22,10,15881,15923,166,0,118,97,108,
                       105,100,63,0,2,2049,102,2049,2843,10,15912,15943,166,0,99,104,101,99,107,45,
                       101,111,102,0,2,1793,15950,1,-1,11,10,1,15946,1793,15958,1,4,11,10,1,
                       15954,2049,2216,22,1793,15968,2049,10493,10,1,15965,9,10,15929,15979,166,0,98,115,0,
                       2049,4032,1,2,2049,2713,1793,15991,2049,3982,3,10,1,15987,9,2049,3982,3,10,15972,
                       16011,166,0,99,104,101,99,107,45,98,115,0,2,1793,16018,1,8,11,10,1,
                       16014,1793,16026,1,127,11,10,1,16022,2049,2216,22,1793,16036,2049,15979,10,1,16033,9,
                       10,15998,16050,166,0,99,104,101,99,107,0,2049,15943,2049,16011,10,16040,16069,166,0,
                       99,104,97,114,97,99,116,101,114,0,2049,10428,2,2049,3957,10,16055,16086,166,0,
                       98,117,102,102,101,114,0,1793,16096,2049,15564,2049,4053,8,2049,3921,10,1,16088,2049,
                       4078,10,16075,16116,166,0,114,101,97,100,45,116,111,107,101,110,0,1793,16132,1793,
                       16127,2049,16069,2049,16050,2049,15849,10,1,16120,2049,2445,10,1,16118,2049,16086,2049,4391,10,
                       16101,16149,166,0,105,110,112,117,116,0,2049,16116,2049,15923,10,16139,16166,166,0,112,
                       114,111,99,101,115,115,0,2049,15818,1793,16184,771,2049,15890,1793,16180,1,15803,2049,3764,
                       10,1,16175,9,10,1,16170,2049,2890,1,405,1,15,2049,64,10,15769,16202,178,16324,
                       47,47,0,2049,14828,1,15803,2049,3750,10,16195,16220,166,16324,98,97,110,110,101,114,
                       0,2049,15833,2049,4281,82,69,84,82,79,32,49,50,32,40,37,110,46,37,110,
                       41,92,110,0,1,16224,2049,8127,2049,10213,2049,10285,2049,1544,2049,10285,18,2049,1544,2049,
                       4281,37,110,32,77,97,120,44,32,37,110,32,85,115,101,100,44,32,37,110,
                       32,70,114,101,101,92,110,0,1,16260,2049,8127,2049,10213,10,16209,16305,166,16324,108,
                       105,115,116,101,110,0,3841,15780,1793,16312,2049,16220,10,1,16309,2049,72,2049,16149,2049,
                       16166,1,16316,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,1793,16376,2049,14765,2049,4308,1793,16366,
                       1,188,1,2,17,8,10,1,16359,2049,2192,2049,1573,2049,184,16,10,1,16353,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,1793,16737,2049,14765,2049,4308,1793,
                       16727,1,188,1,2,17,8,10,1,16720,2049,2192,2049,1573,2049,184,16,10,1,16714,
                       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,16669,16776,166,16739,100,58,119,111,114,100,115,0,1793,16785,2049,
                       186,2049,10213,2049,10185,10,1,16778,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,16764,16832,166,16790,
                       100,58,119,111,114,100,115,45,119,105,116,104,0,2049,1953,2049,5346,1793,16863,2049,
                       186,2,2049,1953,2049,4849,1793,16852,2049,10213,2049,10185,10,1,16847,1793,16858,3,10,1,
                       16856,2049,64,10,1,16838,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,16815,16913,166,16868,100,105,
                       115,112,108,97,121,45,105,102,45,108,101,102,116,0,2,2049,1953,2049,5294,1793,
                       16925,2049,10213,2049,10185,10,1,16920,1793,16931,3,10,1,16929,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,16815,16988,166,16936,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,16999,2049,186,2049,16913,10,
                       1,16994,2049,8364,10,0 };
                       114,116,104,0,16294,16415,166,16378,100,58,119,111,114,100,115,0,1793,16424,2049,186,
                       2049,10213,2049,10185,10,1,16417,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,16403,16471,166,16429,100,
                       58,119,111,114,100,115,45,119,105,116,104,0,2049,1953,2049,5346,1793,16502,2049,186,
                       2,2049,1953,2049,4849,1793,16491,2049,10213,2049,10185,10,1,16486,1793,16497,3,10,1,16495,
                       2049,64,10,1,16477,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,16454,16552,166,16507,100,105,115,
                       112,108,97,121,45,105,102,45,108,101,102,116,0,2,2049,1953,2049,5294,1793,16564,
                       2049,10213,2049,10185,10,1,16559,1793,16570,3,10,1,16568,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,16454,16627,166,16575,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,16638,2049,186,2049,16552,10,1,
                       16633,2049,8364,10,0 };

M vm/nga-c/retro.c => vm/nga-c/retro.c +27 -4
@@ 114,6 114,7 @@ void query_filesystem();    void io_filesystem();
void io_clock();            void query_clock();
void io_scripting();        void query_scripting();
void io_rng();              void query_rng();
void io_unsigned();         void query_unsigned();

#ifdef ENABLE_UNIX
void query_unix();          void io_unix();


@@ 1300,6 1301,19 @@ void query_keyboard() {

/*=====================================================================*/

#ifdef ENABLE_UNSIGNED
void io_unsigned() {
  cpu[active].u = 1;
}

void query_unsigned() {
  stack_push(0);
  stack_push(8101);
}
#endif

/*=====================================================================*/

void io_image() {
  FILE *fp;
  char *f = string_extract(stack_pop());


@@ 1786,6 1800,9 @@ int main(int argc, char **argv) {
  nlibs = 0;
  nffi = 0;
#endif
#ifdef ENABLE_UNSIGNED
  register_device(io_unsigned, query_unsigned);
#endif

  strcpy(code_start, "~~~");
  strcpy(code_end,   "~~~");


@@ 2062,6 2079,7 @@ void inst_re() {
void inst_eq() {
  if (cpu[active].u != 0) {
    NOS = ((unsigned)NOS == (unsigned)TOS) ? -1 : 0;
    cpu[active].u = 0;
  } else {
    NOS = (NOS == TOS) ? -1 : 0;
  }


@@ 2071,6 2089,7 @@ void inst_eq() {
void inst_ne() {
  if (cpu[active].u != 0) {
    NOS = ((unsigned)NOS != (unsigned)TOS) ? -1 : 0;
    cpu[active].u = 0;
  } else {
    NOS = (NOS != TOS) ? -1 : 0;
  }


@@ 2080,6 2099,7 @@ void inst_ne() {
void inst_lt() {
  if (cpu[active].u != 0) {
    NOS = ((unsigned)NOS < (unsigned)TOS) ? -1 : 0;
    cpu[active].u = 0;
  } else {
    NOS = (NOS < TOS) ? -1 : 0;
  }


@@ 2089,6 2109,7 @@ void inst_lt() {
void inst_gt() {
  if (cpu[active].u != 0) {
    NOS = ((unsigned)NOS > (unsigned)TOS) ? -1 : 0;
    cpu[active].u = 0;
  } else {
    NOS = (NOS > TOS) ? -1 : 0;
  }


@@ 2115,6 2136,7 @@ void inst_st() {
void inst_ad() {
  if (cpu[active].u != 0) {
    NOS = (unsigned)NOS + (unsigned)TOS;
    cpu[active].u = 0;
  } else {
    NOS += TOS;
  }


@@ 2124,6 2146,7 @@ void inst_ad() {
void inst_su() {
  if (cpu[active].u != 0) {
    NOS = (unsigned)NOS - (unsigned)TOS;
    cpu[active].u = 0;
  } else {
    NOS -= TOS;
  }


@@ 2133,6 2156,7 @@ void inst_su() {
void inst_mu() {
  if (cpu[active].u != 0) {
    NOS = (unsigned)NOS * (unsigned)TOS;
    cpu[active].u = 0;
  } else {
    NOS *= TOS;
  }


@@ 2146,6 2170,7 @@ void inst_di() {
  if (cpu[active].u != 0) {
    TOS = (unsigned)b / (unsigned)a;
    NOS = (unsigned)b % (unsigned)a;
    cpu[active].u = 0;
  } else {
    TOS = b / a;
    NOS = b % a;


@@ 2174,10 2199,8 @@ void inst_sh() {
    NOS = NOS << (0 - TOS);
  else {
    if (cpu[active].u != 0) {
      if (x < 0 && y > 0)
        NOS = (unsigned)x >> (unsigned)y | ~(~0U >> (unsigned)y);
      else
        NOS = (unsigned)x >> (unsigned)y;
      NOS = (unsigned)x >> (unsigned)y;
      cpu[active].u = 0;
    } else {
      if (x < 0 && y > 0)
        NOS = x >> y | ~(~0U >> y);