home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
tcom
/
debugger
/
wdump.seq
< prev
Wrap
Text File
|
1989-09-16
|
2KB
|
71 lines
\ WDUMP.SEQ A word dump utility
\ anew wdumpstuff
DECIMAL
\ The dump utility gives you a formatted hex dump with the ascii
\ text corresponding to the bytes on the right hand side of the
\ screen. In addition you can use the SM word to set a range of
\ memory locations to desired values. SM displays an address and
\ its contents. You can go forwards or backwards depending upon
\ which character you type. Entering a hex number changes the
\ contents of the location. DL can be used to dump a line of
\ text from a screen.
: %DUMP@ ( A1 --- C1 )
DUMPSEG @ SWAP @L ;
DEFER DUMP@ ' %DUMP@ IS DUMP@
headerless
: .2Ww ( n -- ) 0 <# # # # # #> TYPE SPACE ;
: D.2Ww ( addr len -- ) BOUNDS ?DO I DUMP@ .2Ww 2 +LOOP ;
headers
: DLNw ( addr --- )
CR ." │" DUMPSEG @ 0 <# ':' HOLD # # # # #> TYPE
DUP 0 <# # # # # #> TYPE ." │ "
16 D.2Ww ." │" ;
headerless
: .HEADw ( addr len -- addr' len' )
OVER 15 AND
CR ." ╒═════════╤"
41 0 DO ." ═" LOOP ." ╕"
CR ." │ SEG:OFF │ "
16 0 DO DUP I + 15 AND 3 .R 2 SPACES 2 +LOOP ." │" drop
CR ." ╞═════════╪"
41 0 DO ." ═" LOOP ." ╡" ;
: .FOOTw ( --- )
CR ." ╘═════════╧"
41 0 DO ." ═" LOOP ." ╛" CR ;
headers
: LWDUMP ( SEG addr len -- )
ROT DUMPSEG !
BASE @ -ROT HEX .HEADw BOUNDS
DO I DLNw KEY? ?LEAVE
16 +LOOP BASE ! .FOOTw ;
: WDUMP ( A1 N1 --- )
?CS: -ROT LWDUMP ;
: YWDUMP ( A1 N1 --- )
YSEG @ -ROT LWDUMP ;
: XWDUMP ( SEG N1 --- )
SWAP +XSEG 0 ROT LWDUMP ;
: WDU ( addr -- addr+64 )
DUP 64 DUMPSEG @ -ROT LWDUMP 64 + ;
behead