Integrate Assembler from polkavm's spectool #103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds another option to load a new program to execute/debug in PVM - typing the assembly code from polkavm's spectool.
The a special version of spectool (see https://github.com/tomusdrw/polkavm/tree/master/tools/spectool-wasm) has been compiled to WASM and published to NPM registry as
@typeberry/spectool-wasm
. This code is later loaded here, so one can write in the same format as for spectool JSON files to get the bytecode directly in the browser.I've also integrated a disassembler, so after loading a PVM program from any input (i.e. JSON upload, example) you can click "Load" again and then go to
Assembly
to alter the program. Hopefully the resulting bytecode should be the same :)