/* Generated by forth2c, (C) Martin Maierhofer 1994 */ /* size of data space, can be changed ! */ int _C_DATA_SIZE = 8192; #include "forth.h" /* general forth definitions */ #include "forth2c.h" /* forth2c specific definitions */ Cells2 mybounds(Cell p0, Cell p1) { Cells2 _c_result; Cell x0; { /* over */ Cell n1, n2; n2 = p0; n1 = p1; p1 = n1; p0 = n2; x0 = n1; } { /* plus */ Cell n1, n2, n; n1 = x0; n2 = p0; n = n2 + n1; p0 = n; } { /* swap */ Cell n1, n2; n1 = p0; n2 = p1; p1 = n1; p0 = n2; } { /* exit */ _c_result.cell0 = p0; _c_result.cell1 = p1; return (_c_result); } } Char seed[4]; void initiate_seed(void) { Cell x0; Cell x1; { /* Literal */ x0 = 74755; } { x1 = (Cell) (&seed[0]); } { /* store */ Cell *a, n; a = (Cell *) x1; n = x0; *a = n; } { /* exit */ return; } } Cell random(void) { Cell _c_result; Cell x0; Cell x1; Cell x2; { x0 = (Cell) (&seed[0]); } { /* fetch */ Cell *a; a = (Cell *) x0; x0 = *a; } { /* Literal */ x1 = 1309; } { /* star */ Cell n1, n2, n; n1 = x1; n2 = x0; n = n2 * n1; x0 = n; } { /* Literal */ x1 = 13849; } { /* plus */ Cell n1, n2, n; n1 = x1; n2 = x0; n = n2 + n1; x0 = n; } { /* Literal */ x1 = 65535; } { /* and */ Cell n1, n2, n; n1 = x1; n2 = x0; n = n2 & n1; x0 = n; } { /* dup */ Cell n; n = x0; x0 = n; x1 = n; } { x2 = (Cell) (&seed[0]); } { /* store */ Cell *a, n; a = (Cell *) x2; n = x1; *a = n; } { /* exit */ _c_result = x0; return (_c_result); } } #define row_size 200 #define row_byte_size 800 #define mat_size 40000 #define mat_byte_size 160000 Char ima[160020]; Char imb[160020]; Char imr[160000]; void initiate_matrix(Cell p0) { Cell x0; Cell x1; Cell r0; Cell r1; { x0 = (Cell) mat_byte_size; } { Cells2 _C_locret; _C_locret = mybounds(x0, p0); p0 = _C_locret.cell1; x0 = _C_locret.cell0; } { /* do */ Cell bound, index; index = x0; bound = p0; r0 = bound; r1 = index; } label0: { Cell _C_locret; _C_locret = random(); p0 = _C_locret; } { /* dup */ Cell n; n = p0; p0 = n; x0 = n; } { /* Literal */ x1 = 120; } { /* slash */ Cell n1, n2, n; n1 = x1; n2 = x0; n = n2 / n1; x0 = n; } { /* Literal */ x1 = 120; } { /* star */ Cell n1, n2, n; n1 = x1; n2 = x0; n = n2 * n1; x0 = n; } { /* minus */ Cell n1, n2, n; n1 = x0; n2 = p0; n = n2 - n1; p0 = n; } { /* Literal */ x0 = 60; } { /* minus */ Cell n1, n2, n; n1 = x0; n2 = p0; n = n2 - n1; p0 = n; } { /* i */ Cell n = r1; x0 = n; } { /* store */ Cell *a, n; a = (Cell *) x0; n = p0; *a = n; } { /* cell */ p0 = sizeof(Cell); } { /* +loop */ Cell step, index, bound; index = r1; bound = r0; step = p0; index += step; if ((step > 0 && index < bound) || (step <= 0 && index >= bound)) { r0 = bound; r1 = index; goto label0; } } { /* unloop */ } { /* exit */ return; } } Cell innerproduct(Cell p0, Cell p1) { Cell _c_result; Cell x0; Cell x1; Cell x2; Cell r0; Cell r1; Cell r2; { /* Literal */ x0 = 0; } { x1 = (Cell) row_size; } { /* Literal */ x2 = 0; } { /* do */ Cell bound, index; index = x2; bound = x1; r0 = bound; r1 = index; } label0: { /* to_r */ Cell n; n = x0; r2 = n; } { /* over */ Cell n1, n2; n2 = p0; n1 = p1; p1 = n1; p0 = n2; x0 = n1; } { /* fetch */ Cell *a; a = (Cell *) x0; x0 = *a; } { /* over */ Cell n1, n2; n2 = x0; n1 = p0; p0 = n1; x0 = n2; x1 = n1; } { /* fetch */ Cell *a; a = (Cell *) x1; x1 = *a; } { /* star */ Cell n1, n2, n; n1 = x1; n2 = x0; n = n2 * n1; x0 = n; } { /* r_from */ Cell n; n = r2; x1 = n; } { /* plus */ Cell n1, n2, n; n1 = x1; n2 = x0; n = n2 + n1; x0 = n; } { /* to_r */ Cell n; n = x0; r2 = n; } { /* swap */ Cell n1, n2; n1 = p0; n2 = p1; p1 = n1; p0 = n2; } { /* cell+ */ Cell * a; a = (Cell *) p0; p0 = (Cell) (a + 1); } { /* swap */ Cell n1, n2; n1 = p0; n2 = p1; p1 = n1; p0 = n2; } { x0 = (Cell) row_byte_size; } { /* plus */ Cell n1, n2, n; n1 = x0; n2 = p0; n = n2 + n1; p0 = n; } { /* r_from */ Cell n; n = r2; x0 = n; } { /* loop */ Cell index, bound; index = r1; bound = r0; index++; if (index != bound) { r0 = bound; r1 = index; goto label0; } } { /* unloop */ } { /* to_r */ Cell n; n = x0; r0 = n; } { /* 2drop */ } { /* r_from */ Cell n; n = r0; p1 = n; } { /* exit */ _c_result = p1; return (_c_result); } } void main(void) { Cell x0; Cell x1; Cell x2; Cell r0; Cell r1; Cell r2; Cell r3; { initiate_seed(); } { x0 = (Cell) (&ima[0]); } { initiate_matrix(x0); } { x0 = (Cell) (&imb[0]); } { initiate_matrix(x0); } { x0 = (Cell) (&imr[0]); } { x1 = (Cell) (&ima[0]); } { x2 = (Cell) mat_byte_size; } { Cells2 _C_locret; _C_locret = mybounds(x2, x1); x1 = _C_locret.cell1; x2 = _C_locret.cell0; } { /* do */ Cell bound, index; index = x2; bound = x1; r0 = bound; r1 = index; } label0: { x1 = (Cell) (&imb[0]); } { x2 = (Cell) row_byte_size; } { Cells2 _C_locret; _C_locret = mybounds(x2, x1); x1 = _C_locret.cell1; x2 = _C_locret.cell0; } { /* do */ Cell bound, index; index = x2; bound = x1; r2 = bound; r3 = index; } label1: { /* j */ Cell n = r1; x1 = n; } { /* i */ Cell n = r3; x2 = n; } { Cell _C_locret; _C_locret = innerproduct(x2, x1); x1 = _C_locret; } { /* over */ Cell n1, n2; n2 = x1; n1 = x0; x0 = n1; x1 = n2; x2 = n1; } { /* store */ Cell *a, n; a = (Cell *) x2; n = x1; *a = n; } { /* cell+ */ Cell * a; a = (Cell *) x0; x0 = (Cell) (a + 1); } { /* cell */ x1 = sizeof(Cell); } { /* +loop */ Cell step, index, bound; index = r3; bound = r2; step = x1; index += step; if ((step > 0 && index < bound) || (step <= 0 && index >= bound)) { r2 = bound; r3 = index; goto label1; } } { /* unloop */ } { x1 = (Cell) row_size; } { /* cells */ Cell n; n = x1; x1 = n * sizeof(Cell); } { /* +loop */ Cell step, index, bound; index = r1; bound = r0; step = x1; index += step; if ((step > 0 && index < bound) || (step <= 0 && index >= bound)) { r0 = bound; r1 = index; goto label0; } } { /* unloop */ } { /* drop */ } { /* exit */ return; } }