Beispiel #1
0
int main(void)
{
    init((CELL *)malloc(1024), 256);

    start_ass(EP);
    ass(O_LESS); ass(O_LESS); ass(O_LESS); ass(O_LESS);
    ass(O_GREATER); ass(O_GREATER); ass(O_GREATER); ass(O_GREATER);
    ass(O_EQUAL); ass(O_EQUAL); ass(O_NEQUAL); ass(O_NEQUAL);
    ass(O_LESS0); ass(O_LESS0); ass(O_LESS0); ass(O_GREATER0);
    ass(O_GREATER0); ass(O_GREATER0); ass(O_EQUAL0); ass(O_EQUAL0);
    ass(O_ULESS); ass(O_ULESS); ass(O_ULESS); ass(O_ULESS);
    ass(O_UGREATER); ass(O_UGREATER); ass(O_UGREATER); ass(O_UGREATER);

    assert(single_step() == -259);   // load first instruction word

    stack1();       // set up the stack with four standard pairs to compare
    step(0, 5);     // do the < tests
    stack1();
    step(5, 10);     // do the > tests
    stack2();       // set up the stack with two standard pairs to compare
    step(10, 12);   // do the = tests
    stack2();
    step(12, 15);   // do the <> tests
    stack3();       // set up the stack with three standard values
    step(15, 18);   // do the 0< tests
    stack3();
    step(18, 22);   // do the 0> tests
    SP = S0;  PUSH(237); PUSH(0);	// set up the stack with two values
    step(22, 25);   // do the 0= tests
    stack1();       // set up the stack with four standard pairs to compare
    step(25, 30);   // do the U< tests
    stack1();
    step(30, 35);   // do the U> tests

    assert(exception == 0);
    printf("Comparison tests ran OK\n");
    return 0;
}
Beispiel #2
0
void stack4() { stack3(); }
Beispiel #3
0
static void stack2(void)
{
	stack3();
}