EPI Structure Opcodes are a series of words corresponding to the No. field of the command below. All other values are also words unless otherwise indicated. Numerical data is compiled as follows: specifies what will be, one of the following: 0 - Variable index. 1 - Short (1-word) value. 2 - Long (2-word) value. If the requirement is constant, then is omitted and the meaning of is assumed as needed. All numeric data is assumed to be unsigned. String data is compiled as follows: [] specifies what will be, one of: 0 - Variable index. 1 - String value length. If is 1, then is the actual string data (1 char per byte), padded with an ASCII 0 to supply an even number of characters, if needed. If the requirement is constant, then is omitted and the meaning of is assumed. If the assumption is type 1 then follows (0-padded if needed). In memory, string variables are stored as: Fields are the same as above. Code indexes are stored as a long (double word) and indicate the offset number of words from the start of the program. Boolean types are the same as numeric types, where !0 = TRUE and 0 = FALSE. EPI Variable Types 0 INT Short (1-word) integer. 0 SHORT Short (1-word) integer. 1 LONG Long (2-word) integer. 2 BOOL Short (1-word) integer with TRUE/FALSE compile-time checking. 3 STRING(X) String variable of X characters. (X) = (255) if omitted. EPI Programs Programs consist of multiple statements, one per line. Statements can be generalized as follows: is a command word from below. are the required parameter(s), if any, for that command word, according to the chart below. Labels take the following form: : is the name of the label. The colon specifies where the label actually points to and is not needed for references. All variable names and label names are limited to 30 characters or less. EPI Compilation Compilation is linear, one pass compilation. Each line is read and compiled sequentially on each pass. All lines are read and processed. Comments are ignored. Variable declarations are processed and allocators are written to the output file in this format: Type is a number from the variable type chart above. depends on the variable type. For strings it is the buffer length, and for numeric variables it is the default value, or 0. (Note that longs can only be initialized in short range.) Variable names and indexes are stored in memory so the program may refer to them.,,,,,,,,,,,,,,,,, Labels are read and their names EPI Commands (simple format) No. Command Word Params Description ------------------------------------------------------------------------------- 0 ADD [] Adds (1) to and stores result in . 0 INC Synonym for ADD 1. 1 SUB [] Subtracts (1) from and stores result in . 1 DEC Synonym for DEC 1. 2 MUL Multiplies and and stores result in . 3 DIV Divides by and stores result in . Mod is discarded. 4 MOD Divides by , stores remainder in , discards quo. - CALC Calculates a math expression (+-*/%) and stores result in . Compiles to an ASSIGN followed by a bunch of math ops, all operating on . 5 CALL Calls function residing at . 6 SHELL Shells to DOS and executes the command in . 7 JUMP Changes program execution location to . 7 RETURN Returns from last function. Translates to JUMP with popped code index. 8 LOOP [] Counts from to in steps of (1). 9 ENDLOOP Ends the last loop. 10 ASSIGN [] Sets to (0). 10 ZERO Same as ASSIGN 0. 11 SET [] Sets string variable to (""). 11 CLEAR Same as SET "". 12 CONCAT Adds to the end of and stores result in . 13 COMPARE Compares and and stores result in . 14 FIND Looks for in and stores result in . 15 OUTPUT [] Prints to (SCREEN), opt. store in and using to fill @# tokens. 16 FILTER [] Filters PubColour codes from , storing the result in (). 17 TRIM [] Trims of spaces by method, storing the result in (). 17 LEFTTRIM [] Synonym for TRIM TRIM_LEFT []. 17 RIGHTTRIM [] Synonym for TRIM TRIM_RIGHT []. 17 FULLTRIM [] Synonym for TRIM TRIM_ALL []. 18 CLIP Clips to characters. 19 EXTEND [] Extends to characters, filling with (32). 20 OUTLANG [] Like OUTPUT but is the name of a language item. 21 RANDOM Generates a random number from 0 to -1 and assigns it to . 100 SETTIME Sets a user's remaining time to minutes. 101 ADDTIME Adds minutes to the user's remaining time. 102 SUBTIME Subtracts minutes from the user's remaining time. 103 SETSEC Sets a user's TOP security level to . 104 SETHANDLE Sets a user's TOP handle to . 500 CARDINIT Initializes a set of cards containing decks, assigning the index to , or 0 for failure. If is true, each deck will be treated as if it had jokers, with 54 slots for cards per deck. Otherwise, the deck(s) will contain 52 slots. Programs are free to treat the cards in any way they like, though the standard identifications (given by CARDNAMES) are recommended. 501 CARDSHUFFLE Shuffles a set of cards, index . This takes all of the discarded cards in the deck and marks them as available again. It does not touch removed cards. 502 CARDDEAL [] Picks card (-1 (random)) from set index and stores it in , or stores 0 if the card is not available. 503 CARDDISCARD Discards card from set index . 504 CARDREMOVE Removes card from play from set index . Removed cards can only be brought back into play using CARDRESET. 505 CARDRESET Resets set index completely, marking ALL cards available again. 506 CARDCLOSE Removes set index from circulation, making it free to be used again. 507 CARDNAMES Returns a 108 character string containing the standard 54 two-character strings (AS, 2S, 3H, etc.) to identify cards, storing it in . This string comes from the language file, and can be changed by sysops.