// token_data.h file defines tokens and formats for HCS_C // This is just an ASCII compatible version // lower case is read // upper case is write // // Author: Bob Morrison // 10/26/03 #define TOKEN_EXEC_START 0x2f // special operators #define TOKEN_OP_SINGLE 0x10 //all operator tokens larger than 0x10 //are special they will not go through the // a op b process #define TOKEN_SOP_TOD_EQ 0x10 #define TOKEN_SOP_TOD_NEQ 0x11 #define TOKEN_SOP_TOD_GT 0x12 #define TOKEN_SOP_TOD_LT 0x13 #define TOKEN_SOP_TOD_GE 0x14 #define TOKEN_SOP_TOD_LE 0x15 #define TOKEN_SOP_RESET 0x16 // normal operators #define TOKEN_OP_NOP 0x0 #define TOKEN_OP_EQ 0x01 #define TOKEN_OP_NEQ 0x02 #define TOKEN_OP_GT 0x03 #define TOKEN_OP_LT 0x04 #define TOKEN_OP_GE 0x05 #define TOKEN_OP_LE 0x06 // normal operands #define TOKEN_OPRND_INBIT 0x17 #define TOKEN_OPRND_VAR 0x30 #define TOKEN_OPRND_TIMER 0x32 #define TOKEN_OPRND_CONST8 0x34 #define TOKEN_OPRND_CONST16 0x35 #define TOKEN_OPRND_TRUE 0x36 #define TOKEN_OPRND_FALSE 0x37 #define TOKEN_OPRND_RANDOM 0x38 #define TOKEN_OPRND_MONTH 0x39 #define TOKEN_OPRND_DAY 0x3a #define TOKEN_OPRND_YEAR 0x3b #define TOKEN_OPRND_DOW 0x3c #define TOKEN_OPRND_HOUR 0x3d #define TOKEN_OPRND_MIN 0x3e #define TOKEN_OPRND_SEC 0x3f #define TOKEN_OPRND_LOGSIZE 0x4d #define TOKEN_OPRND_NETBYTE 0x4e #define TOKEN_OPRND_GETKEY 0x53 #define TOKEN_OPRND_GETKNUM 0x54 #define TOKEN_OPRND_FPGA_IN 0x55 #define TOKEN_OPRND_KEYBD 0x56 #define TOKEN_OPRND_CID 0x57 #define TOKEN_OPRND_CHANGED 0x58 #define TOKEN_OPRND_CHANGE_VALUE 0x59 #define TOKEN_OP_ABS 0x5a #define TOKEN_OP_MOD 0x60 #define TOKEN_OP_SIGNUM 0x61 #define TOKEN_OP_LSHIFT 0x62 #define TOKEN_OP_RSHIFT 0x63 #define TOKEN_OP_NEG 0x6f #define TOKEN_LEFTPAREN 0x70 #define TOKEN_RIGHTPAREN 0x71 #define TOKEN_OP_AND 0x72 #define TOKEN_OP_OR 0x73 #define TOKEN_OP_NOT 0x74 #define TOKEN_OP_ADD 0x75 #define TOKEN_OP_SUB 0x76 #define TOKEN_OP_MUL 0x77 #define TOKEN_OP_DIV 0x78 #define TOKEN_OP_LAND 0x79 #define TOKEN_OP_LOR 0x7a #define TOKEN_OP_LNOT 0x7b #define TOKEN_OP_BIT 0x7c #define TOKEN_OP_CAND 0x7d #define TOKEN_OP_COR 0x7e #define TOKEN_OP_CNOT 0x7f //action tokens #define TOKEN_ACTION_CONS_STRING 0x97 #define TOKEN_ACTION_FPGA 0x9b #define TOKEN_ACTION_FPGA_STRING 0x9c #define TOKEN_ACTION_OUT 0x82 #define TOKEN_ACTION_UNUSED 0x83 #define TOKEN_ACTION_VAR 0xa0 #define TOKEN_ACTION_TIMER 0x84 #define TOKEN_ACTION_TIMER_MODE 0x8d #define TOKEN_ACTION_LCD_LINK 0x88 #define TOKEN_ACTION_LOG 0xa4 #define TOKEN_ACTION_LOG_MODE 0xac // control operators #define TOKEN_CTL_IF 0xf0 #define TOKEN_CTL_ELSE 0xf2 #define TOKEN_CTL_FIRST_IS 0xf3 #define TOKEN_CTL_NEXT_IS 0xf4 #define TOKEN_CTL_THEN 0xf5 #define TOKEN_CTL_GOTO 0xf6 #define TOKEN_CTL_CALL 0xf7 #define TOKEN_CTL_RETURN 0xf8 // Terminating ops #define TOKEN_ENDPGM 0xee #define TOKEN_ENDCONT 0xef #define TOKEN_STOPMATH 0xfc #define TOKEN_STOP 0xfd #define TOKEN_IF_END 0xfe #define TOKEN_ENDTABLE 0xff #define TOKEN_WRITE_CONSOLE_CHAR 'o' #define TOKEN_WRITE_CONSOLE 'O' #define TOKEN_WRITE_CONSOLE_HEX 'X' #define TOKEN_WRITE_FPGA 'F' #define TOKEN_WRITE_MEM 'M' #define TOKEN_LIST_LOAD 'l' #define TOKEN_LIST_END '.' #define TOKEN_MATH_END '=' #define TOKEN_ALERT '!' #define TOKEN_ACK '^' // formatting tokens (these are independent of the program // control tokens (and can overlap those values) #define TOKEN_FORMAT_TIME_A 0x80 // Display time HH:MM #define TOKEN_FORMAT_TIME_B 0x81 // Display time HH:MM #define TOKEN_FORMAT_TIME_C 0x82 // Display time HH:MM #define TOKEN_FORMAT_TIME_D 0x83 // Display time HH:MM #define TOKEN_FORMAT_TIME_E 0x84 // Display time HH:MM #define TOKEN_FORMAT_FPGA_X 0x87 // hex format, 1 parameter #define TOKEN_FORMAT_VAR_P 0x90 // fmt n digits, no leading zeroes #define TOKEN_FORMAT_VAR_Q 0x91 // fmt n digits, lead zeroes rep w/ sp #define TOKEN_FORMAT_VAR_R 0x92 // fmt n digits with leading zeroes #define TOKEN_FORMAT_VAR_S 0x93 // unknown format with leading zeroes #define TOKEN_FORMAT_VAR_X 0x9d // hex format #define EVAL_FALSE 0 #define EVAL_TRUE 1 // Timer actions #define TIMER_ACTION_OFF 0x00 #define TIMER_ACTION_ON 0x01 #define TIMER_ACTION_CLR 0x02 #define TIMER_ACTION_PAUSE 0x03 #define TIMER_ACTION_CONTINUE 0x04 #define TIMER_ACTION_MINUTES 0x05 #define TIMER_ACTION_SECONDS 0x06 // Log mode constants #define LOG_MODE_OFF 0 // pause logging #define LOG_MODE_ON 1 // continue logging #define LOG_MODE_NORMAL 2 // normal HCS2 mode logging #define LOG_MODE_SHORT 3 // short info logging #define LOG_MODE_ACTIONS 4 // action/IF token logging // console tokens #define CONSOLE_PAUSE 0x1 #define CONSOLE_UPDATE 0x2 #define CONSOLE_GETTIME 0x04 #define CONSOLE_SETTIME 0x05 #define CONSOLE_NEWEVENT 0x6 #define CONSOLE_ACTION 0x24 #define CONSOLE_SENDTIME 0x80 #define CONSOLE_SENDIN 0x82 #define CONSOLE_SENDOUT 0x83 #define CONSOLE_CLRLOG 0x07 #define CONSOLE_GETLOG 0x08 #define CONSOLE_SENDLOG 0x0b