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 dynamic cfe & cfs #471

Merged
merged 4 commits into from
Mar 17, 2023
Merged
Changes from 1 commit
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
Next Next commit
add register based cfe
  • Loading branch information
Voxelot committed Mar 17, 2023
commit 574c29c78b385fbe24e8f4a2ccd857d9f46861cc
16 changes: 16 additions & 0 deletions src/vm/instruction_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 42,7 @@
- [RET: Return from context](#ret-return-from-context)
- [Memory Instructions](#memory-instructions)
- [ALOC: Allocate memory](#aloc-allocate-memory)
- [CFEI: Extend call frame](#cfe-extend-call-frame)
- [CFEI: Extend call frame immediate](#cfei-extend-call-frame-immediate)
- [CFSI: Shrink call frame immediate](#cfsi-shrink-call-frame-immediate)
- [LB: Load byte](#lb-load-byte)
Expand Down Expand Up @@ -807,6 808,21 @@ Panic if:
- `$hp - $rA` underflows
- `$hp - $rA < $sp`

### CFE: Extend call frame

| | |
|-------------|----------------------------------------|
| Description | Extend the current call frame's stack. |
| Operation | ```$sp = $sp $rA``` |
| Syntax | `cfei $rA` |
| Encoding | `0x00 rA - - -` |
| Notes | Does not initialize memory. |

Panic if:

- `$sp $rA` overflows
- `$sp $rA > $hp`

### CFEI: Extend call frame immediate

| | |
Expand Down