Skip to content

Instantly share code, notes, and snippets.

@RickCarlino
Last active February 23, 2022 00:25
Show Gist options
  • Save RickCarlino/4db757db2e5f931d79c95a9deaca0cdb to your computer and use it in GitHub Desktop.
Save RickCarlino/4db757db2e5f931d79c95a9deaca0cdb to your computer and use it in GitHub Desktop.
Web Assembly Forth VM
var wasmCode = new Uint8Array([0,97,115,109,1,0,0,0,1,177,128,128,128,0,9,96,0,0,96,1,127,1,127,96,0,1,127,96,1,127,0,96,2,127,127,0,96,2,127,127,1,127,96,5,127,127,127,127,127,0,96,3,127,127,127,0,96,4,127,127,127,127,0,2,157,128,128,128,0,2,3,101,110,118,7,103,101,116,99,104,97,114,0,2,3,101,110,118,7,112,117,116,99,104,97,114,0,1,3,224,128,128,128,0,95,3,2,2,2,3,2,2,3,2,3,2,3,1,4,2,1,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,2,0,4,133,128,128,128,0,1,112,1,72,72,5,131,128,128,128,0,1,0,2,6,129,128,128,128,0,0,7,216,134,128,128,0,95,6,109,101,109,111,114,121,2,0,6,112,117,116,107,101,121,0,2,5,108,108,107,101,121,0,3,10,107,101,121,87,97,105,116,105,110,103,0,4,6,103,101,116,107,101,121,0,5,4,116,101,108,108,0,6,3,112,111,112,0,7,3,116,111,115,0,8,4,112,117,115,104,0,9,4,100,112,111,112,0,10,5,100,112,117,115,104,0,11,4,114,112,111,112,0,12,5,114,112,117,115,104,0,13,7,114,101,97,100,77,101,109,0,14,8,119,114,105,116,101,77,101,109,0,15,8,114,101,97,100,87,111,114,100,0,16,2,117,112,0,17,8,102,105,110,100,87,111,114,100,0,18,11,112,97,114,115,101,78,117,109,98,101,114,0,19,5,100,111,99,111,108,0,20,10,100,111,67,101,108,108,83,105,122,101,0,21,7,109,101,109,82,101,97,100,0,22,11,109,101,109,82,101,97,100,66,121,116,101,0,23,3,107,101,121,0,24,4,101,109,105,116,0,25,4,100,114,111,112,0,26,6,100,111,69,120,105,116,0,27,3,98,121,101,0,28,8,100,111,76,97,116,101,115,116,0,29,6,100,111,72,101,114,101,0,30,6,100,111,66,97,115,101,0,31,7,100,111,83,116,97,116,101,0,32,15,103,111,116,111,73,110,116,101,114,112,114,101,116,101,114,0,33,12,103,111,116,111,67,111,109,112,105,108,101,114,0,34,4,104,105,100,101,0,35,4,114,116,111,115,0,36,4,115,116,111,114,0,37,5,107,101,121,95,112,0,38,6,98,114,97,110,99,104,0,39,7,122,98,114,97,110,99,104,0,40,15,116,111,103,103,108,101,73,109,109,101,100,105,97,116,101,0,41,6,100,111,70,114,101,101,0,42,4,115,48,95,114,0,43,5,100,115,112,95,114,0,44,3,110,111,116,0,45,3,100,117,112,0,46,8,109,101,109,87,114,105,116,101,0,47,12,109,101,109,87,114,105,116,101,66,121,116,101,0,48,4,115,119,97,112,0,49,4,111,118,101,114,0,50,5,99,111,109,109,97,0,51,9,99,111,109,109,97,66,121,116,101,0,52,4,119,111,114,100,0,53,4,102,105,110,100,0,54,6,103,101,116,67,102,97,0,55,3,99,102,97,0,56,6,110,117,109,98,101,114,0,57,3,108,105,116,0,58,4,113,117,105,116,0,59,4,112,108,117,115,0,60,5,109,105,110,117,115,0,61,3,109,117,108,0,62,6,100,105,118,109,111,100,0,63,3,114,111,116,0,64,8,100,111,67,114,101,97,116,101,0,65,10,99,114,101,97,116,101,87,111,114,100,0,66,5,99,111,108,111,110,0,67,9,115,101,109,105,99,111,108,111,110,0,68,4,114,103,101,116,0,69,3,100,111,74,0,70,4,116,105,99,107,0,71,6,101,113,117,97,108,115,0,72,7,115,109,97,108,108,101,114,0,73,6,108,97,114,103,101,114,0,74,5,100,111,65,110,100,0,75,4,100,111,79,114,0,76,5,112,95,100,117,112,0,77,9,108,105,116,115,116,114,105,110,103,0,78,3,120,111,114,0,79,11,116,105,109,101,115,68,105,118,105,100,101,0,80,14,116,105,109,101,115,68,105,118,105,100,101,77,111,100,0,81,7,100,101,113,117,97,108,115,0,82,8,100,115,109,97,108,108,101,114,0,83,7,100,108,97,114,103,101,114,0,84,9,100,117,115,109,97,108,108,101,114,0,85,5,100,112,108,117,115,0,86,6,100,109,105,110,117,115,0,87,4,100,109,117,108,0,88,4,100,100,105,118,0,89,5,100,115,119,97,112,0,90,5,100,111,118,101,114,0,91,4,100,114,111,116,0,92,4,115,108,101,110,0,93,10,97,100,100,66,117,105,108,116,105,110,0,94,4,109,97,105,110,0,95,9,206,128,128,128,0,1,0,65,0,11,72,96,20,21,22,47,23,48,24,25,49,46,26,50,51,52,53,54,56,27,59,57,28,29,30,31,32,60,61,62,63,64,33,34,65,35,58,67,68,36,37,69,70,71,38,72,73,74,75,76,39,40,41,42,77,43,44,78,45,79,80,81,82,83,84,85,86,87,88,89,90,91,92,10,164,205,128,128,0,95,135,128,128,128,0,0,32,0,16,1,26,11,168,128,128,128,0,1,1,127,2,64,65,0,40,2,136,23,34,0,45,0,0,69,13,0,65,0,32,0,65,1,106,54,2,136,23,32,0,44,0,0,15,11,16,0,11,146,128,128,128,0,0,65,127,65,0,65,0,40,2,16,65,0,40,2,12,72,27,11,173,129,128,128,0,1,2,127,2,64,65,0,40,2,16,34,0,65,0,40,2,12,78,13,0,65,0,32,0,65,1,106,54,2,16,32,0,65,144,23,106,44,0,0,15,11,65,0,65,0,54,2,12,65,0,33,0,2,64,3,64,2,64,2,64,65,0,40,2,136,23,34,1,45,0,0,69,13,0,65,0,32,1,65,1,106,54,2,136,23,32,1,44,0,0,34,1,65,127,70,13,3,12,1,11,16,0,33,1,65,0,40,2,12,33,0,32,1,65,127,70,13,2,11,32,0,65,128,1,70,13,1,32,0,65,144,23,106,32,1,58,0,0,65,0,32,0,65,1,106,34,0,54,2,12,32,1,65,10,71,13,0,11,11,65,0,65,1,54,2,16,65,144,23,44,0,0,11,184,128,128,128,0,1,1,127,2,64,32,0,45,0,0,34,1,69,13,0,32,0,65,1,106,33,0,3,64,32,1,65,24,116,65,24,117,16,1,26,32,0,45,0,0,33,1,32,0,65,1,106,33,0,32,1,13,0,11,11,11,187,129,128,128,0,1,3,127,65,0,33,2,2,64,2,64,65,0,40,2,144,24,34,0,47,1,0,34,1,65,1,71,13,0,65,63,16,1,26,65,32,16,1,26,65,211,0,16,1,26,65,244,0,16,1,26,65,225,0,16,1,26,65,227,0,16,1,26,65,235,0,16,1,26,65,32,16,1,26,65,245,0,16,1,26,65,238,0,16,1,26,65,228,0,16,1,26,65,229,0,16,1,26,65,242,0,16,1,26,65,230,0,16,1,26,65,236,0,16,1,26,65,239,0,16,1,26,65,247,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,12,1,11,32,0,32,1,65,127,106,34,2,59,1,0,65,0,40,2,152,24,32,2,65,255,255,3,113,65,1,116,106,47,1,0,33,2,11,32,2,65,255,255,3,113,11,171,129,128,128,0,1,2,127,65,0,33,1,2,64,2,64,65,0,40,2,144,24,47,1,0,34,0,65,1,71,13,0,65,63,16,1,26,65,32,16,1,26,65,211,0,16,1,26,65,244,0,16,1,26,65,225,0,16,1,26,65,227,0,16,1,26,65,235,0,16,1,26,65,32,16,1,26,65,245,0,16,1,26,65,238,0,16,1,26,65,228,0,16,1,26,65,229,0,16,1,26,65,242,0,16,1,26,65,230,0,16,1,26,65,236,0,16,1,26,65,239,0,16,1,26,65,247,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,12,1,11,65,0,40,2,152,24,32,0,65,1,116,106,65,126,106,47,1,0,33,1,11,32,1,65,255,255,3,113,11,160,129,128,128,0,1,2,127,2,64,65,0,40,2,144,24,34,1,47,1,0,34,2,65,192,1,73,13,0,65,63,16,1,26,65,32,16,1,26,65,211,0,16,1,26,65,244,0,16,1,26,65,225,0,16,1,26,65,227,0,16,1,26,65,235,0,16,1,26,65,32,16,1,26,65,239,0,16,1,26,65,246,0,16,1,26,65,229,0,16,1,26,65,242,0,16,1,26,65,230,0,16,1,26,65,236,0,16,1,26,65,239,0,16,1,26,65,247,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,15,11,32,1,32,2,65,1,106,59,1,0,65,0,40,2,152,24,32,2,65,1,116,106,32,0,59,1,0,11,138,128,128,128,0,0,16,7,65,16,116,16,7,114,11,146,128,128,128,0,0,32,0,65,255,255,3,113,16,9,32,0,65,16,118,16,9,11,193,129,128,128,0,1,3,127,65,0,33,2,2,64,2,64,65,0,40,2,156,24,34,0,47,1,0,34,1,65,1,71,13,0,65,63,16,1,26,65,32,16,1,26,65,210,0,16,1,26,65,211,0,16,1,26,65,244,0,16,1,26,65,225,0,16,1,26,65,227,0,16,1,26,65,235,0,16,1,26,65,32,16,1,26,65,245,0,16,1,26,65,238,0,16,1,26,65,228,0,16,1,26,65,229,0,16,1,26,65,242,0,16,1,26,65,230,0,16,1,26,65,236,0,16,1,26,65,239,0,16,1,26,65,247,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,12,1,11,32,0,32,1,65,127,106,34,2,59,1,0,65,0,40,2,160,24,32,2,65,255,255,3,113,65,1,116,106,47,1,0,33,2,11,32,2,65,255,255,3,113,11,166,129,128,128,0,1,2,127,2,64,65,0,40,2,156,24,34,1,47,1,0,34,2,65,192,0,73,13,0,65,63,16,1,26,65,32,16,1,26,65,210,0,16,1,26,65,211,0,16,1,26,65,244,0,16,1,26,65,225,0,16,1,26,65,227,0,16,1,26,65,235,0,16,1,26,65,32,16,1,26,65,239,0,16,1,26,65,246,0,16,1,26,65,229,0,16,1,26,65,242,0,16,1,26,65,230,0,16,1,26,65,236,0,16,1,26,65,239,0,16,1,26,65,247,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,15,11,32,1,32,2,65,1,106,59,1,0,65,0,40,2,160,24,32,2,65,1,116,106,32,0,59,1,0,11,139,128,128,128,0,0,32,0,65,176,24,106,47,1,0,11,141,128,128,128,0,0,32,0,65,176,24,106,32,1,59,1,0,11,171,133,128,128,0,1,5,127,65,0,40,2,12,33,3,65,0,40,2,16,33,1,3,64,2,64,2,64,32,1,32,3,78,13,0,65,0,32,1,65,1,106,34,0,54,2,16,32,1,65,144,23,106,33,4,32,0,33,1,12,1,11,65,0,33,3,65,0,65,0,54,2,12,2,64,3,64,2,64,2,64,65,0,40,2,136,23,34,1,45,0,0,69,13,0,65,0,32,1,65,1,106,54,2,136,23,32,1,44,0,0,33,1,32,3,65,128,1,70,13,3,12,1,11,16,0,33,1,65,0,40,2,12,34,3,65,128,1,70,13,2,11,32,1,65,127,70,13,1,32,3,65,144,23,106,32,1,58,0,0,65,0,32,3,65,1,106,34,3,54,2,12,32,1,65,10,71,13,0,11,11,65,1,33,1,65,0,65,1,54,2,16,65,144,23,33,4,11,2,64,32,4,44,0,0,34,4,65,220,0,71,13,0,3,64,2,64,2,64,32,1,32,3,78,13,0,65,0,32,1,65,1,106,34,0,54,2,16,32,1,65,144,23,106,33,4,32,0,33,1,12,1,11,65,0,33,3,65,0,65,0,54,2,12,2,64,3,64,2,64,2,64,65,0,40,2,136,23,34,1,45,0,0,69,13,0,65,0,32,1,65,1,106,54,2,136,23,32,1,44,0,0,33,1,32,3,65,128,1,70,13,3,12,1,11,16,0,33,1,65,0,40,2,12,34,3,65,128,1,70,13,2,11,32,1,65,127,70,13,1,32,3,65,144,23,106,32,1,58,0,0,65,0,32,3,65,1,106,34,3,54,2,12,32,1,65,10,71,13,0,11,11,65,1,33,1,65,0,65,1,54,2,16,65,144,23,33,4,11,32,4,44,0,0,34,4,65,127,70,13,2,32,4,65,10,71,13,0,12,2,11,11,32,4,65,10,70,13,0,32,4,65,32,70,13,0,11,65,0,33,0,2,64,32,4,65,127,70,13,0,3,64,32,4,65,10,70,13,1,32,4,65,32,70,13,1,32,0,65,30,75,13,1,32,0,65,177,24,106,32,4,58,0,0,32,0,65,1,106,33,0,2,64,32,1,32,3,78,13,0,65,0,32,1,65,1,106,34,4,54,2,16,32,1,65,144,23,106,33,2,32,4,33,1,32,2,44,0,0,34,4,65,127,70,13,2,12,1,11,65,0,33,3,65,0,65,0,54,2,12,2,64,3,64,2,64,2,64,65,0,40,2,136,23,34,1,45,0,0,13,0,16,0,33,1,65,0,40,2,12,34,3,65,128,1,71,13,1,12,3,11,65,0,32,1,65,1,106,54,2,136,23,32,1,44,0,0,33,1,32,3,65,128,1,70,13,2,11,32,1,65,127,70,13,1,32,3,65,144,23,106,32,1,58,0,0,65,0,32,3,65,1,106,34,3,54,2,12,32,1,65,10,71,13,0,11,11,65,1,33,1,65,0,65,1,54,2,16,65,144,23,44,0,0,34,4,65,127,71,13,0,11,11,65,0,32,0,58,0,176,24,32,0,65,255,1,113,11,158,128,128,128,0,0,32,0,65,224,1,106,32,0,32,0,65,159,127,106,65,255,1,113,65,26,73,27,65,24,116,65,24,117,11,150,130,128,128,0,1,6,127,2,64,2,64,65,0,40,2,176,152,4,47,1,0,34,7,69,13,0,2,64,32,1,69,13,0,32,0,65,176,24,106,33,2,3,64,2,64,32,7,65,255,255,3,113,34,3,65,178,24,106,45,0,0,34,0,65,31,113,32,1,71,13,0,32,0,65,192,0,113,13,0,32,3,65,179,24,106,33,0,65,0,33,6,32,2,33,5,3,64,32,0,44,0,0,34,4,65,224,1,106,32,4,32,4,65,159,127,106,65,255,1,113,65,26,73,27,65,255,1,113,32,5,44,0,0,34,4,65,224,1,106,32,4,32,4,65,159,127,106,65,255,1,113,65,26,73,27,65,255,1,113,71,13,1,32,0,65,1,106,33,0,32,5,65,1,106,33,5,32,6,65,1,106,34,6,65,255,255,3,113,32,1,73,13,0,12,5,11,11,32,3,65,176,24,106,47,1,0,34,7,13,0,12,2,11,11,3,64,2,64,32,7,65,255,255,3,113,34,0,65,178,24,106,45,0,0,34,5,65,31,113,32,1,71,13,0,32,5,65,192,0,113,69,13,3,11,32,0,65,176,24,106,47,1,0,34,7,13,0,11,11,65,0,33,7,11,32,7,65,255,255,3,113,11,172,130,128,128,0,1,4,127,65,0,33,5,32,2,65,0,54,2,0,32,4,65,0,58,0,0,2,64,2,64,2,64,2,64,2,64,32,1,69,13,0,2,64,32,0,45,0,0,34,8,65,43,70,13,0,32,8,65,45,71,13,2,65,1,33,5,11,32,1,65,127,106,65,255,255,3,113,34,1,69,13,3,32,0,65,1,106,33,0,12,2,11,32,3,65,0,59,1,0,15,11,65,0,33,5,11,65,0,33,8,3,64,2,64,2,64,32,0,32,8,106,45,0,0,34,6,65,46,71,13,0,32,4,65,1,58,0,0,12,1,11,65,80,33,7,2,64,32,6,65,80,106,65,255,1,113,65,10,73,13,0,65,73,33,7,32,6,65,191,127,106,65,255,1,113,65,26,73,13,0,65,169,255,3,33,7,32,6,65,159,127,106,65,255,1,113,65,25,75,13,4,11,32,7,32,6,65,24,116,65,24,117,106,65,255,255,3,113,34,6,65,0,40,2,180,152,4,47,1,0,34,7,79,13,3,32,2,32,2,40,2,0,32,7,108,32,6,106,54,2,0,11,32,8,65,1,106,34,8,32,1,73,13,0,12,2,11,11,65,0,33,8,11,32,3,32,1,32,8,107,59,1,0,2,64,32,5,69,13,0,32,2,65,0,32,2,46,1,0,107,54,2,0,11,11,156,128,128,128,0,0,65,0,47,1,210,152,4,16,13,65,0,65,0,47,1,212,152,4,65,2,106,59,1,214,152,4,11,134,128,128,128,0,0,65,2,16,9,11,141,128,128,128,0,0,16,7,65,176,24,106,47,1,0,16,9,11,141,128,128,128,0,0,16,7,65,176,24,106,45,0,0,16,9,11,188,129,128,128,0,1,2,127,2,64,2,64,65,0,40,2,16,34,0,65,0,40,2,12,78,13,0,65,0,32,0,65,1,106,54,2,16,32,0,65,144,23,106,33,0,12,1,11,65,0,65,0,54,2,12,65,0,33,0,2,64,3,64,2,64,2,64,65,0,40,2,136,23,34,1,45,0,0,69,13,0,65,0,32,1,65,1,106,54,2,136,23,32,1,44,0,0,33,1,32,0,65,128,1,70,13,3,12,1,11,16,0,33,1,65,0,40,2,12,34,0,65,128,1,70,13,2,11,32,1,65,127,70,13,1,32,0,65,144,23,106,32,1,58,0,0,65,0,32,0,65,1,106,34,0,54,2,12,32,1,65,10,71,13,0,11,11,65,0,65,1,54,2,16,65,144,23,33,0,11,32,0,44,0,0,65,255,255,3,113,16,9,11,141,128,128,128,0,0,16,7,65,24,116,65,24,117,16,1,26,11,133,128,128,128,0,0,16,7,26,11,139,128,128,128,0,0,65,0,16,12,59,1,214,152,4,11,139,128,128,128,0,0,65,0,65,1,54,2,212,154,4,11,134,128,128,128,0,0,65,32,16,9,11,134,128,128,128,0,0,65,34,16,9,11,134,128,128,128,0,0,65,36,16,9,11,134,128,128,128,0,0,65,38,16,9,11,142,128,128,128,0,0,65,0,40,2,244,155,4,65,0,59,1,0,11,142,128,128,128,0,0,65,0,40,2,244,155,4,65,1,59,1,0,11,160,128,128,128,0,1,1,127,65,0,40,2,176,152,4,47,1,0,65,178,24,106,34,0,32,0,45,0,0,65,192,0,115,58,0,0,11,134,128,128,128,0,0,16,12,16,9,11,134,128,128,128,0,0,16,7,16,13,11,150,128,128,128,0,0,65,255,255,3,65,0,65,0,40,2,16,65,0,40,2,12,72,27,16,9,11,158,128,128,128,0,1,1,127,65,0,65,0,47,1,214,152,4,34,0,65,176,24,106,47,1,0,32,0,106,59,1,214,152,4,11,179,128,128,128,0,1,3,127,16,7,33,1,65,0,47,1,214,152,4,33,0,65,2,33,2,2,64,32,1,13,0,32,0,65,176,24,106,47,1,0,33,2,11,65,0,32,2,32,0,106,59,1,214,152,4,11,160,128,128,128,0,1,1,127,65,0,40,2,176,152,4,47,1,0,65,178,24,106,34,0,32,0,45,0,0,65,128,1,115,58,0,0,11,152,128,128,128,0,0,65,128,128,4,65,0,40,2,148,158,4,47,1,0,107,65,255,255,3,113,16,9,11,134,128,128,128,0,0,65,42,16,9,11,152,128,128,128,0,0,65,0,40,2,144,24,47,1,0,65,1,116,65,40,106,65,254,255,3,113,16,9,11,139,128,128,128,0,0,16,7,65,255,255,3,115,16,9,11,134,128,128,128,0,0,16,8,16,9,11,141,128,128,128,0,0,16,7,65,176,24,106,16,7,59,1,0,11,141,128,128,128,0,0,16,7,65,176,24,106,16,7,58,0,0,11,148,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,32,0,16,9,32,1,16,9,11,148,128,128,128,0,1,2,127,16,7,33,0,16,8,33,1,32,0,16,9,32,1,16,9,11,175,128,128,128,0,1,1,127,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,0,32,0,47,1,0,65,2,106,59,1,0,11,175,128,128,128,0,1,1,127,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,58,0,0,65,0,40,2,148,158,4,34,0,32,0,47,1,0,65,1,106,59,1,0,11,144,128,128,128,0,1,1,127,16,16,33,0,65,1,16,9,32,0,16,9,11,144,128,128,128,0,1,1,127,16,7,33,0,16,7,32,0,16,18,16,9,11,182,128,128,128,0,1,1,127,32,0,65,2,106,33,1,32,0,65,178,24,106,45,0,0,65,31,113,33,0,3,64,32,0,65,1,106,34,0,65,1,113,13,0,11,32,1,32,0,65,255,1,113,106,65,255,255,3,113,11,215,128,128,128,0,1,2,127,16,7,34,1,65,2,106,33,0,32,1,65,178,24,106,45,0,0,65,31,113,33,1,3,64,32,1,65,1,106,34,1,65,1,113,13,0,11,2,64,65,0,47,1,178,161,4,32,0,32,1,65,255,1,113,106,65,255,255,3,113,34,1,77,13,0,32,1,65,176,24,106,47,1,0,16,9,15,11,32,1,16,9,11,241,130,128,128,0,1,9,127,16,7,33,0,16,7,33,8,2,64,2,64,2,64,2,64,2,64,2,64,2,64,2,64,32,0,69,13,0,65,0,33,7,65,0,33,2,2,64,32,8,65,176,24,106,34,1,45,0,0,34,8,65,43,70,13,0,32,8,65,45,71,13,2,65,1,33,2,11,32,0,65,127,106,65,255,255,3,113,34,0,69,13,3,32,1,65,1,106,33,1,12,2,11,65,0,33,8,65,0,33,7,12,5,11,65,0,33,2,11,65,0,33,7,65,0,40,2,180,152,4,33,3,65,0,33,4,65,0,33,8,2,64,3,64,2,64,2,64,32,1,32,8,106,45,0,0,34,5,65,46,71,13,0,65,1,33,4,12,1,11,65,80,33,6,2,64,32,5,65,80,106,65,255,1,113,65,10,73,13,0,65,73,33,6,32,5,65,191,127,106,65,255,1,113,65,26,73,13,0,65,169,255,3,33,6,32,5,65,159,127,106,65,255,1,113,65,25,75,13,3,11,32,6,32,5,65,24,116,65,24,117,106,65,255,255,3,113,34,5,32,3,47,1,0,34,6,79,13,2,32,7,32,6,108,32,5,106,33,7,11,32,8,65,1,106,34,8,32,0,73,13,0,11,11,32,2,69,13,2,12,1,11,65,0,33,4,65,0,33,8,32,2,69,13,1,11,65,0,32,7,65,16,116,65,16,117,107,33,7,11,32,0,32,8,107,33,8,32,4,65,255,1,113,69,13,0,32,7,65,255,255,3,113,16,9,32,7,65,16,118,16,9,12,1,11,32,7,65,255,255,3,113,16,9,11,32,8,65,255,255,3,113,16,9,11,163,128,128,128,0,0,65,0,47,1,214,152,4,65,176,24,106,47,1,0,16,9,65,0,65,0,47,1,214,152,4,65,2,106,59,1,214,152,4,11,142,139,128,128,0,1,9,127,65,0,65,0,54,2,212,154,4,2,64,3,64,65,0,65,0,47,1,146,162,4,34,4,59,1,214,152,4,65,0,32,4,59,1,210,152,4,65,0,65,0,54,2,148,24,16,16,33,4,65,1,16,9,32,4,16,9,16,7,33,4,16,7,32,4,16,18,16,9,2,64,2,64,2,64,2,64,2,64,2,64,2,64,16,7,34,4,69,13,0,32,4,65,2,106,33,3,32,4,65,178,24,106,45,0,0,34,5,65,31,113,33,4,32,5,65,24,116,65,24,117,33,5,3,64,32,4,65,1,106,34,4,65,1,113,13,0,11,65,0,32,3,32,4,65,255,1,113,106,34,4,59,1,212,152,4,32,4,65,255,255,3,113,34,3,65,176,24,106,47,1,0,33,4,32,5,65,0,72,13,1,65,0,40,2,244,155,4,47,1,0,65,255,255,3,113,69,13,1,32,4,65,127,106,65,255,255,3,113,65,197,0,77,13,2,32,3,16,9,12,3,11,65,0,33,7,2,64,2,64,65,0,45,0,176,24,34,0,13,0,65,0,33,6,12,1,11,65,0,33,6,65,0,33,8,2,64,2,64,2,64,2,64,2,64,65,0,45,0,177,24,34,4,65,43,70,13,0,2,64,32,4,65,45,70,13,0,65,0,33,8,65,177,24,33,1,12,2,11,65,1,33,8,11,32,0,65,127,106,34,4,65,255,255,3,113,33,0,65,178,24,33,1,32,4,69,13,1,11,65,0,33,6,65,0,40,2,180,152,4,33,2,65,0,33,7,65,0,33,4,2,64,3,64,2,64,2,64,32,1,32,4,106,45,0,0,34,3,65,46,71,13,0,65,1,33,7,12,1,11,65,80,33,5,2,64,32,3,65,80,106,65,255,1,113,65,10,73,13,0,65,73,33,5,32,3,65,191,127,106,65,255,1,113,65,26,73,13,0,65,169,255,3,33,5,32,3,65,159,127,106,65,255,1,113,65,25,75,13,3,11,32,5,32,3,65,24,116,65,24,117,106,65,255,255,3,113,34,3,32,2,47,1,0,34,5,79,13,2,32,6,32,5,108,32,3,106,33,6,11,32,4,65,1,106,34,4,32,0,73,13,0,11,11,32,0,32,4,107,33,4,32,8,69,13,2,12,1,11,65,0,33,7,32,0,65,0,107,33,4,32,8,69,13,1,11,65,0,32,6,65,16,116,65,16,117,107,33,6,11,32,4,65,255,255,3,113,69,13,0,65,213,0,16,1,26,65,238,0,16,1,26,65,235,0,16,1,26,65,238,0,16,1,26,65,239,0,16,1,26,65,247,0,16,1,26,65,238,0,16,1,26,65,32,16,1,26,65,247,0,16,1,26,65,239,0,16,1,26,65,242,0,16,1,26,65,228,0,16,1,26,65,58,16,1,26,65,32,16,1,26,2,64,65,0,45,0,176,24,69,13,0,65,0,33,4,3,64,32,4,65,177,24,106,44,0,0,16,1,26,32,4,65,1,106,34,4,65,0,45,0,176,24,72,13,0,11,11,65,10,16,1,26,65,0,40,2,156,24,65,1,59,1,0,65,0,40,2,144,24,65,1,59,1,0,65,0,40,2,212,154,4,69,13,7,12,8,11,2,64,2,64,2,64,65,0,40,2,244,155,4,47,1,0,69,13,0,65,37,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,4,32,4,47,1,0,65,2,106,59,1,0,32,7,65,255,1,113,69,13,1,32,6,65,255,255,3,113,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,4,32,4,47,1,0,65,2,106,59,1,0,65,37,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,4,32,4,47,1,0,65,2,106,59,1,0,32,6,65,16,118,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,4,32,4,47,1,0,65,2,106,59,1,0,65,0,40,2,148,24,13,8,12,7,11,32,7,65,255,1,113,69,13,1,32,6,65,255,255,3,113,16,9,32,6,65,16,118,16,9,65,0,40,2,148,24,13,7,12,6,11,32,6,65,255,255,3,113,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,4,32,4,47,1,0,65,2,106,59,1,0,65,0,40,2,148,24,13,6,12,5,11,32,6,65,255,255,3,113,16,9,65,0,40,2,148,24,13,5,12,4,11,2,64,65,0,40,2,212,154,4,34,6,65,0,40,2,148,24,34,5,114,13,0,3,64,32,4,65,255,255,3,113,34,3,65,38,70,13,4,2,64,2,64,32,3,65,198,0,75,13,0,32,3,65,2,116,65,32,106,40,2,0,17,0,0,65,0,40,2,212,154,4,33,6,65,0,40,2,148,24,33,5,65,0,47,1,214,152,4,33,4,12,1,11,65,0,65,0,47,1,214,152,4,59,1,210,152,4,65,0,32,4,59,1,214,152,4,11,65,0,32,4,59,1,212,152,4,65,0,32,4,65,255,255,3,113,34,4,65,2,106,59,1,214,152,4,32,4,65,176,24,106,47,1,0,33,4,32,6,32,5,114,69,13,0,11,11,32,5,69,13,3,12,4,11,32,4,65,255,255,3,113,16,9,11,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,4,32,4,47,1,0,65,2,106,59,1,0,11,65,0,40,2,148,24,13,1,11,2,64,65,0,40,2,16,65,0,40,2,12,72,13,0,65,0,40,2,136,23,45,0,0,13,0,65,32,16,1,26,65,207,0,16,1,26,65,203,0,16,1,26,65,10,16,1,26,65,0,40,2,212,154,4,69,13,2,12,3,11,65,0,40,2,212,154,4,69,13,1,12,2,11,65,0,40,2,156,24,65,1,59,1,0,65,0,40,2,144,24,65,1,59,1,0,65,0,40,2,212,154,4,69,13,0,11,11,11,142,128,128,128,0,0,16,7,16,7,106,65,255,255,3,113,16,9,11,148,128,128,128,0,1,1,127,16,7,33,0,16,7,32,0,107,65,255,255,3,113,16,9,11,142,128,128,128,0,0,16,7,16,7,108,65,255,255,3,113,16,9,11,176,128,128,128,0,1,2,127,16,7,33,0,16,7,65,16,116,65,16,117,34,1,32,0,65,16,116,65,16,117,34,0,111,65,255,255,3,113,16,9,32,1,32,0,109,65,255,255,3,113,16,9,11,156,128,128,128,0,1,3,127,16,7,33,0,16,7,33,1,16,7,33,2,32,1,16,9,32,0,16,9,32,2,16,9,11,164,128,128,128,0,1,1,127,16,16,33,0,65,1,16,9,32,0,16,9,16,7,33,0,16,7,65,176,24,106,32,0,65,255,1,113,65,0,16,66,11,165,130,128,128,0,1,2,127,65,0,40,2,148,158,4,47,1,0,33,3,65,0,40,2,176,152,4,47,1,0,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,4,32,4,47,1,0,65,2,106,59,1,0,32,2,32,1,114,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,58,0,0,65,0,40,2,148,158,4,34,2,32,2,47,1,0,65,1,106,34,2,59,1,0,2,64,32,1,69,13,0,3,64,32,0,44,0,0,65,255,255,3,113,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,58,0,0,65,0,40,2,148,158,4,34,2,32,2,47,1,0,65,1,106,34,2,59,1,0,32,0,65,1,106,33,0,32,1,65,127,106,34,1,65,255,1,113,13,0,11,11,2,64,32,2,65,1,113,69,13,0,3,64,65,0,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,58,0,0,65,0,40,2,148,158,4,34,0,32,0,47,1,0,65,1,106,34,0,59,1,0,32,0,65,1,113,13,0,11,11,65,0,40,2,176,152,4,32,3,59,1,0,11,251,128,128,128,0,1,1,127,16,16,33,0,65,1,16,9,32,0,16,9,16,7,33,0,16,7,65,176,24,106,32,0,65,255,1,113,65,0,16,66,65,0,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,0,32,0,47,1,0,65,2,106,59,1,0,65,0,40,2,176,152,4,47,1,0,65,178,24,106,34,0,32,0,45,0,0,65,192,0,115,58,0,0,65,0,40,2,244,155,4,65,1,59,1,0,11,219,128,128,128,0,1,1,127,65,7,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,0,32,0,47,1,0,65,2,106,59,1,0,65,0,40,2,176,152,4,47,1,0,65,178,24,106,34,0,32,0,45,0,0,65,192,0,115,58,0,0,65,0,40,2,244,155,4,65,0,59,1,0,11,142,128,128,128,0,1,1,127,16,12,34,0,16,13,32,0,16,9,11,158,128,128,128,0,1,3,127,16,12,33,0,16,12,33,1,16,12,34,2,16,13,32,1,16,13,32,0,16,13,32,2,16,9,11,220,129,128,128,0,1,2,127,16,16,33,1,65,1,16,9,32,1,16,9,16,7,33,1,16,7,32,1,16,18,16,9,16,7,34,1,65,2,106,33,0,32,1,65,178,24,106,45,0,0,65,31,113,33,1,3,64,32,1,65,1,106,34,1,65,1,113,13,0,11,2,64,2,64,65,0,47,1,178,161,4,32,0,32,1,65,255,1,113,106,65,255,255,3,113,34,1,77,13,0,32,1,65,176,24,106,47,1,0,16,9,12,1,11,32,1,16,9,11,2,64,65,0,40,2,244,155,4,47,1,0,69,13,0,65,37,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,1,32,1,47,1,0,65,2,106,34,1,59,1,0,32,1,65,255,255,3,113,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,1,32,1,47,1,0,65,2,106,59,1,0,11,11,144,128,128,128,0,0,65,255,255,3,65,0,16,7,16,7,70,27,16,9,11,162,128,128,128,0,1,1,127,16,7,33,0,65,255,255,3,65,0,16,7,65,16,116,65,16,117,32,0,65,16,116,65,16,117,72,27,16,9,11,162,128,128,128,0,1,1,127,16,7,33,0,65,255,255,3,65,0,16,7,65,16,116,65,16,117,32,0,65,16,116,65,16,117,74,27,16,9,11,137,128,128,128,0,0,16,7,16,7,113,16,9,11,137,128,128,128,0,0,16,7,16,7,114,16,9,11,146,128,128,128,0,1,1,127,2,64,16,8,34,0,69,13,0,32,0,16,9,11,11,217,128,128,128,0,1,2,127,65,0,65,0,47,1,214,152,4,34,1,65,2,106,34,0,59,1,214,152,4,32,1,65,176,24,106,47,1,0,33,1,32,0,65,255,255,3,113,16,9,32,1,16,9,32,1,65,0,47,1,214,152,4,106,33,1,3,64,32,1,34,0,65,1,106,33,1,32,0,65,1,113,13,0,11,65,0,32,0,59,1,214,152,4,11,137,128,128,128,0,0,16,7,16,7,115,16,9,11,163,129,128,128,0,1,2,127,16,7,33,0,16,7,16,7,108,32,0,110,34,0,65,255,255,3,113,34,1,16,9,2,64,32,1,32,0,70,13,0,65,193,0,16,1,26,65,242,0,16,1,26,65,233,0,16,1,26,65,244,0,16,1,26,65,232,0,16,1,26,65,237,0,16,1,26,65,229,0,16,1,26,65,244,0,16,1,26,65,233,0,16,1,26,65,227,0,16,1,26,65,32,16,1,26,65,239,0,16,1,26,65,246,0,16,1,26,65,229,0,16,1,26,65,242,0,16,1,26,65,230,0,16,1,26,65,236,0,16,1,26,65,239,0,16,1,26,65,247,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,11,11,172,129,128,128,0,1,2,127,16,7,33,0,16,7,16,7,108,34,1,32,0,112,16,9,32,1,32,0,110,34,0,65,255,255,3,113,34,1,16,9,2,64,32,1,32,0,70,13,0,65,193,0,16,1,26,65,242,0,16,1,26,65,233,0,16,1,26,65,244,0,16,1,26,65,232,0,16,1,26,65,237,0,16,1,26,65,229,0,16,1,26,65,244,0,16,1,26,65,233,0,16,1,26,65,227,0,16,1,26,65,32,16,1,26,65,239,0,16,1,26,65,246,0,16,1,26,65,229,0,16,1,26,65,242,0,16,1,26,65,230,0,16,1,26,65,236,0,16,1,26,65,239,0,16,1,26,65,247,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,11,11,166,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,65,255,255,3,65,0,16,7,65,16,116,16,7,114,32,1,32,0,65,16,116,114,70,27,16,9,11,166,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,65,255,255,3,65,0,16,7,65,16,116,16,7,114,32,1,32,0,65,16,116,114,72,27,16,9,11,166,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,65,255,255,3,65,0,16,7,65,16,116,16,7,114,32,1,32,0,65,16,116,114,74,27,16,9,11,166,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,65,255,255,3,65,0,16,7,65,16,116,16,7,114,32,1,32,0,65,16,116,114,73,27,16,9,11,173,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,16,7,65,16,116,16,7,114,32,1,32,0,65,16,116,114,106,34,0,65,255,255,3,113,16,9,32,0,65,16,118,16,9,11,173,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,16,7,65,16,116,16,7,114,32,1,32,0,65,16,116,114,107,34,0,65,255,255,3,113,16,9,32,0,65,16,118,16,9,11,173,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,16,7,65,16,116,16,7,114,32,1,32,0,65,16,116,114,108,34,0,65,255,255,3,113,16,9,32,0,65,16,118,16,9,11,173,128,128,128,0,1,2,127,16,7,33,0,16,7,33,1,16,7,65,16,116,16,7,114,32,1,32,0,65,16,116,114,109,34,0,65,255,255,3,113,16,9,32,0,65,16,118,16,9,11,164,128,128,128,0,1,4,127,16,7,33,0,16,7,33,1,16,7,33,2,16,7,33,3,32,1,16,9,32,0,16,9,32,3,16,9,32,2,16,9,11,170,128,128,128,0,1,4,127,16,7,33,0,16,7,33,1,16,7,33,2,16,7,34,3,16,9,32,2,16,9,32,1,16,9,32,0,16,9,32,3,16,9,32,2,16,9,11,180,128,128,128,0,1,6,127,16,7,33,0,16,7,33,1,16,7,33,2,16,7,33,3,16,7,33,4,16,7,33,5,32,3,16,9,32,2,16,9,32,1,16,9,32,0,16,9,32,5,16,9,32,4,16,9,11,197,128,128,128,0,1,2,127,2,64,2,64,32,0,45,0,0,69,13,0,32,0,65,1,106,33,0,65,0,33,2,3,64,32,2,65,1,106,33,2,32,0,45,0,0,33,1,32,0,65,1,106,33,0,32,1,13,0,12,2,11,11,65,0,33,2,11,32,2,65,255,1,113,11,159,134,128,128,0,1,2,127,2,64,65,0,40,2,148,24,69,13,0,15,11,2,64,32,0,65,199,0,73,13,0,65,197,0,16,1,26,65,242,0,16,1,26,65,242,0,16,1,26,65,239,0,16,1,26,65,242,0,16,1,26,65,32,16,1,26,65,225,0,16,1,26,65,228,0,16,1,26,65,228,0,16,1,26,65,233,0,16,1,26,65,238,0,16,1,26,65,231,0,16,1,26,65,32,16,1,26,65,226,0,16,1,26,65,245,0,16,1,26,65,233,0,16,1,26,65,236,0,16,1,26,65,244,0,16,1,26,65,233,0,16,1,26,65,238,0,16,1,26,65,32,16,1,26,2,64,32,1,45,0,0,34,3,69,13,0,32,1,65,1,106,33,5,3,64,32,3,65,24,116,65,24,117,16,1,26,32,5,45,0,0,33,3,32,5,65,1,106,33,5,32,3,13,0,11,11,65,58,16,1,26,65,32,16,1,26,65,207,0,16,1,26,65,245,0,16,1,26,65,244,0,16,1,26,65,32,16,1,26,65,239,0,16,1,26,65,230,0,16,1,26,65,32,16,1,26,65,226,0,16,1,26,65,245,0,16,1,26,65,233,0,16,1,26,65,236,0,16,1,26,65,244,0,16,1,26,65,233,0,16,1,26,65,238,0,16,1,26,65,32,16,1,26,65,201,0,16,1,26,65,196,0,16,1,26,65,243,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,15,11,2,64,32,0,65,2,116,65,32,106,34,5,40,2,0,69,13,0,65,197,0,16,1,26,65,242,0,16,1,26,65,242,0,16,1,26,65,239,0,16,1,26,65,242,0,16,1,26,65,32,16,1,26,65,225,0,16,1,26,65,228,0,16,1,26,65,228,0,16,1,26,65,233,0,16,1,26,65,238,0,16,1,26,65,231,0,16,1,26,65,32,16,1,26,65,226,0,16,1,26,65,245,0,16,1,26,65,233,0,16,1,26,65,236,0,16,1,26,65,244,0,16,1,26,65,233,0,16,1,26,65,238,0,16,1,26,65,32,16,1,26,2,64,32,1,45,0,0,34,3,69,13,0,32,1,65,1,106,33,5,3,64,32,3,65,24,116,65,24,117,16,1,26,32,5,45,0,0,33,3,32,5,65,1,106,33,5,32,3,13,0,11,11,65,58,16,1,26,65,32,16,1,26,65,201,0,16,1,26,65,196,0,16,1,26,65,32,16,1,26,65,231,0,16,1,26,65,233,0,16,1,26,65,246,0,16,1,26,65,229,0,16,1,26,65,238,0,16,1,26,65,32,16,1,26,65,244,0,16,1,26,65,247,0,16,1,26,65,233,0,16,1,26,65,227,0,16,1,26,65,229,0,16,1,26,65,10,16,1,26,65,0,65,1,54,2,148,24,15,11,32,5,32,3,54,2,0,65,0,33,5,2,64,32,1,45,0,0,69,13,0,32,1,65,1,106,33,3,65,0,33,5,3,64,32,5,65,1,106,33,5,32,3,45,0,0,33,4,32,3,65,1,106,33,3,32,4,13,0,11,11,32,1,32,5,65,255,1,113,32,2,16,66,32,0,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,3,32,3,47,1,0,65,2,106,59,1,0,65,7,16,9,65,0,40,2,148,158,4,47,1,0,16,9,16,7,65,176,24,106,16,7,59,1,0,65,0,40,2,148,158,4,34,3,32,3,47,1,0,65,2,106,59,1,0,11,184,138,128,128,0,1,2,127,65,0,65,214,24,54,2,244,155,4,65,0,65,212,24,54,2,180,152,4,65,0,65,208,24,54,2,176,152,4,65,0,65,210,24,54,2,148,158,4,65,0,65,216,24,54,2,144,24,65,0,65,218,24,54,2,152,24,65,0,65,0,54,2,148,24,65,0,65,216,27,54,2,156,24,65,0,65,218,27,54,2,160,24,65,0,65,1,59,1,216,27,65,0,65,1,59,1,216,24,65,0,65,0,59,1,214,24,65,0,65,10,59,1,212,24,65,0,65,0,59,1,208,24,65,0,65,168,4,59,1,210,24,65,0,65,0,40,2,204,152,4,65,0,65,1,16,94,65,1,65,0,40,2,232,152,4,65,0,65,2,16,94,65,2,65,0,40,2,132,153,4,65,0,65,3,16,94,65,27,65,0,40,2,164,159,4,65,0,65,4,16,94,65,3,65,0,40,2,164,153,4,65,0,65,5,16,94,65,28,65,0,40,2,196,159,4,65,0,65,6,16,94,65,4,65,0,40,2,196,153,4,65,0,65,7,16,94,65,5,65,0,40,2,232,153,4,65,0,65,8,16,94,65,29,65,0,40,2,232,159,4,65,0,65,9,16,94,65,26,65,0,40,2,132,159,4,65,0,65,10,16,94,65,6,65,0,40,2,136,154,4,65,0,65,11,16,94,65,30,65,0,40,2,136,160,4,65,0,65,12,16,94,65,31,65,0,40,2,164,160,4,65,0,65,13,16,94,65,32,65,0,40,2,196,160,4,65,0,65,14,16,94,65,33,65,0,40,2,232,160,4,65,0,65,15,16,94,65,34,65,0,40,2,136,161,4,65,0,65,16,16,94,65,35,65,0,40,2,168,161,4,65,0,65,17,16,94,65,7,65,0,40,2,168,154,4,65,0,65,18,16,94,65,38,65,0,40,2,136,162,4,65,0,65,19,16,94,65,0,40,2,176,152,4,47,1,0,34,1,65,2,106,33,0,32,1,65,178,24,106,45,0,0,65,31,113,33,1,3,64,32,1,65,1,106,34,1,65,1,113,13,0,11,65,0,32,0,32,1,65,255,1,113,106,59,1,146,162,4,65,36,65,0,40,2,200,161,4,65,0,65,20,16,94,65,8,65,0,40,2,196,154,4,65,0,65,21,16,94,65,9,65,0,40,2,232,154,4,65,0,65,22,16,94,65,10,65,0,40,2,136,155,4,65,0,65,23,16,94,65,11,65,0,40,2,168,155,4,65,0,65,24,16,94,65,12,65,0,40,2,200,155,4,65,0,65,25,16,94,65,39,65,0,40,2,164,162,4,65,0,65,26,16,94,65,40,65,0,40,2,196,162,4,65,0,65,27,16,94,65,41,65,0,40,2,228,162,4,65,0,65,28,16,94,65,42,65,0,40,2,136,163,4,65,0,65,29,16,94,65,43,65,0,40,2,164,163,4,65,0,65,30,16,94,65,13,65,0,40,2,228,155,4,65,128,1,65,31,16,94,65,14,65,0,40,2,132,156,4,65,0,65,32,16,94,65,44,65,0,40,2,200,163,4,65,0,65,33,16,94,65,15,65,0,40,2,168,156,4,65,0,65,34,16,94,65,37,65,0,40,2,228,161,4,65,0,65,35,16,94,65,45,65,0,40,2,228,163,4,65,0,65,36,16,94,65,46,65,0,40,2,132,164,4,65,128,1,65,37,16,94,65,16,65,0,40,2,196,156,4,65,0,65,38,16,94,65,17,65,0,40,2,228,156,4,65,0,65,39,16,94,65,47,65,0,40,2,164,164,4,65,0,65,40,16,94,65,48,65,0,40,2,196,164,4,65,0,65,41,16,94,65,49,65,0,40,2,228,164,4,65,128,1,65,42,16,94,65,18,65,0,40,2,136,157,4,65,0,65,43,16,94,65,50,65,0,40,2,132,165,4,65,0,65,44,16,94,65,51,65,0,40,2,164,165,4,65,0,65,45,16,94,65,52,65,0,40,2,196,165,4,65,0,65,46,16,94,65,53,65,0,40,2,228,165,4,65,0,65,47,16,94,65,54,65,0,40,2,132,166,4,65,0,65,48,16,94,65,19,65,0,40,2,168,157,4,65,0,65,49,16,94,65,20,65,0,40,2,200,157,4,65,0,65,50,16,94,65,21,65,0,40,2,236,157,4,65,128,1,65,51,16,94,65,22,65,0,40,2,136,158,4,65,0,65,52,16,94,65,55,65,0,40,2,168,166,4,65,0,65,53,16,94,65,23,65,0,40,2,164,158,4,65,0,65,54,16,94,65,24,65,0,40,2,200,158,4,65,0,65,55,16,94,65,56,65,0,40,2,204,166,4,65,0,65,56,16,94,65,25,65,0,40,2,228,158,4,65,0,65,57,16,94,65,57,65,0,40,2,228,166,4,65,0,65,58,16,94,65,58,65,0,40,2,132,167,4,65,0,65,59,16,94,65,59,65,0,40,2,168,167,4,65,0,65,60,16,94,65,60,65,0,40,2,196,167,4,65,0,65,61,16,94,65,61,65,0,40,2,228,167,4,65,0,65,62,16,94,65,62,65,0,40,2,132,168,4,65,0,65,63,16,94,65,63,65,0,40,2,164,168,4,65,0,65,192,0,16,94,65,192,0,65,0,40,2,196,168,4,65,0,65,193,0,16,94,65,193,0,65,0,40,2,228,168,4,65,0,65,194,0,16,94,65,194,0,65,0,40,2,132,169,4,65,0,65,195,0,16,94,65,195,0,65,0,40,2,164,169,4,65,0,65,196,0,16,94,65,196,0,65,0,40,2,200,169,4,65,0,65,197,0,16,94,65,197,0,65,0,40,2,232,169,4,65,0,65,198,0,16,94,65,198,0,65,0,40,2,136,170,4,65,0,65,199,0,16,94,65,0,65,0,40,2,148,158,4,47,1,0,65,255,255,3,106,59,1,178,161,4,2,64,65,0,40,2,148,24,69,13,0,65,1,15,11,65,0,65,0,40,2,132,23,54,2,136,23,16,59,65,0,11,131,128,128,128,0,0,0,11,11,245,172,128,128,0,176,2,0,65,12,11,4,0,0,0,0,0,65,16,11,4,0,0,0,0,0,65,192,2,11,194,20,58,32,68,69,67,73,77,65,76,32,49,48,32,66,65,83,69,32,33,32,59,10,58,32,72,69,88,32,49,54,32,66,65,83,69,32,33,32,59,10,58,32,79,67,84,65,76,32,56,32,66,65,83,69,32,33,32,59,10,58,32,50,68,85,80,32,79,86,69,82,32,79,86,69,82,32,59,10,58,32,50,68,82,79,80,32,68,82,79,80,32,68,82,79,80,32,59,10,58,32,78,73,80,32,83,87,65,80,32,68,82,79,80,32,59,10,58,32,50,78,73,80,32,50,83,87,65,80,32,50,68,82,79,80,32,59,10,58,32,84,85,67,75,32,83,87,65,80,32,79,86,69,82,32,59,10,58,32,47,32,47,77,79,68,32,78,73,80,32,59,10,58,32,77,79,68,32,47,77,79,68,32,68,82,79,80,32,59,10,58,32,66,76,32,51,50,32,59,10,58,32,67,82,32,49,48,32,69,77,73,84,32,59,10,58,32,83,80,65,67,69,32,66,76,32,69,77,73,84,32,59,10,58,32,78,69,71,65,84,69,32,48,32,83,87,65,80,32,45,32,59,10,58,32,68,78,69,71,65,84,69,32,48,46,32,50,83,87,65,80,32,68,45,32,59,10,58,32,67,69,76,76,83,32,67,69,76,76,32,42,32,59,10,58,32,65,76,76,79,84,32,72,69,82,69,32,64,32,43,32,72,69,82,69,32,33,32,59,10,58,32,84,82,85,69,32,45,49,32,59,10,58,32,70,65,76,83,69,32,48,32,59,10,58,32,48,61,32,48,32,61,32,59,10,58,32,48,60,32,48,32,60,32,59,10,58,32,48,62,32,48,32,62,32,59,10,58,32,60,62,32,61,32,48,61,32,59,10,58,32,60,61,32,62,32,48,61,32,59,10,58,32,62,61,32,60,32,48,61,32,59,10,58,32,48,60,61,32,48,32,60,61,32,59,10,58,32,48,62,61,32,48,32,62,61,32,59,10,58,32,49,43,32,49,32,43,32,59,10,58,32,49,45,32,49,32,45,32,59,10,58,32,50,43,32,50,32,43,32,59,10,58,32,50,45,32,50,32,45,32,59,10,58,32,50,47,32,50,32,47,32,59,10,58,32,50,42,32,50,32,42,32,59,10,58,32,68,50,47,32,50,46,32,68,47,32,59,10,58,32,43,33,32,68,85,80,32,64,32,82,79,84,32,43,32,83,87,65,80,32,33,32,59,10,58,32,91,67,79,77,80,73,76,69,93,32,87,79,82,68,32,70,73,78,68,32,62,67,70,65,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,91,67,72,65,82,93,32,107,101,121,32,39,32,76,73,84,32,44,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,82,69,67,85,82,83,69,32,76,65,84,69,83,84,32,64,32,62,67,70,65,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,68,79,67,79,76,32,48,32,59,10,58,32,67,79,78,83,84,65,78,84,32,67,82,69,65,84,69,32,68,79,67,79,76,32,44,32,39,32,76,73,84,32,44,32,44,32,39,32,69,88,73,84,32,44,32,59,10,58,32,50,67,79,78,83,84,65,78,84,32,83,87,65,80,32,67,82,69,65,84,69,32,68,79,67,79,76,32,44,32,39,32,76,73,84,32,44,32,44,32,39,32,76,73,84,32,44,32,44,32,39,32,69,88,73,84,32,44,32,59,10,58,32,86,65,82,73,65,66,76,69,32,72,69,82,69,32,64,32,67,69,76,76,32,65,76,76,79,84,32,67,82,69,65,84,69,32,68,79,67,79,76,32,44,32,39,32,76,73,84,32,44,32,44,32,39,32,69,88,73,84,32,44,32,59,10,58,32,50,86,65,82,73,65,66,76,69,32,72,69,82,69,32,64,32,50,32,67,69,76,76,83,32,65,76,76,79,84,32,67,82,69,65,84,69,32,68,79,67,79,76,32,44,32,39,32,76,73,84,32,44,32,44,32,39,32,69,88,73,84,32,44,32,59,10,58,32,73,70,32,39,32,48,66,82,65,78,67,72,32,44,32,72,69,82,69,32,64,32,48,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,84,72,69,78,32,68,85,80,32,72,69,82,69,32,64,32,83,87,65,80,32,45,32,83,87,65,80,32,33,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,69,76,83,69,32,39,32,66,82,65,78,67,72,32,44,32,72,69,82,69,32,64,32,48,32,44,32,83,87,65,80,32,68,85,80,32,72,69,82,69,32,64,32,83,87,65,80,32,45,32,83,87,65,80,32,33,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,66,69,71,73,78,32,72,69,82,69,32,64,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,85,78,84,73,76,32,39,32,48,66,82,65,78,67,72,32,44,32,72,69,82,69,32,64,32,45,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,65,71,65,73,78,32,39,32,66,82,65,78,67,72,32,44,32,72,69,82,69,32,64,32,45,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,87,72,73,76,69,32,39,32,48,66,82,65,78,67,72,32,44,32,72,69,82,69,32,64,32,48,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,82,69,80,69,65,84,32,39,32,66,82,65,78,67,72,32,44,32,83,87,65,80,32,72,69,82,69,32,64,32,45,32,44,32,68,85,80,32,72,69,82,69,32,64,32,83,87,65,80,32,45,32,83,87,65,80,32,33,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,85,78,76,69,83,83,32,39,32,48,61,32,44,32,91,67,79,77,80,73,76,69,93,32,73,70,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,68,79,32,72,69,82,69,32,64,32,39,32,83,87,65,80,32,44,32,39,32,62,82,32,44,32,39,32,62,82,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,76,79,79,80,32,39,32,82,62,32,44,32,39,32,82,62,32,44,32,39,32,83,87,65,80,32,44,32,39,32,49,43,32,44,32,39,32,50,68,85,80,32,44,32,39,32,61,32,44,32,39,32,48,66,82,65,78,67,72,32,44,32,72,69,82,69,32,64,32,45,32,44,32,39,32,50,68,82,79,80,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,43,76,79,79,80,32,39,32,82,62,32,44,32,39,32,82,62,32,44,32,39,32,83,87,65,80,32,44,32,39,32,82,79,84,32,44,32,39,32,43,32,44,32,39,32,50,68,85,80,32,44,32,39,32,60,61,32,44,32,39,32,48,66,82,65,78,67,72,32,44,32,72,69,82,69,32,64,32,45,32,44,32,39,32,50,68,82,79,80,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,73,32,39,32,82,64,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,83,80,65,67,69,83,32,68,85,80,32,48,62,32,73,70,32,48,32,68,79,32,83,80,65,67,69,32,76,79,79,80,32,69,76,83,69,32,68,82,79,80,32,84,72,69,78,32,59,10,58,32,65,66,83,32,68,85,80,32,48,60,32,73,70,32,78,69,71,65,84,69,32,84,72,69,78,32,59,10,58,32,68,65,66,83,32,50,68,85,80,32,48,46,32,68,60,32,73,70,32,68,78,69,71,65,84,69,32,84,72,69,78,32,59,10,58,32,46,68,73,71,73,84,32,68,85,80,32,57,32,62,32,73,70,32,53,53,32,69,76,83,69,32,52,56,32,84,72,69,78,32,43,32,69,77,73,84,32,59,10,58,32,46,83,73,71,78,32,68,85,80,32,48,60,32,73,70,32,52,53,32,69,77,73,84,32,78,69,71,65,84,69,32,84,72,69,78,32,59,10,58,32,46,80,79,83,32,66,65,83,69,32,64,32,47,77,79,68,32,63,68,85,80,32,73,70,32,82,69,67,85,82,83,69,32,84,72,69,78,32,46,68,73,71,73,84,32,59,10,58,32,46,32,46,83,73,71,78,32,68,85,80,32,73,70,32,46,80,79,83,32,69,76,83,69,32,46,68,73,71,73,84,32,84,72,69,78,32,59,10,58,32,67,79,85,78,84,80,79,83,32,83,87,65,80,32,49,32,43,32,83,87,65,80,32,66,65,83,69,32,64,32,47,32,63,68,85,80,32,73,70,32,82,69,67,85,82,83,69,32,84,72,69,78,32,59,10,58,32,68,73,71,73,84,83,32,68,85,80,32,48,60,32,73,70,32,49,32,69,76,83,69,32,48,32,84,72,69,78,32,83,87,65,80,32,67,79,85,78,84,80,79,83,32,59,10,58,32,46,82,32,79,86,69,82,32,68,73,71,73,84,83,32,45,32,83,80,65,67,69,83,32,46,32,59,10,58,32,46,32,46,32,83,80,65,67,69,32,59,10,58,32,63,32,64,32,46,32,59,10,58,32,46,83,32,68,83,80,64,32,66,69,71,73,78,32,68,85,80,32,83,48,64,32,62,32,87,72,73,76,69,32,68,85,80,32,63,32,67,69,76,76,32,45,32,82,69,80,69,65,84,32,68,82,79,80,32,59,10,58,32,84,89,80,69,32,48,32,68,79,32,68,85,80,32,67,64,32,69,77,73,84,32,49,32,43,32,76,79,79,80,32,68,82,79,80,32,59,10,58,32,65,76,73,71,78,32,66,69,71,73,78,32,72,69,82,69,32,64,32,67,69,76,76,32,77,79,68,32,87,72,73,76,69,32,48,32,67,44,32,82,69,80,69,65,84,32,59,10,58,32,115,34,32,39,32,76,73,84,83,84,82,73,78,71,32,44,32,72,69,82,69,32,64,32,48,32,44,32,66,69,71,73,78,32,75,69,89,32,68,85,80,32,51,52,32,60,62,32,87,72,73,76,69,32,67,44,32,82,69,80,69,65,84,32,68,82,79,80,32,68,85,80,32,72,69,82,69,32,64,32,83,87,65,80,32,45,32,67,69,76,76,32,45,32,83,87,65,80,32,33,32,65,76,73,71,78,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,46,34,32,91,67,79,77,80,73,76,69,93,32,115,34,32,39,32,84,89,80,69,32,44,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,40,32,66,69,71,73,78,32,75,69,89,32,91,67,72,65,82,93,32,41,32,61,32,85,78,84,73,76,32,59,32,73,77,77,69,68,73,65,84,69,10,58,32,67,79,85,78,84,32,68,85,80,32,49,43,32,83,87,65,80,32,67,64,32,59,10,58,32,77,73,78,32,50,68,85,80,32,60,32,73,70,32,68,82,79,80,32,69,76,83,69,32,78,73,80,32,84,72,69,78,32,59,10,58,32,77,65,88,32,50,68,85,80,32,62,32,73,70,32,68,82,79,80,32,69,76,83,69,32,78,73,80,32,84,72,69,78,32,59,10,58,32,68,48,61,32,79,82,32,48,61,32,59,10,58,32,68,77,73,78,32,50,79,86,69,82,32,50,79,86,69,82,32,68,60,32,73,70,32,50,68,82,79,80,32,69,76,83,69,32,50,78,73,80,32,84,72,69,78,32,59,10,58,32,68,77,65,88,32,50,79,86,69,82,32,50,79,86,69,82,32,68,62,32,73,70,32,50,68,82,79,80,32,69,76,83,69,32,50,78,73,80,32,84,72,69,78,32,59,10,0,0,65,132,23,11,4,64,1,0,0,0,65,136,23,11,4,0,0,0,0,0,65,144,24,11,4,0,0,0,0,0,65,148,24,11,4,0,0,0,0,0,65,152,24,11,4,0,0,0,0,0,65,156,24,11,4,0,0,0,0,0,65,160,24,11,4,0,0,0,0,0,65,176,152,4,11,4,0,0,0,0,0,65,180,152,4,11,4,0,0,0,0,0,65,184,152,4,11,4,0,0,0,0,0,65,192,152,4,11,9,82,85,78,68,79,67,79,76,0,0,65,204,152,4,11,4,64,12,1,0,0,65,208,152,4,11,1,0,0,65,210,152,4,11,2,0,0,0,65,212,152,4,11,2,0,0,0,65,214,152,4,11,2,0,0,0,65,216,152,4,11,4,1,0,0,0,0,65,224,152,4,11,5,67,69,76,76,0,0,65,232,152,4,11,4,96,12,1,0,0,65,240,152,4,11,1,0,0,65,244,152,4,11,4,2,0,0,0,0,65,128,153,4,11,2,64,0,0,65,132,153,4,11,4,128,12,1,0,0,65,144,153,4,11,1,0,0,65,148,153,4,11,4,3,0,0,0,0,65,160,153,4,11,3,67,64,0,0,65,164,153,4,11,4,160,12,1,0,0,65,176,153,4,11,1,0,0,65,180,153,4,11,4,4,0,0,0,0,65,192,153,4,11,4,75,69,89,0,0,65,196,153,4,11,4,192,12,1,0,0,65,208,153,4,11,1,0,0,65,212,153,4,11,4,5,0,0,0,0,65,224,153,4,11,5,69,77,73,84,0,0,65,232,153,4,11,4,224,12,1,0,0,65,240,153,4,11,1,0,0,65,244,153,4,11,4,6,0,0,0,0,65,128,154,4,11,5,68,82,79,80,0,0,65,136,154,4,11,4,0,13,1,0,0,65,144,154,4,11,1,0,0,65,148,154,4,11,4,7,0,0,0,0,65,160,154,4,11,5,69,88,73,84,0,0,65,168,154,4,11,4,32,13,1,0,0,65,176,154,4,11,1,0,0,65,180,154,4,11,4,8,0,0,0,0,65,192,154,4,11,4,66,89,69,0,0,65,196,154,4,11,4,64,13,1,0,0,65,208,154,4,11,1,0,0,65,212,154,4,11,4,0,0,0,0,0,65,216,154,4,11,4,9,0,0,0,0,65,224,154,4,11,7,76,65,84,69,83,84,0,0,65,232,154,4,11,4,96,13,1,0,0,65,240,154,4,11,1,0,0,65,244,154,4,11,4,10,0,0,0,0,65,128,155,4,11,5,72,69,82,69,0,0,65,136,155,4,11,4,128,13,1,0,0,65,144,155,4,11,1,0,0,65,148,155,4,11,4,11,0,0,0,0,65,160,155,4,11,5,66,65,83,69,0,0,65,168,155,4,11,4,160,13,1,0,0,65,176,155,4,11,1,0,0,65,180,155,4,11,4,12,0,0,0,0,65,192,155,4,11,6,83,84,65,84,69,0,0,65,200,155,4,11,4,192,13,1,0,0,65,208,155,4,11,1,0,0,65,212,155,4,11,4,13,0,0,0,0,65,224,155,4,11,2,91,0,0,65,228,155,4,11,4,224,13,1,0,0,65,240,155,4,11,1,128,0,65,244,155,4,11,4,0,0,0,0,0,65,248,155,4,11,4,14,0,0,0,0,65,128,156,4,11,2,93,0,0,65,132,156,4,11,4,0,14,1,0,0,65,144,156,4,11,1,0,0,65,148,156,4,11,4,15,0,0,0,0,65,160,156,4,11,5,72,73,68,69,0,0,65,168,156,4,11,4,32,14,1,0,0,65,176,156,4,11,1,0,0,65,180,156,4,11,4,16,0,0,0,0,65,192,156,4,11,3,82,62,0,0,65,196,156,4,11,4,64,14,1,0,0,65,208,156,4,11,1,0,0,65,212,156,4,11,4,17,0,0,0,0,65,224,156,4,11,3,62,82,0,0,65,228,156,4,11,4,96,14,1,0,0,65,240,156,4,11,1,0,0,65,244,156,4,11,4,18,0,0,0,0,65,128,157,4,11,5,75,69,89,63,0,0,65,136,157,4,11,4,128,14,1,0,0,65,144,157,4,11,1,0,0,65,148,157,4,11,4,19,0,0,0,0,65,160,157,4,11,7,66,82,65,78,67,72,0,0,65,168,157,4,11,4,160,14,1,0,0,65,176,157,4,11,1,0,0,65,180,157,4,11,4,20,0,0,0,0,65,192,157,4,11,8,48,66,82,65,78,67,72,0,0,65,200,157,4,11,4,192,14,1,0,0,65,208,157,4,11,1,0,0,65,212,157,4,11,4,21,0,0,0,0,65,224,157,4,11,10,73,77,77,69,68,73,65,84,69,0,0,65,236,157,4,11,4,224,14,1,0,0,65,240,157,4,11,1,128,0,65,244,157,4,11,4,22,0,0,0,0,65,128,158,4,11,5,70,82,69,69,0,0,65,136,158,4,11,4,0,15,1,0,0,65,144,158,4,11,1,0,0,65,148,158,4,11,4,0,0,0,0,0,65,152,158,4,11,4,23,0,0,0,0,65,160,158,4,11,4,83,48,64,0,0,65,164,158,4,11,4,32,15,1,0,0,65,176,158,4,11,1,0,0,65,180,158,4,11,4,24,0,0,0,0,65,192,158,4,11,5,68,83,80,64,0,0,65,200,158,4,11,4,64,15,1,0,0,65,208,158,4,11,1,0,0,65,212,158,4,11,4,25,0,0,0,0,65,224,158,4,11,4,78,79,84,0,0,65,228,158,4,11,4,96,15,1,0,0,65,240,158,4,11,1,0,0,65,244,158,4,11,4,26,0,0,0,0,65,128,159,4,11,4,68,85,80,0,0,65,132,159,4,11,4,128,15,1,0,0,65,144,159,4,11,1,0,0,65,148,159,4,11,4,27,0,0,0,0,65,160,159,4,11,2,33,0,0,65,164,159,4,11,4,160,15,1,0,0,65,176,159,4,11,1,0,0,65,180,159,4,11,4,28,0,0,0,0,65,192,159,4,11,3,67,33,0,0,65,196,159,4,11,4,192,15,1,0,0,65,208,159,4,11,1,0,0,65,212,159,4,11,4,29,0,0,0,0,65,224,159,4,11,5,83,87,65,80,0,0,65,232,159,4,11,4,224,15,1,0,0,65,240,159,4,11,1,0,0,65,244,159,4,11,4,30,0,0,0,0,65,128,160,4,11,5,79,86,69,82,0,0,65,136,160,4,11,4,0,16,1,0,0,65,144,160,4,11,1,0,0,65,148,160,4,11,4,31,0,0,0,0,65,160,160,4,11,2,44,0,0,65,164,160,4,11,4,32,16,1,0,0,65,176,160,4,11,1,0,0,65,180,160,4,11,4,32,0,0,0,0,65,192,160,4,11,3,67,44,0,0,65,196,160,4,11,4,64,16,1,0,0,65,208,160,4,11,1,0,0,65,212,160,4,11,4,33,0,0,0,0,65,224,160,4,11,5,87,79,82,68,0,0,65,232,160,4,11,4,96,16,1,0,0,65,240,160,4,11,1,0,0,65,244,160,4,11,4,34,0,0,0,0,65,128,161,4,11,5,70,73,78,68,0,0,65,136,161,4,11,4,128,16,1,0,0,65,144,161,4,11,1,0,0,65,148,161,4,11,4,35,0,0,0,0,65,160,161,4,11,5,62,67,70,65,0,0,65,168,161,4,11,4,160,16,1,0,0,65,176,161,4,11,1,0,0,65,178,161,4,11,2,0,0,0,65,180,161,4,11,4,36,0,0,0,0,65,192,161,4,11,7,78,85,77,66,69,82,0,0,65,200,161,4,11,4,192,16,1,0,0,65,208,161,4,11,1,0,0,65,212,161,4,11,4,37,0,0,0,0,65,224,161,4,11,4,76,73,84,0,0,65,228,161,4,11,4,224,16,1,0,0,65,240,161,4,11,1,0,0,65,244,161,4,11,4,38,0,0,0,0,65,128,162,4,11,5,81,85,73,84,0,0,65,136,162,4,11,4,0,17,1,0,0,65,144,162,4,11,1,0,0,65,146,162,4,11,2,0,0,0,65,148,162,4,11,4,39,0,0,0,0,65,160,162,4,11,2,43,0,0,65,164,162,4,11,4,32,17,1,0,0,65,176,162,4,11,1,0,0,65,180,162,4,11,4,40,0,0,0,0,65,192,162,4,11,2,45,0,0,65,196,162,4,11,4,64,17,1,0,0,65,208,162,4,11,1,0,0,65,212,162,4,11,4,41,0,0,0,0,65,224,162,4,11,2,42,0,0,65,228,162,4,11,4,96,17,1,0,0,65,240,162,4,11,1,0,0,65,244,162,4,11,4,42,0,0,0,0,65,128,163,4,11,5,47,77,79,68,0,0,65,136,163,4,11,4,128,17,1,0,0,65,144,163,4,11,1,0,0,65,148,163,4,11,4,43,0,0,0,0,65,160,163,4,11,4,82,79,84,0,0,65,164,163,4,11,4,160,17,1,0,0,65,176,163,4,11,1,0,0,65,180,163,4,11,4,44,0,0,0,0,65,192,163,4,11,7,67,82,69,65,84,69,0,0,65,200,163,4,11,4,192,17,1,0,0,65,208,163,4,11,1,0,0,65,212,163,4,11,4,45,0,0,0,0,65,224,163,4,11,2,58,0,0,65,228,163,4,11,4,224,17,1,0,0,65,240,163,4,11,1,0,0,65,244,163,4,11,4,46,0,0,0,0,65,128,164,4,11,2,59,0,0,65,132,164,4,11,4,0,18,1,0,0,65,144,164,4,11,1,128,0,65,148,164,4,11,4,47,0,0,0,0,65,160,164,4,11,3,82,64,0,0,65,164,164,4,11,4,32,18,1,0,0,65,176,164,4,11,1,0,0,65,180,164,4,11,4,48,0,0,0,0,65,192,164,4,11,2,74,0,0,65,196,164,4,11,4,64,18,1,0,0,65,208,164,4,11,1,0,0,65,212,164,4,11,4,49,0,0,0,0,65,224,164,4,11,2,39,0,0,65,228,164,4,11,4,96,18,1,0,0,65,240,164,4,11,1,128,0,65,244,164,4,11,4,50,0,0,0,0,65,128,165,4,11,2,61,0,0,65,132,165,4,11,4,128,18,1,0,0,65,144,165,4,11,1,0,0,65,148,165,4,11,4,51,0,0,0,0,65,160,165,4,11,2,60,0,0,65,164,165,4,11,4,160,18,1,0,0,65,176,165,4,11,1,0,0,65,180,165,4,11,4,52,0,0,0,0,65,192,165,4,11,2,62,0,0,65,196,165,4,11,4,192,18,1,0,0,65,208,165,4,11,1,0,0,65,212,165,4,11,4,53,0,0,0,0,65,224,165,4,11,4,65,78,68,0,0,65,228,165,4,11,4,224,18,1,0,0,65,240,165,4,11,1,0,0,65,244,165,4,11,4,54,0,0,0,0,65,128,166,4,11,3,79,82,0,0,65,132,166,4,11,4,0,19,1,0,0,65,144,166,4,11,1,0,0,65,148,166,4,11,4,55,0,0,0,0,65,160,166,4,11,5,63,68,85,80,0,0,65,168,166,4,11,4,32,19,1,0,0,65,176,166,4,11,1,0,0,65,180,166,4,11,4,56,0,0,0,0,65,192,166,4,11,10,76,73,84,83,84,82,73,78,71,0,0,65,204,166,4,11,4,64,19,1,0,0,65,208,166,4,11,1,0,0,65,212,166,4,11,4,57,0,0,0,0,65,224,166,4,11,4,88,79,82,0,0,65,228,166,4,11,4,96,19,1,0,0,65,240,166,4,11,1,0,0,65,244,166,4,11,4,58,0,0,0,0,65,128,167,4,11,3,42,47,0,0,65,132,167,4,11,4,128,19,1,0,0,65,144,167,4,11,1,0,0,65,148,167,4,11,4,59,0,0,0,0,65,160,167,4,11,6,42,47,77,79,68,0,0,65,168,167,4,11,4,160,19,1,0,0,65,176,167,4,11,1,0,0,65,180,167,4,11,4,60,0,0,0,0,65,192,167,4,11,3,68,61,0,0,65,196,167,4,11,4,192,19,1,0,0,65,208,167,4,11,1,0,0,65,212,167,4,11,4,61,0,0,0,0,65,224,167,4,11,3,68,60,0,0,65,228,167,4,11,4,224,19,1,0,0,65,240,167,4,11,1,0,0,65,244,167,4,11,4,62,0,0,0,0,65,128,168,4,11,3,68,62,0,0,65,132,168,4,11,4,0,20,1,0,0,65,144,168,4,11,1,0,0,65,148,168,4,11,4,63,0,0,0,0,65,160,168,4,11,4,68,85,60,0,0,65,164,168,4,11,4,32,20,1,0,0,65,176,168,4,11,1,0,0,65,180,168,4,11,4,64,0,0,0,0,65,192,168,4,11,3,68,43,0,0,65,196,168,4,11,4,64,20,1,0,0,65,208,168,4,11,1,0,0,65,212,168,4,11,4,65,0,0,0,0,65,224,168,4,11,3,68,45,0,0,65,228,168,4,11,4,96,20,1,0,0,65,240,168,4,11,1,0,0,65,244,168,4,11,4,66,0,0,0,0,65,128,169,4,11,3,68,42,0,0,65,132,169,4,11,4,128,20,1,0,0,65,144,169,4,11,1,0,0,65,148,169,4,11,4,67,0,0,0,0,65,160,169,4,11,3,68,47,0,0,65,164,169,4,11,4,160,20,1,0,0,65,176,169,4,11,1,0,0,65,180,169,4,11,4,68,0,0,0,0,65,192,169,4,11,6,50,83,87,65,80,0,0,65,200,169,4,11,4,192,20,1,0,0,65,208,169,4,11,1,0,0,65,212,169,4,11,4,69,0,0,0,0,65,224,169,4,11,6,50,79,86,69,82,0,0,65,232,169,4,11,4,224,20,1,0,0,65,240,169,4,11,1,0,0,65,244,169,4,11,4,70,0,0,0,0,65,128,170,4,11,5,50,82,79,84,0,0,65,136,170,4,11,4,0,21,1,0,0,65,144,170,4,11,1,0]);
WebAssembly
.compile(wasmCode)
.then(m => WebAssembly.instantiate(m, {
env: {
getchar: () => {
return -1;
},
putchar: (n) => {console.log(String.fromCharCode(n))}
}
}))
.then(m => {
window.wow = m;
m.exports.main();
console.log("DONE");
});
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*
* I, the copyright holder of this work, hereby release it into the public
* domain. This applies worldwide. In case this is not legally possible, I grant
* any entity the right to use this work for any purpose, without any conditions,
* unless such conditions are required by law.
*
*******************************************************************************/
/* Only a single include here; I'll define everything on the fly to keep
* dependencies as low as possible. In this file, the only C standard functions
* used are getchar, putchar and the EOF value. */
#include <stdio.h>
/* Base cell data types. Use short/long on most systems for 16 bit cells. */
/* Experiment here if necessary. */
#define CELL_BASE_TYPE int
#define DOUBLE_CELL_BASE_TYPE long
/* Basic memory configuration */
#define MEM_SIZE 65536 /* main memory size in bytes */
#define STACK_SIZE 192 /* cells reserved for the stack */
#define RSTACK_SIZE 64 /* cells reserved for the return stack */
#define INPUT_LINE_SIZE 32 /* bytes reserved for the WORD buffer */
/******************************************************************************/
/* Our basic data types */
typedef CELL_BASE_TYPE scell;
typedef DOUBLE_CELL_BASE_TYPE dscell;
typedef unsigned CELL_BASE_TYPE cell;
typedef unsigned DOUBLE_CELL_BASE_TYPE dcell;
typedef unsigned char byte;
#define CELL_SIZE sizeof(cell)
#define DCELL_SIZE sizeof(dcell)
/* A few constants that describe the memory layout of this implementation */
#define LATEST_POSITION INPUT_LINE_SIZE
#define HERE_POSITION (LATEST_POSITION + CELL_SIZE)
#define BASE_POSITION (HERE_POSITION + CELL_SIZE)
#define STATE_POSITION (BASE_POSITION + CELL_SIZE)
#define STACK_POSITION (STATE_POSITION + CELL_SIZE)
#define RSTACK_POSITION (STACK_POSITION + STACK_SIZE * CELL_SIZE)
#define HERE_START (RSTACK_POSITION + RSTACK_SIZE * CELL_SIZE)
#define MAX_BUILTIN_ID 71
/* Flags and masks for the dictionary */
#define FLAG_IMMEDIATE 0x80
#define FLAG_HIDDEN 0x40
#define MASK_NAMELENGTH 0x1F
/* This is the main memory to be used by this Forth. There will be no malloc
* in this file. */
byte memory[MEM_SIZE];
/* Pointers to Forth variables stored inside the main memory array */
cell *latest;
cell *here;
cell *base;
cell *state;
cell *sp;
cell *stack;
cell *rsp;
cell *rstack;
/* A few helper variables for the compiler */
int exitReq;
int errorFlag;
cell next;
cell lastIp;
cell quit_address;
cell commandAddress;
cell maxBuiltinAddress;
/* The TIB, stored outside the main memory array for now */
char lineBuffer[128];
int charsInLineBuffer = 0;
int positionInLineBuffer = 0;
/* A basic setup for defining builtins. This Forth uses impossibly low
* adresses as IDs for the builtins so we can define builtins as
* standard C functions. Slower but easier to port. */
#define BUILTIN(id, name, c_name, flags) const int c_name##_id=id; const char* c_name##_name=name; const byte c_name##_flags=flags; void c_name()
#define ADD_BUILTIN(c_name) addBuiltin(c_name##_id, c_name##_name, c_name##_flags, c_name)
typedef void(*builtin)();
builtin builtins[MAX_BUILTIN_ID] = { 0 };
/* This is our initialization script containing all the words we define in
* Forth for convenience. Focus is on simplicity, not speed. Partly copied from
* Jonesforth (see top of file). */
char *initscript_pos;
const char *initScript =
": DECIMAL 10 BASE ! ;\n"
": HEX 16 BASE ! ;\n"
": OCTAL 8 BASE ! ;\n"
": 2DUP OVER OVER ;\n"
": 2DROP DROP DROP ;\n"
": NIP SWAP DROP ;\n"
": 2NIP 2SWAP 2DROP ;\n"
": TUCK SWAP OVER ;\n"
": / /MOD NIP ;\n"
": MOD /MOD DROP ;\n"
": BL 32 ;\n"
": CR 10 EMIT ;\n"
": SPACE BL EMIT ;\n"
": NEGATE 0 SWAP - ;\n"
": DNEGATE 0. 2SWAP D- ;\n"
": CELLS CELL * ;\n"
": ALLOT HERE @ + HERE ! ;\n"
": TRUE -1 ;\n"
": FALSE 0 ;\n"
": 0= 0 = ;\n"
": 0< 0 < ;\n"
": 0> 0 > ;\n"
": <> = 0= ;\n"
": <= > 0= ;\n"
": >= < 0= ;\n"
": 0<= 0 <= ;\n"
": 0>= 0 >= ;\n"
": 1+ 1 + ;\n"
": 1- 1 - ;\n"
": 2+ 2 + ;\n"
": 2- 2 - ;\n"
": 2/ 2 / ;\n"
": 2* 2 * ;\n"
": D2/ 2. D/ ;\n"
": +! DUP @ ROT + SWAP ! ;\n"
": [COMPILE] WORD FIND >CFA , ; IMMEDIATE\n"
": [CHAR] key ' LIT , , ; IMMEDIATE\n"
": RECURSE LATEST @ >CFA , ; IMMEDIATE\n"
": DOCOL 0 ;\n"
": CONSTANT CREATE DOCOL , ' LIT , , ' EXIT , ;\n"
": 2CONSTANT SWAP CREATE DOCOL , ' LIT , , ' LIT , , ' EXIT , ;\n"
": VARIABLE HERE @ CELL ALLOT CREATE DOCOL , ' LIT , , ' EXIT , ;\n" /* TODO: Allot AFTER the code, not before */
": 2VARIABLE HERE @ 2 CELLS ALLOT CREATE DOCOL , ' LIT , , ' EXIT , ;\n" /* TODO: Allot AFTER the code, not before */
": IF ' 0BRANCH , HERE @ 0 , ; IMMEDIATE\n"
": THEN DUP HERE @ SWAP - SWAP ! ; IMMEDIATE\n"
": ELSE ' BRANCH , HERE @ 0 , SWAP DUP HERE @ SWAP - SWAP ! ; IMMEDIATE\n"
": BEGIN HERE @ ; IMMEDIATE\n"
": UNTIL ' 0BRANCH , HERE @ - , ; IMMEDIATE\n"
": AGAIN ' BRANCH , HERE @ - , ; IMMEDIATE\n"
": WHILE ' 0BRANCH , HERE @ 0 , ; IMMEDIATE\n"
": REPEAT ' BRANCH , SWAP HERE @ - , DUP HERE @ SWAP - SWAP ! ; IMMEDIATE\n"
": UNLESS ' 0= , [COMPILE] IF ; IMMEDIATE\n"
": DO HERE @ ' SWAP , ' >R , ' >R , ; IMMEDIATE\n"
": LOOP ' R> , ' R> , ' SWAP , ' 1+ , ' 2DUP , ' = , ' 0BRANCH , HERE @ - , ' 2DROP , ; IMMEDIATE\n"
": +LOOP ' R> , ' R> , ' SWAP , ' ROT , ' + , ' 2DUP , ' <= , ' 0BRANCH , HERE @ - , ' 2DROP , ; IMMEDIATE\n"
": I ' R@ , ; IMMEDIATE\n"
": SPACES DUP 0> IF 0 DO SPACE LOOP ELSE DROP THEN ;\n"
": ABS DUP 0< IF NEGATE THEN ;\n"
": DABS 2DUP 0. D< IF DNEGATE THEN ;\n"
": .DIGIT DUP 9 > IF 55 ELSE 48 THEN + EMIT ;\n"
": .SIGN DUP 0< IF 45 EMIT NEGATE THEN ;\n" /* BUG: 10000000000... will be shown wrong */
": .POS BASE @ /MOD ?DUP IF RECURSE THEN .DIGIT ;\n"
": . .SIGN DUP IF .POS ELSE .DIGIT THEN ;\n"
": COUNTPOS SWAP 1 + SWAP BASE @ / ?DUP IF RECURSE THEN ;\n"
": DIGITS DUP 0< IF 1 ELSE 0 THEN SWAP COUNTPOS ;\n"
": .R OVER DIGITS - SPACES . ;\n"
": . . SPACE ;\n"
": ? @ . ;\n"
": .S DSP@ BEGIN DUP S0@ > WHILE DUP ? CELL - REPEAT DROP ;\n"
": TYPE 0 DO DUP C@ EMIT 1 + LOOP DROP ;\n"
": ALIGN BEGIN HERE @ CELL MOD WHILE 0 C, REPEAT ;\n"
": s\" ' LITSTRING , HERE @ 0 , BEGIN KEY DUP 34 <> WHILE C, REPEAT DROP DUP HERE @ SWAP - CELL - SWAP ! ALIGN ; IMMEDIATE\n"
": .\" [COMPILE] s\" ' TYPE , ; IMMEDIATE\n"
": ( BEGIN KEY [CHAR] ) = UNTIL ; IMMEDIATE\n"
": COUNT DUP 1+ SWAP C@ ;\n"
": MIN 2DUP < IF DROP ELSE NIP THEN ;\n"
": MAX 2DUP > IF DROP ELSE NIP THEN ;\n"
": D0= OR 0= ;\n"
": DMIN 2OVER 2OVER D< IF 2DROP ELSE 2NIP THEN ;\n"
": DMAX 2OVER 2OVER D> IF 2DROP ELSE 2NIP THEN ;\n"
;
/******************************************************************************/
/* The primary data output function. This is the place to change if you want
* to e.g. output data on a microcontroller via a serial interface. */
void putkey(char c)
{
putchar(c);
}
/* The primary data input function. This is where you place the code to e.g.
* read from a serial line. */
int llkey()
{
if (*initscript_pos) return *(initscript_pos++);
return getchar();
}
/* Anything waiting in the keyboard buffer? */
int keyWaiting()
{
return positionInLineBuffer < charsInLineBuffer ? -1 : 0;
}
/* Line buffered character input. We're duplicating the functionality of the
* stdio library here to make the code easier to port to other input sources */
int getkey()
{
int c;
if (keyWaiting())
return lineBuffer[positionInLineBuffer++];
charsInLineBuffer = 0;
while ((c = llkey()) != EOF)
{
if (charsInLineBuffer == sizeof(lineBuffer)) break;
lineBuffer[charsInLineBuffer++] = c;
if (c == '\n') break;
}
positionInLineBuffer = 1;
return lineBuffer[0];
}
/* C string output */
void tell(const char *str)
{
while (*str)
putkey(*str++);
}
/* The basic (data) stack operations */
cell pop()
{
if (*sp == 1)
{
tell("? Stack underflow\n");
errorFlag = 1;
return 0;
}
return stack[--(*sp)];
}
cell tos()
{
if (*sp == 1)
{
tell("? Stack underflow\n");
errorFlag = 1;
return 0;
}
return stack[(*sp)-1];
}
void push(cell data)
{
if (*sp >= STACK_SIZE)
{
tell("? Stack overflow\n");
errorFlag = 1;
return;
}
stack[(*sp)++] = data;
}
dcell dpop()
{
cell tmp[2];
tmp[1] = pop();
tmp[0] = pop();
return *((dcell*)tmp);
}
void dpush(dcell data)
{
cell tmp[2];
*((dcell*)tmp) = data;
push(tmp[0]);
push(tmp[1]);
}
/* The basic return stack operations */
cell rpop()
{
if (*rsp == 1)
{
tell("? RStack underflow\n");
errorFlag = 1;
return 0;
}
return rstack[--(*rsp)];
}
void rpush(cell data)
{
if (*rsp >= RSTACK_SIZE)
{
tell("? RStack overflow\n");
errorFlag = 1;
return;
}
rstack[(*rsp)++] = data;
}
/* Secure memory access */
cell readMem(cell address)
{
if (address > MEM_SIZE)
{
tell("Internal error in readMem: Invalid addres\n");
errorFlag = 1;
return 0;
}
return *((cell*)(memory + address));
}
void writeMem(cell address, cell value)
{
if (address > MEM_SIZE)
{
tell("Internal error in writeMem: Invalid address\n");
errorFlag = 1;
return;
}
*((cell*)(memory + address)) = value;
}
/* Reading a word into the input line buffer */
byte readWord()
{
char *line = (char*)memory;
byte len = 0;
int c;
while ((c = getkey()) != EOF)
{
if (c == ' ') continue;
if (c == '\n') continue;
if (c != '\\') break;
while ((c = getkey()) != EOF)
if (c == '\n')
break;
}
while (c != ' ' && c != '\n' && c != EOF)
{
if (len >= (INPUT_LINE_SIZE - 1))
break;
line[++len] = c;
c = getkey();
}
line[0] = len;
return len;
}
/* toupper() clone so we don't have to pull in ctype.h */
char up(char c)
{
return (c >= 'a' && c <= 'z') ? c - 'a' + 'A' : c;
}
/* Dictionary lookup */
cell findWord(cell address, cell len)
{
cell ret = *latest;
char *name = (char*)&memory[address];
cell i;
int found;
for (ret = *latest; ret; ret = readMem(ret))
{
if ((memory[ret + CELL_SIZE] & MASK_NAMELENGTH) != len) continue;
if (memory[ret + CELL_SIZE] & FLAG_HIDDEN) continue;
found = 1;
for (i = 0; i < len; i++)
{
if (up(memory[ret + i + 1 + CELL_SIZE]) != up(name[i]))
{
found = 0;
break;
}
}
if (found) break;
}
return ret;
}
/* Basic number parsing, base <= 36 only atm */
void parseNumber(byte *word, cell len, dcell *number, cell *notRead, byte *isDouble)
{
int negative = 0;
cell i;
char c;
cell current;
*number = 0;
*isDouble = 0;
if (len == 0)
{
*notRead = 0;
return;
}
if (word[0] == '-')
{
negative = 1;
len--;
word++;
}
else if (word[0] == '+')
{
len--;
word++;
}
for (i = 0; i < len; i++)
{
c = *word;
word++;
if (c == '.') { *isDouble = 1; continue; }
else if (c >= '0' && c <= '9') current = c - '0';
else if (c >= 'A' && c <= 'Z') current = 10 + c - 'A';
else if (c >= 'a' && c <= 'z') current = 10 + c - 'a';
else break;
if (current >= *base) break;
*number = *number * *base + current;
}
*notRead = len - i;
if (negative) *number = (-((scell)*number));
}
/*******************************************************************************
*
* Builtin definitions
*
*******************************************************************************/
BUILTIN(0, "RUNDOCOL", docol, 0)
{
rpush(lastIp);
next = commandAddress + CELL_SIZE;
}
/* The first few builtins are very simple, not need to waste vertical space here */
BUILTIN( 1, "CELL", doCellSize, 0) { push(CELL_SIZE); }
BUILTIN( 2, "@", memRead, 0) { push(readMem(pop())); }
BUILTIN( 3, "C@", memReadByte, 0) { push(memory[pop()]); }
BUILTIN( 4, "KEY", key, 0) { push(getkey()); }
BUILTIN( 5, "EMIT", emit, 0) { putkey(pop() & 255); }
BUILTIN( 6, "DROP", drop, 0) { pop(); }
BUILTIN( 7, "EXIT", doExit, 0) { next = rpop(); }
BUILTIN( 8, "BYE", bye, 0) { exitReq = 1; }
BUILTIN( 9, "LATEST", doLatest, 0) { push(LATEST_POSITION); }
BUILTIN(10, "HERE", doHere, 0) { push(HERE_POSITION); }
BUILTIN(11, "BASE", doBase, 0) { push(BASE_POSITION); }
BUILTIN(12, "STATE", doState, 0) { push(STATE_POSITION); }
BUILTIN(13, "[", gotoInterpreter, FLAG_IMMEDIATE) { *state = 0; }
BUILTIN(14, "]", gotoCompiler, 0) { *state = 1; }
BUILTIN(15, "HIDE", hide, 0) { memory[*latest + CELL_SIZE] ^= FLAG_HIDDEN; }
BUILTIN(16, "R>", rtos, 0) { push(rpop()); }
BUILTIN(17, ">R", stor, 0) { rpush(pop()); }
BUILTIN(18, "KEY?", key_p, 0) { push(keyWaiting()); }
BUILTIN(19, "BRANCH", branch, 0) { next += readMem(next); }
BUILTIN(20, "0BRANCH", zbranch, 0) { next += pop() ? CELL_SIZE : readMem(next); }
BUILTIN(21, "IMMEDIATE", toggleImmediate, FLAG_IMMEDIATE) { memory[*latest + CELL_SIZE] ^= FLAG_IMMEDIATE; }
BUILTIN(22, "FREE", doFree, 0) { push(MEM_SIZE - *here); }
BUILTIN(23, "S0@", s0_r, 0) { push(STACK_POSITION + CELL_SIZE); }
BUILTIN(24, "DSP@", dsp_r, 0) { push(STACK_POSITION + *sp * CELL_SIZE); }
BUILTIN(25, "NOT", not, 0) { push(~pop()); }
BUILTIN(26, "DUP", dup, 0) { push(tos()); }
BUILTIN(27, "!", memWrite, 0)
{
cell address = pop();
cell value = pop();
writeMem(address, value);
}
BUILTIN(28, "C!", memWriteByte, 0)
{
cell address = pop();
cell value = pop();
memory[address] = value & 255;
}
BUILTIN(29, "SWAP", swap, 0)
{
cell a = pop();
cell b = pop();
push(a);
push(b);
}
BUILTIN(30, "OVER", over, 0)
{
cell a = pop();
cell b = tos();
push(a);
push(b);
}
BUILTIN(31, ",", comma, 0)
{
push(*here);
memWrite();
*here += CELL_SIZE;
}
BUILTIN(32, "C,", commaByte, 0)
{
push(*here);
memWriteByte();
*here += sizeof(byte);
}
BUILTIN(33, "WORD", word, 0)
{
byte len = readWord();
push(1);
push(len);
}
BUILTIN(34, "FIND", find, 0)
{
cell len = pop();
cell address = pop();
cell ret = findWord(address, len);
push(ret);
}
cell getCfa(cell address)
{
byte len = (memory[address + CELL_SIZE] & MASK_NAMELENGTH) + 1;
while ((len & (CELL_SIZE-1)) != 0) len++;
return address + CELL_SIZE + len;
}
BUILTIN(35, ">CFA", cfa, 0)
{
cell address = pop();
cell ret = getCfa(address);
if (ret < maxBuiltinAddress)
push(readMem(ret));
else
push(ret);
}
BUILTIN(36, "NUMBER", number, 0)
{
dcell num;
cell notRead;
byte isDouble;
cell len = pop();
byte* address = &memory[pop()];
parseNumber(address, len, &num, &notRead, &isDouble);
if (isDouble) dpush(num); else push((cell)num);
push(notRead);
}
BUILTIN(37, "LIT", lit, 0)
{
push(readMem(next));
next += CELL_SIZE;
}
/* Outer and inner interpreter, TODO split up */
BUILTIN(38, "QUIT", quit, 0)
{
cell address;
dcell number;
cell notRead;
cell command;
int i;
byte isDouble;
cell tmp[2];
int immediate;
for (exitReq = 0; exitReq == 0;)
{
lastIp = next = quit_address;
errorFlag = 0;
word();
find();
address = pop();
if (address)
{
immediate = (memory[address + CELL_SIZE] & FLAG_IMMEDIATE);
commandAddress = getCfa(address);
command = readMem(commandAddress);
if (*state && !immediate)
{
if (command < MAX_BUILTIN_ID && command != docol_id)
push(command);
else
push(commandAddress);
comma();
}
else
{
while (!errorFlag && !exitReq)
{
if (command == quit_id) break;
else if (command < MAX_BUILTIN_ID) builtins[command]();
else
{
lastIp = next;
next = command;
}
commandAddress = next;
command = readMem(commandAddress);
next += CELL_SIZE;
}
}
}
else
{
parseNumber(&memory[1], memory[0], &number, &notRead, &isDouble);
if (notRead)
{
tell("Unknown word: ");
for (i=0; i<memory[0]; i++)
putkey(memory[i+1]);
putkey('\n');
*sp = *rsp = 1;
continue;
}
else
{
if (*state)
{
*((dcell*)tmp) = number;
push(lit_id);
comma();
if (isDouble)
{
push(tmp[0]);
comma();
push(lit_id);
comma();
push(tmp[1]);
comma();
}
else
{
push((cell)number);
comma();
}
}
else
{
if (isDouble) dpush(number); else push((cell)number);
}
}
}
if (errorFlag)
*sp = *rsp = 1;
else if (!keyWaiting() && !(*initscript_pos))
tell(" OK\n");
}
}
BUILTIN(39, "+", plus, 0)
{
scell n1 = pop();
scell n2 = pop();
push(n1 + n2);
}
BUILTIN(40, "-", minus, 0)
{
scell n1 = pop();
scell n2 = pop();
push(n2 - n1);
}
BUILTIN(41, "*", mul, 0)
{
scell n1 = pop();
scell n2 = pop();
push(n1 * n2);
}
BUILTIN(42, "/MOD", divmod, 0)
{
scell n1 = pop();
scell n2 = pop();
push(n2 % n1);
push(n2 / n1);
}
BUILTIN(43, "ROT", rot, 0)
{
cell a = pop();
cell b = pop();
cell c = pop();
push(b);
push(a);
push(c);
}
void createWord(const char* name, byte len, byte flags);
BUILTIN(44, "CREATE", doCreate, 0)
{
byte len;
cell address;
word();
len = pop() & 255;
address = pop();
createWord((char*)&memory[address], len, 0);
}
BUILTIN(45, ":", colon, 0)
{
doCreate();
push(docol_id);
comma();
hide();
*state = 1;
}
BUILTIN(46, ";", semicolon, FLAG_IMMEDIATE)
{
push(doExit_id);
comma();
hide();
*state = 0;
}
BUILTIN(47, "R@", rget, 0)
{
cell tmp = rpop();
rpush(tmp);
push(tmp);
}
BUILTIN(48, "J", doJ, 0)
{
cell tmp1 = rpop();
cell tmp2 = rpop();
cell tmp3 = rpop();
rpush(tmp3);
rpush(tmp2);
rpush(tmp1);
push(tmp3);
}
BUILTIN(49, "'", tick, FLAG_IMMEDIATE)
{
word();
find();
cfa();
if (*state)
{
push(lit_id);
comma();
comma();
}
}
BUILTIN(50, "=", equals, 0)
{
cell a1 = pop();
cell a2 = pop();
push(a2 == a1 ? -1 : 0);
}
BUILTIN(51, "<", smaller, 0)
{
scell a1 = pop();
scell a2 = pop();
push(a2 < a1 ? -1 : 0);
}
BUILTIN(52, ">", larger, 0)
{
scell a1 = pop();
scell a2 = pop();
push(a2 > a1 ? -1 : 0);
}
BUILTIN(53, "AND", doAnd, 0)
{
cell a1 = pop();
cell a2 = pop();
push(a2 & a1);
}
BUILTIN(54, "OR", doOr, 0)
{
cell a1 = pop();
cell a2 = pop();
push(a2 | a1);
}
BUILTIN(55, "?DUP", p_dup, 0)
{
cell a = tos();
if (a) push(a);
}
BUILTIN(56, "LITSTRING", litstring, 0)
{
cell length = readMem(next);
next += CELL_SIZE;
push(next);
push(length);
next += length;
while (next & (CELL_SIZE-1))
next++;
}
BUILTIN(57, "XOR", xor, 0)
{
cell a = pop();
cell b = pop();
push(a ^ b);
}
BUILTIN(58, "*/", timesDivide, 0)
{
cell n3 = pop();
dcell n2 = pop();
dcell n1 = pop();
dcell r = (n1 * n2) / n3;
push((cell)r);
if ((cell)r != r)
{
tell("Arithmetic overflow\n");
errorFlag = 1;
}
}
BUILTIN(59, "*/MOD", timesDivideMod, 0)
{
cell n3 = pop();
dcell n2 = pop();
dcell n1 = pop();
dcell r = (n1 * n2) / n3;
dcell m = (n1 * n2) % n3;
push((cell)m);
push((cell)r);
if ((cell)r != r)
{
tell("Arithmetic overflow\n");
errorFlag = 1;
}
}
BUILTIN(60, "D=", dequals, 0)
{
dcell a1 = dpop();
dcell a2 = dpop();
push(a2 == a1 ? -1 : 0);
}
BUILTIN(61, "D<", dsmaller, 0)
{
dscell a1 = dpop();
dscell a2 = dpop();
push(a2 < a1 ? -1 : 0);
}
BUILTIN(62, "D>", dlarger, 0)
{
dscell a1 = dpop();
dscell a2 = dpop();
push(a2 > a1 ? -1 : 0);
}
BUILTIN(63, "DU<", dusmaller, 0)
{
dcell a1 = dpop();
dcell a2 = dpop();
push(a2 < a1 ? -1 : 0);
}
BUILTIN(64, "D+", dplus, 0)
{
dscell n1 = dpop();
dscell n2 = dpop();
dpush(n1 + n2);
}
BUILTIN(65, "D-", dminus, 0)
{
dscell n1 = dpop();
dscell n2 = dpop();
dpush(n2 - n1);
}
BUILTIN(66, "D*", dmul, 0)
{
dscell n1 = dpop();
dscell n2 = dpop();
dpush(n1 * n2);
}
BUILTIN(67, "D/", ddiv, 0)
{
dscell n1 = dpop();
dscell n2 = dpop();
dpush(n2 / n1);
}
BUILTIN(68, "2SWAP", dswap, 0)
{
dcell a = dpop();
dcell b = dpop();
dpush(a);
dpush(b);
}
BUILTIN(69, "2OVER", dover, 0)
{
dcell a = dpop();
dcell b = dpop();
dpush(b);
dpush(a);
dpush(b);
}
BUILTIN(70, "2ROT", drot, 0)
{
dcell a = dpop();
dcell b = dpop();
dcell c = dpop();
dpush(b);
dpush(a);
dpush(c);
}
/*******************************************************************************
*
* Loose ends
*
*******************************************************************************/
/* Create a word in the dictionary */
void createWord(const char* name, byte len, byte flags)
{
cell newLatest = *here;
push(*latest);
comma();
push(len | flags);
commaByte();
while (len--)
{
push(*name);
commaByte();
name++;
}
while (*here & (CELL_SIZE-1))
{
push(0);
commaByte();
}
*latest = newLatest;
}
/* A simple strlen clone so we don't have to pull in string.h */
byte slen(const char *str)
{
byte ret = 0;
while (*str++) ret++;
return ret;
}
/* Add a builtin to the dictionary */
void addBuiltin(cell code, const char* name, const byte flags, builtin f)
{
if (errorFlag) return;
if (code >= MAX_BUILTIN_ID)
{
tell("Error adding builtin ");
tell(name);
tell(": Out of builtin IDs\n");
errorFlag = 1;
return;
}
if (builtins[code] != 0)
{
tell("Error adding builtin ");
tell(name);
tell(": ID given twice\n");
errorFlag = 1;
return;
}
builtins[code] = f;
createWord(name, slen(name), flags);
push(code);
comma();
push(doExit_id);
comma();
}
/* Program setup and jump to outer interpreter */
int main()
{
errorFlag = 0;
if (DCELL_SIZE != 2*CELL_SIZE)
{
tell("Configuration error: DCELL_SIZE != 2*CELL_SIZE\n");
return 1;
}
state = (cell*)&memory[STATE_POSITION];
base = (cell*)&memory[BASE_POSITION];
latest = (cell*)&memory[LATEST_POSITION];
here = (cell*)&memory[HERE_POSITION];
sp = (cell*)&memory[STACK_POSITION];
stack = (cell*)&memory[STACK_POSITION + CELL_SIZE];
rsp = (cell*)&memory[RSTACK_POSITION];
rstack = (cell*)&memory[RSTACK_POSITION + CELL_SIZE];
*sp = *rsp = 1;
*state = 0;
*base = 10;
*latest = 0;
*here = HERE_START;
ADD_BUILTIN(docol);
ADD_BUILTIN(doCellSize);
ADD_BUILTIN(memRead);
ADD_BUILTIN(memWrite);
ADD_BUILTIN(memReadByte);
ADD_BUILTIN(memWriteByte);
ADD_BUILTIN(key);
ADD_BUILTIN(emit);
ADD_BUILTIN(swap);
ADD_BUILTIN(dup);
ADD_BUILTIN(drop);
ADD_BUILTIN(over);
ADD_BUILTIN(comma);
ADD_BUILTIN(commaByte);
ADD_BUILTIN(word);
ADD_BUILTIN(find);
ADD_BUILTIN(cfa);
ADD_BUILTIN(doExit);
ADD_BUILTIN(quit);
quit_address = getCfa(*latest);
ADD_BUILTIN(number);
ADD_BUILTIN(bye);
ADD_BUILTIN(doLatest);
ADD_BUILTIN(doHere);
ADD_BUILTIN(doBase);
ADD_BUILTIN(doState);
ADD_BUILTIN(plus);
ADD_BUILTIN(minus);
ADD_BUILTIN(mul);
ADD_BUILTIN(divmod);
ADD_BUILTIN(rot);
ADD_BUILTIN(gotoInterpreter);
ADD_BUILTIN(gotoCompiler);
ADD_BUILTIN(doCreate);
ADD_BUILTIN(hide);
ADD_BUILTIN(lit);
ADD_BUILTIN(colon);
ADD_BUILTIN(semicolon);
ADD_BUILTIN(rtos);
ADD_BUILTIN(stor);
ADD_BUILTIN(rget);
ADD_BUILTIN(doJ);
ADD_BUILTIN(tick);
ADD_BUILTIN(key_p);
ADD_BUILTIN(equals);
ADD_BUILTIN(smaller);
ADD_BUILTIN(larger);
ADD_BUILTIN(doAnd);
ADD_BUILTIN(doOr);
ADD_BUILTIN(branch);
ADD_BUILTIN(zbranch);
ADD_BUILTIN(toggleImmediate);
ADD_BUILTIN(doFree);
ADD_BUILTIN(p_dup);
ADD_BUILTIN(s0_r);
ADD_BUILTIN(dsp_r);
ADD_BUILTIN(litstring);
ADD_BUILTIN(not);
ADD_BUILTIN(xor);
ADD_BUILTIN(timesDivide);
ADD_BUILTIN(timesDivideMod);
ADD_BUILTIN(dequals);
ADD_BUILTIN(dsmaller);
ADD_BUILTIN(dlarger);
ADD_BUILTIN(dusmaller);
ADD_BUILTIN(dplus);
ADD_BUILTIN(dminus);
ADD_BUILTIN(dmul);
ADD_BUILTIN(ddiv);
ADD_BUILTIN(dswap);
ADD_BUILTIN(dover);
ADD_BUILTIN(drot);
maxBuiltinAddress = (*here) - 1;
if (errorFlag) return 1;
initscript_pos = (char*)initScript;
quit();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment