home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / C128 / CPMPRMR3.TXT < prev    next >
Text File  |  2000-06-30  |  15KB  |  284 lines

  1. *********************************************************************
  2. This article is being presented through the *StarBoard* Journal of the
  3. FlagShip/StarShip, SIGS (Special Interest Groups) on the Delphi and
  4. GEnie telecommunications networks.  Permission is hereby granted to
  5. non-profit organizations only to reprint this article or pass it along
  6. electronically as long as proper credit is given to both the author and
  7. the *StarBoard* Journal.
  8. *********************************************************************
  9.  
  10.                                   -
  11.                             CP/M Primer #3
  12.                                   -
  13.              By: Mike Mantino   (GEnie MAIL address: MIKEM)
  14.                                   -
  15.  
  16. Welcome back!  If you're still with us after reading the first two CP/M
  17. Primer articles, you've probably concluded that although the CP/M
  18. environment is a lot different from the Commodore operating system (and
  19. a bit slower on our 128's than in most CP/M machines), it is nonetheless
  20. an interesting and powerful world.  This month we will add to that power
  21. and discuss ways to speed up the system and generally make life easier
  22. for you thru the use of key configurations and batch processing of
  23. commands in a variety of ways.
  24.  
  25.                                   -
  26.  
  27. Let's get organized, first.  Because the C-128 does not automatically
  28. boot-up in CP/M mode, we have to do it manually by loading-in the CP/M
  29. system files.  Once that is done, there really isn't any need to have
  30. those files on our disk, so it makes sense to create just one CP/M BOOT
  31. disk (plus a backup).  That disk should also include some important
  32. files and programs that will aid in setting up your initial parameters
  33. and getting things set correctly for the rest of your CP/M session.  The
  34. files I use quite often upon boot-up are: CONF.COM, NFORMAT.COM,
  35. SUBMIT.COM, DIR.COM, DATE.COM, SHOW.COM, C1571.COM, NSWEEP.COM,
  36. NULU15.COM, INITDIR.COM, TYPE.COM, and KEYFIG.COM.
  37.  
  38. CONF.COM is very important to us C-128 folks, because we need to adjust
  39. a few parameters every time we boot-up CP/M.  For instance, by turning
  40. off the 40-column display, we can gain a speed increase of about 10%.
  41. This is accomplished, simply enough, by typing: conf 40col=off.
  42.  
  43. We can change a wide variety of things using CONF.COM which will enhance
  44. the way we do things.  All of the parameters that follow require that
  45. you precede them with: conf.  You can, however, string a number of them
  46. together in one command line which starts with: conf.
  47.  
  48. 40col=off  - As stated, this turns off the 40-column display.  To turn
  49. it back on, you would use: 40col=on.
  50.  
  51. feel=0     - This parameter adjusts the way the keyboard 'feels'.  The
  52. keyboard is scanned with the same interrupts used in handling the serial
  53. port, so as the BAUD rate is increased, the number of keyscans per
  54. second is increased.  Because of this, we use FEEL to set the number of
  55. interrupts that are *not* used between each one that *is*.  The default
  56. values for the different baud rates are set to keep about 300 keyscans
  57. per second.  For instance, at 300 baud, the FEEL is defaulted to 2.
  58.  
  59. baud=75    - The modem port baud rate adjustment can be changed to any
  60. of these values:  50,75,110,134,150,300,600,1200.  I have found that 75
  61. seems to be both a fast and reliable speed.  Remember that changing this
  62. also changes the FEEL.
  63.  
  64. back=6     - Change the background color by supplying the appropriate
  65. color number.
  66.  
  67. bord=6     - Same as above, but for the border color.
  68.  
  69. char=9     - Same as above, but for the character color.
  70.  
  71. cursor=fast 7   - For the 80-col display cursor.  This example sets up
  72. the cursor to be a flashing (fast or slow) underline.  You may set it up
  73. as "solid" instead of fast or slow, and also include the optional start
  74. and end scan line parameters.  Examples:  cursor=solid 0 4 or
  75. cursor=slow 4.
  76.  
  77. date=      - This parameter was reviewed in CP/M Primer #2.
  78.  
  79. dump xxxx  - Allows you to dump 16 bytes of memory starting from the HEX
  80. address supplied (xxxx).  This is RAM BANK 0, *not* the TPA memory.
  81.  
  82. map        - This will show both of the character sets.
  83.  
  84. parity=<number><parity><stops>   - The options in which the serial data
  85. can be sent or received, normally defaulted to 8 bits/no parity/1 stop
  86. bit (8N1).
  87.  
  88. poke xxxx - This powerful command allows you to change bytes within the
  89. operating system (again, BANK 0, *not* the TPA).  The range you can
  90. change is 1000 to FEFF.  (Below 1000h is ROM) Example: poke 4000=21 22
  91. 23 24 25  (will write 21 to 4000, 22 to 4001, etc).
  92.  
  93. prt1=cbm  - Specifies either CBM or ASCII sent to the printer on the
  94. serial port.  A secondary address may be added to allow different
  95. printer and interface configurations.  Note: If your printer/interface
  96. allows a transparent mode and you find you are unable to print a dbl
  97. quote mark ("), use: prt1=ascii x  (where x is the secondary address,
  98. usually 4, 5, or 7).
  99.  
  100. repeat=0  - If a 0 is specified here, then your keys will not repeat.
  101. Otherwise the lower the number, the faster the repeat.
  102.  
  103. vol=0     - You can set the volume of the keyclicks with this parameter.
  104. If a 0, you will turn them off.  15 will set the highest volume, and the
  105. default is a 6.
  106.  
  107.  
  108. Okay, so that's the run-down on our CONF.COM options.  Now we will make
  109. it easy to use.  As previously stated, we can string a number of these
  110. parameters together on the same command line.  Every time I boot-up CP/M
  111. I send the following CONF commands:
  112.  
  113. conf 40col=off,cursor=solid 6,back=6,char=9,vol=0,repeat=1,feel=1.
  114.  
  115. Easy enough, but still not the best way to do things, since you need to
  116. type this in at each system reset.  We will see in a few minutes that we
  117. can make that command line be executed automatically upon booting the
  118. CP/M system.  Before going into how that is done, let's discuss one more
  119. of the modular utilities we have at our disposal so that we can include
  120. both of them into the automatic process (batch processing).
  121.  
  122.                                    -
  123.  
  124. The little utility called c1571.com is used specifically to turn off
  125. disk verify's on any or all of your drives, thus gaining additional
  126. speed.  The format for the utility is: c1571 [drive letter, drive
  127. letter, drive letter, etc].  So, if you had two 1571's (drives A and B)
  128. and a 17xx RAM expansion module, plus the virtual drive E, your format
  129. might look like:  c1571 [a,b,e,m].
  130.  
  131.                                    -
  132.  
  133. Now that we know how to set up our system to allow it to run more
  134. efficiently, and we have an idea of what parameters we want to
  135. customize, let's store those things in such a way that they are brought
  136. up automatically and directly after the CP/M system is loaded in.
  137.  
  138. The reason we can do this is because every time we load CP/M into the
  139. 128, it looks for a special file called PROFILE.SUB.  If it is present,
  140. CP/M+ will then look for and run a file called SUBMIT.COM which in turn
  141. will go to the PROFILE.SUB file and execute all the commands you have
  142. put into it.
  143.  
  144. Given that we now have SUBMIT.COM on our disk, and know what commands we
  145. need to put into the PROFILE.SUB file, let's do it.
  146.  
  147. All it takes to create any .SUB file (in this case, PROFILE.SUB) is an
  148. editor or word processor of some sort.  Both ED.COM and WordStar work
  149. well, and PIP can also be used (but not if you want to do any editing).
  150. Here is an example of what a PROFILE.SUB file should look like:
  151.  
  152. ^z
  153. c1571 [a,b,e,m]
  154. conf 40col=off,cursor=solid 6,back=6,char=9,vol=15,repeat=1,feel=1
  155. a1: mex
  156.  
  157. Note that each command is given a separate line in the .SUB file.  The
  158. above PROFILE.SUB file will turn off the disk verify on drives a, b, e,
  159. and m.  It will then run CONF.COM and set up our parameters and colors,
  160. and after that, will load MEX.COM from drive A, user area 1 (A1:).
  161.  
  162. After we create this file using an editor and save it to disk giving it
  163. the filename PROFILE.SUB, it will be executed immediately after CP/M is
  164. booted up.  SUBMIT.COM can also be used to run any other file that has
  165. the .SUB extension, but you will need to manually do this using the
  166. format:  submit <filename>.  For instance, if we had named that
  167. PROFILE.SUB file FAST.SUB, it would not be executed initially with the
  168. CP/M system.  But we could still execute all of our commands contained
  169. in the file by manually typing:  submit fast.
  170.  
  171. SUBMIT.COM is a very powerful tool with a numerous amount of varied
  172. uses.  Just about anything we manually type in at the keyboard can be
  173. included in a .SUB file and executed using SUBMIT.COM.  We can even
  174. include other SUBMIT commands inside other .SUB files, linking these
  175. together to do a number of tasks for us, like copying files from drive
  176. to drive using PIP inside the .SUB file.  The number of options and
  177. ideas available for SUBMIT.COM is endless, but this article is geared
  178. toward familiarizing one with the CP/M environment in general.  If you
  179. plan on doing much with CP/M, learning how SUBMIT.COM works will greatly
  180. enhance your systems efficiency and save you bunches of time.
  181.  
  182.                                  -
  183.  
  184. The first thing I had done when I acquired my C-128 was to learn how to
  185. use the KEYFIG.COM utility.  I wasn't very impressed with the purple
  186. character color that came up with the system; changing it manually was
  187. getting old, quickly; and I had no idea what a PROFILE.SUB was.  I was
  188. also used to having programmable function keys, true Commodorian that I
  189. am.  KEYFIG.COM allowed me to do both, easily.  It also implants these
  190. things directly on the disk(s), and you never have to use the resident
  191. keyboard editor and function editor again.
  192.  
  193. Since I happen to like blue characters on a black background, I'll
  194. explain the method of doing just that.  Afterwards, we'll redefine the
  195. British Pound key so that we can make better use of it.
  196.  
  197. First, boot-up KEYFIG.COM and find yourself another CP/M disk that you'd
  198. like to put a few changes into.  Initially, you will be asked if you
  199. want any HELP, and since it's hard to turn down the first time you use a
  200. program, go ahead and answer 'Sure!'.  (Actually, you must answer with a
  201. Y for YES.  Boring, isn't it?).
  202.  
  203. After scrolling up and down the HELP options with the cursor keys (the
  204. ones at the top of the keyboard, *not* the two keys next to SHIFT), hit
  205. <RETURN> and you will be given the appropriate HELP file.  When you've
  206. had enough, choose '--> done help <--' and we will start messing things
  207. up.
  208.  
  209. Now, you will be given three options to choose from as far as sources of
  210. the key definitions.  We can take them from the DEFAULT definitions, the
  211. definitions on our CP/M disk, or the CURRENT definitions.  Since we are
  212. going to be saving the set-up to the disk, we may as well take them from
  213. the disk in the first place.  After choosing the CP/M disk option, you
  214. will be shown three more options: EDIT KEYS, ASSIGN COLORS, and
  215. EXIT/SAVE WORK.  We'll do the colors first, so choose that.
  216.  
  217. The next options are for 40-Column or 80-Column screens.  Choose the
  218. appropriate one, and you will be shown two nifty pallettes of colors.
  219. Looks nice, huh?  But what the heck does LOGICAL and PHYSICAL have to do
  220. with colors?  Well, the LOGICAL colors are the key-defined colors.  In
  221. other words, that little purple box in the LOGICAL color map (letter e)
  222. is the one we want to change to blue.  So, since the program is now
  223. asking you for a letter found in the LOGICAL map, tell it you want 'e'.
  224. Then it's going to ask for a letter corresponding to a color in the
  225. PHYSICAL color map.  The blue box is the one we want, and it's labeled
  226. with the letter 'o', so respond with that.
  227.  
  228. Now we can go ahead and make the color change semi-permanent and save it
  229. to disk.  Choose the option:  done logical<-->physical colors.  Now
  230. choose to: Exit and save your work file on CP/M disk.  The colors are
  231. now imbedded, and the program will ask if there is anything else you
  232. want to fool around with.  Tell it 'Y' again, and we can set up that
  233. British Pound key that we hardly ever use.
  234.  
  235. We are now back at the initial three options, but this time we want to
  236. EDIT KEYS.  Choosing that will give us a list of values for some key on
  237. our keyboard.  The NORMAL value is the unshifted value of the key that
  238. is labeled.  The others are SHIFTED, CONTROL, and CAPS LOCK.  Now, since
  239. we want to change the British Pound key, go ahead and press it.  You
  240. should see all the values change.  Starting to make sense?  You can
  241. scroll up or down these values in order to set it up for a change in
  242. that appropriate value.  Since we want to be able to just press the
  243. British pound key (one keystroke) and get something other than that
  244. symbol, cursor around until the lightbar is resting on the NORMAL value.
  245. Now hit the <RETURN> key.  The next options are fairly clear, so select
  246. the option to ASSIGN A STRING.  You can now type in anything you want
  247. the British Pound key to display instead of the symbol.  I have it
  248. changed so that it displays:  dir [user=all,drive=all]   That way,
  249. whenever I'm at a CP/M command prompt, I can hit just the British Pound
  250. key and get a directory of all files on all drives in all user areas of
  251. each disk.  You can redefine the SHIFTED value of the same key so that
  252. it displays something entirely different.  The same for the CONTROL
  253. value and CAPS LOCK value.  Then whenever you hit SHIFT and the British
  254. Pound key, the string that you changed is displayed, and so on.
  255.  
  256. Once you have finished defining keys, select the 'exit string edit'
  257. option and save the string to disk.  Every time you boot up that
  258. particular disk, all of your redefined colors and keys will be
  259. instituted without any more input from you.
  260.  
  261. KEYFIG.COM helps in other ways that I won't cover here, so do read
  262. through the HELP files for information on the other options available.
  263. One interesting aspect of KEYFIG is its ability to actually describe
  264. what it can't display.  To refer to the left arrow key which is there in
  265. the upper left corner of the keyboard, KEYFIG describes it as the LEFT
  266. ARROW NEXT TO 1.  To describe the DELETE key, which has no displayable
  267. ASCII code, KEYFIG refers to it as RUBOUT.
  268.  
  269. Lastly, remember that the CAPS LOCK key is not operative under CP/M, so
  270. you must substitute the combination of C= and SHIFT keys for it.
  271.  
  272. If there is anything contained in this article or previous CP/M Primer
  273. articles that you still do not understand or that I haven't made clear
  274. enough, or if you have a question about some other area of CP/M-land,
  275. stop by GEnie's Commodore *FlagShip* Roundtable at page 625, or the CP/M
  276. Roundtable at page 685 and let us know.  There are a good number of
  277. people in both places that are more than willing to help!
  278.  
  279. - Mike Mantino
  280.   (GEnie Address: MIKEM)
  281.  
  282. For our DELPHI CP/M users, be sure to check with GARYWAYNE, the CP/M
  283. SYSOP for the DELPHI *FlagShip*.
  284.