Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *******************************
- * Normal CPU operations *
- *******************************
- 0000 -- NOP (Comments)
- Offset 2, WORD: Length of comment
- Offset 4, WORD: Location of coment in array
- Offset 6, WORD: ignored
- 0001 -- Allocate for single precision number
- Offset 2, WORD: Location of name in array
- Offset 4, DWORD: Actual single
- 0002 -- Allocate for string
- Offset 2, WORD: location of name in array
- Offset 4, WORD: location of string in array
- Offset 6, WORD: ignored
- 0003 -- dispatch (GOTO/GOSUB/RETURN/etc.)
- Offset 2, WORD: Type of jump (0 = GOTO/JMP || 1 = GOSUB/CALL || 2 = RETURN)
- Offset 4, WORD: Instruction to jump to
- Offset 6, WORD: ignored
- 0004 -- IF= (IF A = B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: Instruction to jump to
- 0005 -- IF> (IF A > B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: Instruction to jump to
- 0006 -- IF< (IF A < B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: Instruction to jump to
- 0007 -- IF<> (IF A <> B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: Instruction to jump to
- 0008 -- LET (LET A = B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: ignored
- 0009 -- LET (LET A = constant)
- Offset 2, WORD: Location of variable A
- Offset 4, DWORD: Integer/single constant
- 000A -- ADD A,B (A += B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: ignored
- 000B -- SUB A,B (A -= B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: ignored
- 000C -- MUL A,B (A *= B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: ignored
- 000D -- DIV A,B (A /= B)
- Offset 2, WORD: Location of variable A
- Offset 4, WORD: Location of variable B
- Offset 6, WORD: ignored
- 000E -- ADD A,x (A += constant)
- Offset 2, WORD: Location of variable A
- Offset 4, DWORD: Integer constant to add
- 000F -- SUB A,x (A -= constant)
- Offset 2, WORD: Location of variable A
- Offset 4, DWORD: Integer constant to subtract
- 0010 -- MUL A,x (A *= constant)
- Offset 2, WORD: Location of variable A
- Offset 4, DWORD: Integer constant to multiply
- 0011 -- DIV A,x (A /= constant)
- Offset 2, WORD: Location of variable A
- Offset 4, DWORD: Integer constant to divide
- 0012 -- RND (x = Rnd(A to B))
- Offset 2, WORD: Location of variable x (Where to save?)
- Offset 4, WORD: Location of variable A (minimum)
- Offset 6, WORD: Location of variable B (maximum)
- 0013 -- Round
- Offset 2, WORD: Offset of variable to round into
- Offset 4, WORD: Offset of variable to round
- Offset 6, WORD: Offset of variable holding decimals to round to
- 0014 -- PUSH x (push variable offset to stack, adjust stack pointer)
- Offset 2, WORD: Type of PUSH (0 = constant || 1 = variable)
- Offset 4, WORD: Offset of variable to push to stack
- Offset 4, DWORD: Constant float value to push to stack
- 0015 -- POP x (read variable offset from stack, adjust stack pointer)
- Offset 2, WORD: Offset of variable to read WORD of stack into
- Offset 4, DWORD: ignored
- 0016 -- SRead (reads 2 bytes from stack, does not move stack pointer)
- Offset 2, WORD: Size of read (0 = WORD || 1 = DWORD)
- Offset 4, WORD: Offset of variable to read data into
- Offset 6, WORD: Offset (in WORDs) of stack to read data from
- *******************************
- * BIOS Calls *
- *******************************
- 1000 -- End (Shuts down robot and stopps executing code)
- Offset 2, WORD: Shutdown code
- Offset 4, DWORD: ignored
- 1001 -- Print (Write to debug console)
- Offset 2, WORD: Type of print (0 = Variable in bytecode || 1 = String in String Buffer)
- Offset 4, WORD: Location of string in array
- Offset 6, WORD: ignored
- 1002 -- Move (Tells motors to move forward or back)
- Offset 2, WORD: Type of value passed (0 = constant, FFFF = variable)
- Offset 4, DWORD: Float constant for direction (positive = forward || negative = back)
- Offset 4, WORD: Offset of direction variable (positive = forward || negative = back)
- 1003 -- Turn (Tells the motors the direction to rotate the bot)
- Offset 2, WORD: Type of value passed (0 = constant, FFFF = variable)
- Offset 4, DWORD: Float constant for direction (positive = right || negative = left)
- Offset 4, WORD: Offset of direction variable (positive = right || negative = left)
- 1004 -- Read Sensor (Pulses a sensor on the robot to tell you how far you are from an object)
- Offset 2, WORD: Variable to save the result into
- Offset 4, WORD: Variable with sensor number to read
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement