PROCESSOR CONTROL
RESET SYS 64738 RESTORE SYS 64759 CLOSE ALL SYS 65511UN-NEW to recover the program that was in memory before a NEW command blanked it out. Do the following commands all in one batch, about one and a half screen lines. Do not put a RETURN in the middle, do that at the end, after the CLR.
POKE 2050,1: SYS 42291: POKE 45,PEEK(34): POKE 46,PEEK(35): CLRSCREEN CONTROL
SCREEN EDITING AND LISTING
LIST to print the loaded program on the screen, and control what parts
are listed by including the line numbers:
LIST from#-to# or LIST from#- or LIST -to#
Edit the line number of a line that you want to duplicate or edit the line number and the line if you want a similar line.
If you delete a line from a program {type line# [RETURN]}, and want it back, you can recover it if it is still on the screen. Just put the cursor on the line and hit [RETURN].
To print the listing of a loaded program or disk directory:
OPEN 4,4: CMD 4: LIST now the program listing prints. When it finishes, do PRINT#4: CLOSE 4When you use OPEN commands directly from the keyboard, you may want to do a CLOSE n#: OPEN n#, d# because you get an error if you OPEN a channel that is already opened. You should also always CLOSE a channel after you use it.
DISK DRIVE CONTROL DIRECT BASIC COMMANDS LOAD"program name",8 for BASIC programs LOAD"program name",8,1 for machine language, pictures LOAD"prog name",8:[RUN] to load and run at once LOAD"*",8 first program, or same one LOAD"name*",8 use part of the name LOAD"ver?name*",8 ? for unknown single character LOAD"$",8 load the Directory LOAD"$name*",8 load dir names that match SAVE"newname",8 put it back on the diskThe verify command checks that the disk and the memory are the same. If not, you get an error. The main uses are:
VERIFY"name",8 checks the file you name VERIFY"*",8 checks the last used disk fileOTHER COMMON DISK COMMANDS
Only the most common disk commands are listed here.
NEW format a disk "N0:name,id" clear directory "N0:name" [no id] RENAME change file name "R0:newname=oldname SCRATCH delete a file "S0:name" COPY copy on disk "C0:new=original" COMBINE copy files into one "C0:new=old1,old2 VALIDATE cleanup directory "V" or "V0"
DISK DRIVE ERROR READOUT
To find out why the drive is flashing that light, you must read the
error channel with the wedge, or with this short program which must be
an entered and run program, it can't be a direct command. Use any
line number that is not the same as a program line that is already in
memory. Line number zero is a good one to try, do a LIST 0, if nothing
lists, there is no line zero and you can use it. This example uses
line zero.
0 OPEN15,8,15: INPUT#15,A,B$,C,D: PRINT A;B$;C;D: CLOSE 15: ENDThis is all one program line, on two lines of the screen.
GET A SEQUENTIAL FILE FROM DISK
TYPE FILE TO SCREEN
This one line program will type a sequential disk file on the
screen. It must be done as a program, not as a direct command.
Line zero, as shown, is a good line number to use.
0 OPEN 8,8,8,"filename": FOR I=0 TO 1: GET#8,A$: I=ST: PRINT A$;: NEXT: CLOSE 8: ENDYou may need to omit the extra spaces.
PRINT FILE ON PRINTER
This short program is a quick way to printout a sequential
file from the disk.
100 OPEN 1,4,7: REM OPEN PRINTER 110 OPEN 2,8,2,"filename": REM OPEN DISK FILE 120 GET#2,A$: IF ST=64 THEN 140: REM READ IN 130 PRINT#1,A$;: GOTO 120: REM PRINT OUT 140 CLOSE 1: CLOSE 2: REM FINISHED
PRINTER OR INTERFACE SETUP
Printing anything requires an opened channel to the printer, which may be through an interface. If you have an interface, you must send it the commands it requires. To print a heading on a page before running a program that will printout the page you can use these direct commands:
OPEN 4,4 PRINT#4,"THIS IS THE HEADING I WANT ON THE PAGE" CLOSE 4The most basic control of the printer is by the OPEN command which sets the character selection that will be printed.
OPEN 4,4,0 or OPEN 4,4gives upper case text and all graphic symbols (UC/Graphic) which is called 'cursor up' mode.
OPEN 4,4,7gives upper and lower case text and some graphics (UC/LC) which is called 'cursor down' mode. Then you could do this:
USING PRINTER CONTROL CODES
The next way to control the printer or interface is with control
codes sent to it as shown:
OPEN 4,4: PRINT#4, CHR$(code1) ;CHR$(code2): CLOSE 4If only one code is needed, drop the extra ;CHR$(code2) but many printers use 'escape codes' or 'escape sequences' in which the code1 number is 27 and then the next number is put in as code2 to give the particular command. You may also need to add other codes like this:
;CHR$(code3)Control codes do not have letters or symbols that should be printed, they are just to control the printer. The escape code tells the printer not to print what is comming next, to use it for control instead, so normal letters and numbers may be used for control after the escape code (27.).
CHR$(code) PRINTER ACTION 0 Null, do nothing 7 Bell or beep 8 Back space, if it can 9 Tab to a stop, if it has them 10 Line Feed, or New Line with return 11 Vertical Tab, not many do this 12 Form Feed to the next page 13 Carriage Return, same or next line 27 Escape from printing, do control Other codes that can be used in the command line OPEN 4,4: PRINT#4, CHR$(code1) ;CHR$(code2): CLOSE 4are common to Commodore 1515 or 1525 printers or printers that emulate Commodore printers. Some of these can be used to set the printing features before another program does the printing. Check your interface or printer manual to see if there is a control code that will LOCK in the setup that you do to keep the later program from changing it.
(code) ACTION 17 set UC/LC cursor down text mode 145 set UC/Graphic cursor up mode 18 set reverse video printing (light-for-dark) 146 set reverse off, to normal 15 set 10 CPI normal size print 29 set 17 CPI condensed size print 14 set double width print, use after 15 or 29 15&14 5 CPI double normal 29&14 8.5 CPI double condensed 27&65 skip page perforations 27&66 turn off perforation skipThe double codes (like 15&14) are code1 and code2 for the print statement CHR$()'s and the & is not used. These codes work on the OKIMATE 10 which is emulating a 1525. Here is an example of a control code that uses a string of numbers to complete the control information:
OPEN 4,4:PRINT#4,CHR$(16);"03";"THIS IS PRINTED":CLOSE 4this will indent the printed line by three spaces, called for by the 03. The CHR$(16) can be printed in the middle of a line of text and then the next two digits will give that number of spaces in the printed line.
W. L. Mays