home *** CD-ROM | disk | FTP | other *** search
/ World of Ham Radio 1997 / WOHR97_AmSoft_(1997-02-01).iso / mods / aea / pkdump.doc < prev   
Text File  |  1997-02-01  |  2KB  |  71 lines

  1. DUMPING THE PK87 MEMORY
  2.  
  3.     The AEA PK87 TNC has the capability to read and/or write any
  4. location in memory via two undocumented commands which are
  5. vaguely hinted at in the 12/86 version of the user's manual.
  6. These commands are ADDRESS, which reads/writes a mmemory pointer,
  7. and MEMORY, which reads/writes the memory byte pointed to by
  8. ADDRESS and also increments ADDRESS by one byte.
  9.     These commands make it possible to create a binary image
  10. file of any memory area (such as the onboard ROM) by setting
  11. ADDRESS to the start of the area and reading MEMORY as many times
  12. as necessary. The following MS-DOS BASIC program is written to
  13. make an image of the ROM, but will dump any area desired with
  14. suitable alterations. Unfortunately, it's very slow, since it has
  15. to exchange a dozen or so bytes with the TNC at 9600 baud, and
  16. then do an ASCII-hex-to-binary conversion, to get one memory
  17. byte; it takes about two hours to dump the full 32K ROM.
  18. Rewriting it in assembler would only speed things up a little,
  19. because the ASCII dialogue takes up most of the time.
  20.     The following notes apply:
  21.  
  22. (1) ROM extends from location $0000 to $7FFF, RAM from $8000
  23. upward depending on unit modification.
  24.  
  25. (2) Modify line 10 as required to suit your serial port.
  26.  
  27. (3) Change the filespec in line 20 if you want to write a file
  28. other than "ROMDATA" in the default directory.
  29.  
  30. (4) The number in line 30 is the starting memory location; change
  31. it as desired, remembering to prefix it with &H if you enter it
  32. in hex.
  33.  
  34. (5) The final number in line 40 is the number of memory bytes to
  35. dump.
  36.  
  37. (6) Line 135 prints the current address (in decimal) to the
  38. screen so you'll know the program isn't hung. If you aren't a
  39. clockwatcher, you can delete it.
  40.  
  41. (7) I suppose this procedure will work for the PK-232 also, but I
  42. don't have access to one.
  43.  
  44. 1 DEFINT A-Z
  45. 10 OPEN "com2:9600,e,7,1" AS #1
  46. 11 FIELD 1,1 AS X$
  47. 20 OPEN "romdata" FOR OUTPUT AS #2
  48. 30 PRINT #1,"add 0"
  49. 31 GET#1,1
  50. 32 IF X$<>"$" GOTO 31
  51. 40 FOR OFFSET=0 TO 32767
  52. 50 PRINT #1,"me"
  53. 80 GET #1,1
  54. 81 IF X$<>"$" GOTO 80
  55. 100 GET#1,1
  56. 110 GOSUB 500:MSB=BINVAL
  57. 111 GET#1,1
  58. 112 GOSUB 500:LSB=BINVAL
  59. 120 Y$=CHR$(LSB+16*MSB)
  60. 130 PRINT#2,Y$;
  61. 135 PRINT OFFSET;" ";
  62. 140 NEXT OFFSET
  63. 150 CLOSE#1:CLOSE#2
  64. 160 END
  65. 400 RETURN
  66. 500 RAWVAL=ASC(X$)
  67. 510 IF RAWVAL<=57 GOTO 550
  68. 520 RAWVAL=RAWVAL-7
  69. 550 BINVAL=RAWVAL-48
  70. 560 RETURN
  71.