pr 44
This commit is contained in:
@@ -1,36 +1,3 @@
|
||||
## PR-04 — Locals opcodes: GET_LOCAL / SET_LOCAL / INIT_LOCAL
|
||||
|
||||
**Why:** PBS `let` and parameters need first-class support.
|
||||
|
||||
### Scope
|
||||
|
||||
* Implement opcodes:
|
||||
|
||||
* `GET_LOCAL <u16 slot>` pushes value slots
|
||||
* `SET_LOCAL <u16 slot>` pops value slots and writes
|
||||
* `INIT_LOCAL <u16 slot>` (optional) for explicit initialization semantics
|
||||
* Enforce bounds: local slot index must be within `[0..param+local_slots)`
|
||||
* Enforce slot width: if types are multi-slot, compiler emits multiple GET/SET or uses `*_N` variants.
|
||||
|
||||
### Deliverables
|
||||
|
||||
* `LocalAddressing` utilities
|
||||
* Deterministic trap codes:
|
||||
|
||||
* `TRAP_INVALID_LOCAL`
|
||||
* `TRAP_LOCAL_WIDTH_MISMATCH` (if enforced)
|
||||
|
||||
### Tests
|
||||
|
||||
* `let x: int = 1; return x;` works
|
||||
* invalid local index traps
|
||||
|
||||
### Acceptance
|
||||
|
||||
* `let` works reliably; no stack side effects beyond specified pops/pushes.
|
||||
|
||||
---
|
||||
|
||||
## PR-05 — Core arithmetic + comparisons in VM (int/bounded/bool)
|
||||
|
||||
**Why:** The minimal executable PBS needs arithmetic that doesn’t corrupt stack.
|
||||
|
||||
Reference in New Issue
Block a user