home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / spectrum / plus3hnt.txt < prev    next >
Encoding:
Text File  |  1994-06-08  |  10.0 KB  |  229 lines

  1. Hints for CP/M users on the Spectrum +3
  2. ---------------------------------------
  3.  
  4. (This file is in rather a random order - please forgive the weirdness.)
  5.  
  6. There's a lot of PD out there for CP/M (especially on oak.oakland.edu :) ),
  7. but there are a few initial stumbling blocks to getting at it.
  8.  
  9. First, you need an internet connection, and some other 'big' host computer
  10. with a serial port. I'll let you sort these two out. You'll also need a serial
  11. lead. These are not fun to make. If you want to try, have a look at page 318
  12. of the +3 manual. If you don't, there is at least one company that still
  13. supply +3 serial leads at the time of writing. They are (or rather, he is) B.
  14. G. Services, phone 081 397 0763 and ask about a Spectrum 128k serial lead. Or 
  15. you can email briang@bgserv.demon.co.uk and ask for a price list. (BTW, no
  16. connection with BGS other than as a satisfied customer.) Price as of May 94
  17. was 6.50 pounds. NB: this serial lead won't do on its' own. It's intended for
  18. connecting to a modem or printer, so you'll need an *additional* null modem
  19. lead, such as you might use for connecting two PCs. A normal 25-25 should do
  20. the job.
  21.  
  22. To help test the serial lead, PIP will probably come in useful. You can do 
  23. 'pip con:=aux:' to receive show input from the serial port, and 'pip 
  24. aux:=con:' to output whatever you type to the port. You'll need ^Z's to end 
  25. the PIP command though.
  26.  
  27. So now you have your working serial lead, you have the unenviable task of 
  28. getting the first program across which 'bootstraps' you into the wonderful 
  29. world of CP/M PD. :) This is a nontrivial task. The method I used was a little 
  30. obscure and involved writing a program which could send data in speccy tape 
  31. format (we're talking LOAD "" here) and using a disk editor to do a couple of 
  32. LDIRs, compensating for the +3DOS header.
  33.  
  34. How you'd do it I'm not sure. If you can get hold of a program which converts
  35. a .COM file into .HEX format, then you can use PIP to copy that first program
  36. with something like 'pip wibble.hex=aux:' and then doing 'hexcom wibble'. This
  37. should create the wibble.com file, and you should be ok from then on.
  38.  
  39. The first program
  40. -----------------
  41.  
  42. This 1st program will obviously be something capable of file transfer, to make
  43. it easier to transfer other stuff. I recommend QTERM, mainly because it's the
  44. only comms program I've managed to get working. :) Actually it looks like the
  45. best one available - it does kermit, xmodem and ymodem, and functions as a
  46. pretty useful terminal. If you ever wanted to play Nethack remotely, now's
  47. your chance.
  48.  
  49. You should be able to find a copy of QTERM called qtplus3.com (and a .HEX file
  50. of it called qtplus3.hex) in the same place you found this.
  51.  
  52. The good stuff
  53. --------------
  54.  
  55. Ok, now the boring bit is out of the way, we can get onto what programs there
  56. are. Well first of all, you'll probably be wanting an editor. (Maybe you
  57. won't, but who's writing this file anyway?)
  58.  
  59. Text editors
  60. ------------
  61.  
  62. There are two editors that look really good, for CP/M:
  63.  
  64. ZDE, which I'm using to write this file - weighs in at about 17k;
  65.  
  66. and Z80EMACS (or is it zmacs?) which weighs in at about 40-oddk, I think. I'm
  67. not sure, as I haven't tried it.
  68.  
  69. ZDE is a Wordstar-like editor. It has a really good configuration program
  70. which is certainly more flexible that most - e.g. you can set the number of
  71. columns as well as the number of lines, which is a great boon on the +3 where
  72. you only get a 51-column screen. ZDE handles a 51-column screen surprisingly
  73. well. You could use the emulated 80-column mode allowed by CP/M, but this
  74. doesn't seem to work too well with ZDE. It moves the cursor all over the place
  75. which confuses the poor speccy no end as it tries to follow the cursor. You
  76. could turn cursor following off, I suppose, but I think it's preferable to use
  77. ZDE's handling.
  78.  
  79. At any rate, it beats using Tasword Two by a mile. :)
  80.  
  81. Zmacs is a port of MicroEMACS to CP/M. This sounds really good - multiple
  82. files for one thing - but it uses a large-ish number of overlays in addition
  83. to a .COM file. Apparently it runs ok though, so you might want to check this
  84. out. This appears to only be on sipb.mit.edu, in /pub/z80/emacs I think. That
  85. site is also known as rtfm.mit.edu, and it's *very* busy as it holds all the
  86. Usenet FAQ postings. These are mirrored in many other places, but the Z80
  87. files aren't. Mumble.
  88.  
  89.  
  90. Z80 disassemblers
  91. -----------------
  92.  
  93. If you're not much of a hacker, you're probably better off skipping to the
  94. next section. :)
  95.  
  96. Although CP/M comes with SID, which is really good for patching programs and
  97. the like, it uses the awful old 8080 opcodes for its' disassembly output.
  98. There are a few different Z80 disassemblers avaiable for free which run on
  99. CP/M, but the best I've encountered is called Wade. It has a command syntax
  100. similar to SID (though not the same), and I used it to help fix up an old
  101. ls.com program which was suboptimal in a couple of ways for the +3 (more on
  102. that later).
  103.  
  104.  
  105. Keyboard problems
  106. -----------------
  107.  
  108. While I'm terribly happy that I can now touch-type on my +3 and it can keep up
  109. with me, there are a few problems I've run into, especially in writing this
  110. file. One is that the old speccy problem of the 'sticky keys' still remains -
  111. this is to do with the way many of the keys on the keyboard are in fact
  112. producing some shift + another key as far as the speccy is concerned. A big
  113. gotcha in this department is the sequence '. ' (dot then space). Several times
  114. while typing random documents I've run into this one. In fact, I just did. The
  115. only way to deal with this is to try and allow for it a bit; just give an
  116. extra bit of time between characters like ; " . and , or if your memory of
  117. which real speccy keys these match to is good enough, use them instead - in my
  118. case, at least, it seems to slow me down enough to mostly alleviate the
  119. problem.
  120.  
  121.  
  122. Using that ramdisk
  123. ------------------
  124.  
  125. You may think that the ramdisk you get under CP/M is rather lame. You're
  126. right, of course - 12k as compared to 58k under +3 basic is pretty bad, but it
  127. is possible to get useful utilities which fit (albeit rather snugly) into this
  128. precious, and fast!, 12k.
  129.  
  130. One which I've really come to appreciate is called ls.com. This is an old
  131. version of the 'SD' program as supplied in tools.lbr, patched to produce nicer
  132. output on a 51-column display, and with the free space display fixed for CP/M
  133. Plus, as used on the +3. This fits in 3k. Another useful utility is 'mft',
  134. which copies files from one disk to another on a single-drive machine. Now,
  135. although the +3 allows a logical A: and B: on a single drive much like +3
  136. basic (and MS-DOS for that matter), PIP wasn't designed with this in mind. In
  137. fact, IMAO, PIP wasn't designed with much at all in mind, but that's another
  138. matter. ;)
  139.  
  140. A third utility which can often come in handy is a text file viewer called
  141. 'peep'. This comes from the 1kutils3.lbr on oak.oakland.edu, and the big plus
  142. with using this instead of 'type' is simply that you can go backwards in the
  143. file.
  144.  
  145. In all, I have five programs on my ramdisk:
  146.  
  147.  
  148. LS      .COM   3k   MFT     .COM   3k
  149. NT      .COM   1k   PEEP    .COM   1k
  150. PIPE    .COM   1k
  151.  
  152. Drive C, user 0 contains 9K in 5 files
  153.  2K free
  154.  
  155. (The dir. listing above was produced with 'ls'.)
  156.  
  157. 'pipe' is a mini-version of pip. It seems to use a very small buffer size,
  158. though, which makes it very slow. It's no good for copying across disks, but
  159. you would be using mft for that. 'nt' is a very small program to take notes to
  160. a file. You can think of it as equivalent to 'cat >file', or (for you DOS
  161. people) 'copy con: file'. Unfortunately pipe doesn't work with devices,
  162. otherwise you could do the literal equivalent of 'copy con: file', which would
  163. be 'pipe con: file' (pipe works in the source, dest order). The normal CP/M
  164. pip does work, however. Try 'pip file=con:' for that.
  165.  
  166. Pipe and nt are both in the 1kutils3.lbr archive.
  167.  
  168.  
  169. Patching with SID
  170. -----------------
  171.  
  172. Although the Locomotive CP/M manual explains a bit of how to configure
  173. commercial software, these obviously don't need you to dig out your favourite
  174. debugging tool to patch them with the right terminal escape sequences. :)
  175.  
  176. Worse though, they don't cover how to use sid at all. (sid is similar to ddt,
  177. which you might see mention of.) Using sid to patch programs is actually
  178. fairly straightforward.
  179.  
  180. There are only three commands you really need to know - 's', which changes one
  181. or more bytes' hex values; 'd', which displays (dumps) a chunk of memory to
  182. the screen as hex and ascii; and 'w', which writes your lovingly patched file
  183. to disk.
  184.  
  185. Say you had to patch a program which was expecting a zero-terminated string
  186. which clears the screen at the address 110h. Your sid session might go
  187. something like this:
  188.  
  189. A>sid thingy.com
  190. CP/M 3 SID - Version 3.0
  191. NEXT MSZE  PC  END
  192. 4300 4300 0100 D0FF
  193. #s110
  194. 0110 06 1b
  195. 0111 10 48
  196. 0112 80 1b
  197. 0113 02 4a
  198. 0114 30 0
  199. 0115 B0 .
  200. #wthingy.com
  201. 0084h record(s) written.
  202. #^C
  203. A>
  204.  
  205. The 's110' starts entering hex bytes at 110h. The hex bytes are 1b 48 1b 4a, 
  206. which are ESC H ESC J, which is the easiest way to clear the screen on a VT52, 
  207. the terminal the speccy (approximately) emulates. The '.' indicates that no 
  208. more bytes are to be changed. You can just press enter to skip a byte without 
  209. changing it.
  210.  
  211. The 'w' command at the end saves the newly patched program to disk. It need 
  212. not have the same name as the file you loaded up when starting sid. but 
  213. usually you'll only want one (working) copy of the program to avoid confusion.
  214.  
  215. One command not used above was the 'd' command. You use this like 'daddr' 
  216. where addr is the address you want the command to start hex dumping at.
  217.  
  218. When you're finished with sid, you can just press control-c to exit (which is 
  219. of course extend mode + c on the +3).
  220.  
  221.  
  222.  
  223. Well, that's all I can think of for now, so I hope this helps someone, 
  224. somewhen, maybe.
  225.  
  226. Cheers,
  227. - Russell Marks.
  228. (rm1ajy3@gre.ac.uk from Oct. 94, probably)
  229.