addressed comments

This commit is contained in:
Nicholas Ward 2023-03-14 14:28:21 -07:00
parent 2000d308f8
commit c4b511baf4
3 changed files with 14 additions and 2 deletions

View File

@ -4,6 +4,11 @@
// Shifts a given bignum right by one bit (in place).
// Assumes that len > 0.
global shr_bignum:
// stack: len, start_loc, retdest
DUP1
// stack: len, len, start_loc, retdest
ISZERO
%jumpi(shr_end_len_zero)
// stack: len, start_loc, retdest
DUP2
// stack: start_loc, len, start_loc, retdest
@ -55,3 +60,8 @@ shr_end:
%pop3
// stack: retdest
JUMP
shr_end_len_zero:
// stack: len, start_loc, retdest
%pop2
// stack: retdest
JUMP

View File

@ -770,7 +770,9 @@ impl<'a> Interpreter<'a> {
fn run_mload_general(&mut self) {
let context = self.pop().as_usize();
let segment = Segment::all()[self.pop().as_usize()];
let offset = self.pop().as_usize();
let x = self.pop();
dbg!(x);
let offset = x.as_usize();
let value = self
.generation_state
.memory

View File

@ -29,7 +29,7 @@ fn gen_bignum(bit_size: usize) -> BigUint {
}
fn bignum_len(a: &BigUint) -> usize {
a.bits() as usize / BIGNUM_LIMB_BITS + 1
ceil_div_usize(a.bits() as usize, BIGNUM_LIMB_BITS)
}
fn gen_two_bignums_ordered(bit_size: usize) -> (BigUint, BigUint) {