begin some work towards adding double: math words

FossilOrigin-Name: 7a90684819936bb43566c40119d14e13d4bc130ccd638fdae478fc3997043966
This commit is contained in:
crc 2022-08-10 17:48:20 +00:00
parent 34c7ffbf53
commit 264faf4ef5
3 changed files with 74 additions and 7 deletions

View file

@ -125,3 +125,5 @@ Thanks go out to my current and past patrons:
- Nuno
- Eli
- Brad S
- Tobias Ammann

View file

@ -10,8 +10,8 @@
#define CELL_MAX LLONG_MAX - 1
#endif
#endif
CELL ngaImageCells = 18957;
CELL ngaImage[] = { 1793,18464,18912,18956,202207,410,382,1242,1535,0,10,1,10,2,10,3,10,4,10,
CELL ngaImageCells = 19871;
CELL ngaImage[] = { 1793,18464,19826,19870,202207,410,382,1242,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,18464,18912,18956,202207,410,382,1242,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,659713,5,1793,18719,17108737,3,2,524559,128,2049,128,
10,659713,1,659713,2,659713,3,659713,4,659713,5,1793,19633,17108737,3,2,524559,128,2049,128,
2049,128,524545,0,128,524545,0,128,2049,142,168820998,2,17700,1242,167841793,211,9,17826049,0,211,
2,15,25,524546,188,134287105,212,116,2305,213,459023,221,134287361,212,216,659201,211,10,659969,7,
2049,56,25,17694978,58,237,9,84152833,48,319750404,236,117507601,239,184618754,45,25,16974851,-1,168886532,1,
@ -170,7 +170,7 @@ CELL ngaImage[] = { 1793,18464,18912,18956,202207,410,382,1242,1535,0,10,1,10,2,
110,58,105,110,99,0,659713,1,10,3114,3139,166,16136,266800217,110,58,100,101,99,0,
659969,1,10,3128,3158,166,16136,1032861494,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,166,16136,-2130983749,83,99,
111,112,101,76,105,115,116,0,18814,18868,10,3172,3198,166,16136,5864091,123,123,0,2049,
111,112,101,76,105,115,116,0,19728,19782,10,3172,3198,166,16136,5864091,123,123,0,2049,
1576,2,1,3187,2049,59,16,10,3190,3225,166,16136,-1644352334,45,45,45,114,101,118,101,
97,108,45,45,45,0,2049,1576,1,3187,2049,3125,16,10,3207,3241,166,16136,5864159,125,
125,0,1,3187,2049,56,4,15,11,1793,3255,3841,3187,4097,2,10,1,3250,1793,3281,
@ -228,7 +228,7 @@ CELL ngaImage[] = { 1793,18464,18912,18956,202207,410,382,1242,1535,0,10,1,10,2,
10,4239,4297,154,16136,1204567429,84,101,109,112,83,116,114,105,110,103,115,0,32,4280,
4317,154,16136,1808866840,84,101,109,112,83,116,114,105,110,103,77,97,120,0,512,4298,
4331,166,16136,-1027089649,83,84,82,73,78,71,83,0,2049,1545,3841,4297,3841,4317,19,18,
10,4318,4353,154,0,0,67,117,114,114,101,110,116,0,16,10,4340,4370,166,0,
10,4318,4353,154,0,0,67,117,114,114,101,110,116,0,20,10,4340,4370,166,0,
0,115,58,112,111,105,110,116,101,114,0,3841,4353,3841,4317,19,2049,4331,17,10,
4355,4391,166,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,166,16136,410724968,115,58,116,
@ -937,7 +937,7 @@ CELL ngaImage[] = { 1793,18464,18912,18956,202207,410,382,1242,1535,0,10,1,10,2,
115,116,101,110,0,3841,17920,1793,18471,2049,18378,10,1,18468,2049,72,2049,18304,2049,18322,
1,18475,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,18452,18523,154,0,0,83,111,117,114,
99,101,115,0,1,18762,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
99,101,115,0,2,18762,18956,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,
@ -958,4 +958,50 @@ CELL ngaImage[] = { 1793,18464,18912,18956,202207,410,382,1242,1535,0,10,1,10,2,
121,45,105,102,45,108,101,102,116,0,2,2049,1977,2049,5519,1793,18901,2049,10761,2049,
10731,10,1,18896,1793,18907,3,10,1,18905,2049,64,10,18814,18940,166,18762,-1159574567,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,18951,2049,188,2049,18889,10,1,18946,2049,8491,10,0 };
0,2049,1977,2049,5573,1793,18951,2049,188,2049,18889,10,1,18946,2049,8491,10,108,105,115,
116,46,102,111,114,116,104,0,18912,18980,154,18956,72570505,83,111,117,114,99,101,115,
0,2,19219,19413,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,18967,19120,166,18956,159149617,107,110,111,119,110,63,
0,2,1,18980,2049,9003,10,19108,19137,166,18956,262739357,105,110,100,101,120,0,1,18980,
4,2049,9320,1,18980,4,2049,9140,10,19126,19160,166,18956,421984292,114,101,99,111,114,100,
0,2049,4500,2,1,18980,2049,3864,3841,18980,1,18980,17,16,10,1793,19217,2049,15559,2049,
19120,1793,19185,2049,19137,10,1,19182,1793,19192,2049,19160,10,1,19189,2049,64,1793,19205,1,
190,1,2,17,8,10,1,19198,2049,2229,2049,1576,2049,184,16,2049,11116,10,1,19176,
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,18912,19257,166,19219,-1519205998,100,58,119,111,114,100,115,0,1793,19266,
2049,188,2049,10761,2049,10731,10,1,19259,2049,8491,10,19244,19289,166,19219,1750461083,100,58,119,
111,114,100,115,45,119,105,116,104,0,2049,1977,2049,5573,1793,19320,2049,188,2,2049,
1977,2049,5286,1793,19309,2049,10761,2049,10731,10,1,19304,1793,19315,3,10,1,19313,2049,64,
10,1,19295,2049,8491,10,19271,19346,166,19219,-1509196721,100,105,115,112,108,97,121,45,105,
102,45,108,101,102,116,0,2,2049,1977,2049,5519,1793,19358,2049,10761,2049,10731,10,1,
19353,1793,19364,3,10,1,19362,2049,64,10,19271,19397,166,19219,-1159574567,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,19408,2049,188,2049,19346,10,1,19403,2049,8491,10,108,105,115,116,46,102,
111,114,116,104,0,19369,19437,154,19413,72570505,83,111,117,114,99,101,115,0,1,19676,
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,19424,19577,166,19413,159149617,107,110,111,119,110,63,0,2,1,
19437,2049,9003,10,19565,19594,166,19413,262739357,105,110,100,101,120,0,1,19437,4,2049,9320,
1,19437,4,2049,9140,10,19583,19617,166,19413,421984292,114,101,99,111,114,100,0,2049,4500,
2,1,19437,2049,3864,3841,19437,1,19437,17,16,10,1793,19674,2049,15559,2049,19577,1793,19642,
2049,19594,10,1,19639,1793,19649,2049,19617,10,1,19646,2049,64,1793,19662,1,190,1,2,
17,8,10,1,19655,2049,2229,2049,1576,2049,184,16,2049,11116,10,1,19633,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,19369,19714,166,19676,-1519205998,100,58,119,111,114,100,115,0,1793,19723,2049,188,2049,
10761,2049,10731,10,1,19716,2049,8491,10,19701,19746,166,19676,1750461083,100,58,119,111,114,100,
115,45,119,105,116,104,0,2049,1977,2049,5573,1793,19777,2049,188,2,2049,1977,2049,5286,
1793,19766,2049,10761,2049,10731,10,1,19761,1793,19772,3,10,1,19770,2049,64,10,1,19752,
2049,8491,10,19728,19803,166,19676,-1509196721,100,105,115,112,108,97,121,45,105,102,45,108,
101,102,116,0,2,2049,1977,2049,5519,1793,19815,2049,10761,2049,10731,10,1,19810,1793,19821,
3,10,1,19819,2049,64,10,19728,19854,166,19676,-1159574567,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,
19865,2049,188,2049,19803,10,1,19860,2049,8491,10,0 };

View file

@ -238,6 +238,25 @@ typedef union {
};
} double_cell;
void double_add(NgaState *vm) {
double_cell a;
double_cell b;
double_cell c;
b.msw = stack_pop(vm);
b.lsw = stack_pop(vm);
a.msw = stack_pop(vm);
a.lsw = stack_pop(vm);
}
void double_sub(NgaState *vm) {
}
void double_mul(NgaState *vm) {
}
void double_divmod(NgaState *vm) {
}
void malloc_allocate(NgaState *vm) {
// TODO: Conditionally compile based on host word size?
double_cell addr = { .val = malloc(stack_pop(vm)) };