home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Ham Radio 1997
/
WOHR97_AmSoft_(1997-02-01).iso
/
mods
/
aea
/
pkdump.doc
< prev
Wrap
Text File
|
1997-02-01
|
2KB
|
71 lines
DUMPING THE PK87 MEMORY
The AEA PK87 TNC has the capability to read and/or write any
location in memory via two undocumented commands which are
vaguely hinted at in the 12/86 version of the user's manual.
These commands are ADDRESS, which reads/writes a mmemory pointer,
and MEMORY, which reads/writes the memory byte pointed to by
ADDRESS and also increments ADDRESS by one byte.
These commands make it possible to create a binary image
file of any memory area (such as the onboard ROM) by setting
ADDRESS to the start of the area and reading MEMORY as many times
as necessary. The following MS-DOS BASIC program is written to
make an image of the ROM, but will dump any area desired with
suitable alterations. Unfortunately, it's very slow, since it has
to exchange a dozen or so bytes with the TNC at 9600 baud, and
then do an ASCII-hex-to-binary conversion, to get one memory
byte; it takes about two hours to dump the full 32K ROM.
Rewriting it in assembler would only speed things up a little,
because the ASCII dialogue takes up most of the time.
The following notes apply:
(1) ROM extends from location $0000 to $7FFF, RAM from $8000
upward depending on unit modification.
(2) Modify line 10 as required to suit your serial port.
(3) Change the filespec in line 20 if you want to write a file
other than "ROMDATA" in the default directory.
(4) The number in line 30 is the starting memory location; change
it as desired, remembering to prefix it with &H if you enter it
in hex.
(5) The final number in line 40 is the number of memory bytes to
dump.
(6) Line 135 prints the current address (in decimal) to the
screen so you'll know the program isn't hung. If you aren't a
clockwatcher, you can delete it.
(7) I suppose this procedure will work for the PK-232 also, but I
don't have access to one.
1 DEFINT A-Z
10 OPEN "com2:9600,e,7,1" AS #1
11 FIELD 1,1 AS X$
20 OPEN "romdata" FOR OUTPUT AS #2
30 PRINT #1,"add 0"
31 GET#1,1
32 IF X$<>"$" GOTO 31
40 FOR OFFSET=0 TO 32767
50 PRINT #1,"me"
80 GET #1,1
81 IF X$<>"$" GOTO 80
100 GET#1,1
110 GOSUB 500:MSB=BINVAL
111 GET#1,1
112 GOSUB 500:LSB=BINVAL
120 Y$=CHR$(LSB+16*MSB)
130 PRINT#2,Y$;
135 PRINT OFFSET;" ";
140 NEXT OFFSET
150 CLOSE#1:CLOSE#2
160 END
400 RETURN
500 RAWVAL=ASC(X$)
510 IF RAWVAL<=57 GOTO 550
520 RAWVAL=RAWVAL-7
550 BINVAL=RAWVAL-48
560 RETURN