Splitting the Atom |
|
page 71 |
Appendix 2. Hex Dump and Modify
Below is the code to enable a HEX DUMP of memory contents, and
modification if this is required. This is one of the features
found in a DISATOM ROM. Remember that the machine code must be
resident for it to work, so don't overwrite it once it has been
assembled. LINK to the first code to activate (here #2800).
40 V=#70;K=#72;T=#75
50 DIMJJ5;F.I=0 TO 5; JJ(I)=-1;N.
60 PRINT $21
70 FOR X = 0 TO 1
80 P=#2800
90[
100 LDA @ JJ0/256
110 STA #207
120 LDA @ JJ0%256
130 STA #206
140 RTS
150:JJ0
160 LDY @0
170 STY T
180 JSR #F876
190 CMP @ CH"*"
200 BEQ JJ1
210 JMP #F8EF
220:JJ1
230 LDA @11
240 JSR #FFF4
250 LDX @V
260 INY
270 JSR #FB93
280 LDX @K
290:JJ2
300 JSR #F876
310 CMP @#0D
320 BEQ JJ3
330 JSR #F893
340 TYA
350 PHA
360 LDA K
370 LDY T
380 STA (V),Y
390 INC T
400 PLA
410 TAY
420 BNE JJ2
|
|
430:JJ3
440 LDX @V
450 JSR #F7D1
460]
470 $P=" **";P=P+LEN(P)
480[
490 NOP
500 JSR #F7F1
510:JJ4
520 LDA (V),Y
530 JSR #F7FA
540 INY
550 CPY @8
560 BNE JJ4
570 TYA
580 CLC
590 ADC V
600 STA V
610 BCC JJ5
620 INC V+1
630:JJ5
640 BIT #B002
650 BVC JJ3
660 JSR #C504
670 BNE JJ5
680]
690 NEXT X;PRINT$6;END
|
|
TO OPERATE: type **XXX. This gives a hex dump of memory
starting at hex xxxx. This may be used to edit the memory as
given below. Pushing <REPEAT> will continue the dump, and
<ESC> exits the mode.
EITING MEMORY: This program displays memory contents as a
two-digit hex number (one byte). To change the memory contents,
hit ESC, and the prompt > will return. Move the cursor over
the line where you want to make the change. You may then type in
the two-digit hex number, and this may be done as many times as
you wish along the line. At the end of the line hit
<RETURN> and <ESC>. You need not go to the end of the
line before hitting RETURN - the rest of the line will copy
automatically.
|