_ KÅRE AANESTAD_ FOR COMMODORE 64 _KA43/61_ opens up the operating system of your Commodore 64. It gives you comprehensive internal commands and opens up for external commands. The internal commands are as you would expect, readily executable. The external commands are automatically loaded from the disk drive before they are executed. KA43/61 is a relocatable machine code (MC) utility. It will highly enhance the cooperation between your computer and any Epson (or IBM) compatible printer. The printer can either be connected to the CBM Serial port or to the User port. In the latter case the User port will act as a Standard Parallel Centronics port, and the only hard-ware required is a simple cable. Any character, even user defined characters, can be printed with high speed. Text and high resolution (Hires) graphics can be intermixed in the same document. KA43/61 goes further and is highly valuable even without a printer as it eases and extends the use of the disk drive. It does even support the supplied standard 1764/1750 RAMDOS for the Ram Expansion Unit (REU). The Function Keys are all activated. supports loading directly from the Directory which is activated with . The supplied external commands support line lenghts of 80 characters. An ordinary TV-set gives acceptable readability when the colour, contrast and light are adjusted. New external commands can easily be added at any time by the user. _ KA43/61 _ can safely be used as an utility for other programs, even other utilities. KA43 wedges itself into the other programs and should therefore, if possible, be the last one to be initiated. All KA43/61 commands can be used both in direct and program mode except after an IF THEN command. KA43/61 -2- Load and run the KA43/61 configuration program "OPEN SYS KA43/61". Choose between Serial and Centronics printer and locate the MC-utility preferably at top of Basic RAM! If you choose this location, the program will lower the necessary pointers to protect itself. If in doubt go for the default values. Turn on any printer. You can now use OPEN 4,4 and PRINT#4 or CMD 4:LIST as normal. _Character type_ for the printer (key in and press ): C0 CBM or your own definded characters printed exactly as used on the screen. The control codes you can use are CHR$(18) and CHR$(146) for _ RVS _ ON/OFF, CHR$(14) and CHR$(15) for _Expand_ ON/OFF, CHR$(21) or U for toggling _Underline_ ON/OFF, CHR$(8) for reduced linespacing (24/216") and CHR$(7) or G for Hires intermixed with your text. Gm,h,l sets the Hires parameters. C0,x As above, except printer bit map density changed to x (default 76) for both text and Hires. Consult your printer manual. Try 76+128 if you have a Serial printer set for PET ASCII and not Standard ASCII (if so also use C3 when not in C0 mode). C1 Standard printer characters, upper/lower set as on screen (default). You can use your printers control codes. C2 Standard printer characters with forced ASCII conversion. To be used when you will ensure character conversion from PET ASCII to Standard ASCII. C3 Standard printer characters, emulation mode i.e. no character conversion. The value choosen will remain intact until you alter it or switch the computer off. Secondary address of the OPEN statement for device 4 have no effect for a parallel printer and is therefore masked off due to compatibility. Listing of a program may require that you use C0. All Commodore control codes will then be printed. The printer must be in _ AUTO LINE FEED mode _. This is most convinient done by setting the appropriate dip-switches of the printer. soft-sets the AUTO LINE FEED for an IBM printer when not in C0 mode. The Character type mode and Function Keys will be disabled by warm starting the computer (e.g. hit & ). The easiest way to reinstall the printer port is to press C1 instead of making a SYS call to the start address . A C command will not reinstall the Function Keys. Line 330 of the configuration program will exchange the the bit map commands above with the Master Graphics Command if supported by the printer. This gives more bitmap options and fully supports 24-pin printers. The syntax is C0,x, where x=0, 1, 2,... If required POKE+1736,20 to reduce the line spacing. _SCREEN DUMPS_ G Graphic dump of high-resolution screen. Can also be used for Multi-color, but you loose the colors. Keep RUN/STOP pressed to stop printing. KA43/61 -3- Gm As above with left margin set to m. Default is 0. Gm,h As above, bit-map screen from location 256*h (i.e. h=high byte). Any value can be used. Most used values are 32,64,96 (default),160 and 224. Gm,h,l L gives number of graphic lines to be printed. Default is 25. This command sets the parameters and returns without printing. K Copy of text screen. You will get an exact copy as KA43/61 automatically seeks for the screen location and chr. set. Keep RUN/STOP pressed to stop printing. Km As above with left margin set to m. Default is 0. Km,1 As above with the one to denote reduced linespacing (24/216"). B0"T" Banner dump to screen of Text enclosed in quoation marks or string variable. B1"T" As above to printer. I Sets interrupt controlled screen dumps ON (does not work for Serial printers). KA43/61 automatically seeks the screen, it be text or Hires. Use _K_ for printer copy. Disable with . The command will normally not work on protected programs or programs which disable and/or . _DISK COMMANDS_ D Directory is shown on the screen without erasing any Basic program. HALT the listing with and STOP with . D"$",d Directory from disk device number d. Without this extension D defaults to d used in the Ed command shown below. D"$:L* Directory with pattern matching (any letter or combination of letters may be used for L). ? can also be used in the search. E Any disk Error status is shown, i.e. disk status channel. Ed Change the disk device numbers of KA43/61 commands. d to be a figure from 8 to 15 (variables are not allowed). E"C" Disk command, see your disk manual. Neither OPEN nor CLOSE are required. E.g. "C"="R0:BETTER=GOOD" which renames the program from "GOOD" to "BETTER". _MC-SAVE & ADD COMMANDS_ M,,"Name",,1 MC-save , d=1 for casette and d=8 for disk. Load with LOAD"Name",d,1. Remember to reset the Basic pointers after a MC load with NEW. A Additional command. is the SYS call address and must be a figure. Later SYS calls to the same address are made with A only. E.g. A49152 . A automatically seeks for an installed machine code monitor. List from the monitor to the printer with : OPEN 4,4:CMD 4:A _EXTERNAL COMMANDS_ X"NAME" External command which will load a MC program and jump to the first address loaded. The command will substitute LOAD"NAME",8,1 KA43/61 -4- and the SYS number, with no Basic pointers altered. Thus the command will have the same effect as if the MC program is already in memory. To recall an already loaded and executed command press X. Parameters kan be passed. Eg. X"AUTO",10,10 , or X,10,10 . KA43/61 will protect itself from being overwritten by an External Command with an OUT OF MEMORY error and it will deny to load a Basic program starting at normal 2049. The name of the command must begin with double quotation marks, therefore if a variable is to be used it must be written as follows: X""+N$ , where N$ is the command name. _ The best location of KA43/61 OPEN SYSTEM is usually at top of Basic RAM. A draw-back is that this may unnecessary reduce the space available for Basic programs. The lenght of KA43/61 is 2935 bytes. You may alternatively locate KA43/61 in MC-RAM somewhere from 49152 to 53248. If location 49152 is interfering with other programs, you can choose 50313 (=53248-2935). By locating KA43/61 at top of Basic RAM, the program will protect itself by lowering the pointers of Basic RAM top (=PEEK(55)+256*PEEK(56)). Start address ( ) will then be equal to this new RAM top (normally 38025). You may save the MC part by help of M if you want. SYS to start up the program when it is loaded (and the computer is reset by NEW ). If you at the same time want the program to protect itself from Basic i.e. lower the Basic top then SYS+7. Do not use SYS+7 more than once. KA43/61 will work with most programs without difficulty, but some programs may use all available RAM and then wipe it out. Let's look at some programs: KA19/2E BASIC :Locate KA43/61 at top of Basic RAM. D-BASE KA9 :Locate KA43/61 at top of Basic RAM. SPEEDSCRIPT 3.x :Locate KA43/61 at 50300. Load SpeedScript. POKE 2481,195. RUN SpeedScript. If used with INSTANT-80 then instead locate KA43/61 at 49152 and POKE 9474,191:POKE 9631,PEEK(806):POKE 9632,PEEK(807). Turn off the Function keys of KA43/61 ( to ) with POKE+2648,197 (ON again with 203). DOS WEDGE :by Commodore does not like the . To change this to ' (=SHIFT 7) POKE+104,39. All KA43/61 command is then to be preceeded by ' , e.g.'G. SIMONS BASIC :Insert the cartridge. Locate KA43/61 at top of Basic RAM. KA43/61 -5- BC-BASIC :Reserve an area of 2935 bytes on top of Basic RAM with a BC-BASIC command (which resembles a POKE to adr. 56/55). Load KA43/61. POKE+66,76. RUN KA43/61 and locate the start to the lower byte of the reserved RAM. Never use SYS+7 with the POKE above. Fast Assembler :The best assembler around. Written by Yves Han. Locate KA43/61 anywhere (preferably at top of Basic RAM). MC-programs :Load and run KA43/61 when still in the Basic environment. Alternatively KA43/61 may be started from another MC-program after the modification mentioned for BC-BASIC is performed. Turbo Cartridges :KA43/61 is tested with Final Cartridge II. The cartridge has a bug in the SAVE command. SAVE preceeded with E"I" works fine. To use the C command you have to "KILL" the cartridge. Action Replay MK V does not work with KA43/61. _SOME POKE AND PEEK'_s to customerise KA43/61 to your needs: POKE+2934,234 to enable T to jump to a MC-prg following immediately after KA43/61. POKE+1776,x x is number of lines K will dump to the printer (25 by default). POKE+2217,x Where x is ASCII value of printing character used by B (64 by default). POKE+904,x x is Control code used for underline (21 by default). POKE+908,128 for overline instead of underline. POKE+1736,x Value of reduced linespacing is x/216" (24 by default). Disable this facility with POKE+1705,96. POKE+2648,197 turns off the Functions keys for a MC-prg if required. The keys are automatically turned off in Basic program mode and will normally only be activated by KA43/61 if not used by other utilities. turns the Function keys and the printer port off. SYS to reactivate. A C command activates the printer port only. POKE+506,44 to allow for C0 mode when in Hires. Character set is updated only with C0. C0 to be used after CHR$(7) or G in Hires to prevent KA43/61 to loose track of the character set. (You may be better off not using this.) POKE+2026,2 K instead of K for Interrupt kopi to printer. POKE+2033,36 and the printing starts with only a touch on the (or ) key. KA43/61 -6- POKE+1711,234 Five bytes at your choice, from +1729 to +1733 will be sent to the printer before the G, K and B1 commands and when using CHR$(8) and CHR$(7) in C0 mode (i.e. commands reducing the line spacing). PEEK(776)+256*PEEK(777)-100 gives the start address of KA43/61. _The User port_ at the left rear side of the CBM64 can be hooked to a Centronics printer with a standard parallel cable. The same cable can also be used for Easy-Script, VizaWrite , Final cartridge etc.. The cable can be wired as follows: CBM User Port: A B C D E F H J K L M N Centr. DB-36 : 27 10 2 3 4 5 6 7 8 9 1 19 Alternatively pin 11 instead of pin 10 may be used on the printer. If so pin 11 must be _on_ when . Some odd printers allow for optionally strange settings. This is the usual way to make up the cable and what a dealer normally will sell you. It matches line 260 of the accompaning configuration program with DE=127. However, the printing speed and performance can be much improved with a smoothing filter. At the User Port end of the cable insert an 50 to 100 ohm resistor between pin B and the wire connecting pin 10 (or 11) of the printer. Connect a 50 to 100 pF capacitor between pin B (nearest to the computer) and pin A. Now DE of line 260 can be reduced to 2 to increase the speed, and any printer problems (especially when using long printer cables) belong to the past. But keep to the following precautions. The printer cable should always be connected/disconnected at the computer end when it is not connected to the printer. The power cord of the printer should be disconnected when connecting the cable from the computer. This precaution will save wear on the output IC (U2, type 6526) of the User port. Another little modification can be made on a TV cable with a SCART plug. Pin 4 on the Audio/Video contact from CBM64 is normally used as it incorporates the colours. Allow for a switch on the cable so that you also can choose Pin 1, getting the much more crisp mono display when needed. _The configuration program_ consists of a Basic program and an MC part. The Basic program can be altered to your preferences and resaved. New lines with your own POKEs can be inserted between line 330 and 340. No string variable must be used in the new lines. WL equals ADR given above. The REMs in line 230 and 330 can be deleted. The DATA in line 240 and 250 is set aside for 14 characters with special translation codes from PET ASCII to standard ASCII. This takes effect in C2 mode and in C1 mode when CBM64 uses upper/lower chr. set. 1st byte translates to 2nd byte, 3rd to 4th etc.. The default (no need to remove the REM of line 230) gives translation from the Box drawing characters on your keyboard to the equivalent IBM characters in "Character Set 2". If all DATA is set to zero, European national char. sets are handled correctly (and not the weird way of American ASCII). When run, KA43/61 moves the 2935 bytes to the desired location and updates the absolute addresses. The Basic area is cleared and the program is initiated. Adresses 251-254 may temporarily be used. Feel free to use these 4 locations in your own programs, but don't expect them to be unaltered when you access KA43/61 -7- your routines later. However, the printing routines of KA43/61 are totally transparent (i.e. using none of these nor other RAM addresses). No other addresses in low RAM is used, except for some pointers which is routed via KA43/61. Location $D000 to $D800 under the character ROM is used for printing graphics or graphic representation of the characters. With line lenghts not exceeding 120 characters, only the first 1K bytes are used. _ KA43/61 OPEN SYSTEM _ introduces a new concept for your CBM 64. You can now let the computer grow as you expand your library of external commands. Examples of external commands are: X"DELETE",100-300 "RENUMBER",100,10,500-999 (Renumber the old lines from 500 to 999 inclusive) X"OLD" X"VIEW-FILE","Name",80 (Reveals the hidden 80 character wide screen) KA43/61 is the leading utility for CBM64. Sorry still some programs do not work with this de facto standard. This can't be helped due to the disgusting low-level programming technics used by some program writers. _ OPEN SYSTEM KA43/61_ is written by Kåre Aanestad(c) for COMMODORE 64. OSLO 20-Sep-92