home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / C128CPM / CPM-PRIMER-3 < prev    next >
Encoding:
Text File  |  2019-04-13  |  14.4 KB  |  286 lines

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