Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: forth eng./68hc11 new micros Message-ID: <598.UUL1.3#5129@willett.UUCP> Date: 2 Mar 90 03:56:36 GMT Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 75 Date: 02-28-90 (13:27) Number: 397 (Echo) To: ALL Refer#: NONE From: JACK BROWN Read: (N/A) Subj: HEX ASCII DUMP FOR MAX Status: PUBLIC MESSAGE ( Hex Ascii memory dump utility. ) DECIMAL : -ROT ROT ROT ; ( Leave true flag if a <= x <= b ) : [IN] ( x a b -- flag ) 1+ -ROT 1- OVER < -ROT > AND ; ( EMIT n as printable ascii or a space ) : .ASCII ( n -- ) 127 AND DUP BL 126 [IN] NOT IF DROP BL THEN EMIT ; ( Double space if i is equal to 8 ) : ?SPACE ( i -- ) 8 = IF SPACE SPACE THEN ; ( Print byte right justified in field w wide. ) : .RBYTE ( n w -- ) >R 0 <# # # #> R> OVER - SPACES TYPE ; ( Based on address adr , display heading for VERIFY ) : HEAD ( addr -- ) CR 5 SPACES 16 0 DO I OVER + 255 AND I ?SPACE 3 .RBYTE LOOP 2 SPACES 16 0 DO I OVER + 15 AND 1 .R LOOP DROP ; ( Verify 16 bytes from address ) : 1LINE ( adr -- ) DUP CR 4 U.R SPACE DUP ( display address ) 16 0 DO I ?SPACE COUNT 3 .RBYTE ( display bytes in hex ) LOOP DROP 2 SPACES 16 0 DO COUNT .ASCII LOOP DROP SPACE ; ( VERIFY only 32 bytes from addr with header. ) : VERIFY ( adr -- ) BASE @ SWAP HEX DUP HEAD DUP 1LINE DUP 16 + 1LINE HEAD CR BASE ! ; ( Peek at word ) : PEEK ( -- ) [COMPILE] ' DUP NFA VERIFY CFA VERIFY ; ( Dump out n bytes of memory starting at adr ) : DUMP ( adr n -- ) BASE @ >R HEX OVER HEAD ( a n ) OVER + OVER ( a n+a a ) DO I 1LINE 16 +LOOP HEAD R> BASE ! CR ; ( PEEK dumps header and pfa fields of ) NET/Mail : British Columbia Forth Board - Burnaby BC - (604)434-5886 ----- This message came from GEnie via willett through a semi-automated process. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'