Skip to content

Commit

Permalink
ADD: u256 print.
Browse files Browse the repository at this point in the history
  • Loading branch information
Softcloud88 committed Feb 20, 2024
1 parent c0134dc commit e968148
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion interpreter/src/interpreter/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,62 @@ impl<'a> Traversal for Executor<'a> {

fn travel_printf(&mut self, node: &PrintfNode) -> NumberResult {
let flag_ret = self.travel(&node.flag)?.get_single().get_number();
if flag_ret == 3 {
if flag_ret == 4 {
let addr = self.travel(&node.val_addr)?.get_single().get_number() as u64;
println!(
"print u256 limbs:={},{},{},{},{},{},{},{}",
self.vm_mem.trace.get(&addr).unwrap().last().unwrap().value,
self.vm_mem
.trace
.get(&(addr + 1))
.unwrap()
.last()
.unwrap()
.value,
self.vm_mem
.trace
.get(&(addr + 2))
.unwrap()
.last()
.unwrap()
.value,
self.vm_mem
.trace
.get(&(addr + 3))
.unwrap()
.last()
.unwrap()
.value,
self.vm_mem
.trace
.get(&(addr + 4))
.unwrap()
.last()
.unwrap()
.value,
self.vm_mem
.trace
.get(&(addr + 5))
.unwrap()
.last()
.unwrap()
.value,
self.vm_mem
.trace
.get(&(addr + 6))
.unwrap()
.last()
.unwrap()
.value,
self.vm_mem
.trace
.get(&(addr + 7))
.unwrap()
.last()
.unwrap()
.value,
);
} else if flag_ret == 3 {
println!(
"print value={}",
self.travel(&node.val_addr)?.get_single().get_number()
Expand Down

0 comments on commit e968148

Please sign in to comment.