Skip to content

Instantly share code, notes, and snippets.

@eparadis
Last active June 26, 2019 07:30
Show Gist options
  • Save eparadis/69af2cbb499422839b441bd6b904f62c to your computer and use it in GitHub Desktop.
Save eparadis/69af2cbb499422839b441bd6b904f62c to your computer and use it in GitHub Desktop.
formatted hex dump of an area of memory in BASIC
5 INPUT "offset (dec) "; F
10 FOR I = 0 TO 255 STEP 16
11 IF I+F<16 THEN PRINT "0";
12 IF I+F<256 THEN PRINT "0";
13 IF I+F<4096 THEN PRINT "0";
15 PRINT HEX$(I+F);" ";
20 FOR J = 0 TO 15
25 V = PEEK(I+J+F)
27 IF V < 16 THEN PRINT "0";
30 PRINT HEX$(V);
35 PRINT " ";
40 NEXT J
50 FOR J = 0 TO 15
60 V = PEEK(I+J+F)
70 IF V<32 OR V>126 THEN V=46
75 PRINT CHR$(V);
80 NEXT J
90 PRINT
100 NEXT I
110 INPUT "N for next, P for previous, Q to quit "; C$
120 IF C$ = "N" OR C$ = "n" THEN F = F+256: GOTO 10
130 IF C$ = "P" OR C$ = "p" THEN F = F-256: GOTO 10
140 END
@eparadis
Copy link
Author

updated to print ASCII value to the right of the hexdump and row address to the left

@eparadis
Copy link
Author

cleanup INPUT prompt and add a way to continue printing more 256 byte "pages"

@eparadis
Copy link
Author

navigate forwards or backwards a page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment