Development tools





The file COMMON\DEVTOOLS.FTH supplies words that are mostly used during development and debugging.

1 equ HexTools? \ -- flag
If non-zero, .DWORD and friends will be compiled.

1 equ DUMP?     \ -- flag
If non-zero, DUMP and friends will be compiled.




Hexadecimal display tools

1 equ simple?   \ -- n
Set this flag non-zero to generate .xWORD to avoid divisions, which are slow on some CPUs.

: .nibble       \ n --
Convert a nibble to a hex ASCII digit and display it.

: .BYTE         \ b --
Display b as two hex digits.

: .WORD         \ w --
Display w as four hex digits.

: .LWORD        \ x --
Display x as eight hex digits. The separator ":" makes the output easier to read. Future releases of MPE Forths will treat the ":" character as having no effect on number input parsing. This character is chosen because it does not conflict with the current use of the "." and "," characters for numbers. This word is only compiled for 32 bit targets.

: .DWORD        \ x --
A synonym for .LWORD.




DUMP and friends

: .ASCII        \ char --
The top bit of char is zeroed. If char is in the range 32..126 it is displayed, otherwise a "." is displayed.

: DUMP          \ addr len --
Display (dump) len bytes of memory starting at addr.

: LDUMP         \ addr len -- ; dump 32 bit long words
Display (dump) len bytes of memory starting at addr as 32 bit words.

: PDUMP         \ addr len -- ; dump 32 bit long words
Display (dump) len bytes of memory starting at addr as 32 bit words with no ASCII dump. This word may be necessary when accessing peripherals that must only be addressed on 32 bit boundaries.

: WDUMP         \ addr len -- ; dump 16 bit half words
Display (dump) len bytes of memory starting at addr as 16 bit half-words.

: .S            \ --
Display the contents of the data stack without affecting it.

: ?             \ a-addr --
Display contents of a memory location as a cell.