--- title: "HexDump" id: 72370 type: "computer_media" slug: "hexdump" url: "http://localhost/computer_media/hexdump/" markdown_url: "http://localhost/computer_media/hexdump.md" published_at: "2026-10-23T07:47:12+00:00" modified_at: "2026-10-23T07:47:12+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/hexdump-1.png" excerpt: "Prints a hex dump of any memory range, eight bytes to a line after a four-digit hex address, using a short decimal-to-hex subroutine and no scroll prompts." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Barry Mulligan" slug: "barry-mulligan" taxonomy: "indiv" url: "http://localhost/indiv/barry-mulligan/" genre: - name: "Programming" slug: "programming" taxonomy: "genre" url: "http://localhost/type/programming/" media_type: "Program" programmers: - name: "Barry Mulligan" slug: "barry-mulligan" taxonomy: "indiv" url: "http://localhost/indiv/barry-mulligan/" download_url: "https://archive.org/download/timex-sinclair-software-archive/HexDump%20%281983%29%28Mulligan%2C%20Barry%29%28TS2068%29%28US%29%28Program%29.zip" tsrun_member: "HexDump (1983)(Mulligan, Barry)(TS2068)(US)(Program)/HexDump (1983)(Mulligan, Barry)(TS2068)(US)(Program).tap" mediadate: "1983" images: - url: "http://localhost/wp-content/uploads/2026/10/hexdump-1.png" article_media: - id: 20254 title: "HexDump" type: "article" url: "http://localhost/article/hexdump/" media_type_tags: "Programming" license: false --- # HexDump Prints a hex dump of memory. You enter a start address, which is rounded down to a multiple of 8, and an end address, both in decimal. Each line then shows a four-digit hex address followed by the next eight bytes in hex. The listing scrolls up from the bottom of the screen without stopping for the “scroll?” prompt, and the program stops when it reaches the end address. The opening REM reads “HEXDUMP by Barry Mulligan” with “Timex Sinclair User V1, #7”, the December 1983 issue in which the program was printed. ## Program Analysis The program has 25 lines. Lines 30–70 take the start and end addresses, and the loop at lines 90–210 PEEKs each byte. When the address is a multiple of 8 it starts a new line and prints the address, converting the high and low bytes separately, then tabs to column 7 for the data. The subroutine at lines 220–250 converts one byte into two hex digits. It splits the byte into high and low nibbles, adds 48 to each to get a digit character, and adds a further 7 when the result passes 57 (“9”) so that 10–15 become A–F. ## Notable Techniques - `POKE 23692,255` before each new line keeps the scroll counter high, so the listing never stops for the scroll prompt. - `PRINT AT 21,0'` prints at the bottom row and forces a scroll, so each new line appears at the foot of the screen. - Hex digits come from character arithmetic (`CHR$ (48+n)`, plus 7 for A–F) instead of a lookup string. This program came from an Oliger (JLO SAFE) disk in the SNUG library set and was converted for tape. It has no disk commands, so no changes were needed. It was tested in ZEsarUX on a stock TS2068 with a dump of ROM addresses 0–159. ## Source Code ``` 10 REM >> HEXDUMP << by Barry Mulligan * Timex Sinclair User V1, #7 20 PRINT AT 19,10;"- HEXDUMP -" 30 PRINT AT 21,1;"START "; 40 INPUT a 50 LET a=8*INT (a/8) 60 PRINT a," END "; 70 INPUT z: PRINT z 80 POKE 23692,255: PRINT AT 21,0' 90 FOR i=a TO z 100 IF i<>8*INT (i/8) THEN GO TO 180 110 POKE 23692,255: PRINT AT 21,0' 120 LET x=INT (i/256) 130 GO SUB 220 140 LET y$=x$ 150 LET x=i-256*INT (i/256) 160 GO SUB 220 170 PRINT y$;x$;TAB 7; 180 LET x=PEEK i 190 GO SUB 220 200 PRINT x$;" "; 210 NEXT i: STOP 220 LET x$=CHR$ (48+INT (x/16)): LET z$=CHR$ (48+x-16*INT (x/16)) 230 IF CODE x$>57 THEN LET x$=CHR$ (CODE x$+7) 240 IF CODE z$>57 THEN LET z$=CHR$ (CODE z$+7) 250 LET x$=x$+z$: RETURN ```