-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand scratch space and implement nested read
- Loading branch information
Showing
2 changed files
with
110 additions
and
94 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,28 +1,30 @@ | ||
#include "../L2Compressor.huff" | ||
|
||
#define constant FMS = 0xa0 | ||
|
||
// Function Dispatching | ||
#define macro MAIN() = takes (1) returns (1) { | ||
// readAdvanced with whatever calldata is passed | ||
// first 32 bytes returns the new rindex and the next 32 bytes returns the new windex | ||
|
||
0x00 // [rindex] | ||
0x80 // [windex, rindex] | ||
[FMS] // [windex, rindex] | ||
|
||
READ_FLAG() // [windex, rindex] | ||
|
||
0x80 // [0x80, windex, rindex] | ||
dup2 // [windex, 0x80, windex, rindex] | ||
[FMS] // [0xa0, windex, rindex] | ||
dup2 // [windex, 0xa0, windex, rindex] | ||
sub // [len, windex, rindex] | ||
|
||
swap2 // [rindex, windex, len] | ||
|
||
0x00 mstore // [windex, len] | ||
0x20 mstore // [len] | ||
0x80 [FMS] sub mstore // [windex, len] | ||
0x60 [FMS] sub mstore // [len] | ||
|
||
0x60 0x40 mstore // [len] | ||
dup1 0x60 mstore // [len] | ||
0x60 0x40 [FMS] sub mstore // [len] | ||
dup1 0x20 [FMS] sub mstore // [len] | ||
|
||
0x80 add // [len + 0x80] | ||
|
||
0x00 return | ||
0x80 [FMS] sub return | ||
} |