// Primitiv.cxx - version for stack.cc // Real number support removed // W. Langdon cs.ucl.ac.uk // 2 May 1994 // Copyright Andy Singleton, 1993,1994 // This code is released for non-commercial use only // For questions or upgrades contact: // Andy Singleton, Creation Mechanics Inc. // PO Box 248, Peterborough, NH 03458 // Internet: p00396@psilink.com // Compuserve 73313,757 // Phone: (603) 563-7757 //************************************************************************** // Standard Functions // includes ConstFunc (numeric constants) // ADD,SUB,MUL,DIV,SINE,ABS,ADD4,PROG4,BOOL,NOT,AND,OR,IF,IFlte //************************************************************************** #include "pch.h" #include "chrome.h" #include "primitiv.h" extern char scratch[100]; #ifdef FASTEVAL extern evalnode* IpGlobal; extern Chrome* ChromeGlobal; #endif OPDEF(ConstEval) {return 127-GETIDX;}; // print the value, not the name char * ConstFunc::getprint(Chrome* st) {sprintf(scratch,"%d",127-VARNUM(st->expr[st->ip]));return scratch;} // Add two arguments. Note that argnum = 2 OPDEF(AddEval) {return EVAL + EVAL;} // Subtract two arguments OPDEF(SubEval) {return EVAL - EVAL;}