-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: magic bytes to constant op codes
- Loading branch information
1 parent
b4021bb
commit 1d2cd50
Showing
7 changed files
with
180 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod error; | ||
|
||
pub mod indices; | ||
pub mod opcodes; | ||
pub mod reader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
pub const NOP: u8 = 0x01; | ||
pub const END: u8 = 0x0B; | ||
pub const LOCAL_GET: u8 = 0x20; | ||
pub const LOCAL_SET: u8 = 0x21; | ||
pub const GLOBAL_GET: u8 = 0x23; | ||
pub const GLOBAL_SET: u8 = 0x24; | ||
pub const I32_LOAD: u8 = 0x28; | ||
pub const I32_STORE: u8 = 0x36; | ||
pub const I32_CONST: u8 = 0x41; | ||
pub const I32_ADD: u8 = 0x6A; | ||
pub const I32_MUL: u8 = 0x6C; | ||
pub const I32_DIV_S: u8 = 0x6D; | ||
pub const I32_DIV_U: u8 = 0x6E; | ||
pub const FB_INSTRUCTIONS: u8 = 0xFB; | ||
pub const FC_INSTRUCTIONS: u8 = 0xFC; | ||
pub const FD_INSTRUCTIONS: u8 = 0xFD; | ||
pub const FE_INSTRUCTIONS: u8 = 0xFE; | ||
|
||
pub mod fc_opcodes { | ||
pub const I32_TRUNC_SAT_F32S: u8 = 0x00; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.