Skip to content

Commit

Permalink
Backport some tooling from entrypoint branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Skydev0h committed Oct 13, 2023
1 parent 0794b7d commit 8041686
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fift/Disasm.fif
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ variable @contX variable @contY variable @cdict
{ atom>$ type } : .atom
{ dup first .atom dup count 1 > { space 0 over count 2- { 1+ 2dup [] type .", " } swap times 1+ [] type } { drop } cond } : std-show-op
{ 0 over count 1- { 1+ 2dup [] type space } swap times drop first .atom } : stk-show-op
{ @dismode @ 2 and { .indent ."// " @curop @ csr. } if } : .curop?
{ @dismode @ 2 and { @curop @ csr. } if } : .curop?
{ .curop? .indent @dismode @ 1 and ' std-show-op ' stk-show-op cond cr
} : show-simple-op
{ dup 4 u@ 9 = { 8 u@+ swap 15 and 3 << s@ } {
Expand Down
16 changes: 16 additions & 0 deletions fift/dasm.fif
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/fift -s
"Asm.fif" include
"Disasm.fif" include

"../build/wallet_v5_compiled.txt" file>B B>$ x>B B>boc

show-vm-code std-disasm +indent +indent

."Disasm" cr
dup <s disasm cr

."Cell tree:" cr
dup <s csr. cr

."Free bits in root cell"
dup <s sbits 1023 - -1 * ." " dup . ." (" 8 / . ."bytes)" cr
5 changes: 5 additions & 0 deletions fift/print.fif
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

"../build/wallet_v5_code.fif" include

show-vm-code std-disasm +indent +indent

."Disasm" cr
dup <s disasm cr

Expand All @@ -12,3 +14,6 @@ dup <s csr. cr

."Compiled hex:" cr
dup 0 boc+>B B>x .dump cr cr

."Free bits in root cell"
dup <s sbits 1023 - -1 * ." " dup . ." (" 8 / . ."bytes)" cr
8 changes: 8 additions & 0 deletions scripts/disasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

cd "$(dirname "$0")" || exit
cd ../fift || exit

jq -j ".hex" ../build/wallet_v5.compiled.json > ../build/wallet_v5_compiled.txt

fift dasm.fif

0 comments on commit 8041686

Please sign in to comment.