;Blitz! Basic tokens ;By Mr.Mouse/XeNTaX/G*P ;---------------------- ;What follows is the tokens used in the compiled code, the address in the interpreter they are dispatched to, ;the number of operands expected that follow the token, a proposed function name and ;a description. All in a tab-delimited manner. ;---------------------- Token Execution Address Operands Function Name Function Description $00 $0AD7 0 BR_CMP_NULL Comparison: Always False $01 $0AD7 0 BR_CMP_LT Comparison: Less Than (<) $02 $0AD7 0 BR_CMP_EQ Comparison: Equal (=) $03 $0AD7 0 BR_CMP_LE Comparison: Less or Equal (<=) $04 $0AD7 0 BR_CMP_GT Comparison: Greater Than (>) $05 $0AD7 0 BR_CMP_NE Comparison: Not Equal (<>) $06 $0AD7 0 BR_CMP_GE Comparison: Greater or Equal (>=) $07 $B86A 0 BR_ADD Addition (FAC = ARG + FAC) $08 $B853 0 BR_SUB Subtraction (FAC = ARG - FAC) $09 $BA2B 0 BR_MUL Multiplication (FAC = ARG * FAC) $0A $BB12 0 BR_DIV Division (FAC = ARG / FAC) $0B $BF7B 0 BR_POW Exponentiation (FAC = ARG ^ FAC) $0C $0C2A 0 BR_AND Logical AND between ARG and FAC $0D $0C2A 0 BR_OR Logical OR between ARG and FAC $0E $0997 0 BR_NEG Negate numeric value in FAC $0F $09AE 0 BR_NOT Bitwise NOT on 16-bit integer in FAC $10 $1E07 5 BR_DIM Array allocation: (DimCount, NameH, NameL, OffsetH, OffsetL) $11 $1B74 0 BR_FOR_INIT Initialize FOR loop with default STEP 1 $12 $1B62 0 BR_FOR_STEP Initialize FOR loop with explicit STEP $13 $1C2A 0 BR_NEXT Increment and loop for most recent FOR frame $14 $1C0A 0 BR_NEXT_VAR Increment and loop with explicit Variable validation $15 $0C80 0 BR_CLR Clear variables, reset stacks, and initialize program $16 $0CA6 0 BR_CONT Continue execution after a STOP or END $17 $1832 0 BR_POKE Store byte from stack into address from FAC $18 $1856 1 BR_SYS Execute machine code at address in FAC (auto-skips one byte following) $19 $1D1C 2 BR_GOTO Jump to 16-bit absolute P-code address $1A $1D0F 2 BR_GOSUB Push return address and jump to 16-bit address $1B $1CE3 2 BR_GOTO_EXE Alternative GOTO dispatcher $1C $1CE3 2 BR_GOSUB_EXE Alternative GOSUB dispatcher $1D $1D30 0 BR_RETURN Pop return address from stack and jump $1E $0CA0 0 BR_RESTORE_DATA Reset DATA pointer to program start $1F $1D72 1 BR_IF_SKIP If FAC is False, skip X bytes of P-code $20 $1566 0 BR_FUNC_SGN Set FAC to Signum of FAC (-1, 0, 1) $21 $1549 0 BR_FUNC_INT Convert FAC to 16-bit integer $22 $1536 0 BR_FUNC_ABS Get Absolute value of FAC $23 $1524 0 BR_FUNC_USR Jump to User function address $24 $1524 0 BR_FUNC_FRE Force garbage collection and return free memory $25 $1595 0 BR_FUNC_POS Return current screen cursor column $26 $1524 0 BR_FUNC_SQR Calculate Square Root of FAC $27 $1524 0 BR_FUNC_RND Generate Random number into FAC $28 $1524 0 BR_FUNC_LOG Calculate Natural Logarithm of FAC $29 $1524 0 BR_FUNC_EXP Calculate Exponential of FAC $2A $1524 0 BR_FUNC_COS Calculate Cosine of FAC $2B $1524 0 BR_FUNC_SIN Calculate Sine of FAC $2C $1524 0 BR_FUNC_TAN Calculate Tangent of FAC $2D $1524 0 BR_FUNC_ATN Calculate Arctangent of FAC $2E $1585 0 BR_FUNC_PEEK Read memory at address in FAC into FAC $2F $159A 0 BR_FUNC_LEN Return length of string in FAC $30 $15FD 0 BR_FUNC_STR Convert numeric FAC to String $31 $15C8 0 BR_FUNC_VAL Convert string FAC to Numeric $32 $14FE 0 BR_FUNC_ASC Return PETSCII code of first char in FAC $33 $167A 0 BR_FUNC_CHR Convert numeric code in FAC to 1-char string $34 $1774 0 BR_FUNC_LEFT Extract left-most chars from string $35 $1774 0 BR_FUNC_RIGHT Extract right-most chars from string $36 $1741 0 BR_FUNC_MID Extract substring from string $37 $1D8D 5 BR_DEF_FN Define User Function (Name, Ptr, SkipLength) $38 $1DC2 0 BR_FN_PUSH Setup function parameter stack frame $39 $1D43 0 BR_FN_POP Restore function parameter stack frame $3A $0ECB 0 BR_ASSIGN_AND_NEXT_TOKEN, Store FAC into current variable $3B $1960 0 BR_PRINT_TAB Print TAB to current device $3C $18DA 0 BR_PRINT_NUM Format and Print numeric FAC $3D $18DA 0 BR_PRINT_NUM Format and Print numeric FAC $3E $18DA 0 BR_PRINT_NUM Format and Print numeric FAC $3F $199E 0 BR_PRINT_CR Print carriage return / newline $40 $196D 0 BR_PRINT_SPC Print spaces to current device $41 $196D 0 BR_PRINT_SPC Print spaces to current device $42 $19BA 0 BR_CMD_OPEN Open logical output channel $43 $18DA 0 BR_PRINT_NUM Format and Print numeric FAC $44 $19BA 0 BR_CMD_OPEN Open logical output channel $45 $19B0 0 BR_CLRCHN Close current channel and reset to screen $46 $16CD 0 BR_GET_CHAR Get single character from input device $47 $0E08 0 BR_ROM_SYNC Synchronize program pointer with ROM basic $48 $16B4 0 BR_INPUT_OPEN Open logical input channel $49 $0E9A 0 BR_END Terminate execution and close channels $4A $186B 0 BR_READ_DATA Read numeric/string item from DATA block $4B $186B 0 BR_READ_DATA Read numeric/string item from DATA block $4C $1832 0 BR_POKE Store byte into memory $4D $1832 0 BR_POKE Store byte into memory $4E $0E9D 0 BR_NEW Clear memory and perform NEW $4F $0EA0 0 BR_STOP Halt execution with Break message $50 $1A12 0 BR_SET_LINE Set current execution line pointer $51 $1A5C 0 BR_PARSE_BUF Process input buffer as BASIC data $52 $1CCC 2 BR_VAL_JUMP Validate target address before jump $53 $1A1D 0 BR_INPUT_GET Start interactive keyboard input $54 $1B1A 0 BR_SECURITY Internal security validation routine $55 $1A1D 0 BR_INPUT_GET Start interactive keyboard input $56 $0DFE 0 BR_STR_GC Free temporary strings and continue $57 $1A5C 0 BR_PARSE_BUF Process input buffer as BASIC data $58 $1D5C 0 BR_IF_THEN Conditional dispatch based on FAC $59 $19FD 0 BR_REST_DATA Restore data pointer to specified location $5A $1A06 0 BR_CLR_SRCH Reset internal search and scan flags $5B $1A00 0 BR_SET_DIR Set interpreter to Direct Mode $5C $1A09 0 BR_CLR_DIR Set interpreter to Program Mode $5D $1EA0 1 BR_IO_XFER Dispatch LOAD/SAVE/VERIFY (Count) $5E $1EA2 1 BR_IO_FAST Dispatch Fast-IO LOAD/SAVE (Count) $5F $1E9F 1 BR_IO_SKIP Skip IO filename and start (Count) $60 $1F3D 1 BR_OPEN Open Logical File (Count) $61 $19DA 0 BR_CLOSE Close Logical File $62 $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $63 $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $64 $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $65 $1F76 0 BR_SYNTAX_ERR Trigger Syntax Error $66 $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $67 $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $68 $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $69 $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $6A $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $6B $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $6C $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $6D $1F74 0 BR_SYNTAX_ERR Trigger Syntax Error $6E $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $6F $1F75 0 BR_SYNTAX_ERR Trigger Syntax Error $70 $1F77 0 BR_SYNTAX_ERR Trigger Syntax Error $80 $0FD2 0 BR_READ_V0 Read Fast Variable 0 into FAC $81 $0FD2 0 BR_READ_V1 Read Fast Variable 1 into FAC $82 $0FD2 0 BR_READ_V2 Read Fast Variable 2 into FAC $83 $0FD2 0 BR_READ_V3 Read Fast Variable 3 into FAC $84 $0FD2 0 BR_READ_V4 Read Fast Variable 4 into FAC $85 $0FD2 0 BR_READ_V5 Read Fast Variable 5 into FAC $86 $0FD2 0 BR_READ_V6 Read Fast Variable 6 into FAC $87 $0FD2 0 BR_READ_V7 Read Fast Variable 7 into FAC $88 $0FD2 0 BR_READ_V8 Read Fast Variable 8 into FAC $89 $0FD2 0 BR_READ_V9 Read Fast Variable 9 into FAC $8A $0FD2 0 BR_READ_V10 Read Fast Variable 10 into FAC $8B $0FD2 0 BR_READ_V11 Read Fast Variable 11 into FAC $8C $0FD2 0 BR_READ_V12 Read Fast Variable 12 into FAC $8D $0FD2 0 BR_READ_V13 Read Fast Variable 13 into FAC $8E $0FD2 0 BR_READ_V14 Read Fast Variable 14 into FAC $8F $0FD2 0 BR_READ_V15 Read Fast Variable 15 into FAC $90 $0FD2 0 BR_READ_V16 Read Fast Variable 16 into FAC $91 $0FD2 0 BR_READ_V17 Read Fast Variable 17 into FAC $92 $0FD2 0 BR_READ_V18 Read Fast Variable 18 into FAC $93 $0FD2 0 BR_READ_V19 Read Fast Variable 19 into FAC $94 $0FD2 0 BR_READ_V20 Read Fast Variable 20 into FAC $95 $0FD2 0 BR_READ_V21 Read Fast Variable 21 into FAC $96 $0FD2 0 BR_READ_V22 Read Fast Variable 22 into FAC $97 $0FD2 0 BR_READ_V23 Read Fast Variable 23 into FAC $98 $0FD2 0 BR_READ_V24 Read Fast Variable 24 into FAC $99 $0FD2 0 BR_READ_V25 Read Fast Variable 25 into FAC $9A $0FD2 0 BR_READ_V26 Read Fast Variable 26 into FAC $9B $0FD2 0 BR_READ_V27 Read Fast Variable 27 into FAC $9C $0FD2 0 BR_READ_V28 Read Fast Variable 28 into FAC $9D $0FD2 0 BR_READ_V29 Read Fast Variable 29 into FAC $9E $0FD2 0 BR_READ_V30 Read Fast Variable 30 into FAC $9F $0FD2 0 BR_READ_V31 Read Fast Variable 31 into FAC $A0 $1065 1 BR_READ_V255 Read variable (32-255) $A1 $1065 1 BR_READ_V511 Read variable (256-511) $A2 $1065 1 BR_READ_V767 Read variable (512-767) $A3 $1065 2 BR_READ_VEXT Read variable with 16-bit index (768+) $A4 $119F 1 BR_ARY_READ Read element from Float/Int Array $A5 $119F 1 BR_ARY_SREAD Read element from String Array $A6 $10CA 1 BR_IMM_BYTE Load immediate 8-bit byte into FAC $A7 $10C6 2 BR_IMM_INT Load immediate 16-bit integer into FAC $A8 $10D9 5 BR_IMM_FLT Load immediate 5-byte Float into FAC $A9 $10D9 5 BR_IMM_FLT Load immediate 5-byte Float into FAC $AA $1139 0 BR_LOAD_PI Copy Pi constant from ROM to FAC $AB $115C 0 BR_LOAD_ST Load system status byte (ST) into FAC $AC $1143 0 BR_LOAD_TI Load system timer (TI) into FAC $AD $1159 0 BR_UNDEFINED Undefined - Triggers Syntax Error $AE $1159 0 BR_UNDEFINED Undefined - Triggers Syntax Error $AF $114F 0 BR_LOAD_TI$ Load system timer string (TI$) as FAC pointer $B0 $10A7 0 BR_SET_0 Set FAC to integer 0 $B1 $10A7 0 BR_SET_1 Set FAC to integer 1 $B2 $10A7 0 BR_SET_2 Set FAC to integer 2 $B3 $10A7 0 BR_SET_3 Set FAC to integer 3 $B4 $10A7 0 BR_SET_4 Set FAC to integer 4 $B5 $10A7 0 BR_SET_5 Set FAC to integer 5 $B6 $10A7 0 BR_SET_6 Set FAC to integer 6 $B7 $10A7 0 BR_SET_7 Set FAC to integer 7 $B8 $10A7 0 BR_SET_8 Set FAC to integer 8 $B9 $10A7 0 BR_SET_9 Set FAC to integer 9 $BA $10A7 0 BR_SET_10 Set FAC to integer 10 $BB $10A7 0 BR_SET_11 Set FAC to integer 11 $BC $10A7 0 BR_SET_12 Set FAC to integer 12 $BD $10A7 0 BR_SET_13 Set FAC to integer 13 $BE $10A7 0 BR_SET_14 Set FAC to integer 14 $BF $10A7 0 BR_SET_15 Set FAC to integer 15 $C0 $0EDB 0 BR_WRITE_V0 Store FAC into Fast Variable 0 $C1 $0EDB 0 BR_WRITE_V1 Store FAC into Fast Variable 1 $C2 $0EDB 0 BR_WRITE_V2 Store FAC into Fast Variable 2 $C3 $0EDB 0 BR_WRITE_V3 Store FAC into Fast Variable 3 $C4 $0EDB 0 BR_WRITE_V4 Store FAC into Fast Variable 4 $C5 $0EDB 0 BR_WRITE_V5 Store FAC into Fast Variable 5 $C6 $0EDB 0 BR_WRITE_V6 Store FAC into Fast Variable 6 $C7 $0EDB 0 BR_WRITE_V7 Store FAC into Fast Variable 7 $C8 $0EDB 0 BR_WRITE_V8 Store FAC into Fast Variable 8 $C9 $0EDB 0 BR_WRITE_V9 Store FAC into Fast Variable 9 $CA $0EDB 0 BR_WRITE_V10 Store FAC into Fast Variable 10 $CB $0EDB 0 BR_WRITE_V11 Store FAC into Fast Variable 11 $CC $0EDB 0 BR_WRITE_V12 Store FAC into Fast Variable 12 $CD $0EDB 0 BR_WRITE_V13 Store FAC into Fast Variable 13 $CE $0EDB 0 BR_WRITE_V14 Store FAC into Fast Variable 14 $CF $0EDB 0 BR_WRITE_V15 Store FAC into Fast Variable 15 $D0 $0EDB 0 BR_WRITE_V16 Store FAC into Fast Variable 16 $D1 $0EDB 0 BR_WRITE_V17 Store FAC into Fast Variable 17 $D2 $0EDB 0 BR_WRITE_V18 Store FAC into Fast Variable 18 $D3 $0EDB 0 BR_WRITE_V19 Store FAC into Fast Variable 19 $D4 $0EDB 0 BR_WRITE_V20 Store FAC into Fast Variable 20 $D5 $0EDB 0 BR_WRITE_V21 Store FAC into Fast Variable 21 $D6 $0EDB 0 BR_WRITE_V22 Store FAC into Fast Variable 22 $D7 $0EDB 0 BR_WRITE_V23 Store FAC into Fast Variable 23 $D8 $0EDB 0 BR_WRITE_V24 Store FAC into Fast Variable 24 $D9 $0EDB 0 BR_WRITE_V25 Store FAC into Fast Variable 25 $DA $0EDB 0 BR_WRITE_V26 Store FAC into Fast Variable 26 $DB $0EDB 0 BR_WRITE_V27 Store FAC into Fast Variable 27 $DC $0EDB 0 BR_WRITE_V28 Store FAC into Fast Variable 28 $DD $0EDB 0 BR_WRITE_V29 Store FAC into Fast Variable 29 $DE $0EDB 0 BR_WRITE_V30 Store FAC into Fast Variable 30 $DF $0EDB 0 BR_WRITE_V31 Store FAC into Fast Variable 31 $E0 $1065 1 BR_WRITE_V255 Store FAC into variable (32-255) $E1 $1065 1 BR_WRITE_V511 Store FAC into variable (256-511) $E2 $1065 1 BR_WRITE_V767 Store FAC into variable (512-767) $E3 $1065 2 BR_WRITE_VEXT Store FAC into variable (768+) $E4 $119F 1 BR_ARY_WRITE Write FAC to Float/Int Array $E5 $119F 1 BR_ARY_SWRITE Write FAC to String Array $E6 $0F4E 0 BR_VAR_CONT Secondary variable dispatch logic $E7 $1118 7 BR_STR_7 Inline String of length VARIABLE $E8 $1118 0 BR_STR_0 Inline String of length 0 $E9 $1118 1 BR_STR_1 Inline String of length 1 $EA $1118 2 BR_STR_2 Inline String of length 2 $EB $1118 3 BR_STR_3 Inline String of length 3 $EC $1118 4 BR_STR_4 Inline String of length 4 $ED $1118 5 BR_STR_5 Inline String of length 5 $EE $1118 6 BR_STR_6 Inline String of length 6 $EF $1118 7 BR_STR_7 Inline String of length 7 $F0 $1100 0 BR_SET_16 Set FAC to integer 16 $F1 $1100 0 BR_SET_17 Set FAC to integer 17 $F2 $1100 0 BR_SET_18 Set FAC to integer 18 $F3 $1100 0 BR_SET_19 Set FAC to integer 19 $F4 $1100 0 BR_SET_20 Set FAC to integer 20 $F5 $1100 0 BR_SET_21 Set FAC to integer 21 $F6 $1100 0 BR_SET_22 Set FAC to integer 22 $F7 $1100 0 BR_SET_23 Set FAC to integer 23 $F8 $1100 0 BR_SET_24 Set FAC to integer 24 $F9 $1100 0 BR_SET_25 Set FAC to integer 25 $FA $1100 0 BR_SET_26 Set FAC to integer 26 $FB $1100 0 BR_SET_27 Set FAC to integer 27 $FC $1100 0 BR_SET_28 Set FAC to integer 28 $FD $1100 0 BR_SET_29 Set FAC to integer 29 $FE $1100 0 BR_SET_30 Set FAC to integer 30 $FF $1100 0 BR_SET_31 Set FAC to integer 31