You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #44 and in #73 we should refactor i/o assembly operations to follow the what.where format and also add new operations for handling memory-based local variables. Overall, the new i/o instruction set should be as follows:
Pushing values onto the stack:
push.xyz - similar to current push but should allow pushing multiple values (up to 8). For example, the following should be valid: push.1, push.1.2, push.1.2.0x3 etc.
pushw.0x... - this should push a single 32-byte value provided in hexadecimal format. Semantically, this should be equivalent to push.a.b.c.d where a is the first 8 bytes of the value, b is the next 8 bytes etc. (although, maybe we should reverse the order?).
push.evn.sdepth
pushw.mem.addr
pushw.local.idx where idx is the index of the local variable. using this instruction outside of a procedure should be an error.
push.adv.n where n can be up to 8.
Removing values from the stack:
popw.mem.addr
popw.local.idx where idx is the index of the local variable. using this instruction outside of a procedure should be an error.
Overwriting values on the stack:
loadw.mem.addr
loadw.local.idx where idx is the index of the local variable. using this instruction outside of a procedure should be an error.
loadw.adv
Save stack values without removing them:
storew.mem.addr
storew.local.idx where idx is the index of the local variable. using this instruction outside of a procedure should be an error.
To enable handling locals, we'll also need to update procedure parsers. The new procedure declaration format should include an optional specifier for the number of memory-based locals the procedure can access. For example:
proc.foo.2 # needs access to 2 memory-based locals
proc.bar # same as proc.bar.0
If code within a procedure tries to access a local outside of the specified bounds, the assembler should return an error.
The text was updated successfully, but these errors were encountered:
As discussed in #44 and in #73 we should refactor i/o assembly operations to follow the what.where format and also add new operations for handling memory-based local variables. Overall, the new i/o instruction set should be as follows:
Pushing values onto the stack:
push.xyz
- similar to currentpush
but should allow pushing multiple values (up to 8). For example, the following should be valid:push.1
,push.1.2
,push.1.2.0x3
etc.pushw.0x...
- this should push a single 32-byte value provided in hexadecimal format. Semantically, this should be equivalent topush.a.b.c.d
where a is the first 8 bytes of the value, b is the next 8 bytes etc. (although, maybe we should reverse the order?).push.evn.sdepth
pushw.mem.addr
pushw.local.idx
whereidx
is the index of the local variable. using this instruction outside of a procedure should be an error.push.adv.n
where n can be up to 8.Removing values from the stack:
popw.mem.addr
popw.local.idx
whereidx
is the index of the local variable. using this instruction outside of a procedure should be an error.Overwriting values on the stack:
loadw.mem.addr
loadw.local.idx
whereidx
is the index of the local variable. using this instruction outside of a procedure should be an error.loadw.adv
Save stack values without removing them:
storew.mem.addr
storew.local.idx
whereidx
is the index of the local variable. using this instruction outside of a procedure should be an error.To enable handling locals, we'll also need to update procedure parsers. The new procedure declaration format should include an optional specifier for the number of memory-based locals the procedure can access. For example:
If code within a procedure tries to access a local outside of the specified bounds, the assembler should return an error.
The text was updated successfully, but these errors were encountered: