Forc Parse Bytecode

Icon Linkforc-parse-bytecode

Parse bytecode file into a debug format

Icon LinkUSAGE:

forc parse-bytecode [OPTIONS] <FILE_PATH>

Icon LinkARGS:

<FILE_PATH>

Icon LinkOPTIONS:

-h, --help

Print help information

-L, --log-level <LOG_LEVEL>

Set the log level

-s, --silent

Silence all output

-v, --verbose

Use verbose output

-V, --version

Print version information

EXAMPLES:

Icon LinkParse bytecode

forc parse-bytecode

Icon LinkEXAMPLE

We can try this command with the initial project created using forc init, with the counter template:

forc new --template counter counter
cd counter
forc build -o obj
counter$ forc parse-bytecode obj

  half-word   byte   op                   raw           notes
          0   0      JI(4)                90 00 00 04   conditionally jumps to byte 16
          1   4      NOOP                 47 00 00 00
          2   8      Undefined            00 00 00 00   data section offset lo (0)
          3   12     Undefined            00 00 00 c8   data section offset hi (200)
          4   16     LW(63, 12, 1)        5d fc c0 01
          5   20     ADD(63, 63, 12)      10 ff f3 00
         ...
         ...
         ...
         60   240    Undefined            00 00 00 00
         61   244    Undefined            fa f9 0d d3
         62   248    Undefined            00 00 00 00
         63   252    Undefined            00 00 00 c8