Disassembler

Many times you'll want to take a peek at an earlier definition. Rather than searching through numerous blocks for a definition, or trying to recall that quick one-liner you wrote, you can use the word inspect to see the compiled code in a human-readable form.

Try this:

inspect words

You'll see some output like:

words:
4242f4: call 4017b5  ; last
4242f9: call 423d48  ; @
4242fe: call 4240b8  ; 0;
424303: call 423d21  ; dup
424308: call 401584  ; literal
42430d: dd 9         ; 9
424311: call 423db8  ; +
424316: call 423d21  ; dup
42431b: dec eax      ; 1-
42431c: call 423d52  ; c@
424321: call 4010a5  ; type
424326: call 4242b4  ; space
42432b: jmp 4242f9

In the first column are the addresses of each decompiled element. The assembly operation is next, and then on the right is the Forth version. The colors in the Forth section are for readability. Word names are in green, numbers in brownish-yellow, and macros are in blue.

Note: inspect is mainly intended for use with normal colon definitions. You can inspect words in the kernel, but don't expect the results to be very readable (at least at this point. We may expand the number of supported instructions in the future.)