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

Add operations that are easy to verify #57

Merged
merged 1 commit into from
Feb 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions specs/opcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
- [EXP: Exponentiate](#exp-exponentiate)
- [EXPI: Exponentiate immediate](#expi-exponentiate-immediate)
- [GT: Greater than](#gt-greater-than)
- [MATHLOG: Math logarithm](#mathlog-math-logarithm)
- [MATHROOT: Math root](#mathroot-math-root)
- [MOD: Modulus](#mod-modulus)
- [MODI: Modulus immediate](#modi-modulus-immediate)
- [MUL: Multiply](#mul-multiply)
Expand Down Expand Up @@ -172,6 +174,26 @@ All these opcodes advance the program counter `$pc` by `4` after performing thei
| Encoding | `0x00 rd rs rt -` |
| Notes | |

### MATHLOG: Math logarithm

| | |
| ----------- | -------------------------------------------- |
| Description | The (integer) logarithm base `$rt` of `$rs`. |
| Operation | ```$rd = math.floor(math.log($rs, $rt));``` |
| Syntax | `mathlog $rd, $rs, $rt` |
| Encoding | `0x00 rd rs rt -` |
| Notes | `$of` is cleared. |

### MATHROOT: Math root

| | |
| ----------- | -------------------------------------------- |
| Description | The (integer) `$rt`th root of `$rs`. |
| Operation | ```$rd = math.floor(math.root($rs, $rt));``` |
| Syntax | `mathroot $rd, $rs, $rt` |
| Encoding | `0x00 rd rs rt -` |
| Notes | `$of` is cleared. |

### MOD: Modulus

| | |
Expand Down