-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from 0xPolygonHermez/fix-sp-negative-offset
fix problem with negative offset
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const chai = require("chai"); | ||
const assert = chai.assert; | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const {verifyZkasm} = require("../../verify_zkasm"); | ||
|
||
describe("Test Fix Negative Offset SP", async function () { | ||
this.timeout(10000000000); | ||
|
||
it("Test Fix Negative Offset SP", async () => { | ||
await verifyZkasm(__dirname + "/sp_negative_offset.zkasm", true, | ||
{ defines: {N: 2 ** 16}, | ||
namespaces: ['Global', 'Main', 'Rom'], | ||
verbose: true, | ||
color: true, | ||
disableUnusedError: true}); | ||
}); | ||
}); |
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,18 @@ | ||
start: | ||
|
||
STEP => A | ||
0 :ASSERT | ||
|
||
|
||
128514851843584385348488432423523454n => A :MSTORE(SP++) | ||
$ => B :MLOAD(SP-1) | ||
B :ASSERT | ||
|
||
end: | ||
0 => A,B,C,D,E,CTX, SP, PC, GAS, MAXMEM, SR, RCX, HASHPOS | ||
|
||
finalWait: | ||
${beforeLast()} : JMPN(finalWait) | ||
|
||
: JMP(start) | ||
opINVALID: |