LBSOS KRNLI/O ERRORFILE 'SOS.KERNEL' NOT FOUNDINVALID KERNEL FILExةw,@  4  J  ȱ⩤i8#) ) 8LeSOS KRNLb.D1/SOS.INTERPŠ̠Š.D1/SOS.DRIVERР頞 0 ) (lH'&3&'&#e'#%e'%'&"$"$#%'#%h`$ev,V5U:SYSTEM.STARTUP[U:HELLO.TEXTU&UMENU.MAKER.CODE"UUFONTS 93lIII.PCL.1031541u' *SOS.KERNEL ,V-$!a*SOS.DRIVER 4-!-*SOS.INTERPo%H-%!)SOURCESCllSOURCES.2..SYSTEM.LIBRARYm#im#iЛ#Lȱ  6L憦  Lsmm l y` @8(Je稽 ʈ%e,ȥ,*,- y,,,-,,,ȱ,,- yL+,ȑ,` 2"p-,-L(Ġ %>,i-i8, ȱ,%,W,pp ڠ %p`l  " ) i   !"#$%&'()*+,-./0120 `8`HiHiH ihhȱh`86)IH)heuQɸ` ` W` ] %饚0` W` ߰4`)|E8LLLRLLLLL*LLLLLhh`LLL`SOS 1.3 01-NOV-82(C) 1980, 1982 BY APPLE COMPUTER INC. ) `G`î** }*`o^`on 8 JJAj@` *?($`ΠņɠŠ堠РѠ͠஠әƆH v?c,,,,h߈ߢ~))`3PLLP*%(i&`Ѕ񩏍E H pph`X٠ŠҠî!((ͽϠРРSOS NTRPSOS DRVR(.D1(YYYYMMDDWHHMMSSMMM̱忠ΠͽŠ堠Р͠Ю̠Ɔx߭J ʈc(()o/ e/''ʈ((''()(1i / e/''ʈ((''((''((''' ('`ŠDAY, DD-MON-YY HH:MMSUNMONTUEWEDTHUFRISATJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDECé@L&I/O ERRORINTERPRETER FILE NOT FOUNDINVALID INTERPRETER FILEINCOMPATIBLE INTERPRETERDRIVER FILE NOT FOUNDINVALID DRIVER FILEDRIVER FILE TOO LARGEROM ERROR: PLEASE NOTIFY YOUR DEALERTOO MANY DEVICESTOO MANY BLOCK DEVICESEMPTY DRIVER FILE '(i%%%h}%%`8 ȥ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8`LŅ ۅ ۩ۍۅ Lɰ ʰۅۄÍÍۙ'Ù ۍ*ۨ  Ѝ۹ۙ8v- ðJ ¥ ð, ðLO ʰƥLT`'  mې浰``8 8 nʰ0 ̰+泱Ƴ m° x̰ ̐8` m° x̰8 ۢ8 ˰y ` ¥ nʰ泱Ƴ T̰#泪 Ѳ *Ƴ ` L:Ϡ`泑Ƴ` LaĥH8`JȘ I8`  S`ۈۥۥ۩Íۭۍۭۍ հL¢H8`Jj Ȅ ۍۆeۅiۅ Lɰ ʰWۅۄ ¦J> ɩE` eĐL Ȑ 15WL QL5WW{5 ې'`,55 ې'` ݠ B1 ȩȑ Lɦ8`5  @ R㥶i ` İG8`F`X8``éۅĩ >` T֩xxMH]@ Kۅ5H ɐE$ eİ Ȱ h`h`8`W h8`hR`hLҿ i x +ۅ5ۅ6 ǰ `E8<W`­ `0XLۅ5` ռ``ߤeI`IiţO`Ȯʆ/ )󘑡`()0zq 滅ѺY Ueۅ5Ѻ Ѻ  Qܐ'`i ҩ *C8/y.i/ ȑ  © $ E7<3W`ȽLֽȄ @8`R ) [)_[AͰ")[)_[A:0/.ЩȑΘ8e * ȩ`Loü 7)?۽۩ W٠Յ<ōōř ռV7 uM78 V榠=ü#)@5 ɐ /ݐE ) .) @L `lqhٯ޿=ϓTXIֲ̛̐~ؠIJK,-NOPQ0vt Ѷ"` ɰ Ȑ`E`Ɔ X̐8`>>5Ѷ Qܩ<`>`\ʊJJJJ ۍ۩  ˰Fȱ X̰6 0 Lɠ 0ۑۑ8ȱ`H8` ɹ $  8JJJJ8 ` ۪` H hQ)fʅ F jF jF jF &!  eװ*  ̰F湥 ƹ`Z8`@  ʰ泭ۑƳ ʐ` ʐ` ˰ ƹ Wː`ۘ . . .۪8*Jۦȱ ˦,+* ʈJj =ؠ yiȩ`y4泱ƳHhz ʠiȱizLA`L;ؠ"  `1` Đ7@8V۩ Lɠ۪8ۊ۠X)JJJƄ X Ġȱ۠ ȍ۱۠ ۭ) ۍ ð*)#  O̰``)(`N8` ) xհۈ ̰آ*գ  Ͱ ݢգ LvL{ؠ;i ڥ(8` ְ( ȱ5 HȦ)`Lxץ: ש ְ⥺i ꥻ(8`Lx Lxש u )۠0)p խ.8`)@ ϰ) ϰۈۅƭۅǭۅ5 X̰ *ƭ۬͵̶L  ΐ` Wհ> H۪ȱHۑhƳh sϰq ` ʰiȱi `)5©éՅĩ5 }JJ+`.`8`ɂ )`@ ש ְO ֤FHۑۑh8`P) հ Wհҥ,J+j泭۪ƳۑȊ ) ~ fPL ͊.>.ʱ+,EP!.E.Lw+,,ӄ*- P*e (` հB հ5 Wհ0,J۪泭ۑƳ sϰ(` L Ͱ2 ~ P kҐ#L8 T 2ΠHHȑhhȑ`Ld )N8` xհ*eȱ+eȱ,i۠Ѻ۹ۑ񥤅- ť.Lcԥ.La Ͱ$)rJ Lɰ )# Ԑ) ͰU..++,,IJ/ ӥ-.?Цե,J+jѲ4Ƴǥ4聠 H hH kh8`8-ȥ.L 8*Ʊ )8 0*-`.G.ʱ*+,EP'.E.LұE0+,,ӄ*p-e  )LBѠٳ )8`i (` )N8`*eȱ+eȱ,i۠Ѻ*ȱ+L - ť.Lkҥ. ՅL ͐Ld ~ pа.J/)@߅4N8`) ))УJ8` ۑȭۑǠۑۑȭۑ($S8`O8` "` / 򑺠+* ͐H h8` ΰi `()  *ǵ յý5Ņ4gȩυɩč5 iψ }.8` iϙLIѠ ˢ L΢ ΰ LϠ ˢ ΰ1` Đ@ АP8`B8`ۑJJJJ -ѥ +jѲ84ƳJJ 2ΐ3泑ƳLTΩ潑ƽ`ƱƳ ΰ( {Π۵*+)e`8`)` J J + ΰ" 0 ΰ 🱼ѼL8`ǩ Ϡ` ϰ ƑȥǑ` Ѻе*`)ȥ+8ۍې  ,ѺLTΠ"LΠ5 խ ɐ /ݐE`C8`)@ ϰa)ۥ,8ېu+J,\ ȱLJΠ) ϰ'#,J(] { ΰ ƑȥǑ.8` { ΰ,JѲ ƳL΅ƱƳ ΰҥ,J0`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X0 8~X 1`C X`)X0`C РǠ𠠐ŠŠӠҠȠƠŮƠҢâӠUAQY @?ZY 9ZYY^TU QZoȥɭ }`` ? }``  }`X0i 8~XX0H }h襯` ©Wéĭ }0W`F X0A */5BL. zF`LLz Lz`Y `Ơ堧 B k L( LO  %   }` ` ?!©UéĩU󥣍V }`` ?)) $p10LYeieLVȱ d0L`Hȱ hh` WɸSI I.ȩ8A 8ɸ4ɠ(H)h h8   `    i Ȣ d` $,)?P^ GL㢮 5L}P.)(Ơ L`ޠ LR  稱 I)0JJJJѤ  БĈ` H`)à`֩ нѽ>`]PU]]UPPX0 0 PPXPP  į󠠩ҙ̙ɠΠɊՐӠӢ̢ՠҠŠԠҚРĠ鱃ԠȠࠠLQ  * WHHH>%H H @`)h8`  HШБˆeЅА SYSTEM FAILURE = $hh8`hhhxآY_Z@tPRVT,p S JJJJ ) ʍL@ i0i6`îӉ͠堧ǥӥ``HhHy)(h`H` 0L?i `h` `` `x)( 8 `jjJJԥ)եӬɂ )Ӆ҅`  `H0Xh`Π'à̠ȈL` 8`څ  Lk%  Lk8Lu텚8嚅 L L Ld V ``  h` ک V `ۅץ  VLFx) ( :` H ) L  .P'pб0 &L:L5'8+8`0Fܢ` ř,Ř 0 8f)J DžŠƠŚ̮ÎȠ Ӡ̠Ӡ` LL#L/LL'Lgab `abBcd cdBrcadbho:ab.cݰdDcݰd8abҊ v+abcde0f`   cCȱcD C Ea  UV 1 ELUFVG FUUCVDեYCWZDXWXCUDV[ v`b0WXYZiUcȥVcWX eeYZ ggE` @SATR ((((PPPPBTVSPLH   5"ʘ HH` (# (=  0`)aI!SHOLES 1!1!2@23#3#4$4$5%5%6^67&7&8*8*9(9(0)0)-_-=+=+\|QWERTYUI OP[{]}`~`~ASDFGHJ K L ;:;:'"'"ZXCVBNM ,<,<.>.>/?/?d0hp00000>" <"<"""<< <"""<"><$""< """"  "" 6***""""""""""<""< :< $"""2,"""""**6"""""< >>8  8>> ""*:<"">""""""""""""">>><2"<""">""" ""  ">"6**"""""&*2""""""""""""*,"" "" ">""""""""""""""**6"""""""> >>>356789:;<=>?@AB 7  3  5  >>< (&20 *, **>> "2*&" " >>  ">> "8""> """"""< SOS DRVR"CHARSET )((8*,;((*,((+)((9/(p((>3  =9 :9 .(+( 8#8# %3(8 ((,+)(%.4$)?((,(103  )* i LiHh`PQPQ>P Q,PQ"PɀQ@PAQ`8`nɀ<)nopoLpp` 0h8蘠fȊf` ab 1abo)abaݰb L9c`` a N0Ioa0H ha`pLopna n`  3ɠ/8 L %iLɠ8逨J Hh $`b >_-%^%p_^^_ab"08^c_L8^c_L8^c_L8^c_ȑcc\] ab^_ ``aV R0M bba dda `Q8STRQ ST`c\ȱc]a  b 5DU e\^e]_ ^_ ^_LH8\^]_?Je\^e]_,78\^]_ ^ݰ_ ^_LH^_ $bL@A^_aoQ*@A RQL@A `T8`RLSJTKQHIQiHiIKNJ)M8逅OPOPHMIN'a MHNILHOIPaOHPI8JHFKIGFGaHMINNMʆSTL8HSITQQST`8 iIi`9A)I@`a{ ~I)_ bJ) b) )ab)a a,h0& &+%a0 +hcefd(c,@cfabdf`cnx  (,4h`dd,9P"<:J H) +̰ H) +ʭcP h̰ʩd8,h)ec efeede`,5 H h 4 `5!   4(P 4 4 `,g0L,10kH0 ԥ f0)ĭ9)9҅xh(ĥŐBGLQgjox',/25:BGKORY\aelpu !$(+.147<?BFILORUX]`finsw| > `ʝ"`t  !#%')+;CNU\eh "*-036<BLORX_fj &+38;?DGLTot <?J}΅н(I I $0;P̑бʑΈ,:JՐ̑ʈ0 Ցʭr̈A萠L> ֦ڱΑ0Б֤ l L p,:0 JfiΥiώJe΅Хiю@ F $p̑бʑΈ0 Б̱ΑʈeمΐeمАA萿հ0`ՑʭrpȐ`=m@< F l AL> 8p,:Jf׮@$PA F $P@/A'ʤ˅΄ϥ̤ͅЄ F $̑бʑΈ0Ƞ l L> $)טɀIim>ٮ@8pذ `$0"8,:Jک@ׅפ؈۩MjL,:08*Ȅ F ,:A@@8A@q==C)CB)B Crx 00 )ߍ:) J,P,QJ,R,S,T,V( > `,k<,: JI`I`<,:J̰`=m@>,:J}ʅ̽(I I `<Mj,:0pJՐ̑ʈ`pJн},,P,`,g$ ( $g " x) (,`% (gL,}0, `gé ĩ `:) j:;jN;~j;O,:0'???>>8?>p<<AA F }~L } `,}0 x) `(`hh% ( ΍ ύ逅Ñ}`` " ( ĩ~Íĩϭ & &υΠÑΈ~ F ~ҰةeÅÐҍ3`)1`Ɂ" (cefd`Hcefh) `xÙ+(`xÙ&(`)4`)5`)6`)7`)8`)9`,i0!M:0p ȱq L`" (~)y ~JJ* I `x|x|,,}P-X~`9`<ȭ=` * @jI`:ȭpȭqé,i0LÈ`,g HH`LL! l      5  Hdcefh&+si M0  h) `(" ( (È& 8 `)2ȱL1upp<`uqq=L> vuL L L <Li Li ,g0L HH`! ( 9EKQWbmz`(" ((è%È`2ȭ3`1`d`c`+È`&È` * IMk`4`5`6`7`8<L<`<p<`,ms<L=q=L> ,lXL ==L> ,lCL <=L> <,n)LL8 L8 u:L8 ;)ߍ;j`; ;j`uBL8 uCL8 u)u;) u;L8   x) `(, Lu%CYgu #1:CY` 9C<m><=m@=>@?AL8 >m<>@m=@<=L8 <m>?=m@AL8 C9L8 ; ;k`;);k`,@`<,m pHe҅Ґhe…å逅h,23Lhґȥӑ,10 h0  `,g0L ҅ӥĥŰ+,0p 4 Ls Ls i )"|tȌs|st HH` MjH,: <J h̰ <rh,oL`L i,1HȊ©L,52,9-P" a{)9 Ln90$0%,7 ҥ L$0T,8OK50P;ҥ,8 L%\   8҅¥Ӆé҅L,5,6  * @jIH,5 p   !%*/369<?BEJMRUX]`h  2;AGMS[fot|              . 3 6 9 < ? B E H N S V \ _ b w      ! ( 0 7 I N S _  . G R Y f {    ! $ 4 9 F I P S V \ a h m p s x |  {============================================================================ #Menu Maker - Pascal Version # #Author: Tom Bartkiewicz # #Date: 21-Oct-87 # #This is a Pascal version of the Washington Apple Pi Menu Maker program. #The original veDFGHPQRSTUVWXYZ[\]^_`abcdefghijklmB E U*@O^joo.+S#SCA3.MEMORY.TEXT8lSCMAKE;l"CMAKE.MENU.MAKERUFF7CSOURCESvl' '/MENU.MAKER.TEXTE=x( C.SIG.START.TEXTJ lRCMENU.MAKER.TEXTQ=xF;(C/CONSOLE.IO.TEXT8F;F/C-LIST.CAT.TEXT F:dCMEMORY۠ '058FV[fjsuw$0) `/0) `,.0L tHsH`! (xy```,.0L HH`Ln,/023x #) "# (```'+"'*CFMRZ_ ('( `,.0L& (,.0L7 Đ`ʥ逅8n134nʐ3x1eʍ1,/p/H h(eʅ8ʅİLa )`Y)D00L:1?24n21  % &Copyright (C) 1983 by Apple Computer Inc. HH` (# (KXT .")"#)  #`,.$ ()-'( / .`% (.L,/0x߼    + / @ C H K R Y j o t | ,/DIMV_x}  RUBSerial Printer Driver -- Copyright (C) 1983 by Apple Computer Inc..PRINTER A")rsion was written in Business Basic. # #The Pascal Menu Maker supports the following function: # &Execution of Pascal programs &Loading of Font files &Display of the following types of text files: )PascalTEXT )ASCII )/// EZ-Pieces Word Processing &Setting and switching disk volumes &Machine/Memory Status  =============================================================================}  program menu_maker; uses #hexstuff, #chainstuff, #sosio, #{$USING console.io.code } console_io, #{$USIXT not found; unable to continue.' ); )exit( program ); &end; # #{$IOCHECK+} #{ read from the file and write to the screen until the file is exhausted } # #while not eof( infile ) do &begin )readln( infile, buffer ); )writeln( output, buffer );  output );  #{ open the standard greeting file. since we're using pascal } #{ i/o, it doesn't matter whether the file is ascii or text. }  {$IOCHECK-} # #reset( infile, 'HELLO.TEXT' ); #if (ioresult <> 0) then &begin )writeln( 'File HELLO.TEprogram sig_start; uses chainstuff; var #infile : text; { input file identifier } #buffer : string; { text buffer } #dummy : char; { character for keyboard input } # begin #{ clear the screen } # #page(able including block i/o, unitread/write, and &SOS i/o. See the source code for MENU.MAKER for an example of &reading a disk file and printing it to screen using SOS i/o. & ===========================================================================} /o for demonstration purposes. &Pascal i/o has the advantage of allowing a program to read either &asci or text files (it converts asci to text on the fly). However, &it has a big draw back in that it is SLOW. Faster disk to screen &methods are avail Apple /// Sig PASCAL public &domain disks and is equivalent to the HELLO program on BASIC disks. & &The program attempts to display the file 'hello.text' on the &console and then chains to the menu.maker program. & &NOTE: This program uses pascal i{============================================================================= SYSTEM.STARTUP program for Washington Apple Pi - Apple /// Sig # #Author: T. Bartkiewicz # #Date: 18-Oct-87 # #Description: &This is the system.startup program forIKLMNOO^**NG list.cat.code } sos_catalog_list; " const " BLANK = ' '; #READ_ONLY = 1; #ON_VALUE = 255; #OFF_VALUE = 0; #MAX_BLK_DEVS = 12; #ESCAPE_KEY = 27; #RETURN_KEY = 13; #LEFT_ARROW = 8; #UP_ARROW = 11; &end; #close( infile ); # #{ wait until the user hits a key on the keyboard } # #gotoxy( 25, 23 ); #write( 'Press any key to continue.' ); #read( keyboard, dummy ); # #{ chain to the menu.maker program } # #setchain( 'menu.maker' ); # end. #DOWN_ARROW = 10; #RIGHT_ARROW = 21;   type #date_string = string[18]; "  var #len : integer; #retcode : integer; { SOS Return status codes } #file_cnt : integer; { # of files in a directory } ory count } # #for i := 1 to 3 do &begin )mem[i] := chr( (whole_k div poweroften) + ord( '0' ) ); )whole_k := whole_k - ((whole_k div poweroften) * poweroften); )poweroften := poweroften div 10 &end; " #{ replace leading '0's with ' 's } # #i { decimal portion of memory } #poweroften : integer; { mask into the whole_k variable } " begin #mem := ' '; #whole_k := num_pages div 4; #remain_k := num_pages mod 4; #poweroften := 100; # #{ convert the integer portion of the mem{ Convert 256 byte pages to Decimal K } procedure cvt_page_to_k( num_pages : integer; var mem : string ); var #i : integer; { counter } #whole_k : integer; { integer value of memory } #remain_k : integer; 2 ), '-', copy( MONTHS, 3*idx+1, 3 ), 6 '-', copy( oldf, 3, 2 ), ' ', copy( oldf, 10, 2 ), 7':', copy( oldf, 12, 2 ) ) #end;  begin #sos_get_time( time_buf ); #make_pretty_date( time_buf, pretty_date ); end; " &MONTHS = '???JanFebMarAprMayJunJulAugSepOctNovDec'; & #var &idx : integer; &ascii_0 : integer; & #begin &newf := BLANK; &ascii_0 := ord( '0' ); &idx := ((ord(oldf[5]) - ascii_0) * 10) + (ord(oldf[6]) - ascii_0); &newf := concat( copy( oldf, 7, rocedure get_date_time( var pretty_date : date_string ); var #time_buf : date_string; # # #{ make_pretty_date -- format system date/time notation to decent form } #procedure make_pretty_date( oldf : date_string; var newf : date_string ); # #const )sos_d_info( i, dev_name, dev_list, retcode ); )if (retcode = 0) and (dev_list[2] > chr(127)) then ,begin /num_blk_devs := num_blk_devs + 1; /blk_devs[num_blk_devs] := dev_name; ,end; &end; end;   { get_date_time -- get system date and time } p; #for i := 1 to MAX_DEVICES do &begin ){ search all possible device entries for a valid block device } ){ block devices are found when the 2nd character in the device } ){ list returns a value greater than 127 (msb is 1 for blk devs } driver } # var #i : integer; { loop counter } #dev_name : string; { device name string } #dev_list : packed array [0..10] of char; { returned device attributes } # begin #num_blk_devs := 0y = chr(ESCAPE_KEY)) then &quit_now := TRUE #else &quit_now := FALSE; end;  { get_blk_devices -- obtain a list of all the block devices installed } procedure get_blk_devices; const #MAX_DEVICES = 24; { maximum number of devices in sos.#until (key = chr(ESCAPE_KEY)); end; { quit_now -- wait until the user says continue or quit } function quit_now : boolean; var #key : char; # begin #repeat &get_kbd( key ); #until (key = chr(ESCAPE_KEY)) or (key = chr(RETURN_KEY)); #if (kery } #file_type : filekind; { file types to look for in directory } " " { get_escape -- wait forever until the user presses } procedure get_escape; var #key : char; # begin #repeat &get_kbd( key ); ices in sos.driver } #prefix : string; { Current SOS prefix } #sys_date : date_string; { System date } #blk_devs : array [1..MAX_BLK_DEVS] of string; #file_list : files; { list of files in a directo#file_idx : integer; { Pointer to file in list } #pages_in_use : integer; { Memory pages in use } #total_pages : integer; { Total pages available in machine } #num_blk_devs : integer; { # of block dev:= 1; #while (mem[i] = '0') and (i <= 2) do &begin )mem[i] := BLANK; )i := i + 1 &end; " #{ load in the decimal portion } # #case remain_k of &0 : mem := concat( mem, '.00K' ); &1 : mem := concat( mem, '.25K' ); &2 : mem := concat( mem, '.50K' ); &3 : mem := concat( mem, '.75K' ) #end end; $ $ { memory_map -- report allocated sos segments } procedure memory_map; type #mem_rec = packed record /base : integer; { 1st page number } /limit : integerr := 12; #lrc := 42; #viewport( ulr, ulc, lrr, lrc ); #clear_viewport; #wait( 1 ); #for i := 1 to 5 do &begin )ulr := ulr - 2; )lrr := lrr + 2; )ulc := ulc - 7; )lrc := lrc + 7; )viewport( ulr, ulc, lrr, lrc ); )clear_viewport; )wait( 1 ); &eport; #ctr_print( 'WAP /// Pascal Menu Maker' ); #curlocat( 23, 0 ); #ctr_print( 'Press for HELP; to exit' ); #curlocat( 12, 0 ); #ctr_print( 'Washington Apple Pi, Ltd.' ); #wait( 60 ); #normal; #ulr := 11; #ulc := 37; #lr#lrr : integer; { lower right corner row } #lrc : integer; { lower right corner column viewport corners } " i : integer; { index loop counter } "  begin #viewport( 0, 0, 23, 79 ); #inverse; #clear_viewdraw_main_screen -- display the fixed portion of the display; leaves 7viewport set at 1,2 - 22,77 } procedure draw_main_screen; var " ulr : integer; { upper left corner row } #ulc : integer; { upper left corner column } ' ); ,TEXT_TYPE : print( ' Text ' ); ,ASCI_TYPE : print( ' Ascii ' ); ,FONT_TYPE : print( ' Font ' ); ,CAT_TYPE : print( ' Catalog ' ); ,EZWP_TYPE : print( ' 3EZP WP ' ); ,otherwise print( ' ???? ' ); )end; &end; end; " "  { )filler := copy( blanks, 1, length(blanks)-length(name) ); )print( concat( name, filler ) ); ){ str( size, strg ); ) filler := copy( blanks, 1, 5-length(strg) ); ) print( concat( filler, strg ) ); } )case f_type of ,CODE_TYPE : print( ' Code procedure list_files( var file_list : files_rec ); const #BLANKS = ' '; { 16 blanks }   var #filler : string; { empty space } #strg : string; { temporary } #  begin #with file_list do &begin ges + user_pages; #print_k( total_pages, 1 ); #print_k( pages_in_use, 2 ); #print_k( sys_pages, 3 ); #print_k( interp_pages, 4 ); #print_k( user_pages, 5 ); #get_escape; #close_window; end; " { list_files -- print the files on the console } f fiveints.retcode = 0 then ,with fiveints do /if segid <= 15 then 2sys_pages := sys_pages + pages /else if segid <= 31 then 2interp_pages := interp_pages + pages /else 2user_pages := user_pages + pages &end; #pages_in_use := sys_pages + interp_pa ' Interp : ' ); #println( ' User : ' ); #total_pages := (peek( 6401, 0 ) + 2) * 128; #pages_in_use := 0; #sys_pages := 0; #interp_pages := 0; #user_pages := 0; #for seg_num := 1 to 31 do &begin )sos_g_seg_info( seg_num, fiveints ); )i&cvt_page_to_k( pages, mem ); &print( mem ); #end; . begin #open_window( 5, 50, 11, 72, 'Memory Map', ' to continue' ); #curlocat( 1, 0 ); #println( ' Total Ram : ' ); #println( ' In Use : ' ); #println( ' SOS : ' ); #println( #seg_num : integer; #fiveints : mem_rec; # # #{ print_k -- print the memory size on the designated line } #procedure print_k( pages, line_num : integer ); # #var &mem : string; & #begin &curlocat( line_num, 14 ); es : integer; { pages allocated to interpreter } #user_pages : integer; { pages allocated to user program } #pages_in_use : integer; { total pages in use } #total_pages : integer; { system memory size }; { last page number } /pages : integer; { number of pages } /segid : integer; { SOS segment id } /retcode : integer; { SOS return code } -end; " var #sys_pages : integer; { pages allocated to SOS } #interp_pagnd; #curlocat( 0, 0 ); end; { synch_prefix -- set the sos prefix equivalent to the pascal prefix } procedure synch_prefix( var current_prefix : string ); var #s_len : integer; begin #get_prefix( current_prefix ); # #{ remove trailing / from prefix } #s_len := length( current_prefix ); #if (current_prefix[s_len] = '/') then &delete( current_prefix, s_len, 1 ); #sos_set_prefix( current_prefix, retcode ); #if (retcode <> 0) then &println( 'Error synchronizing Pas ) = RETURN_KEY then /begin 2new_prefix := vol_name[i]; 2do_vol_list := true /end; ,if i <> old then /begin 2curlocat( old, 17 ); 2print( vol_name[old] ); 2curlocat( i, 17 ); 2inverse; 2print( vol_name[i] ); 2normal /end )until ((key = chr(REd := i; ,get_kbd( key ); ,if ord( key ) = DOWN_ARROW then { down arrow } /if i = num_vols then 2i := 1 /else 2i := i + 1 ,else if ord( key ) = UP_ARROW then { up arror } /if i = 1 then 2i := num_vols /else 2i := i - 1 ,else if ord( key#for i := 1 to num_blk_devs do &if (on_line[i] = false) then )println( concat( ' ', blk_devs[i], ' is off-line.' )); #if num_vols > 0 then &begin )i := 1; )curlocat( i, 17 ); )inverse; )print( vol_name[i] ); )normal; )repeat ,ol ,begin /on_line[i] := true; /num_vols := num_vols + 1; /insert( '/', vol_name[num_vols], 1 ); /curlocat( num_vols, 17 ); /print( vol_name[num_vols] ); /println( concat( ' in drive ', blk_devs[i] )) ,end )else ,on_line[i] := false &end; 4+num_blk_devs, 70, 'Volumes On-Line', &'Press to select a new volume, to exit.' ); #curlocat( 0, 0 ); #for i := 1 to num_blk_devs do # begin )sos_volume( blk_devs[i], vol_name[num_vols+1], tb, fb, retcode ); )if retcode = 0 then { Temporary variable } #vol_name : packed array [1..max_blk_devs] of string[16]; { the volumes name } #on_line : packed array [1..max_blk_devs] of boolean; # begin #do_vol_list := false; #num_vols := 0; #new_prefix := prefix; #open_window( 3, 10, #i : integer; { loop counter } #key : char; { User's key stroke } #num_vols : integer; { Number of on-line volumes } #old : integer; t( var new_prefix : string ) : boolean; var #tb : integer; { total blocks on a volume } #fb : integer; { free space on a volume } ( 'Program written by Tom Bartkiewicz' ); #get_escape; #close_window; end; { do_vol_list -- present a list of all the volumes currently on line. The } { user may change the prefix by selecting a new active volume } function do_vol_lis----------------' ); #println( concat( oa_char, 'S displays system memory map' ) ); #println( concat( oa_char, 'V displays, selects available block devices' ) ); #println( concat( oa_char, '? displays this information' ) ); #println( ' ' ); #ctr_print#println( ' Catalog : Sets the prefix to the directory.' ); #println( ' Ascii : Displays the file.' ); #println( ' Text : Displays the file.' ); #println( ' 3EZP WP : Formats and displays the file.' ); #print( '-------------------------------tln( ' ' ); #println( ' Action taken depends on selected file''s type.' ); #println( ' Code : Runs the selected program.' ); #println( ' Font : Downloads the font to the console.' ); v1.0 Help Screen', 0'Press to continue...' ); #curlocat( 0, 0 ); #get_date_time( today ); #r_print( today ); #curlocat( 2, 0 ); #println( ' Use the arrow keys to highlight a file' ); #println( ' and press to select it.' ); #princal-SOS prefix' ); end; { do_help -- give the user the low down on this program } procedure do_help; var #today : date_string; #oa_char : string[2]; # begin #oa_char := ' '; #oa_char[2] := chr( 127 ); #open_window( 3, 17, 20, 63, 'Menu MakerTURN_KEY)) or (key = chr(ESCAPE_KEY))) &end; #close_window; end; { confirm_quit -- make sure that the user really wants to leave menu.maker } function confirm_quit : boolean; begin #open_window( 19, 19, 20, 57, 'Exit MENU MAKER?', ' ' ); #println( ' Press to exit Menu Maker ' ); #print( ' Press to return to the menu' ); #confirm_quit := (not quit_now); #close_window; end; { do_catalog -- set the new prefix and obtain all files of interest in the 0 directory thennpqrstuvwxyz{|}~ q.CONSOLE.GRAFIX.PRINTER.RS232.D?qq%q.q5qppp`ppp`p+p&p!pp0pp0``qpqq`qҼq ̺qpppppppSOS NTRPpPGLpLLuLuLvLvLQyLxyLyLyLxLxLxLxLwLxL_xLoxLxLyL6yL?yLyLzL`{Lt{L}xLtprpnppPLqLq var #key : char; #temp : integer; #do_item : boolean; #new_prefix : string;  #procedure move_to_item( i : integer );  #begin &if (odd( i mod 2 )) then )curlocat( 3+(i div 2), 4 ) &else )curlocat( 2+(i div 2), 44 ); i mod 2 )) then ,curlocat( 3+(i div 2), 4 ) )else ,curlocat( 2+(i div 2), 44 ); )list_file( file_list[i] ); &end; end;  { do_menu -- allow the user to select a file or option to be acted upon } function do_menu( var file_idx : integer ) : boolean;t := file_cnt + 1; )with file_list[file_cnt] do ,begin /name := PARENT_NAME; /f_type := CAT_TYPE; /size := 0; ,end &end; & #{ display the list of files of the selected type(s) in this directory } # #for i := 1 to file_cnt do &begin )if (odd( )inverse; )println( 'Error in directory processing' ); )normal; &end # #{ if this is a subdirectory, provide the means to move towards the } #{ root directory via this subdirectories parent } # #else if is_subdir( prefix ) then &begin )file_cntial_prefix ); #clear_viewport; #curlocat( 1, 0 ); #ctr_print( prefix ); # #{ get the file names and check for errors on return } # #list_catalog( file_type, prefix, file_list, file_cnt, retcode ); #if retcode <> 0 then &begin )println( ' ' ); /) } &if pos( '/', test_prefix ) = 0 then )is_subdir := false &else )is_subdir := true; #end;  begin #retcode := 0; #file_cnt := 0; #if (partial_prefix = PARENT_NAME) then &pop_catalog #else if (partial_prefix <> BLANK) then &push_catalog( parintln( 'Error setting new prefix' ); #end; # # #{ is_subdir -- determine if a prefix is a directory or subdirectory } #function is_subdir( test_prefix : string ) : boolean; # #begin &delete( test_prefix, 1, 1 ); { remove 1st char (always . or #{ push_catalog -- add a subdirectory to the current directory tree } #procedure push_catalog( partial_prefix : string ); # #begin &prefix := concat( prefix, '/', partial_prefix ); &if (set_prefix( prefix )) then )synch_prefix( prefix ) &else )pri] = '/') then ,found := true )else ,i := i - 1; &delete( prefix, i, (length(prefix) - i) + 1 ); &if (set_prefix( prefix )) then )synch_prefix( prefix ) &else )println( 'Error setting new prefix' ); #end; # # parent } #procedure pop_catalog; # #var &i : integer; { counting variable } &found : boolean; { true when last / has been found } & #begin &found := false; &i := length( prefix ); &while (i > 0) and (not found) do )if (prefix[ display the files name, size, and type in 0 the window } procedure do_catalog( partial_prefix : string ); const #PARENT_NAME = '< ..Parent.. >'; # var #i : integer; { loop counter }   #{ pop_catalog -- set the prefix to this catalogsppq9qq:qqq qp;qqqqq qp?qq@qqq qpp18qAqqBqqpq q _q8qLrq~pqp qq qq q qqqL oqDqa p5pLsb p&pLsA ppLs  ح)pR}S}ER}R}S}T}U}V}AR}X}8  W}8L\W} R}S}U}T}V}W}@R}R}}S}}T}V}X}W}R}}H}H LR}U}S}T}U}W}V}R}3~vR}R}vjjj)*R}}`p񟷞ʴδ$FԲsߠ2l|Yp X Ol|Lhh)аX0 eXXYL eTveUwUwv8vXwvYLBhvhwhvhwлL hL\hvhwhvhwL hL HHL-XHXHL飨RHRHL- gRe`fSeag fHfH\8\]\R]S]S_\ȥ]Z[[ Hz RPRRSQRRQ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 8 8ȱ8e e Ցȱiȥ ʊ ȑȑ` f`"\]ŧ S}R}ER}`hh HL hh L mKqmLq`mCqmDq`mEqmFq`mMqmNq`F Ȫ`F; Ȫ` f` P($ȭFň |8Ɠ ~5~8~8\~ȥ]~8~Ə8 ƏL[PQ ~v~8~8~~ȥ~~8~~ iiL )i )i ~ 8Ɠ|L[ ` <8`Ɠ ~…`ŧS}R}ER}L\]L  `\]e&mmeeUȱP8\\]]LS8\Z][ Ѓ8\Z][LS\8]` ]ee8)/HPHHHHHHH }xLLاS}R}T}U}X} V}ȱ*W}.X}R}!R}T}U}V}W}R}\]L``­8ȱU}U}U}LSR}S}i T}V}AR}LW}Y}W}X}8 X} ΰ0 [}L R}[}S}ER}\8居\]岅]LSE08居\岅]LS8\Z][ Ѓ8\Z][LS\Lܤ~8~Lܤ~8冪HHL hzh{hvhwhxhy{wy07ȱzx0xȱx,xyLB xȱxxyLBHHLHHLHHxvȥyvL 8~`~ȱ~wL쥠8~~vȥ~wvevȱvev~8~Ɔ` UNIT 2UNTIL USES 1VAR WHILE WITH hhh`hahhhhL hlhmhellhemmma ʑlmLt`LlL hhh~hhe~~hehhhhh`ehae`Ii`Iia~Ŋ.L'~0 ~WARD "FUNCTION GOTO IF IMPLEMEN4IN )INTERFAC3LABEL LEAVE 8MOD 'NOT &OF OR (OTHERWIS6PROCEDURPROGRAM !PACKED +REPEAT RECORD -SET *SEGMENT !THEN TO TYPE V RVȱRW RWUYRTȱRURXȱRYRRRSVGLBO)@ |8 OX8XY LFpPQvȑ RȥSTȑVȑUT8U8񹅻񹅼8X廑Y弑z LXx (`LLL/ Stack overflow Type to continue! RHQH LpLLpX8XYL L L L L L6 Source language error Type to continuehhXiXY ӲHҲH LpL#CM_WRAP = 4; #CM_SCROLL = 8; #WT = 2; { window corner coordinates } #WL = 0; #WB = 22; #WR = 79; #  var #ifd : integer; { ascii file; internal file descriptor } #bytesreprog_name ); #exit( program ); end; { do_asci -- display the selected ascii text file in the window } procedure do_asci( ascii_file : string ); const #CM_ADVANCE = 1; { .console cursor movement constants } #CM_LINEFEED = 2; int( concat( 'Running program: ', prog_name ) ); #viewport( 0, 0, 23, 79 ); #curlocat( 6, 0 ); #inverse; #clear_eol; #ctr_print( 'When program finishes, enter X to restart MENU.MAKER' ); #normal; #curlocat( 7, 0 ); #clear_eov; #setchain( )end; #until ((key = chr(RETURN_KEY)) or (key = chr(ESCAPE_KEY))); #do_menu := do_item; end; { do_exec -- run the selected pascal program } procedure do_exec( prog_name : string ); begin #curlocat( 2, 0 ); #clear_eov; #curlocat( 3, 0 ); #ctr_pr>list_file( file_list[file_idx] ); >normal ;end; &end; &if (temp <> file_idx) then )begin ,move_to_item( file_idx ); ,list_file( file_list[file_idx] ); ,move_to_item( temp ); ,inverse; ,list_file( file_list[temp] ); ,normal; ,file_idx := temp;_prefix )) then { oa-v or oa-V } ;begin >prefix := new_prefix; >if (set_prefix( prefix )) then Abegin Dsynch_prefix( prefix ); Ddo_catalog( BLANK ) Aend; >file_idx := 1; >temp := file_idx; >move_to_item( file_idx ); >inverse; ESCAPE_KEY : if confirm_quit then ;do_item := false 8else ;key := chr(0); ( 175, 191 : do_help; { oa-/ or oa-? } )211, 243 : memory_map; { oa-s or oa-S } )214, 246 : if (do_vol_list( newle_cnt-1) then ;temp := temp + 2 8else ;temp := 1; )UP_ARROW : if (temp > 2) then ;temp := temp - 2 8else ;temp := file_cnt; )RETURN_KEY : do_item := true; )RIGHT_ARROW : if ((odd( temp )) and (temp < file_cnt)) then ;temp := temp + 1; )#end; # begin #temp := file_idx; #move_to_item( temp ); #inverse; #list_file( file_list[temp] ); #normal; #repeat &get_kbd( key ); &case (ord( key )) of )LEFT_ARROW : if (not odd( temp )) then ;temp := temp - 1; )DOWN_ARROW : if (temp < fiH|HP0 oxLH tLH vLH yLH xLH ?yLH hhhhL XG~ L }zLҵ~? |$RќĆL ||}z{L v Lʵ| |}zЬ{~  L ۤ8 Ɛ L``  ` `8\] ULI`8Z[0[HZHHH uZ[```HHlHHlhhh|h}he||he}}hhɀ HH}H|H t{LH HH}yhzh{0Lh0{h|h}he||he}}hhɀLA P0Lsv [\st~ L }zLҵ~? |$RќĆL ||}z{L v ULʵ| |}zЬ{~  UL +8 Ɛ ɥHHHH vL9 yL9 xL9 6yL9 L HHHH}H|H{HzHyHxH~ yLk zL HHHH}H|H{HzHyHxH~ wL xL `hhL `hhhhL hhhhhhL ~[Z[h))hhxhhhhh漥HHHH u Lu 楽HH`n55xyxyyLuLuQyxxx `hhL HHL LL hh HHL hh L hhɀ `{L9 P0 _xL9ȅad : integer; { number of bytes read from ascii file } #sysbuf : char; { sos i/o buffer; not used } #in_buff : string; { input buffer for reads } #w_width : integer; { window width } #w_height : integer; { window height } #cur_line : integer; { current line in the window } #user_quits : boolean; { true if user wants to exit early }  begin #w_width := (WR - WL) + 1; #w_height := (WB - WT) + 1; #viewport,pbuf_pos := pbuf_pos + 2; )end; & &{ now fill out the line until the max length is reached or found } &{ must use 79-spaces instead of 80 since scan counts from 0, not 1 } &{$RANGECHECK-} &chr_cnt := scan( (79-spaces), =chr(CR), page_buff[pbuf need to do DLE expansion } &if (page_buff[pbuf_pos] = chr(DLE)) then )begin ,spaces := ord( page_buff[pbuf_pos+1] ) - 32; ,if ((spaces > 0) and (spaces < 80)) then /fillchar( in_buff[1], spaces, chr(SPACE) ) ,else /spaces := 0; ifd, page_buff, 1024, bytesread, retcode ); ,if ((retcode = 0) and (bytesread = 1024)) then /pbuf_pos := 0 ,else /begin / retcode := 1; 2exit( read_a_line ); /end; )end; & &{ pbuf_pos now points to a valid character in a string } &{ see if weger; { number of characters xfer'd to in_buff } # #begin &spaces := 0; &chr_cnt := 0; & &{ determine if we need to read in the next page from the text file } &if ((pbuf_pos = 1023) or (page_buff[pbuf_pos] = chr(NULL))) then )begin ,sos_read(#procedure read_a_line( ifd : integer; var in_buff : string; 9var retcode : integer ); 4 #const &NULL = 0; &DLE = 16; &CR = 13; &SPACE = 32; & #var &spaces : integer; { # of DLE expansion spaces added to line } &chr_cnt : intege_buff : two_blocks; { page buffer for text file reads } #pbuf_pos : integer; { position in the page buffer } # # #{ read_a_line -- read the next line of text from a pascal text file } reads } #w_width : integer; { window width } #w_height : integer; { window height } #cur_line : integer; { current line in the window } #user_quits : boolean; { true if user wants to exit early } #pa : integer; { text file; internal file descriptor } #bytesread : integer; { number of bytes read from text file } #sysbuf : char; { sos i/o buffer; not used } #in_buff : string; { input buffer for#CM_ADVANCE = 1; { .console cursor movement constants } #CM_WRAP = 4; #CM_SCROLL = 8; #WT = 2; { window corner coordinates } #WL = 0; #WB = 22; #WR = 79; #  var #ifd se_window; #viewport( 1, 2, 22, 77 ); { set window to normal menu maker proportions } end; { do_text -- display the selected pascal text file in the window } procedure do_text( text_file : string ); const clear_viewport; ,end; )println( in_buff ); )sos_s_read( ifd, in_buff, 1, w_width, bytesread, retcode ); &end; #cursor_movement( CM_ADVANCE + CM_WRAP + CM_SCROLL ); #sos_close( ifd, retcode ); #if (not user_quits) then &user_quits := quit_now; #cloesread, retcode ); #while ((retcode = 0) and (not user_quits)) do &begin ){$RANGECHECK-} )in_buff[0] := chr( bytesread ); ){$RANGECHECK+} )cur_line := cur_line + 1; )if (cur_line > w_height) then ,begin /cur_line := 1; /user_quits := quit_now; /#sos_open( ascii_file, READ_ONLY, 0, sysbuf, ifd, retcode ); #sos_newline( ifd, ON_VALUE, chr( RETURN_KEY ), retcode ); #cursor_movement( CM_ADVANCE ); #in_buff := ' '; #cur_line := 0; #user_quits := FALSE; #sos_s_read( ifd, in_buff, 1, w_width, byt( 1, 0, 23, 79 ); { set full screen width for text display } #open_window( WT, WL, WB, WR, concat( 'Listing ASCII File: ', ascii_file ), 0'Press for next page; to quit.' ); _pos] ) + 1; &moveleft( page_buff[pbuf_pos], in_buff[spaces+1], chr_cnt ); &pbuf_pos := pbuf_pos + chr_cnt; &{ set the string length } &in_buff[0] := chr( chr_cnt + spaces ); &{$RANGECHECK+} #end;  begin #w_width := (WR - WL) + 1; #w_height := (WB - WT) + 1; #viewport( 1, 0, 23, 79 ); { set full screen width for text display } #open_window( WT, WL, WB, WR, concat( 'Listing Text File: ', text_file ), 0'Press for next page; to quit.' ); #sos_open( text_file, READ_ONLY, 0/println( in_buff ); ,end , ){ a line record was encountered, write out a blank line } )else if (ord( cmd_buff[1] ) = 208) then ,begin /cur_line := cur_line + 1; /if (cur_line > w_height) then 2begin 5cur_line := 1; 5user_quits := quit_now;(17); { end bold } 811: in_buff[i] := ' ' { sticky space } 8otherwise delete( in_buff, i, 1 ); 5end; /cur_line := cur_line + 1; /if (cur_line > w_height) then 2begin 5cur_line := 1; 5user_quits := quit_now; 5clear_viewport; 2end; := chr( bytesread ); /{$RANGECHECK+} /{ strip out special codes in the text string } /for i := bytesread downto 1 do 2if (ord( in_buff[i] ) < 32) then 5case ord( in_buff[i] ) of 81 : in_buff[i] := chr(18); { begin bold } 82 : in_buff[i] := chrine of text associated with this record } )if (ord( cmd_buff[1] ) < 208) then ,begin /sos_set_mark( ifd, 2, 2, 0, retcode ); { jump ahead 2 bytes } /sos_s_read( ifd, in_buff, 1, ord(cmd_buff[0])-2, bytesread, ;retcode ); /{$RANGECHECK-} /in_buff[0]#sos_set_mark( ifd, 0, 300, 0, retcode ); { advance past 300 byte header } #if (retcode = 0) then &sos_read( ifd, cmd_buff, 2, bytesread, retcode ); { read 1st rec } #while ((retcode = 0) and (not user_quits)) do &begin ){ a text record, get the l Pieces WP File: ', wp_file ), 0'Press for next page; to quit.' ); #sos_open( wp_file, READ_ONLY, 0, sysbuf, ifd, retcode ); #cursor_movement( CM_ADVANCE ); #in_buff := ' '; #cur_line := 0; #user_quits := FALSE; t early } #cmd_buff : packed array [0..1] of char; { command input buffer }  begin #w_height := (WB - WT) + 1; #viewport( 1, 0, 23, 79 ); { set full screen width for text display } #open_window( WT, WL, WB, WR, 0concat( 'Listing /// E-Z; not used } #in_buff : string; { input buffer for reads } #w_height : integer; { window height } #cur_line : integer; { current line in the window } #user_quits : boolean; { true if user wants to exi#ifd : integer; { ascii file; internal file descriptor } #bytesread : integer; { number of bytes read from ascii file } #i : integer; { index counter } #sysbuf : char; { sos i/o bufferCE = 1; { .console cursor movement constants } #CM_WRAP = 4; #CM_SCROLL = 8; #WT = 2; { window corner coordinates } #WL = 0; #WB = 22; #WR = 79; #  var user_quits := quit_now; #close_window; #viewport( 1, 2, 22, 77 ); { set window to normal menu maker proportions } end; { do_3ezp -- display the selected /// EZ Pieces WP file in the window } procedure do_3ezp( wp_file : string ); const #CM_ADVANbegin /cur_line := 1; /user_quits := quit_now; /clear_viewport; ,end; )println( in_buff ); )read_a_line( ifd, in_buff, retcode ); &end; #cursor_movement( CM_ADVANCE + CM_WRAP + CM_SCROLL ); #sos_close( ifd, retcode ); #if (not user_quits) then &&sos_read( ifd, page_buff, 1024, bytesread, retcode ); { read 1st page } &if (retcode = 0) then )read_a_line( ifd, in_buff, retcode ); #while ((retcode = 0) and (not user_quits)) do &begin )cur_line := cur_line + 1; )if (cur_line > w_height) then ,, sysbuf, ifd, retcode ); #cursor_movement( CM_ADVANCE ); #cur_line := 0; #in_buff := ' '; #pbuf_pos := 0; #user_quits := FALSE; #sos_set_mark( ifd, 0, 1024, 0, retcode ); { advance past header page } #if (retcode = 0) then 5clear_viewport; 2end; /println( ' ' ); ,end; )sos_read( ifd, cmd_buff, 2, bytesread, retcode ); &end; #cursor_movement( CM_ADVANCE + CM_WRAP + CM_SCROLL ); #sos_close( ifd, retcode ); #if (not user_quits) then &user_quits := quit_now; #close_window; #viewport( 1, 2, 22, 77 ); { set window to normal menu maker proportions } end; { do_font -- change the font to the selected font } procedure do_font( font_file : string ); $ var #fontbuf : two_blocks; { new font to be downloaded }O^˰b)SOURCES.2v.' ',SOURCES.TEXT 4SOTHERS4Wfile_list[file_idx].name ); ,CAT_TYPE : begin 5 do_catalog( file_list[file_idx].name ); ;file_idx := 1; 8end; ,EZWP_TYPE : do_3ezp( file_list[file_idx].name ); )end; &end; #viewport( 0, 0, 23, 79 ); #clear_viewport; end. #while (do_menu( file_idx )) do &begin )case (file_list[file_idx].f_type) of ,CODE_TYPE : do_exec( file_list[file_idx].name ); ,TEXT_TYPE : do_text( file_list[file_idx].name ); ,ASCI_TYPE : do_asci( file_list[file_idx].name ); ,FONT_TYPE : do_font( #curlocat( 2, 0 ); #clear_eol; end;  begin #file_type := [ CODE_TYPE, TEXT_TYPE, ASCI_TYPE, FONT_TYPE, CAT_TYPE, 2EZWP_TYPE ]; #file_idx := 1; #draw_main_screen; #get_blk_devices; #synch_prefix( prefix ); #do_catalog( BLANK ); ose( ifd, retcode ); &error_chk( retcode ) #end; # begin #curlocat( 2, 0 ); #ctr_print( concat( 'Downloading Font: ', font_file ) ); #getfont( font_file ); #download_font( fontbuf ); #wait( 15 ); { wait until download is completed } &sysbuf : char; { sos i/o buffer; not used } # #begin &sos_open( font_file, READ_ONLY, 0, sysbuf, ifd, retcode ); &error_chk( retcode ); &sos_read( ifd, fontbuf, sizeof( fontbuf ), bytesread, retcode ); &error_chk( retcode ); &sos_cl#{ get_font -- read the font file into the font buffer } #procedure get_font( font_file : string ); # #var &ifd : integer; { font file; internal file descriptor } &bytesread : integer; { number of bytes read from font file } # # #{ error_chk -- check for and process errors } #procedure error_chk( retcode : integer ); # #begin &if retcode <> 0 then )begin ) writeln( 'SOS i/o error # ', retcode ); ,exit( do_font ) )end #end; # # O^jb1{ viewport -- set a viewport on the screen, all coords are absolute } procedure viewport( top, left, bottom, right : integer ); { open_window -- open a sub window on the screen } procedure open_window( top, left, bottom, right : integer; 7title, foo_viewport; # { clear_eov -- clear the to the end of the current viewport } procedure clear_eov; { clear_eol -- clear the from cursor to the end of the line } procedure clear_eol; ally } procedure horiz_scroll( left_right : integer ); { cursor_movement -- set the cursor movement control value } procedure cursor_movement( ctrl_char : integer );  { clear_viewport -- clear the current viewport and home the cursor } procedure clear ); { r_print -- right justify text within a line } procedure r_print( buff : string ); { curlocat -- set the cursor position within the viewport } procedure curlocat( row, col : integer );  { horiz_scroll -- scroll text within the viewport horizontprocedure print( buff : string ); { println -- send a line of text to the console terminated by a } procedure println( buff : string ); { ctr_print -- print text centered on the current line in the viewport } procedure ctr_print( buff : stringd number of 1/60 second intervals } procedure wait( tics : integer ); { inverse -- turn on reverse video mode } procedure inverse; { normal -- turn on normal video mode } procedure normal; { print -- send a line of text to the console } ay [0..1023] of char;  { get_kbd -- read a keystroke from the console without echoing it } procedure get_kbd( var key : char ); { get_chr -- read a keystroke from the console with echo } procedure get_chr( var key : char ); { wait -- wait a specifiedevice. A rudimentary windowing system is implmented which uses #pop up/exploding windows.  ============================================================================}  unit console_io; interface  uses "sosio; " type "two_blocks = packed arr{============================================================================ #SOS_Catalog_List regular unit # #Author: T. Bartkiewicz # #Date: 02-Jan-88 # #Description: # #The console I/O unit uses SOS I/O to read and write to the console #ter : string ); { close_window -- restore the display to its state prior to open_window } procedure close_window; { download_font -- down load the new font, stored in fontbuf, into console } procedure download_font( fontbuf : two_blocks ); {===========================================================================}  implementation  const #{ Console Screen Control Codes } # #RESET_VIEWPORT = 1; #TOP_VIEWPORT = 2; #BOTTOM_VIEWPORT = 3; #RESTORE_VIEWPORT = 4; #SCREEN_'sos_write( ifd, output, 1, retcode ) #end; # # #{ inverse -- turn on reverse video mode } #procedure inverse; # #begin # output[1] := chr( INVERSE_MODE ); &sos_write( ifd, output, 1, retcode ); #end; # # #{ normal -- turn on normal videontrl_list, retcode ); #end; # # #{ wait -- wait a specified number of 1/60 second intervals } #procedure wait{( tics : integer )}; # #var %icnt : integer; % #begin %output[1] := chr( SYNC_SCREEN ); %for icnt := 1 to tics do = ECHO_ON; &sos_d_control( con_id, SCREEN_ECHO, cntrl_list, retcode ); &sos_read( ifd, inbuf, 1, bytes_read, retcode ); &if bytes_read = 1 then )key := inbuf[0] &else )key := chr( 0 ); &cntrl_list := ECHO_OFF; &sos_d_control( con_id, SCREEN_ECHO, cr key : char )}; # #var &bytes_read : integer; { # bytes actually read } &inbuf : packed array [0..1] of char; { input buffer } &cntrl_list : integer; { single word list } # #begin &cntrl_list :#{ get_chr -- read a keystroke from the console with echo. Note Apple /// } #{ Pascal does its own echoing, so we must turn console driver } #{ echoing on before getting the key stroke then turn it off } #procedure get_chr{( va { # bytes actually read } &inbuf : packed array [0..1] of char; { input buffer } # #begin &sos_read( ifd, inbuf, 1, bytes_read, retcode ); &if bytes_read = 1 then )key := inbuf[0] &else )key := chr( 0 ); #end; # # window is open } #con_status : stat_table; { Console status table } " " #{ get_kbd -- read a keystroke from the console without echoing it } #procedure get_kbd{( var key : char )}; # #var &bytes_read : integer; ]; { console name string } #output : packed array [1..128] of char; { Internal text buffer } #saved_wndo : max_viewport; { Contains window data } #wndo_open : boolean; { True if #window_width : integer; { track of window size } #con_id : integer; { Console device ID } #cr_lf : string[2]; { Carriage_Return-Line_Feed } #console : string[10teger; { Function return code } #sysbuf : integer; { SOS system buffer } #window_height : integer; { Internal vars to keep } iewport = packed array [0..1922] of char; #stat_table = packed record 5tbl_size : 0..255; 5tbl_data : packed array [1..90] of char; 4end;   var #ifd : integer; { Console file descriptor } #retcode : in = 18; # #{ Console Status Codes } # #SAVE_STATUS = 1; #SAVE_VIEWPORT = 18; # #{ Miscellaneous } # #ECHO_ON = 128; #ECHO_OFF = 0; #READ_WRITE = 3; #BW_80_x_24 = 2;  type #max_v#ABS_POSITION = 26; #CLR_VIEWPORT = 28; #CLR_EOV = 29; #CLR_EOL = 31; # #{ Console Control Codes } # #RSTR_STATUS = 1; #SCREEN_ECHO = 11; #CC_CHARSET = 16; #RSTR_VIEWPORT OFF = 14; #SCREEN_ON = 15; #TEXT_MODE = 16; #NORMAL_MODE = 17; #INVERSE_MODE = 18; #CURSOR_CONTROL = 21; #SYNC_SCREEN = 22; #HORIZONTAL_SHIFT = 23; #SET_HORIZ_POS = 24; mode } #procedure normal; # #begin &output[1] := chr( NORMAL_MODE ); &sos_write( ifd, output, 1, retcode ); #end; # # #{ print -- send a line of text to the console } #procedure print{( buff : string )}; # #var &len : integer; # #begin &len := length( buff ); &if (len > 0) then )sos_s_write( ifd, buff, 1, len, retcode ); #end; # # #{ println -- send a line of text to the console terminated by a } #procedure println{( buff : string )}; # #begin &print( buff ); &sos_s_&{ explode_window -- make window openig look exciting (yawn) } &procedure explode_window; & &var )l, r, t, b : integer; )diff_w, diff_h : integer; ) &begin )diff_w := (right - left) div 2; )diff_h := (bottom - top) div 2; )l := left + diff_w; left) + 1; &window_height := (bottom - top) + 1; &sos_write( ifd, output, 9, retcode ) #end; # $ #{ open_window -- open a sub window on the screen } #procedure open_window{( top, left, bottom, right : integer; ;title, footer : string }; # # 3] := chr( left ); &output[4] := chr( top ); &output[5] := chr( TOP_VIEWPORT ); &output[6] := chr( ABS_POSITION ); &output[7] := chr( right - left ); &output[8] := chr( bottom - top ); &output[9] := chr( BOTTOM_VIEWPORT ); &window_width := (right - op < 0 then )top := 0; &if right > 79 then )right := 79; &if bottom > 23 then )bottom := 23; &{ set the viewport and calculate its height and width for internal use } &output[1] := chr( RESET_VIEWPORT ); &output[2] := chr( ABS_POSITION ); &output[#{ viewport -- set a viewport on the screen, all coords are absolute } #procedure viewport{( top, left, bottom, right : integer )}; # #begin &{ validate the parameters to make sure they fall in physical space } &if left < 0 then )left := 0; &if tte( ifd, output, 1, retcode ) #end; # # #{ clear_eol -- clear the from cursor to the end of the line } #procedure clear_eol; # #begin %output[1] := chr( CLR_EOL ); %sos_write( ifd, output, 1, retcode ) #end; # # e clear_viewport; # #begin %output[1] := chr( CLR_VIEWPORT ); %sos_write( ifd, output, 1, retcode ) #end; # # #{ clear_eov -- clear the to the end of the current viewport } #procedure clear_eov; # #begin %output[1] := chr( CLR_EOV ); %sos_wrirsor_movement{( ctrl_char : integer)}; # #begin &output[1] := chr( CURSOR_CONTROL ); &output[2] := chr( ctrl_char ); &sos_write( ifd, output, 2, retcode ); #end; # # #{ clear_viewport -- clear the current viewport and home the cursor } #procedur%output[1] := chr( HORIZONTAL_SHIFT ); %if (left_right = -1) then 'output[2] := chr( 255 ) %else 'output[2] := chr( 1 ); %sos_write( ifd, output, 2, retcode ) #end; # # #{ cursor_movement -- set the cursor movement control value } #procedure cu&output[2] := chr( col ); &output[3] := chr( row ); &sos_write( ifd, output, 3, retcode ); #end; # #{ horiz_scroll -- scroll text within the viewport horizontally } #procedure horiz_scroll{( left_right : integer )}; # #begin _write( ifd, output, 2, retcode ); )end; &sos_s_write( ifd, buff, 1, len, retcode ); #end; # % #{ curlocat -- set the cursor position within the viewport } #procedure curlocat{( row, col : integer )}; # #begin &output[1] := chr( ABS_POSITION ); justify text within a line } #procedure r_print{( buff : string )}; # #var %len : integer; % #begin &len := length( buff ); &if (len <= window_width) then )begin ,output[1] := chr( SET_HORIZ_POS ); ,output[2] := chr( window_width - len ); ,sos&if (len <= window_width) then )begin ) output[1] := chr( SET_HORIZ_POS ); ,output[2] := chr( (window_width - len) div 2 ); ,sos_write( ifd, output, 2, retcode ); )end; &sos_s_write( ifd, buff, 1, len, retcode ); #end; # # #{ r_print -- rightwrite( ifd, crlf, 1, 2, retcode ); #end; # # #{ ctr_print -- print text centered on the current line in the viewport } #procedure ctr_print{( buff : string )}; # #var &len : integer; # #begin # len := length( buff ); )r := right - diff_w; )t := top + diff_h; )b := bottom - diff_h; )normal; )repeat ,if l-1 > left then /l := l - 2 ,else if l > left then /l := l - 1; ,if r+1 < right then /r := r + 2 ,else if r < right then /r := r + 1; ,if t > top then /t := t - 1; ,if b < bottom then /b := b + 1; ,viewport( t, l, b, r ); ,wait( 1 ); ,clear_viewport; )until ((t <= top) and (b >= bottom) and (l <= left) and (r >= right)); &end; & #begin &sos_d_status( con_id, SAVE_STATUS, con_status, retcode ); &if B E O^j>do_open := false; end. ); &exit( program ) #end; #output[1] := chr( TEXT_MODE ); #output[2] := chr( BW_80_x_24 ); #output[3] := chr( RESET_VIEWPORT ); #output[4] := chr( SCREEN_ON ); #sos_write( ifd, output, 4, retcode ); #window_height := 24; #window_width := 80; #wn); #cr_lf[2] := chr(10); #console := '.CONSOLE'; #sos_get_d_num( console, con_id, retcode ); #sos_open( console, READ_WRITE, 0, sysbuf, ifd, retcode ); #if (retcode <> 0) then begin &writeln( 'Error opening the output device, terminating execution.' #{ download_font -- down load the new font, stored in fontbuf, into console } #procedure download_font{( fontbuf : two_blocks )}; # #begin &sos_d_control( con_id, CC_CHARSET, fontbuf, retcode ); #end; " # begin #cr_lf := ' '; #cr_lf[1] := chr(13 con_status.tbl_data[24] )) + 1; 8window_height := (ord( con_status.tbl_data[27] ) - ;ord( con_status.tbl_data[26] )) + 1; 5 wndo_open := false; 5end; /end; )end; #end; # # print, etc. The previous window } 8{ parameters can be found in the con_status } 8{ buffer at the indicated locations. This may be } 8{ specific to .console v1.3 only, be forewarned! } 8window_width := (ord( con_status.tbl_data[25] ) - ;ord(gin ,sos_d_control( con_id, RSTR_STATUS, con_status, retcode ); ,if retcode = 0 then /begin 2sos_d_control( con_id, RSTR_VIEWPORT, saved_wndo, retcode ); 2if retcode = 0 then 5begin 8{ we must reset the window_width and _height for } 8{ use by ctr_2ctr_print( title ); 2curlocat( window_height, 0 ); 2ctr_print( footer ); 2explode_window; /end; )end; #end; #{ close_window -- restore the display to its state prior to open_window } #procedure close_window; # #begin &if wndo_open then )beretcode = 0 then )begin ,sos_d_status( con_id, SAVE_VIEWPORT, saved_wndo, retcode ); ,if retcode = 0 then /begin 2wndo_open := true; 2viewport( top-1, left-1, bottom+1, right+1 ); 2inverse; 2clear_viewport; 2curlocat( 0, 0 ); {============================================================================ #SOS_Catalog_List regular unit # #Author: T. Bartkiewicz # #Date: 02-Jan-88 # #Description: &This unit provides access to the SOS catalog (directory) structure. &Pro= retcode; ,exit( list_catalog ); )end; &check_for_valid_directory #end; #{ get_file_info -- get the file information from the directory } #procedure get_file_info( num : integer ); #const &OFFSET = 4; &BYTES_PER_ENTRY = 39; " #var &i : 0) or (block_buf[35] <> 39) then {sig chars} ,begin /error := INV_DIR; /sos_close( infile, retcode ); /exit( list_catalog ) ,end &end; #begin &sos_open( pathname, READ_ONLY, 0, sysbuf, infile, retcode ); &if retcode <> 0 then )begin ,error :#procedure open_directory; &{ check_for_valid_directory -- determine if it's a directory } &procedure check_for_valid_directory; " &begin )sos_read( infile, block_buf, sizeof( block_buf ), count, retcode ); )trap_io_error; )if (block_buf[0] <>re trap_io_error; #begin &if (not ((retcode = SUCCESS) or (retcode = EOFERR))) then )begin ) error := retcode; ,sos_close( infile, retcode ); ,exit( list_catalog ) )end #end; #{ open_directory -- open the directory for use } { file entry length record } "retcode : integer; { sos file system status } "sysbuf : char; { dummy var, sos finds its own } #{ trap_io_error -- if error occurs, exit from this function } #proceduar infile : integer; { directory path to list } count : counter; { temps used for control } block_buf : packed array [0..511] of byte; { buffer variable } "len : lgth_rec; #INV_DIR = 7; { File is not a directory file } #EOFERR = 76; { End of File encountered } #READ_ONLY = 1; #  type counter = integer; byte = 0..255; lgth_rec = packed record /len : 0..15; /typ : 0..15; -end; vtation procedure list_catalog{( file_type : filekind; 9var pathname : string; 9var file_list : files; 9var file_count : integer; 9var error : integer )}; const #SUCCESS = 0; { SOS success code } " "  { list_catalog -- provide a list of all the files of specified type 9from a SOS path } procedure list_catalog( file_type : filekind; 8var pathname : string; 8var file_list : files; 8var file_count : integer; 8var error : integer ); implemen15; #EZDB_TYPE = 25; #EZWP_TYPE = 26; #EZSP_TYPE = 27;   type #filekind = set of 0..255; #files_rec = packed record 2name : string[15]; 2f_type : 0..255; 2size : integer; /end; #files = array [1..MaxCatEntry] of files_rec;#BBLK_TYPE = 1; #CODE_TYPE = 2; #TEXT_TYPE = 3; #ASCI_TYPE = 4; #DATA_TYPE = 5; #BIN_TYPE = 6; #FONT_TYPE = 7; #FOTO_TYPE = 8; #BPRG_TYPE = 9; #BDAT_TYPE = 10; #WPFL_TYPE = 11; #SOS_TYPE = 12; #CAT_TYPE = =============================================================}  unit sos_catalog_list;  interface  uses #sosio; #  const #MaxCatEntry = 36; { Maximum # of files returned } #UNKW_TYPE = 0; { List of Sos/ProDOS file types } iles_rec should be allocated as a dynamic record with &a linked list of records returned to the calling program. & #Modifications: &04-Nov-88 T.Bartkiewicz Exit as soon as MaxCatEntry files have Aloaded into the file_list record. & ===============cedure list_catalog returns a list of all files in a catalog &which are in the specified set of file types. & &NOTE: The present version assumes that not more than 36 files &will be found in a directory. Rather than the fixed array of &files_rec, fcounter; &low_byte, first, temp : integer; " #begin &first := ord( num = 12 ); &for i := first to 12 do )begin ,low_byte := (BYTES_PER_ENTRY * i) + OFFSET; ,moveleft( block_buf[low_byte+0], len, 1 ); ,if (file_count < MaxCatEntry) and (len.typ <> 0) and /(block_buf[low_byte+16] in file_type) then /begin 2file_count := file_count + 1; 2with file_list[file_count] do 5begin 8name := ' '; 8moveleft( block_buf[low_byte+1], name[1], 15 ); 8temp := OTHERSv4' '-SETCLOCK.TEXT 4l-MEMORY.LAYOUT$5~S'DRIVERS(5Tanother directory, three slashes would be required. t the MENU.MAKER.TEXT file is what needs re-compiling. To execute an exec file, select X)ecute from the Pascal main menu. Enter the following at the prompt: %exec//make.menu.maker % The double slash is required. If the exec file is located in Two Exec files are also on the reverse side of this disk in the sources directory. The exec file MAKE.MENU.MAKER rebuilds the program from scratch. The exec file MAKE assumes that the LIST.CAT and CONSOLE.IO files have already been compiled and tha The program uses the units listed above. Functions are , provided to download fonts, execute programs, display 5ascii, text, and Three EZ pieces word processing files, 5and more. 5 5 =Rebuilding the Program functions. These 6functions interact directly with SOS to achieve maximum 6speed and efficiency. The file also contains a 6rudimentary set of windowing functions. 6 %MENU.MAKER.TEXT This file contains the bulk of the menu.maker program.  below: %LIST.CAT.TEXT This file contains the procedure which obtains directory  information from a disk and stores the info into a  record array. %CONSOLE.IO.TEXT This file contains the screen handler9Menu Maker Program Source Code 9 The Pascal source code for the Menu maker program can be found on the flip  side of this disk in the directory called sources. There are three files which make up the program. The function of the files are described ap_io_error; )end; #end; $ begin #error := SUCCESS; #file_count := 0; #open_directory; #do_it; #sos_close( infile, retcode ); #trap_io_error end; begin end. # #begin &get_file_info( 12 ); &sos_read( infile, block_buf, sizeof( block_buf ), count, retcode ); &trap_io_error; &while (retcode = SUCCESS) do )begin ,get_file_info( 13 ); ,sos_read( infile, block_buf, sizeof( block_buf ), count, retcode ); ,trlen.len; 8moveleft( temp, name, 1 ); 8f_type := 0; 8moveleft( block_buf[low_byte+16], f_type, 1 ); 8moveleft( block_buf[low_byte+19], size, 2 ); 5end; /end; )end #end; # #{ do_it -- performs the listing of the directory } #procedure do_it; O^j˰wHO=====|====|====|====|====|====|====|====|====|====|====|====|====|====|====|===G copy( setting, 4, 2 ), '1', copy( setting, 12, 2 ), copy( setting, 15, 2 ), '00000' ); sos_set_time( newsetting ); end end. ; begin while (not clock_set) do begin writeln; write( 'Enter date and time as MM/DD/YYYY HH:MM : ' ); readln( setting ); newsetting := concat( copy( setting, 7, 4 ), copy( setting, 1, 2 ), ldtime, 12, 2 ) ); writeln; write( 'Press if okay, S)et_clock to change: ' ); readln( okay ); if (okay = 'S') or (okay = 's') then clock_set := false { we want to reset it } else clock_set := true { current setting is ok } end begin sos_get_time( oldtime ); writeln; writeln( 'System date and time are as follows:' ); writeln( 'Date : ',copy( oldtime, 5, 2),'/',copy( oldtime, 7, 2),'/', copy( oldtime, 1, 4 ) ); writeln( 'Time : ',copy( oldtime, 10, 2 ),':', copy( oprogram set_clock; uses sosio; var setting : string[16]; { input string for new clock setting } newsetting : string[18]; { reconstructed procedure for SETTIME procedure } function clock_set : boolean; var oldtime : string[18]; okay : char;%MEMORY LOCATIONS ON THE APPLE ///!X Bytes for eXtended addressing)Hex Dec Resultant combination'--- --- --------------------->$00 0 "Ordinary" system bank= Assembly language modules included in user programs 17 Keyboard layout> 18 System zero page. Used by SOS.Kernel and by drivers" 19 SOS data and jump tables1 1A "User" zero page. Used by interpreter.E 1B "Alefix, ? Access routes to files.412-13 Used as I/O buffer for reading directoriesG 14 Xbyte page when zeropage is $18. Used by SOS.Kernel & drivers 15 Typeahead bufferD 16 Xbyte page when zeropage is $1A. Used by interpreters and ,78 (Decimal)B08-0B Text page 2. Memory for odd numbered columns 1,3,5,..79? Note corresponding addresses in textpage 1 and 2 are 9 interchanged by the relation (hi byte) XOR $0C.0C-0F Character set710-11 File names, Pr. Used as stack@ page by interrupt handlers, drivers, and by SOS.Kernel itself.'02-03 I/O buffers for floppy drivesE04-07 Text page 1. In eighty column mode holds screen memory for 6 even numbered columns 0,2,4,...----------------C 00 "True" zero page. Used early in boot sequence, and as the* zero page for interrupt handlersE 01 "Normal" 6502 stack. Addressed by PHA, JSR, etc., wheneverF bit 2 of environment register ($FFDF) is setUsed as flags for slot interrupts)0 bit 5 clear indicates slot 3 interrupt0 bit 4 clear indicates slot 4 interrupt$Lower system bank: Pages $00...$1FPage FunctionF---- -------------------------------------------- - I/O space% 7 0 Clock speed - 2 MHz% 1 - 1 MHz!$FFEF Bank Register E-VIA IORANibble Function------ --------, Lo Selects currently switched in bank8 Hi Usually $F ( - Read only (Write protected)2 4 0 Reset Key - Disabled at keyboard% 1 - Enabled" 5 0 Video - Disabled! 1 - Enabled% 6 0 $C000...$CFFF - RAM+ 1 = ROM #2 (Doesn't exist)8 1 = ROM #1 (If switched in w/ bit 0)6 2 0 Alternate stack = (zero-page XOR $1)) 1 Normal stack (page $01), 3 0 $C000...$FFFF - Read/Write= 1 space2 3. $F000 to $FFFF = ROM"$FFDF - The environment registerBit Value Function--- ----- --------% 0 0 $F000...$FFFF = RAM% 1 = ROM. 1 0 ROMt page of bank 0; RAM beneath VIA's ($FFD0...$FFEF)=$FF 255 "artificial" - gives system type bank with:= 1. "true" zero-page and stack-page8 2. $C000 to $CFFF = I/O ir 3, 4 $84 132 Bank pair 4, 5 $85 133 Bank pair 5, 6D$86 134 Bank pair 6, 7 Bank 7 nonexistent in 256K machineB$8F 143 Like system bank. Bank 0 to $2000-$9FFF. All RAM9 Access to lowes. User at $2000..$9FFFC zero-page mapped from $1A, stack from $1B $80 128 Bank pair 0, 1 $81 129 Bank pair 1, 2D$82 130 Bank pair 2, 3 Bank 3 nonexistent in 128K machine $83 131 Bank paternate" stack. Used by interpreter. Bit 2 $FFDF clear+1C-1D Route information for open files.+1E-1F Available for use by interpreter.Standard EnvironmentsCSituation User Kernel Driver IRQ MonitorA--------- ---- ------ ------ --- -------=E-Reg ($FFDF) $38 $34 $74 $74 $77=Zero Page $1A $18 $18 $00 $03>Xbyte Page $16 $14 $14 none none=Bank Kbdflg of last key pressed$C010 Clear keyboard strobe'$C020 Deselect all peripheral slots($C030 Clicks speaker (Apple ][ type)($C040 Beeps Speaker (Apple /// type)*$C050 Black and white mode soft switch $C051 Color mode soft S subroutine jump#$1990 Start of copyright notice0$1980 Holds error number from Syserr routine:$198C Entry of return portion of monitor entry routine2$19FD Holds return address from Syserr routine$C000 Last key pressed$$C008 rror number lookup for internal buffer allocation>$192E ? Error number lookup for internal buffer allocation>$1931 ? Error number lookup for internal buffer allocation.$1934 Probably debug - SOS subroutine jump.$1985 Probably debug - SOutine jmp*$191F * Queevent - SOS subroutine jump)$1922 * SelC800 - SOS subroutine jumpG$1925 Writes system failure, the value of A, and hang - SOS routineF$1928 * Syserr reports errors from drivers to caller - SOS routine>$192B ? Elly set to a do nothing routine*$1913 * AllocSIR - SOS subroutine jump+$1916 * DealcSIR - SOS subroutine jump F$1919 Disable reset key (unless NMI pending) - SOS subroutine jumpG$191C Enable reset key (just sets $FFDF bit 4) - SOS subro | Text or graphics mode9 Screen on/off0$1907 Number of pages allocated for graphics;$1908 Disk busy byte. (Non-zero when a disk is in use)E$1910 NMI Subroutine vector, norma- Bit 7 6 5 4 3 2 1 0F | | | | B/W or colorG | | | 40 or 80 columnA | | Page 1 or 2C for console control #7 and #9 (bit 7 suspends screen < output if set, bit 6 flushes screen output if set.,$1903 High bit set indicated NMI pending5$1904 Entry to beginning of Enter monitor routine;$1906 Used for console control #5 09 ? 15-17 Pseudo slots 5-7 Memory Locations - System BankAddr. FunctionG----- -------------------------------------------------------------1$1901 Contains highest bank number on machineD$1902 Used 10 Character set downloader 0 03 Clock chip 11 Slot 10 04 ? 12 Slot 20 05 Console code 22 (Sync) 13 Slot 30 06 Charset interrupts 14 Slot 4:07-stem Internal Resources (SIR's)4SIR # Function SIR # Function2----- -------- ----- --------2 00 ? 0A Any slot+ 01 ACIA 0B-0F ?C 02 Keyboardndle Event yes no no no N/A=Allocate SIR yes yes yes yes ???=Call SelC800 w/care yes yes yes N/A=Call Syserr no yes yes no N/A#SyIssue SOS Calls yes no no no no=Be Interrupted yes yes w/care w/care N/A=Handle Interrupt no no no yes N/A=Queue Event yes no yes yes N/A=HaReg ($FFEF) NC NC NC handler $F0=6502 Interrupts enabled enabled enabled disable ???CFunctions Allowed User Kernel Driver IRQ MonitorA----------------- ---- ------ ------ --- -------