@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@W!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `8  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D8:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D8:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu } 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG*}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES+}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N',}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx -}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL/}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD0}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.1}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC2}COPY--FROM, TO?OPTION NOT ALLOWED697 FREE SECTORS COPYING---D8:COPY32.COMl# 0|D .L/%#3}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY4}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E 5}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A6}LLOWED IN DESTINATION 0 <.|K}N 2 FORMAT. t* 5) 1L!`) 0NΞ 0 L1) 1 L!BAD LOAD FILELOAD FROM WHAT FILE?) 0 ?}0#B 1L!WHAT FILE TO LOCK?) 0 0$B 1L!WHAT FILE TO UNLOCK?DUP DISK-SOURCE,DEST DRIVES?TYPE "Y" IF OK TO US@}E PROGRAM AREACAUTION: A "Y" INVALIDATES MEM.SAV.FE! +L1   `*  70 2 2A} 0.* 1 y0 0)INSERT BOTH DISKS, TYPE RETURN^, 1 y038逍 N, 1L! ,B}C, t*  Lx+, 0 ^, 1 y0 , ,0,0 ,L+ ,I0 ,Vǭ0C}Ξ, 0 }, 1 y0C,ШC, 0K'!" H H 'h h Lx+!EF 5L1L!D,I,HhD}` NOT ENOUGH ROOMINSERT SOURCE DISK,TYPE RETURNINSERT DESTINATION DISK,TYPE RETURNE}`  `8 rL1`-* 1P* 1 y0Y`hhL!NAME OF FILE TO MOVE?- 0 0|DL% <.F},^ 1 70 0 .@L# .BJ 1  DEHIB V L1 ,} 1 70,L.  G}JB|,#P#DE 1 HI BDEHHII 1 B 1 ,^ 1 70,0La- B V,#PH},^ 1 70 0L#L!-* 1P* 1 y0Yj383}mm ݭI}}`8}``|* ? ɛ,`|:-)| / 1L!`DESTINATION CANT BE DOJ}S.SYS0 0H{ 24Δ 28/L!/) 2 Π 2 0 ξK}hAΞB,0 J 1 BDEHI,HÝDE 1HIHIDELSAVE-GIVE L}FILE,START,END(,INIT,RUN)O S0 1`BDEPHI V` S0H 1 L!M}0 0 1L~0`PLEASE TYPE 1 LETTER,0`hhL! 70 1L0L<1 ,;ɛ7,"ɛ:ݦ1ݥN}A"D|ݤD|ȩ:|ȩ|ɛ,,(/+.ީ1 1,ɛ`轤{NAMEO} TOO LONG B VL!` L1I H1EΝDL1|mDiE` V0`8d/8 i:222 1 LP}!ERROR- 164ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8u05  15 2 2151^116115ύ011$r2ԭ5 3)5)5ԭx GT}@@L00)+& 2 L0=ɛ -L!1LV1L1 /3 3ȹ441L-4 v3 25 2H 2h͔5U}L3L3 2 k3U hh`DOC`QL3P1Lk0S1H /3h0B k3@ VL0LU!#$53 1181118V}1111Ε5 1Lk0552 1Ȍ1i111i11115Lk0pppB4f5&&&&&&&&^6f^6&&&&&W}&&A1@BJ D2ELVK@BHILV^Щ6 2BD2EJ VBD5EHI0 V0%5X}5 2iХiL[2 25 25`D:*.*` i@`8 ``@i `8@`0 BLV525<4Y}5`HH i ԍΗ552 ԍhh@ Lح1Э1Ѣ 24.4 24Z}4`D4E` 2BJ k3LVRH` 2BD4EhK)I JLV333 BASIC language TUR > TURBO BASIC OBJ| f}COM > MACHINE language DOC > DOCumentation PIC|MIC|FNT|MVM > Graphics AMS|MUS|MBD > Music LST > BASIC g} LISTing -Some MACHINE language programs can only be run by loading the MENU without BASIC! ------- -For s h}ome programs, XL/XE models may require a "TRANSLATOR" program (available from BELLCOM) to be loaded first! -Most i}programs are relatively self-explanatory; however, some may have separate DOCumentation files. Some BASIC programs m j}ay contain instructions in their program listings. LIST to read. -To view DOCumentation files one page at a time, k} press [START], [Return], or the Joystick Trigger to display the highlighted DOC file. Pressing the [Esc] key cau l}ses a return to MENU. -To print out a hard-copy of any DOCumentation file, [Q]uit the MENU, boot DOS, and then from m} DOS, use the (C)Copy command: D:Filename.DOC,P: -To use this great MENU program on your own disks, simply n} copy the file "AUTORUN.SYS". D:Filename.DOC,P: -To use this great MENU program on your own disks, simply ! ==== ==== ==== ==== ==== ===p}=== == == == == == == == == == [R] _________________________________ q}ATARI * SYSTEM REFERENCE MANUAL _________________________________ A voluntary payment of $1.50 is requested for thisr} SHAREWARE disk. I will give any technical support I can to those who have paid this fee and include a S.A.S.E. withs} their questions. Write to the address on the title page of this Manual: Bob DuHamel, 6915 Casselberry t}Way, San Diego, CA. 92119 This double sided disk contains parts 1 and 2 of an extensive 4- part systems refeu}rence Manual for Atari 8-bit computers, consisting of 20 chapters, plus 3 appendices. The Manual is written for the Av}tari 400/800, but updates for latest XL/XE models are included. The Manual may be read from the SCREEN and/or PRINTED w}out by using the READER.OBJ program included, or it may be dumped to a PRINTER by using your own favourite Word Procex}ssor. It is recommended that the Manual be printed out, due to it's large size and the need for referral. Also, as ty}he Manual is written in 80-columns, it is much easier to read in a printed form. ADDITIONAL PRINz}TING INSTRUCTIONS _____________________ The files on this disk were written with AtariWriter, and for an Epson{} MX80 printer. You should be able to load them into another Word Processor and easily change them to work with it an|}d a different printer. If you have AtariWriter and an Epson compatible printer, load and print each CHAP/APNDX file }}(CHAP1-CHAP20 / APNDXA-APNDXC). Ignore the files with extensions (i.e. CHAP1.1) as they will auto- matically chain to t~}he previous CHAP file. Change the following codes for a different word processor or printer: [CTRL][O]27E starts }NLQ mode " [O]27F stops NLQ mode " [O]27G starts BOLD mode " [O]27H stops BOLD mode " [V]D:... chai}ns new file " [E] page eject " [L] left margin " [R] right margin " [T] top margin (hal}f " [B] bottom margin lines) " [Y] page length " " [C] center " [C][C] right justify} _________________________________ (Advertisement) **************************** * DO YOU PROGRAM IN BA}SIC? * **************************** Add over 40 powerful new commands to Atari and compatible BASICs with the Ata}ri BASIC Power Pack; a function library for Atari BASIC. Just some of it's features are: = High speed disk access d}irectly to strings. = High speed graphics saving and loading. = Custom character set loading. = Mixed text a}nd graphics in mode 8. = English error messages. = Decimal aligned number columns. = Five color, 40 column text} mode. It is written in standard Atari BASIC with some machine language in strings. It's easy to use too because} all commands are called by name, not by address or line number. For information on how to obtain this terrific utility} by Bob DuHamel, write to: |BELLCOM |Public Domain Software Library |P.O. Box 1043, Peterborough |ONTARIO, CANADA} K9J 7A5DuHamel, write to: |BELLCOM |Public Domain Software Library |P.O. Box 1043, Peterborough |ONTARIO, CANADA $d0L 2L>%L-Lx%Lo(L(L(L(L4)L2)L%L%L%L%L%LU,L`,L(L)L,L(L+L$(L".L,L(L'L'L'Lm'Lv'L,L,L'L(L'L'L.L.Lk}.L.L.L.L.L.L.L#*L.*L&L&L.&L=&LF&LQ&Lk&Lr&L{&L&L&L&L)L)L)L)L,.L)L:'L'L&LL'L['LR'L*L*L.L&L&L&La'LB(LR(L}.L(L/L9/L6/L/L/L/L/L0L0L+0LC0L/L^(Lj(L)'L@'Lo/Lr/LO/L%L'L%L% -膚 ɩҍD҅ 2 22}2 a(2222 ` -Lq -l ԤՄԅ`ȱ`ȱ`ȥ`}ԑȥՑ`ԤՄ`ԤԅդՅ` '0=D '04.5 '0.( '0 ' ' 8`ԅ`} & & & &ѐ & &ʥ %аЪ %Зьɛ &0 &0 `}ԥ`Ɠƒ` % &LS* %LS* %օ0֥0 S*` %eԥe` %La* % % o*L% %Lo* % &L|* %L|* %}L% % Ʌ` BLV䅆L' %ԅ`TU HH 'hhL, B VԩL%p v'P}KJBDEL, &fL=) %ԅ`Ę eĘ +L4( % & %` %Ԅԅ`} -``&eԅԥeՅ`L% o(ԨL%Ԅ & %eԥe` Ԅ &ɛ +0` d) ذI} ( 8ԅԩՅL%L,ȹɛ꩛` d)f & 8fԆՅɛ摥0L}?)$0`2 2L,(,ɛM(M( )ɛ )򩀅` %ԍ`ԄL%}ԄL%ɛԆL% &󅐩f =) ؐL(L4,ԅԥՅL%82ԭ 2L%ԤՄԅե`}8ե`eեe` B* K+fL% B* +fL%8ԨՄԅL% & B*ԥՄԩՅօפԥFf G+}ԥ K+ԅՅԥզЦ`ԅՅʩ0B+=+ B+ 08f$˹ `' d }+1ԦԄզՄFԐ eਊe&Lh+Ԇ`hh L, +Ff&֐ݥ ԆՅԠ&&&8થ}օԈ`քע +Ե 8`晄 ,L,`GHFH` U,0ɛȄ ؐL,HI h 8}ԅԩՅL%?S, ,򦅩DEBHIL,ɛ +` +` %HI BL,}՝HIB VL,L%B Vú.hh -l. -0dd-8/ i - 0-- ,}@ . ,... + x' $(.Ԏ.8ե ".LO-- , `,ɛD(C` ذ -L- -L 2 -- ,}L- - -L-l lp '8`ERROR- ?Run address> BASIC exitTrace:P8Յթԅ` ,.L, .-}ȘH *h00,)` & ҅ԭ ) |*օեׅ` L,0թԅթᨊઐ}```Յ`8Յթԅ`0 ԩ`ԅ`` ' %`BԝK)I JD/ELVS:)H)h y}` & % & %TԅUՅV`&B ,NLսM` & %ԝL՝MN%BL, & /` BHIL, & /`}B JKL, %ԅUՅV & %ԅT`)ҩҊ H) hҘ` %)xԩL% %))Lc&LZ& %})pԩL% %)|LZ&Lc& V0L-$2~2'@'@DDhDDL 2 $ppҠD Z$1@ H$ ?$ $ <}G@vD $K@D $5@ !$PD '$5@ !$R22D '$N@hD $Z@D $a@} !$ $D $ h9 Z$ ?$ Z$c@ H$ Z$ -$ᢐD <$2}3թ@D $L*3L}3ԩթ@D $LY3L3ԩթ@D $~33L3@wD $L3 h9}L2 h9 Z$ ?$ Z$@ H$ Z$ -$ᢐD <$ԩթ@D $L43{4L%6ԩթ@}D $L/4L%6ԩթ@D $Ls4@D $Ly4 h9L3 h9|44 Z$ ?$ Z$@ }H$ Z$ -$ᢐD <$ԩթڅ@D $L4LV5ppҠDԩթ@4z5D }$L5LV5ԩթ܅@D $LP5/@ !$PD '$LV5 h9Ly4 h9 Z$ ?$ Z$ޠ@ H$ Z$ -${55}ᢐD <$ԩթڅ@D $L5L%6ԩթ@D $L5L%6ԩթ@}5y6D $L6/@ !$RD '$L%6 h9LV5 h9 Z$ ?$ Z$A H$ Z$ -$ hD <$ԩթ @h}D $z66L6N@hD $L> h9 Z$ ?$ Z$A H$ ?$ Z$ ?$ Z$5A H$ ?$Щ r$LD '$LD !$C@} $L6L7LD6x7 !$?@ $L7L 2L6 Z$1@ H$ ?$8 %vD{D $hD~D $ Z$}{D f$ Q$ Z$y77ᢌD f$ Q$ppҠD =ԩթ@D $L8 Z$1@ }H$ ?$ Z$ ?$ Z$ ?$ Z$ ?$ Z$Q7x8A H$ ?$ Z$ `$FD '$ԩթjAD $L?8 ~; Z$FD !$ }$ᢀ K$FD !$a@ $L8 Z$y88ᢧD K$ ?$L8é r$HD '$RHD !$pA $L8 Z$ ?$ Z}$rA H$ ?$ Z$ ?$L9 Z$ ?$ Z$A H$HD !$ E$8x9A H$ ?$ Z$ T$ Z$ T$0 Z$ T$ppҠD Z$A H$ ?$Щ} r$LD '$LD !$C@ $L_9Lb9L69L 2L$5@ !$OA $$ $y99 Z$ؠA H$ ?$A !$B $$ $ Z$wD K$ ?$}ԩթjAD $L9A !$A@ $$ $ Z$B H$9x: ?$ԩթ@D $LH:}A !$A@ $$ $ Z$ B H$ ?$PD !$5@ $L:A !$B $$ $ Z$By:: H$ ?$PD !$/@ $L:A !$}B $$ $ Z$B H$ ?$RD !$5@ $L:A !$'B $$ $ Z$)B H$ ?$RD !$/@:v; $L$;A !$'B $$ $} Z$,B H$ ?$A !$'@ $$ $ Z$0B H$ ?$A !$'@ $$ $ Z$ hD K$ ?$5@ !$E@w;; $$ $`T r$JD '$}^D !$3@ $L; Z$ ?$ Z$ $L> Z$A@ !$ $ᢀ K$RD !$/@ $L> Z$)D !$ $ᢀ K$-D !$ $}ᢀ K$/D !$n>> $ᢀ K$` Z$1@ H$ ?$/@ !$^D '$8 %vDD $0 Z$ T$ R Z$1@} H$ ?$0 Z$ᢓD f$>l? Q$ppҠD Z$3D H$vD K$7D H$ ?$ Z$ ?$? %/@ !$ND '$0 Z$ }`$`D '$ Z$`D !$ $ᢀm?? K$`D !$a@ $L? Z$ᢧD K$ ?$ ~;ND $BD $LE?é r$HD }'$pA $L?L83@ !$^D '$ ~;R?b@ Z$ ?$0 Z$ T$5@ !$^D '$ Z$1@ H$ ?$ $0D >13 + command may be made to a clos}ed channel * device specific commandsICSTAThe status byte contains an error code if something goes wrong. If bit 7 i}s 0 there have been no errors.ICBAL and ICBAHBefore a channel is opened, the buffer address bytes are set point to the bl}ock of memory which contains the name of the device the channel is to be opened to. Before actual input or output these byte}s are set to point to the block of memory where the I/O data is stored or is to be stored.ICPTL and ICPTHThe put routine }pointer is set by CIO to point to the handlers' put-byte routine. When the channel is closed the pointer points to the IOCB-}closed routine. This pointer is only used by BASIC.ICBLL and ICBLHThe buffer length bytes show the number of bytes in th}e block of memory used to store the input or output data. (See ICBAL and ICBAH.) If the amount of data read during an input} operation is less than the length of the buffer, the number of bytes actually read will be put in ICBLL and ICBLH by CIO.I}CAX1 through ICAX6The auxiliary information bytes are used to give CIO or the device any special information needed.D:C}HAP1.1rough ICAX6The auxiliary information bytes are used to give CIO or the device any special information needed.D:C27GOPENNING A CIO CHANNELBefore using a CIO channel it must be assigned to an I/O device. 27HIn machine language you sta!}rt by putting the channel number in the four high bits of the 6502 X register (X = $30 for channel three). Next you place th!}e necessary codes (parameters) into IOCB 0 indexed by X. The X register will cause the numbers to be offset in memory by 16 !}times the channel number. This puts the numbers into the correct IOCB instead of IOCB 0. Below are the parameters used to o!}pen a channel.Channel-open parameters: ICCOM open code ICBAL address of device name ICBAH in memory ICAX! }1 direction code ICAX2 zeroThe direction code byte in ICAX1 takes on the following format:ICAX1 format for open! }ing a channel 7 6 5 4 3 2 1 0 ----------------- ICAX1 | W R | ---------! }-------- 8 4 2 1 W 1 = open for output (write) R 1 = open for input (read)ICAX1 may have the fo! }llowing data27GCIO direction codes HEX DEC operation $04 4 input $08 8 output $0C! } 12 input and output (cannot change the length of a disk file)27HICBAL and ICBAH point to the device !}name stored in memory. The device and file name must be followed by 0 or $9B (decimal 155).Once the parameters are set, ju!}mping (JSR) to the CIO vector(CIOV) at address $E456 (58454) will cause the channel to be opened. In the following exampl!}e a basic knowledge of assembly language is assumed.Routine to open channel 1 to the keyboard: ICHID = $0340 !} ICCOM = ICHID+2 ICAX1 = ICHID+10 ICAX2 = ICHID+11 IOCB1 = $10 channel in four high bits CI!}OV = $E456 OPEN = $03 OREAD = $04 ;open for input ERROR = (address of error handling routine) ;!} START LDX IOCB1 LDA OPEN STA ICCOM,X LDA NAME STA ICBAH,X !} LDA OREAD STA ICAX1,X LDA #0 STA ICAX2,X JSR CIOV BPL OK JMP ERROR ; N!}AME .BYTE "K:",$9B OK (program continues here)27GTo open a CIO channel in BASIC the OPEN command is used. BASIC !}OPEN command format: OPEN #channel,aux1,aux2,device:file name aux1 = direction code aux2 = special codeTo open!} channel 1 to the keyboard in BASIC Type: OPEN #1,4,0,"K:"The third parameter, aux2, is a rarely used special paramete!}r. One use is to keep the screen from erasing when changing graphics modes.The fourth parameter is the device to open the !}channel to. It may be either a string in quotes or a string variable.CIO device names C cassette recorder *!}D disk drive E screen editor K Keyboard P printer *R RS 232 I/O port S screen handler !} * Uses a non-resident handler loaded by the device at power-up.The device name must usually be followed by a colo!}n. With the disk drive a file name is expected after the device name. The screen handler is used for graphics. The screen !}editor uses both the keyboard handler and the screen handler to work between the keyboard and screen.D:CHAP1.2The screen r27GUSING AN OPEN CHANNELOnce a channel is opened to a device you have several options:INPUT:27H (ICCOM = $05)27GThe%} computer reads data from the device until a carriage-return is read (decimal number 155, hex $9B) or the end of the file (EO% }F) is reached. A carriage return is also known as an End-Of-Line or EOL. 27HThe IOCB input parameters are:IOCB input pa%!}rameters: ICCOM get record code ICBAL address of buffer to ICBAH store the data in ICBLL length of the data%"} ICALH bufferThe following routine demonstrates the input command in assembly language. Some of the equates are in th%#}e channel openning example above.Input routine: GETREC = $05 BUFF = (address to store data at) %$}BUFLEN = (number of bytes available at storage address) : LDX IOCB1 LDA GETREC STA ICCOM,X %%} LDA < BUFF STA ICBAL,X LDA > BUFF STA ICBAH,X LDA < BUFLEN STA ICBLL,X L%&}DA > BUFLEN STA ICBLH,X JSR CIOV BPL OK2 JMP ERROR : OK2 (continues if no errors)%'}If the data retrieved is shorter than the prepared buffer, the number of bytes actually read will be put into ICBLL and ICBL%(}H.27GIn BASIC, the INPUT command is used.BASIC INPUT command format: INPUT #channel,string variableor INPUT #ch%)}annel,arithmetic variableFor example: INPUT #1,IN$The above commands will cause the data from the device to be put int%*}o the specified buffer (IN$ in the BASIC example) until an EOL is reached. If the INPUT statement is used again, without clo%+}sing the channel, the computer will get more data from the device until another EOL is read or the end of the file is reached%,}. The new data will write over the old data in the input string or buffer. If an arithmetic variable is used, only numbers %-}can be input.PRINT: 27H(ICCOM = $09)In assembly language the print command is identical to the input command. The only%.} difference is that the PUTREC code ($09) is stored in ICCOM. Of course the buffer bytes of the IOCB then specify the block %/}of memory to be output from rather than input to. With the print command, EOLs within the string or buffer are ignored but a%0}n EOL is placed at the end of the data when sent to the device.27GIn BASIC, the PRINT command is used like INPUT except yo%1}u want to use a semicolon instead of a comma to separate parameters. For example: PRINT #1;OUT$or PRINT #1;"HELLO"I%2}f you use a comma, ten space characters will be sent before the string.If the print command is used again, without closing %3}the channel, the new data will be appended to the end of the data previously sent. Old data will not be written over.GET:%4} 27H(ICCOM = $07)27GIn BASIC this command inputs a single byte of data from the device. EOLs are ignored. In BASIC, GE%5}T is used like INPUT except an arithmetic variable must be used. For example: GET #1,INIf the get command is used again %6}the next byte from the device will be read. If the end of a file is reached an error will occur.There is no command in BAS%7}IC to input an entire file without stopping at each EOL. If you wish to ignore EOLs while reading a file to a string, you mu%8}st use the GET command. Each byte of data is then put into the string by the program.EXAMPLE: 10 OPEN #1,4,0,"D:TEST" 2%9}0 TRAP 60:REM GOES TO LINE 60 WHEN END OF FILE ERROR OCCURS 30 GET #1,IN 40 IN$(LEN(IN$)+1)=CHR$(IN) 50 GOTO 30 60 CLOSE %:}#127HIn assembly language, the get command can be used to get any number of bytes from the device. It works just as INPU%;}T does except EOLs are ignored.IOCB get-byte parameters: ICCOM get-character (single byte) code ICBAL \ ICBAH %<}same as in input ICBLL ICBAH /Other than the ICCOM code (GETCHR = $07) this command is identical to the input command.%=}27GPUT: 27H(ICCOM = $0B)27GIn BASIC, PUT is the opposite of GET. It outputs a single byte from a variable to the devi%>}ce. PUT is used the same as GET. For example: PUT #1,OUT27HIn assembly language, the command byte of the IOCB is load%?}ed with the put-character code (PUTCHR = $0B). Otherwise the PUT command is identical to GET.27GCLOSING A CHANNELClosin%@}g a channel frees it for use by another device or for changing parameters. 27HIn assembly language the close code is put in%A}to the command byte of the IOCB then the CIOV call is made.IOCB close command: CLOSE = $0C : LDX IOCB%B}1 LDA CLOSE STA ICCOM,X JSR CIOV27GIn BASIC, use the CLOSE command followed by the channel number. %C}CLOSE #1With the disk drive, the file name is not put into the directory until the channel is closed.27HTHE DEVICE TABLE%D}CIO uses a jump table located at $031A (794). When a CIO call is made, CIO searches the table for the one-byte device name%E}. The two bytes following the device name contain the address of the device handler's vector table. CIO searches the device%F} table from the end, $033D (829) to the beginning. This way, if a custom handler has ben substituted for a resident handler,%G} the custom handler will be found first. (custom handlers cannot be inserted directly in the place of resident handlers in t%H}he device table.)Each handler has its' own vector table. This vector table is 16 bytes long. The two-byte vectors point t%I}o the various handler routines. The vectors are stored in the vector table in the following order:Handler vector table o%J}rder open close get byte put byte get stat special JMP init code (3 bytes)The open rout%K}ine should validate the ICAX parameters and check for illegal commands.The close routine should send any remaining data in %L}the buffer to the device, mark the End-Of-File and update any directories, etc.The get byte routine should get a byte from %M}the device or the handler buffer and put it in the 6502 A register. Handlers with long timouts must monitor the break key fl%N}ag and put a $80 in the 6502 Y register if the [BREAK] key is pressed.The put byte routine should send the byte in the 6502%O} A register to the device or handler buffer. If the buffer fills, it should be sent to the device. BASIC can call the put b%P}yte routine without using CIO.The get status routine may get 4 bytes of status information from the device and put them in %Q}DVSTAT [$02EA] to DVSTAT+3.For special commands the handler must examine the command byte and find the proper routine entry%R} point.In all cases the status (error code) of the operation should be put in the 6502 Y register.To be compatible with a%S}ll versions of the operating system, the handler must redirect DOSINI [$000C,2 (12)] for initialization upon reset. This ini%T}tialization must restore the vectors in the handler vector table and jump to the origional DOSINI vector.27GSPECIAL COMMAN%U}DSSome devices have special CIO commands. These are known as device specific commands. In assembly language these command%V}s are executed just as any other CIO command is. In BASIC the XIO command is used. An example of the XIO command is: XIO%W} command code #channel,aux1,aux2,device:file nameTo open a channel with the XIO command instead of the OPEN command use: %X}XIO 3 #1,4,0,"K:"Note that the above command is identical to the OPEN command except "XIO 3" is used instead of "OPEN". 2%Y}7HAlso note that $03 is the IOCB open code for ICCOM. 575Useful database variables and OS equatesDOSINI $000C,2 %Z} (12): initialization vectorBRKKEY $0011 (17): break key flagICHID $0340 (832): start of IOCBsICDNO $034%[}1 (833):ICCOM $0342 (834):ICSTA $0343 (835):ICBAL $0344 (836):ICBAH $0345 (837):I%\}CPTL $0346 (838):ICPTH $0347 (839):ICBLL $0348 (840):ICBLH $0349 (841):ICAX1 $034A %]} (842):ICAX2 $034B (843):HATABS $031A,16 (794): device handler tableCIOV $E456 (58454): CIO entry vect%^}or842):ICAX2 $034B (843):HATABS $031A,16 (794): device handler tableCIOV $E456 (58454): CIO entry vect$12 4 1 5 0 10 70 2 12 1322-@27E27HCHAPTER 2THE DISK OPERATING SYSTEM (D:)27GThe disk operating syste)`}m program (DOS) is also called the file management system (FMS). DOS is not a permanent part of the computer, it is loaded i)a}n upon power-up if a disk drive is attached to the computer.When the computer is turned on, one of the first things it does)b} is send a request to the disk drive to load DOS into the computer. This startup operation is called booting. The word boot)c} is short for bootstrapping -- the start-up process of early computers. The term comes from "lifting one's self by one's boo)d}t straps".27HAnytime the disk boots, the computer tries to read a program starting at sector 1 and continuing in sequence.)e} If the disk has DOS on it, the first three sectors, called the boot record, have a program which loads the DOS.SYS file. )f}27GIf there is no DOS.SYS file on the disk the computer will display: -------------------- | BOOT ERROR | | BO)g}OT ERROR | | BOOT ERROR | | BOOT ERROR | | BOOT ERROR | | BOOT ERROR | | (etc.)q}lB%DOS SYSB*)DUP SYSB SAUTORUN SYSB_HELP DOCBoMANUAL DOCBBREADER OBJBCHAP0 B!CHAP1 BCHAP1 1 BACHAP1 2 B*_CHAP2 B6CHAP2 1 BGCHAP3 BCHAP4 B(!CHAP5 BICHAP6 BMCHAP7 ) | | | | | -------------------- 27HWhen a disk is formatted, the dri)r}ve read/write head passes over the entire disk and puts magnetic marks on it. These marks divide the disk into 32 concentric)s} tracks. With DOS 2.0 each track is divided into 18 sectors, each holding 128 bytes of data. With DOS 2.5 there are 32 sect)t}ors per track giving a total of 1,024 sectors.Each sector on the disk is marked with a reference number from 1 to 720. Unf)u}ortunately, the writers of DOS 2.0 didn't know this so they wrote the DOS to use sectors numbered from 0 to 719. As a result)v}, DOS 2.0 cannot access sector 720. The designers of the disk drive were the guilty party in this case. It is normal to num)w}ber from 0 in computers. With DOS 2.5, sectors 720 - 1,024 can be accessed normally.Sector 720 can be accessed using the )x}computer's resident disk handler. Some software writers use sector 720 to hide special information to make their programs di)y}fficult to copy.DOS 2 SECTOR ASSIGNMENTSSectors 1 through 3 are called the boot record. They contain a program which lo)z}ads the DOS.SYS file into memory. Sector 360 is called the Volume Table of Contents or VTOC. The main purpose of the VTOC ){}is to keep track of what sectors are occupied. Bytes 3 and 4 of the VTOC tell how many sectors are available. Starting at b)|}yte 10 is the Volume Bit Map. Each byte in the VBM tells the status of eight sectors. If a bit is a 1 the sector is availab)}}le. If a bit is a 0 the sector is occupied.Sectors 361 through 368 contain the disk directory. Each directory sector hold)~}s eight file names. The first byte of a file name is called the flag byte. It tells the status of that file.Directory f)}lag byte. 7 6 5 4 3 2 1 0 ----------------- | flag byte | -----------------Bits: 7 1 = file de)}leted 6 1 = file in use 5 1 = file locked 0 1 = open for outputThe next two bytes tell how many)} sectors are in the file. The two bytes after them tell the starting sector of the file. The last 11 bytes contain the file)} name.Sector 720 cannot be accessed with DOS 2.0.The boot record, VTOC, directory and sector 720 use 13 sectors. This le)}aves 707 sectors for storing files with DOS 2.0.Each file sector has 125 bytes of data. The last three bytes tell how many)} bytes of the sector are used, what directory entry the sector belongs to and which sector is next in the file.File secto)}r structure 7 6 5 4 3 2 1 0 ----------------- | data | byte 0 - - - - | byt)}es | byte 124 ----------------- | Dir. No. |hi | byte 125 ----------------- |forward pointer| byte 1)}26 ----------------- |S| byte count | byte 127 ----------------- hi = high 2 bits of forward pointer )} S = Short sector flag. 1 = short sector (End Of File)If the directory number does not match the order of the file name)} in the directory, an error 167 (file number mismatch) will occur.As a file is written to an empty disk it is put in conse)}cutive sectors, 125 bytes at a time. After the file is written, the VTOC and directory are updated. When new files are writ)}ten they also use consecutive sectors.When a file is deleted the status bit of the directory is changed to show that the fi)}le has been deleted. DOS then tracks the file, sector by sector, to find what sectors are used. Finally the VTOC is updated)} to show that the deleted file's sectors are available for new files. The file is not erased from the disk; only the VTOC an)}d directory are changed.When a file is deleted, an "island" of free sectors may be left on the disk. When a new file is th)}en written to the disk it will first use these new free sectors. When the island is used up, DOS will skip over the occupied)} sectors to the next free sector. This is the reason for the sector link. A file can end up with it's sectors scattered all)} over a disk. It can be complicated but it's efficient.D:CHAP2.1link. A file can end up with it's sectors scattered all(EDISK FILE STRUCTURE27HThe first few bytes of a file may tell DOS or another program what kind of file it is. These infor-}mation bytes are called a header.A text file is any file which has no header. A listed BASIC program is a type of text fil-}e. A letter from a word processor is another.A binary load file is a file intended to load to a specific address in memory-}. The first two bytes of a binary load file are decimal 255. The next two bytes hold the address at which the file is to lo-}ad. The last two header bytes tell the ending address for the file. If the file is a program and is to run automatically, t-}he initialization and run address are appended to the end of the file.binary load file header Decimal Hexa-}decimal 255 identifier FF 255 FF 0 start 00 7 07-} 15 end FF 8 08The above file would load at address $0700 (1792 decimal) and end-} at address $08FF (2063). If a binary load file has initialization and run address appended to it they take on the following-} format:Init and run tailer CHR Decimal Hexadecimalinit address format [b] 226 identifier E2-} | 2 02 [c] 227 E3 | 2 02 n address nn -} n nnrun address format [diamond] 224 identifier E0 | 2 02 [a] -} 225 E1 | 2 02 n address nn n nn [ ]=inve-}rse videoA program which doesn't need special initialization can be run at the init address. Otherwise, an RTS instructio-}n is expected at the end of the initialization section. The computer will then jump to the run address if specified.INSID-}E THE COMPUTERDOS uses the computer's CIO utility. When a DOS disk is booted a non-resident handler is loaded into memory.-} A new handler name, D, is then added to the handler table. When CIO is called with a device name of D: or Dn:, CIO will se-}arch the handler table for that device name. If the 'D' is found, the next two bytes in the table point to the DOS entry add-}ress.27GDOS FILE NAME CONVENTIONSDOS is unique among CIO handlers in that it requires an eight character file name to fo-}llow the device name. This file name may be followed by a period and then a three character extender.EXAMPLES: D:TEST, D2-}:FIREMAN, D:VENTURE.EXE, D:CHAPTER.001The D2: is used for drive number two if present.The file name must use upper-case -}letters or numbers. The first character must always be a letter. WILD CARDSThe characters * and ? may be used as wild c-}ards. * means any combination of characters and ? means any single character.EXAMPLES: D:P* any file beginning -}with P and without an extender D:*.EXE any file with the extender .EXE D-}:*.* any file. D:F?REMAN one unknown character, FIREMAN or FOREMAN will mat-}chWild cards can only be used to load, delete, lock and unlock files. When loading a file using wild cards, only the firs-}t matching file will be loaded.When renaming a file, both the new and old names are expected after the device name.EXAMPL-}E: D:OLDNAME.BAS,NEWNAME.BASTo format a disk, only the device name (D: or Dn:) is needed.USING DOSWhen a CIO channel i-}s opened to the disk drive it must actually be opened to a specific file on the disk. The device name in the open command mu-}st be followed by a file name.When a channel is opened to the disk, two special parameters may be used in ICAX1.27HICAX-}1 for disk open: 7 6 5 4 3 2 1 0 ----------------- | W R D A| ------------------} D 1 = open to read the directory instead of a file A 1 = append data to the end of the fileThis gives the following -}extra ICAX1 options.27GDisk specific ICAX1 options: HEX DEC $06 6 open to read director-}y $09 9 output, append to the end of an existing fileREADING THE DIRECTORYWh-}en the directory is read, each file name is treated as if it were followed by an EOL. A loop must be used to read all of the-} file names in the directory. The last entry read is the free sector count. After it is read, another read operation will r-}esult in an End-Of-File error.The disk drive has a number of device specific commands other than the regular CIO commands. -} From BASIC the XIO command is used to access these commands. 27HThe XIO command allows you to directly load the IOCBs from-} BASIC. Each parameter of the XIO command places values in certain bytes of an IOCB.27GXIO command format: XIO comma-}nd channel,aux1,aux2,device:file nameNote that the parameters resemble the BASIC OPEN command. The BASIC OPEN command is -}identical to it's equivalent XIO command.XIO commands specific to the disk drive.RENAME XIO $20 (32)DELETE XI-}O $21 (33)LOCK XIO $23 (35)UNLOCK XIO $24 (36)POINT XIO $25 (37)NOTE XIO $26 (38)FORMAT -} XIO $FE (254)EXAMPLES: XIO 33 #1,0,0,"D:JUNK" = delete file named D:JUNK XIO 32 #1,0,0,"D:OLD,NEW" = change name o-}f D:OLD to D:NEWNOTE and POINT can also be used directly from BASIC. NOTE finds the current position of the read/write he-}ad on the disk. POINT moves the read/write head to the desired position.USING NOTE AND POINTThe command format for NOTE -}and POINT is as follows: NOTE \ channel,sector,byte POINT/EXAMPLE: NOTE #1,SECT,BYTEBASIC requires the se-}ctor and byte parameters in both commands to be variables. Fixed numbers cannot be used. If you try to do a POINT to a sect-}or outside the file the channel is open to, a point error will occur. Care may need to be taken to be sure the file being ac-}cessed is in contiguous sectors on the disk. If it is not, it will be difficult to know where to do points to.One use of N-}OTE is to use the command immediately after opening a channel to a disk file. After the NOTE command, the parameter variable-}s contain the coordinates of the first byte of the file. They can then be used as a reference for the POINT command.27HIn-} assembly language, ICAX3 and ICAX4 are used for the sector number (lsb,msb). ICAX5 is used for the byte number.STATUS REQ-}UESTIf the status request command is used, one of the following values will be found in ICSTA and the 6502 Y register. -} HEX DEC $01 1 OK $A7 167 file locked $AA 170 file not found ,{12 4 1 5 0 10 70 2 12 1323-@27E27HCHAPTER 3USING THE DOS 2 UTILITIES (DUP.SYS)If you boot a DOS disk 1}with no cartridge in the slot or with BASIC disabled (by holding the OPTION key), DOS will try to load the file named DUP.SYS1}. This is the disk utility file. When using BASIC, typing DOS [RETURN] will load the DUP.SYS file. When the utilities are 1}loaded the menu will appear on the screen.THE DOS UTILITIES MENUDISK OPERATING SYSTEM II VERSION 2.0SCOPYRIGHT 1980 ATA1}RIA. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDGE J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S1}) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRESSF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE D1}ISKH. WRITE DOS FILES SELECT ITEM OR [RETURN] FOR MENU[A] DIRECTORYAfter pressing [A] [RETURN] you will get the promp1}t: DIRECTORY--SEARCH SPEC,LIST FILE?If you want to see the entire directory just press [RETURN] again. If you wish, you 1}may type in a specific file name (D: is optional) or wild cards to search for. If you specify a search spec only matching fi1}les will be displayed.If you want, you can have the directory sent to another device. To do this type a comma and the devi1}ce name. For example, if you type ,P: the directory will be sent to the printer.[B] RUN CARTRIDGEIf a cartridge was inse1}rted or BASIC was not disabled when the computer was turned on, [B] [RETURN] will run that cartridge or BASIC.[C] COPY FIL1}EThis option will copy a file to another part of the same disk (with a different file name) or copy from one disk drive to 1}another. When you press [C] [RETURN] you will be given the prompt: COPY--FROM,TOType the devices and file names separate1}d by a comma.EXAMPLES:FOREMAN,FIREMANorD1:TEST,D2:TESTThe first example will copy to the same disk. The seco1}nd example will copy from disk drive one to disk drive two.If you want to have the first file appended to the end of the se1}cond file type /A after the file names.EXAMPLE:RUNMENU.EXE,AUTORUN.SYS/AIf the files are binary load files, this wi1}ll cause both files to be saved as one file. When the load command is used they will both be loaded and run.[D] DELETE FIL1}E(S)After pressing [D] [RETURN] you will get the prompt: DELETE FILE SPECAfter typing the file name you will be asked t1}o confirm the file to delete. DELETE FILE SPEC DELETE-D1:JUNK ARE YOU SURE?Press [Y] if the correct file is displayed. 1}If you use wild cards you will be asked to confirm each matching file.[E] RENAMEUpon typing [E] [RETURN] you will be giv1}en the prompt: RENAME-GIVE OLD NAME,NEWType the file name you want to change and the new name separated by a comma.EX1}AMPLE:COLT,HORSEWARNING! Do not rename a file to a name which already exists on the disk. You will end up with a dupl1}icate file name and will not be able to access one of them. Attempting to rename or delete one of them will rename or delete1} both. The only way to fix a duplicate file name is with a sector editor or other special utility.[F] LOCK FILEA locked 1}file cannot be written to, renamed or deleted. To lock a file type [F] [RETURN]. You will get the prompt: WHAT FILE TO LO1}CK?Type the file name you want to lock. Wild cards will cause all matching files to be locked.[G] UNLOCK FILEUsed the 1}same as lock.[H] WRITE DOS FILESThis option will write the DOS.SYS and DUP.SYS files to a formatted disk. When you type 1}[H] [RETURN] you will receive the prompt: DRIVE TO WRITE DOS FILES TO?Type the number of the drive. If the drive contain1}s a formatted disk the dos files will be written to it.[I] FORMAT DISKThis option formats a new disk or erases a disk wi1}th files on it. Typing [I] [RETURN] will get you the prompt: WHICH DRIVE TO FORMATBe sure you have the correct disk in t1}he proper drive then type the drive number. It is impossible to recover files on a disk formatted by accident.While the di1}sk is being formatted the drive will check to be sure the disk is formatted correctly. If not, the drive attempt to format t1}he disk again. If the disk is defective the drive will not finish the formatting process.[J] DUPLICATE DISKThis option w1}ill copy an entire disk except for sectors listed as free in the VTOC. Some programs are copy-proofed by changing the VTOC t1}o show that some occupied sectors are empty. For such disks, a program which copies the entire disk is needed.When you pre1}ss [J] [RETURN] you will be given the prompt: DUP DISK--SOURCE,DEST DRIVES?If you are using only one disk drive, type 1,11}. If you have only one drive you will be told when to swap disks.[K] BINARY SAVEThis option saves a block of memory as a1} binary load file. When you type [K] [RETURN] you will be given the prompt: SAVE-GIVE FILE,START,END(,INIT,RUN)Type the 1}desired file name and a comma. Now type the start and end addresses of the memory block to be saved, in hexadecimal numbers,1} separated by commas. If the file is a program which is to automatically run when loaded, give the initialization address, i1}f needed, then the run address.EXAMPLE:CHASE.EXE,0700,09FF,,0700This will save the block of memory from address 071}00 to 09FF. The program is not initialized before running so there is no address typed after the third comma. When the prog1}ram is loaded the computer will jump to address 0700, as specified in the last parameter, to run the program.[L] BINARY LOA1}DTo load a binary file type [L] [RETURN]. You will get the Prompt: LOAD FROM WHAT FILE?Type the file name and the file 1}will be loaded. If wild cards are used, only the first matching file will be loaded.[M] RUN AT ADDRESSTyping [M] [RETURN1}] will get the prompt: RUN FROM WHAT ADDRESS?Type the hexadecimal address of the program you want to run.[N] CREATE MEM1}.SAVA MEM.SAV file is used by BASIC and some other programs to save the part of memory which the DUP.SYS file loads into. 1}If there is no MEM.SAV file on the disk when you go to the DOS utilities, you will loose that part of memory. With BASIC you1} will loose your program.When you type [N] [RETURN] you will get the prompt: TYPE Y TO CREATE MEM.SAVTyping [Y] [RETURN1}] will create a MEM.SAV file on the disk in drive one.[O] DUPLICATE FILEThis option is used to copy a file from one disk 1}to another, using only one disk drive. When you type [O] [RETURN] you will get the prompt: NAME OF FILE TO MOVE?If you 1}use wild cards you will be asked to swap disks for each matching file.DOS 2.5 also has option:[P] FORMAT SINGLEDOS 2.51} normally formats disks to use "enhanced" density. This option will format a disk in single density for use with the 810 dri1}ve.DOS 2.5 also has some special utilities on the master disk. Use the binary load option to run them.RAMDISK.SYSThis 1}program will cause the extra bank of memory in the 130XE to act like a disk drive (called D8:). If this program is on the di2}sk it will automatically run. It need not be renamed to AUTORUN.SYS.COPY32.COMCopies DOS 3 files to DOS 2.DISKFIX.COM2}Can make certain "repairs" to a disk, such as restoring deleted files.SETUP.COMUsed to change the default configuration 2}of DOS.AUTORUN.SYS (DOS 2.0 and 2.5)This program is needed to operate the RS-232 ports on the 850 interface. If you don'2}t want this program to automatically load when you boot with the master disk, rename the file to RS232.SPECIAL DOS INFORMAT2}IONWhen DOS is in memory, changes can be made to the DOS program. These changes can be made by poking the changes into mem2}ory. If you want to make the changes permanent, you can type DOS [RETURN] to load the utilities. From the utilities menu yo2}u can use the write DOS files option to save the changes on disk. Some of the useful changes you can make follow. POKE 192}13,80This turns off the write verify and speeds up disk writing. POKE 1913,87This turns write verify on POKE 5903,42}2 POKE 5904,46 POKE 5905,82 POKE 5906,85 POKE 5907,78 POKE 5908,155This causes any binary file with the extender .RUN 2 }to be loaded automatically when the computer is turned on. POKE 5903,65 POKE 5904,85 POKE 5905,84 POKE 5906,79 POKE 592 }07,82 POKE 5908,85This returns the DOS to normal, Automatically loading files named AUTORUN.SYS. DOS 2.0 2 }DOS 2.5 POKE 3772,255 POKE 3818,64 POKE 3774,64 POKE 3822,123 POKE 3778,123This will cau2 }se DOS to accept lower-case as well as upper-case letters in file names. It will also now accept @,[,\,],^ and _ . 2 } POKE 3772,223 POKE 3818,65 POKE 3774,65 POKE 3822,91 POKE 3778,91 This will change DOS back to 2}normal, accepting only upper-case letters and numbers.4,65 POKE 3822,91 POKE 3778,91 This will change DOS back to 0712 4 1 5 0 10 70 2 12 1324-@27E27HCHAPTER 4THE CASSETTE HANDLER (C:)27HThe cassette handler sends da6}ta to the cassette recorder in blocks of 128 bytes each. The blocks are sent in the following format:Cassette record for6}mat ----------------- |0 1 0 1 0 1 0 1| speed measurement bytes ----------------- |6}0 1 0 1 0 1 0 1| ----------------- | control byte | ----------------- | 128 6} | = data = | bytes | ----------------- | checksum | handled 6}by SIO -----------------The control byte may have one of the following values. $FC (252) record is full.6} $FA (250) partly full, next record is EOF. $FE (254) EOF record, data section is all zeroes.The cassette handle6}r has two modes of operation. The first mode uses only a short gap between records. It is called the no IRG (interrecord ga6}ps) mode. The second mode uses longer gaps between records and is called the IRG mode. In the IRG mode the computer may sto6}p the cassette recorder between records for processing data.When a channel is opened to the cassette recorder, bit 7 of ICA6}UX2 may be set to 1 (ICAX2 = $80 (128)). This will cause the cassette to use the no IRG mode.A cassette file starts with a6} 20 second mark tone. This tone is followed by the file records with 128 data bytes each. The final record is an End-Of-Fil6}e record.27GThe cassette is a straight-forward read/write device. There are no special functions other than those common 6}to other CIO devices.27HThe cassette motor is controlled by one of the controller port control registers. If bit 3 of PAC6}TL [$D302 (54018)] is 0 then the cassette motor is on. 27GThe following BASIC commands will turn the cassette motor on and 6}off.Cassette motor control. POKE 54018,PEEK(54018)-8 motor on POKE 54018,PEEK(54018)+8 motor off 57527H6}Useful data base variables and OS equatesPACTL $D302 (54018): port A control register, bit 4 6 } controls cassette motoruatesPACTL $D302 (54018): port A control register, bit 4 4$12 4 1 5 0 10 70 2 12 1325-@27E27HCHAPTER 5THE KEYBOARD HANDLER (K:)27GThe keyboard is a read only d:"}evice and therefore the keyboard handler has no output functions.The keyboard handler reads the keys as ATASCII codes. Eac:#}h key is represented by one byte of data. Therefore, each time a key is pressed the data is treated as a byte of data just a:$}s data from any other device is. The only difference is that the computer must wait for the operator to press the keys as it:%} reads the data.27HWhenever a key is pressed an IRQ interrupt is generated by the keyboard reading hardware. The internal:&} code (not ATASCII) for the key just pressed is then stored in CH [$02FC (764)]. The code is then compared with the prior ke:'}y code in CH1 [$02F2 (754)]. If the code in CH1 is different from the code in CH, the key is accepted. The code is then con:(}verted to ATASCII, and placed in the database variable ATACHR [$02FB (763)]. On XL and XE models, KEYDEF [$0079,2 (121)] poi:)}nts to the key-code-to-ATASCII conversion table. (This address is used by the the screen handler in 400/800 models).If the:*} code in CH1 is the same as the code in CH, the new key code will not be accepted unless the key debounce timer, KEYDEL [$02F:+}1 (753)] is 0.When CIO is told to do an input operation from the keyboard, CH is checked to see if a key has been pressed. :,} If CIO finds $FF (255) in CH, it waits until a key is pressed. If CH is not $FF, a key has been pressed and the ATASCII cod:-}e for that key is taken from ATACHR. CH is then set to $FF.The data in CH is in the following format.Key code format::.} 7 6 5 4 3 2 1 0 ----------------- |C|S| key code | ----------------- C 1 = [CTRL] :/}key is pressed S 1 = [SHIFT] key is pressedAnytime a key is pressed, CH is loaded with the key code. CH will hold the c:0}ode until the computer is commanded to read the keyboard. 27GSometimes the computer will read a key which was pressed long :1}ago. If you want to prevent this, load CH with $FF before reading the keyboard. (In BASIC use POKE 764,255.) This will cle:2}ar out any old key pressings.Special function keys [CTRL][1] screen output start/stop [CTRL][2] BEL:3}L [CTRL][3] Generates End-Of-File status [/|\] or [/] inverse video toggle [CAPS LOW:4}ER] sets lower case [CTRL][CAPS] sets CTRL lock [SHIFT][CAPS] sets caps lock27HKEYBOARD REPEAT DELAY AND RA:5}TE CONTROLOn the XL and XE, KRPDEL [$02D9 (729)] determines the delay before the key repeat begins. The value of this byte:6} is the number of vertical blanks (1/60th second each) to delay. KEYREP [$02DA (730)] determines the repeat rate in vertical:7} blanks.KEYBOARD CLICKThe keyboard click of the XL/XE is heard through the TV speaker. The click may be turned off by pu:8}tting $FF in NOCLIK [$02DB (731)].NON-HANDLER, NON-CIO KEYSThe [OPTION], [SELECT] and [START] keys are read from the cons:9}ole switch register, CONSOL [$D01F (53279)].The console switch register 7 6 5 4 3 2 1 0 -----::}-------------------- CONSOL |0 |0 |0 |0 |SP|OP|SE|ST| ------------------------- 8 4 2 :;}1 ST 0 = [START] SE 0 = [SELECT] OP 0 = [OPTION] SP Console speaker. set to 1 during vertical blank. :<} toggleing this bit operates the speaker (which is heard through the TV on XL/XE models). This bi:=}t always reads 0The [HELP] key on XL and XE models is read from HELPFG, [$02DC (732)]. This address is latched and must be:>} reset to zero after being read.The [HELP] key register 7 6 5 4 3 2 1 0 ----------------- HELPFG :?} |C S 0 H 0 0 0 H| ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8 H 1 :@}= [HELP] (bits 0 and 4) S 1 = [SHIFT] C 1 = [CONTROL] 575Useful database variables and OS equatesKEYDEF :A}$0079,2 (121): key code coversion table vector (XL/XE)KRPDEL $02D9 (729): delay before key repeat (XL/XE)KEYREP $:B}02DA (730): key repeat rate (XL/XE)NOCLIK $02DB (731): $FF turns off key click (XL/XE)HELPFG $02DC (732)::C} [HELP] key (XL/XE)ATACHR $02FB (763): ATASCII Code for last keyCH $02FC (764): keycode, $FF if no key has :D}been pressedBRKKEY $0011 (17): break key flag, 0 = break key pressedSRTIMR $022B (555): Key delay and repeat t:E}imerSHFLOK $02BE (702): SHIFT/CTRL lock flag 32$00 = lower case$40 (64) = upper case lock$80 (128) = CTRL lo:F}ck 5INVFLG $02B6 (694): inverse video flag, non-zero = inverseCONSOL $D01F (53279): start, select and option keysI:G}RQEN $D20E (53774): IRQ interrupt enable 32bit 7 enables [BREAK]bit 6 enables other keys 5shadow registersPOKMS:H}K $0010 (16): IRQEN shadowrupt enable 32bit 7 enables [BREAK]bit 6 enables other keys 5shadow registersPOKMS8"12 4 1 5 0 10 70 2 12 1326-@27E27HCHAPTER 6THE PRINTER HANDLER (P:)The printer is a write only device>J} so the printer handler has no input functions. The printer handler has no special functions other than the CIO functions co>K}mmon to all other devices.Although many printers have special functions, the printer handler has no control over them. See>L} your printer manual for information on special functions.cial functions, the printer handler has no control over them. See<;12 4 1 5 0 10 70 2 12 1327-@27E27HCHAPTER 7SCREEN EDITOR (E:)27HThe screen editor uses both the keybBN}oard handler and the screen handler to provide interactive control of the computer. In fact, the keyboard handler, the screeBO}n handler and the screen editor are contained in a single section of code and are therefore very closely related.27GThe edBP}itor works with one line of characters at a time. The lines it works with are called logical lines and are up to three screeBQ}n lines long.27HThe screen editor inputs data from the keyboard and then prints the data on the screen. When the [RETURN]BR} key is pressed, the editor inputs all of the data on the present logical line for processing by CIO.If characters are typBS}ed on the screen, and then the cursor is moved off the line, then back on the line, and new characters are typed, only the chBT}aracters to the right of the reentry point of the cursor are input when [RETURN] is pressed. However, if the cursor is movedBU} off the line again, then moved back on, all characters on that logical line are input.If bit 0 of ICAX1 is 1, the editor wBV}ill act as if the [RETURN] key is being held down. This bit may be changed at any time.27GEditor control codesThe screeBW}n editor treats certain ATASCII codes as special control codes.Screen editor control codes KEY HEX DEC BX} FUNCTION [RETURN] $9B 155 carriage return or EOL [CLEAR] $7D 125 Clear screen,putBY} cursor in 46upper left 10 [UP ARROW] $1C 28 Move cursor up one screen 46line 10 [DOWN] $1D BZ} 29 down one line [LEFT] $1E 30 left one character [RIGHT] $1F 31 right one chB[}aracter [BACK S] $7E 126 Back-space operation [SET TAB] $9F 159 sets tab stop at cursorB\} [CLEAR TAB] $9E 158 Clear tab stop at cursor [TAB] $7F 127 move to next tab B]}stop [SHIFT] [INSERT] $9D 157 Make space for a new line [SHIFT] [DELETE] $9C 156 B^} delete the logical line at 46the cursor 10 [CTRL] [INSERT] $FF 255 make room for a character [B_}CTRL] [DELETE] $FE 254 delete character at cursor [ESCAPE] $1B 27 causes next non-EOL cB`}ode 46to be displayed as an ATASCII character, even if it is an editor control code 10 [CTRL] sBa}creen print start/stop [1] [CTRL] $FD 253 rings bell, no effect on [2] Bb} display [CTRL] creats End-Of-File status [3] 575Useful database variablesDSPFLG Bc} $02FE,1 (766): if > 0 then control codes displayedd-Of-File status [3] 575Useful database variablesDSPFLG @8