Skip to content

Instantly share code, notes, and snippets.

@Proximyst
Last active October 9, 2018 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Proximyst/3a66f66f51ba9709461f09e80d38a8df to your computer and use it in GitHub Desktop.
Save Proximyst/3a66f66f51ba9709461f09e80d38a8df to your computer and use it in GitHub Desktop.
PMC specification

Proxi's Machine Code

Instructions

All instructions are given in uint8_t.

Code Name Description Parameters
0x00 END Ends the program 1: Error code as 8-bit value
0x01 PRINT Prints a string of characters 1: Length; 2: Characters to write as 8-bit ASCII values
0x02 MOV1 Moves 1 byte from a register into the destination 1: destination; 2: source register
0x03 MOV2 Moves 2 bytes from a register into the destination 1: destination; 2: source register
0x04 LET1 Moves 1 byte into a destination 1: destination; 2: source value
0x05 LET2 Moves 2 big-endian bytes into a destination 1: destination; 2: source value first 8 bits; 3: source value last 8 bits
0x06 ADD Adds x to the destination registry 1: registry; 2: x to add
0x07 SUB Subtracts x from the destination registry 1: registry; 2: x to subtract
0x08 MUL Multiplies x with the destination registry 1: registry; 2: x to multiply
0x09 DIV
0x0A MOD
0x0B CMP
0x0C NEQ
0x0D EQ
0x0E GT
0x0F LT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment