Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised opcodes #88

Open
thosakwe opened this issue May 31, 2018 · 0 comments
Open

Revised opcodes #88

thosakwe opened this issue May 31, 2018 · 0 comments

Comments

@thosakwe
Copy link
Contributor

  • REGISTER - Get the index of the first available register, or create a new one. The index is placed on the stack.
  • LDR reg, offset, size - Read size (max 8) bytes from offset, store in reg
  • STO offset, reg, size
  • NEW - Pops a size from stack, then calls malloc. Pushes address to stack
  • FREE - free a pointer of memory
  • BANK nn - Switch the R/W memory base pointer. Useful after calling NEW.
  • CUR_BANK - Push the base pointer of the current bank
  • PUSH nn - Push the value from a given register to the stack.
  • POP nn - Pop the top stack value to the given register.
  • MUL nnA, nnB - Multiply register A by B, store in A
  • DIV nnA, nnB
  • MOD nnA, nnB
  • ADD nnA, nnB
  • SUB nnA, nnB
  • AND regA, regB
  • OR regA, regB
  • XOR regA, regB
  • CMP regA, regB - Boolean comparison of numbers
  • NOT - Invert carry flag (xor cf, 0xFF)
  • JMP nn - Jump...
  • JZ nn
  • JNZ nn
  • JG nn
  • JGE nn
  • JL nn
  • JLE nn
  • RET - Pop address from stack, jump
  • CALL nn - Push next address to stack, then jump to nn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant