
/* following are commands */
#define CMD_WRPIN	    1
#define CMD_RDPIN	    CMD_WRPIN	+ 1
#define CMD_WRCOMM	    CMD_RDPIN	+ 1
#define CMD_RDCOMM	    CMD_WRCOMM	+ 1
#define CMD_WRMEM	    CMD_RDCOMM	+ 1
#define CMD_RDMEM	    CMD_WRMEM	+ 1
#define CMD_DEFINE	    CMD_RDMEM	+ 1
#define CMD_CMP 	    CMD_DEFINE	+ 1
#define CMD_PRINT	    CMD_CMP	+ 1
#define CMD_BRA 	    CMD_PRINT	+ 1
#define CMD_CALL	    CMD_BRA	+ 1
#define CMD_BEGIN	    CMD_CALL	+ 1
#define CMD_END 	    CMD_BEGIN	+ 1
#define CMD_RET 	    CMD_END	+ 1
#define CMD_RETURN	    CMD_RET	+ 1
#define CMD_DELAY	    CMD_RETURN	+ 1
#define CMD_PAUSE	    CMD_DELAY	+ 1
#define CMD_PUSH	    CMD_PAUSE	+ 1
#define CMD_POP 	    CMD_PUSH	+ 1
#define CMD_INPUT	    CMD_POP	+ 1

#define MAX_COMMANDS	    CMD_INPUT	+ 1

/* following are predefined arguments */
#define ARG_FLAGS	    MAX_COMMANDS
#define ARG_ACC 	    ARG_FLAGS	+ 1
#define ARG_DAC 	    ARG_ACC	+ 1
#define ARG_STATE	    ARG_DAC	+ 1
#define ARG_SOURCE	    ARG_STATE	+ 1
#define ARG_GROUND	    ARG_SOURCE	+ 1
#define ARG_PULLUP	    ARG_GROUND	+ 1
#define ARG_TTL_HI	    ARG_PULLUP	+ 1
#define ARG_TTL_LOW	    ARG_TTL_HI	+ 1
#define ARG_DECOUPLE	    ARG_TTL_LOW + 1
#define ARG_VOLTS	    ARG_DECOUPLE + 1
#define ARG_COMP	    ARG_VOLTS	+ 1
#define ARG_THRESH	    ARG_COMP	+ 1
#define ARG_POWER	    ARG_THRESH	+ 1
#define ARG_CURRENT	    ARG_POWER	+ 1
#define ARG_SLEWRATE	    ARG_CURRENT + 1
#define ARG_ID		    ARG_SLEWRATE + 1
#define ARG_OVC 	    ARG_ID	+ 1
#define ARG_CHAR	    ARG_OVC	+ 1
#define ARG_VAR 	    ARG_CHAR	+ 1
#define ARG_BIT 	    ARG_VAR	+ 1
#define ARG_BYTE	    ARG_BIT	+ 1
#define ARG_WORD	    ARG_BYTE	+ 1
#define ARG_LONG	    ARG_WORD	+ 1
#define ARG_DEC 	    ARG_LONG	+ 1
#define ARG_HEX 	    ARG_DEC	+ 1
#define ARG_KEYSTAT	    ARG_HEX	+ 1
#define ARG_EQU 	    ARG_KEYSTAT + 1
#define ARG_NEQ 	    ARG_EQU	+ 1
#define ARG_LT		    ARG_NEQ	+ 1
#define ARG_GT		    ARG_LT	+ 1
#define ARG_NLT 	    ARG_GT	+ 1
#define ARG_NGT 	    ARG_NLT	+ 1
#define ARG_LTE 	    ARG_NGT	+ 1
#define ARG_GTE 	    ARG_LTE	+ 1
#define ARG_OVF 	    ARG_GTE	+ 1
#define ARG_UNC 	    ARG_OVF	+ 1
#define ARG_LOCAL	    ARG_UNC	+ 1
#define ARG_EXTERN	    ARG_LOCAL	+ 1
#define ARG_MS		    ARG_EXTERN	+ 1
#define ARG_US		    ARG_MS	+ 1
#define ARG_LABEL	    ARG_US	+ 1
#define ARG_CALC	    ARG_LABEL	+ 1

#define MAX_KEY_WORDS	    ARG_CALC	+ 1

/* following are operators */
#define OPR_EQUALS	    MAX_KEY_WORDS
#define OPR_ADD 	    OPR_EQUALS	+ 1
#define OPR_SUB 	    OPR_ADD	+ 1
#define OPR_MUL 	    OPR_SUB	+ 1
#define OPR_DIV 	    OPR_MUL	+ 1
#define OPR_AND 	    OPR_DIV	+ 1
#define OPR_OR		    OPR_AND	+ 1
#define OPR_SHR 	    OPR_OR	+ 1
#define OPR_SHL 	    OPR_SHR	+ 1
#define OPR_MOD 	    OPR_SHL	+ 1

#define MAX_OPR 	    OPR_MOD	+ 1

/* following are types and are not in the "key_word_table" table */
#define ARG_NUMBER	    MAX_OPR
#define ARG_VARIABLE	    ARG_NUMBER	+ 1
#define ARG_STRING	    ARG_VARIABLE + 1

#define MAX_VARIABLES		10
#define MAX_COMMAND_SIZE	10
#define MAX_ARGS		20
#define CRLF			0
#define STX			2
#define ETX			3
#define TYP_PTR 		3
#define TYP_WORD		2
#define TYP_BYTE		1
#define SIZE_PTR		2
#define SIZE_BYTE		1
#define SIZE_WORD		2
#define SOURCE_LINE_SIZE	80
#define DEST_BUFFER_SIZE	1024
#define OBJECT_BUFFER_SIZE	1024

