OpenBoot 3.x Command Reference Manual

Using the Forth Language Decompiler

The built-in Forth language decompiler can be used to recreate the source code for any previously-defined Forth word. The command:

ok see old-name

displays a listing of the source for old-name (without the source comments, of course).

A companion to see is (see) which is used to decompile the Forth word whose execution token is taken from the stack. For example:

ok ' old-name (see)

(see) produces a listing in a format identical to see.

ok see see
: see   
   ' ['] (see) catch if    
ok see (see)
defer (see) is 
: (f0018a44)   
   40 rmargin ! dup dup (f00189c4) dup (f0018944) (f0018980) (f0018658) 
ok f0018a44 (see)
: (f0018a44)   
   40 rmargin ! dup dup (f00189c4) dup (f0018944) (f0018980) (f0018658) 

The preceding listing shows that:

For words implemented in Forth assembler language, see displays a Forth assembler listing. For example, decompiling dup displays:

ok see dup
code dup 
f0008c98     sub         %g7, 8, %g7
f0008c9c     stx         %g4, [%g0 + %g7]
f0008ca0     ld          [%g5], %l0
f0008ca4     jmp         %l0, %g2, %g0
f0008ca8     add         %g5, 4, %g5