4 CLS
5 DEF SEG = &HB800
6 WID = 16:  SCRWID = 40: OFS=3: YOFS=1
7 ADDRESS = SCRWID*YOFS+OFS
8 WIDTH SCRWID
9 GOSUB 40
10 FOR I = 0 TO 255
20   POKE ADDRESS*2,I
25 IF I MOD WID >= WID-1 THEN ADDRESS = ADDRESS+(SCRWID-2*WID+2) ELSE ADDRESS=ADDRESS+2
30 NEXT 
35 GOSUB 1000: END
40 LOCATE 1,1: COLOR 0, 7: PRINT SPACE$(2*WID+OFS-1);
45 FOR I = 0 TO WID-1
46 LOCATE 1,2*I+OFS+1: PRINT HEX$(I);
47 NEXT
50 FOR I = 1 TO 256/WID
60 LOCATE I+1,1: PRINT HEX$(I-1)+" ";
70 NEXT
80 RETURN
1000 COLOR 7, 0
1040 LOCATE 21,1
1050 RETURN
