Hexadecimal dump
Thisfeature is useful for programmers who are debugging printing programs and want to
see the actual codes the printer is receiving. (Some computers change the codes the
programmer intended.)
In thismode, all data received will be printed in ahexadecimal dump format, rather than
the control codes being acted on as command codes.
This mode is accessed with the following procedure:
1. While holding the IIbutton down, turn power ON. Abeep tone will be
heard.
2. Begin printing. In place of the usual printout you will get aformatted dump showing
exactly what data the printer receives. Each line presents sixteen characters, their
hexadecimal codes to the left and printable characters printed on the right.
3. Attheendofthehexadecimaldump,setthepfinteroff-line withthe ION ]button.
This is necessary to print the last line.
The following BASIC program is asimple test you can run in hexadecimal mode:
10 WIDTH LPT 1:,255
20 FOR 1=0 TO 255
30 LPRINT CHR$ (I):
40 NEXT I
50 LPRINT
END
Ifyour system passes the codes directly to the printer without changing them, you will get
aprintout likeFigure 4-7.
00 01 02 0.3 04 05 06 07 Oh 09 [M OH OC (01) OF OF
10 11 12 13 14 15 16 17 Ib 1Y1AiBI(: 1D1!- 1F
20 21 22 23 24 25 26 27 2b 29 2A 2B 2(: 2D 2E 2F’
30 31 32 33 34 .35 36 37 3b 39 .3A 3B 3C 31) 3E 3E”
40 41 42 43 44 45 46 47 48 49 4A. 4B 4C 4U 41? 4F
50 51 52 53 54 55 5b .57 .58 59 5A 5B 5C 51) 5E 5P’
60 61 62 6.3 64 65 66 67 66 69 6A OF! bC bI) bF 6F-
70 ’71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7fi’
80 81 82 83 84 55 86 87 86 $39 6A hB bC hI) SE bF
90 91 92 93 94 95 96 97 98 99 9A 9B 9(; 91) 91? 9F”
AO A1A2 A3 .A4 .A5 .Ab A7 AS .A9 .AA AR AC AD .4P AF
BO B1 B2 B3 134 B5 Bb B7 B8 B9 nA Hi? 13c [it) BP: BP”
co c1C2 C3 C4 [:5 C(-JC7 CS C9 CA (;11 CC CD CE CF’
DO D1D2 F)3 04 D5 Db 1)7 1)8 1)9 DA F)B IX; DE I)F I)h
EO E1E2 h;.3 !s4 E5 I-6 !-7 E8 E9 F:A F;B EC El) F:P: EF’
FO F1F2 F:3 F4 F5 F“6 E-7 FEi F9 E“A FB FC E’D F1- F’P’
................
............
;: ;$O/o&()?<+,–./
0;?
BIJKLMNO
PQRSTUVWXY’Z [\1
ai j k
p{I}
................
................
................
................
................
................
................
................
F4Sh d
MostBASICS, however, are notquite that straightforward. For example, the IBM-PC will
give you aprintout similar to Figure 4-8.
When theIBM-PC BASIC interpreter sends hex code OD (carriagereturn) it adds an extra
hex OA(line feed). Hex code 1A (end-of-file) also gets special treatment: the interpreter
doesnot send it at all. This can cause problems with graphics or download character data.
However, you can solvethis problem by changing line 30 in the preceding program and
adding the coding shown below.
Chapter4 CONTROL PANEL OPERATIONS 27