Acorn CPCPMDISCâîú~ÒÊæyëÏGreetings from Clean End - Ian Mark Neil Simon Dirty End - Dave Ian John TobyBoss Man - Howard >2.>ý끊P$TlLll##/M  0T!!P~#G˸ 2g:_^#V>!g(5!>͌>!} O!g6 yÞ..>} .>!>y&>.>0ɯ=.!!!y! >.!o>.!>}ȯ=:̀>"h>|!6( (!&l͎Printer off linèl͎SPACE starts Printer Sink ͢(ͮ .>.>l ͺ*hͺMͺLͺȯ{ ~#(ͣ ͬ> Oú͎ Not a CP/M system disc in Aͮ1ͧ2!C D:O8yO122C2D3͓͎ Acorn CP/M 2.2 - Bios 1.20 ͎!܆#7!R 2222Ϳ*">!>22!"!"C: 2y2`i!y2o)))) y2s12>22>2/s12y2 >2:2:2:2:(1=2:! $:! :! 4~86!422<22:2!~6(":! :! :!($::2:2:2:2:o&)))))))r[: >2::{2:-w>S(M:(:! :!(!:w:2I>2>->K w>22:2:P8 O:2>2:ͬ2!cͤ(S M͎ Bdos Err On :AOͺ͎: R/O (Disc is Write Protected)ͮR(r(>2O! ~rS"&S*j 2,:ͬ!% r>!r[w*rRR0[y*tR *{:vȯ2:!!rw:(  :8ɯ= F<(!͎Running BOOT.COM ! 9<,<(͎Submitting BOOT.SUB !͎BOOT.SUB present but no SUBMIT.COM BOOT SUBMIT BOOTSUBMIT COMBOOT SUBBOOT COMðì SJCCP version 1.40 $(C)SJ Research 1984.:O21!"!q חo_g]*"!"C<21*" m$DIRTYPEERA.REN^SAVEUSERLLOADGOVDUfPRINTbOLDRUNRESETVERSmSJCCP version 1.40$ZJ|1*#~ >~*&>\͹* Aborted *$1ԗ2!>":_<2@]J}>>(>]֗2!Ó![~(O  # ~#foy~# ##=e!:] :\=_!~wCOMH>}> >  0Oxy 0_!\@O#~ y͹Syntax error$!\66  6 #6#8*O: >?w33# 8 .( *w# 8 *w#:Է͹Illegal filename$>?(w#+ _A8[8 ,=  =ח2!]~  6?#:\?( 2:@27<=7o&~ O:ط ~ @ > :K>::ط( ~ ܧͧ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:!Z2:E߷ẅ́͊Ͳ>2>2T*CGͻ:ẅ́n>2;O ^DM;}H>"*C ::ddslO s#r:E߷͊:==»y==»*Ww#*"͸*:G#š"͸:!w4!iw:Z!E~=262*C!!~~#~O~G#n,-.‹! w! yG!x͢.:E<ʄ! q!pQ:E<. ʄ$.:E<ʄi6}2ExN! ~态O>G~G!~G} *C!r#r#r ^ͥ_y#x#{s+p+q-*C ͥ!!q#p#w*:BOYG}*MD "ã:!B߾w!>2*C~=2u:B2~2wE:A*C߶w>"!""2B!"!rQQQâ~?ͦ~?rQ*"CQ-Q͜QüQrQ$Q*):B"*)*)Q;*"E:;:A2AQÓQÜQ*C}/_|/*W}_*"}o|g":ʑ*C6:ʑw:2E**E}DQ>26502-Z80BBC ANIMAL BBCANIMAL DAT BBCBASICCOMn BBCBASICTXTg CONVERT COMCRC COMCRCKLISTCRCF-INDEX BBC5F-RAND0 BBC F-RAND1 BBCF-RAND2 BBC? !"#F-RSER1 BBC$F-RSER2 BBC %F-RSTD BBC &F-WESER1BBC'F-WESER2BBC()F-WSER1 BBC*F-WSER2 BBC+,F-WSTD BBC-.MERGE BBC/READ ME  0READDFS BBC1SORT BBC2SORTREALBBC33 . PROGRAM TO CONVERT 6502 BBCBASIC FORMAT FILE ,. INTO Z80 INTERNAL BINARY FORMAT FILE. . R.T.RUSSELL, 04-02-1984 (: 2 7 < ':&85::': \F''141"6502 format to Z80 format converter"'141"6502 format to Z80 format converter"'' P: Z "d"6502-format file:"infile$' ,n infile$,".")=0 infile$=infile$+".DFS" xfin=(infile$) ) fin=0 "File "infile$" not found"' fin<>0 : ""Z80-format file:"outfile$' fout=(outfile$) " fout=0 "Directory full"': :  ."Enter file type (program/data):"type$' type=(type$)&5F ! type<>68 type<>80 11,11  type=68 type=80 :  type=80 program data #0  "; , program *6 #fin<>13 "Not a BASIC program"': @ Jnhi=#fin FT nhi<&80 nlo=#fin:ll=#fin:#fin,l$ nhi=&FF:nlo=&FF:ll=0:l$="" +^ l$,1)=" " l$=l$,2):ll=ll-1: D^A 2h nhi<&80 ll<>(l$)+4 "** Bad program **"' &r #fout,ll: #fout,nlo: #fout,nhi | nhi<&80 #fout,l$  #fin nhi>&7F  #fin binary  ;  binary F%=fin:G%=fout #G%,#F%:#F%  ;  data F%=fin:G%=fout  T%=#F% D T%=&40 i T%=&FF r T%=0 s "** Bad data **"':#G%,T% #F%  ; & i #0A%=#F%:B%=#F%:C%=#F%:D%=#F% #:#G%,D%:#G%,C%:#G%,B%:#G%,A% D#G%,0 N X; b r +lA%=#F%:B%=#F%:C%=#F%:D%=#F%:E%=#F% ?v E%=0 E%=1 "** Underflow **"':A%=0:B%=0:C%=0:D%=0:E%=1 -#G%,A%:#G%,B%:#G%,C%:#G%,D%:#G%,E%-1  ;  s  s$ S%=#F% ! S% N%=1N" T~C K=1  question  A$(K),2)<>"\Q" 'A$=query("Is it "+art(A$(K),3))) 4 A$="Y" "Why not try another one?"'' new  ; " *** , NEW ANIMAL 6 *** @ new GJ "OK, I give up."'"Tell me what animal you were thinking"'"of ",V$ TV$=strip(convlc(V$)) <^ "Please tell me a question that would"'"distinguish "; 'h art(V$);" from ";art(A$(K),3)) r X$:X$=capital(X$) "| X$,1)="?" X$=X$,(X$)-1) 6A$=query("For "+art(V$)+" the answer would be ") S%:s$=(#F%)+s$: $ s$,13) "** Bad string **"' #G%,s$  ((22<<FFPPZZddnnxx&3237 RJP OSFIND \.openout fLD A,&80:JP &218E p.openup zLD A,&C0:JP &218E .try_first_save LD (load_block),HL:PUSH HL PUSH DE:INC DE LD (load_block+2),DE LD (load_block+10),DE EX DE,HL:INC HL:ADD HL,BC LD (load_block+14),HL  load_set_up LD (load_block+8),HL LD (load_block+12),HL LD (load_block+16),HL -LD HL,run_load_entry:LD (load_block+ A$="Y" B$="N"  A$="N" B$="Y" Z1=(A$(0)) A$(0)=(Z1+2) A$(Z1)=A$(K) A$(Z1+1)="\A"+V$ 1A$(K)="\Q"+X$+"\"+A$+(Z1+1)+"\"+B$+(Z1)+"\"  ;  ***  PRINT QUESTIONS  ***  question Q$=A$(K) "C$=query(Q$,3,Q$,"\",3)-3)) &T$="\"+C$ 0X=Q$,T$,3) :Y=Q$,"\",X+1) DK=(Q$,X+2,Y-X-2)) N X; b *** l READ DATA FILE v ***  read % "Just let me refresh my memory" Z=0  #X,A$(Z):Z=Z+1  #X Z=MAX+1 A$(Z-1)=""  #X  ;  :@%=10: 0: 15)"ANIMAL" 2 "Creative Computing Morristown New Jersey"'' ( by Nathan Teichholtz & Steve North 0( from an original idea by Arthur Luehrmann. 52 Modified by Chris Atkinson and Richard Russell. <: ,F =17 T~C ::" at line ";: PMAX=(-P)/40 Z A$(MAX) d "Play 'Guess the Animal'" n: xX=("ANIMAL.DAT") ( X<>0 read I=0 3: A$(I): I N=(A$(0)) : ***  MAIN CONTROL SECTION ***  9 query("Are you thinking of an animal ")="  ***  PRINT NAME OF ANIMAL  ***  print  10*X);A$(I),3); X=(X+1) 4   ;  *** * LIST CONTENTS 4 *** > %H ' "Animals I already know are:" RX=0:I=0 \ I=I+1 f A$(I),2)="\A" print p A$(I)="" I=MAX )z ' "Room for ";((MAX-I)/3);" more." : query("Do you want to save these on disk")<>"Y" :  ***  DUMP FILE IF REQUESTED  *** % "ANIMAL.DAT" *ERA ANIMAL.DAT 2X="ANIMAL.DAT":Z=0: X=0 "Directory full":  # X,A$(Z):Z=Z+1  A$(Z)="" Z=MAX+1 # 0  ; 2 4,\QDoes it fly\N2\Y3\,\Agoldfish,\Asparrow, ; . NOW THE FUNCTIONS ; /$ art(noun$): Indefinite article appender ;. "AEIOUaeiou",noun$,1)) ="an "+noun$ ="a "+noun$ 8; &B strip(name$): Article stripper Lname$=nospace(name$) V AT$,Z ` tRD j Z=Z+1: AT$ t AT$=name$,(AT$)) Z=10 #~ Z<10 name$=name$,1+(AT$)) =nospace(name$) - A ,AN ,THE ,a ,an ,the ,An ,The ,THe ,, ;  nospace(name$) name$=" "+name$  name$=name$,2)  name$,1)<>" " =name$ ;  convlc(name$)  L%,A%,B$  L%=1 (name$) A%=(name$,L%))   A%<97 A%>64 A%=A%+32 B$=B$+(A%): L% =B$ (; 2 capital(name$) < A$ "Fname$=nospace(convlc(name$)) P (name$)<97 =name$ ZA$=((name$)-32) dA$=A$+name$,2) n=A$ x;  query(prompt$)  A$  ' prompt$;: A$:A$=capital(A$),1)  A$="Y" A$="N" =A$ HH H H68 \QDoes it fly\N2\Y3\ \QDoes it live in water\N9\Y8\ \QIs it an insect\Y5\N4\ \QIs it a mammal\Y7\N6\ \QDoes it have black stripes\Y37\N36\ \QIs it yellow\Y19\N18\ \Abat \QIs it a mammal\Y15\N14\ \QIs it an insect\Y11\N10\ \QIs it a mammal\N13\Y12\ \Aant \QDoes it have a long trunk\Y21\N20\ \QDoes it have a pouch\Y27\N26\ \QIs it a fish\N17\Y16\ \QIs it very big\N23\Y22\ \Agoldfish \QDoes it have a hard shell\Y29\N28\ \QDoes it have a red breast\Y25\N24\ \Acanary \QDoes it purr\Y33\N32\ \Aelephant \Awhale \QIs it furry\Y45\N44\ \QDoes it eat fish\Y31\N30\ \Arobin \QDoes it have eight legs\Y39\N38\ \Akangaroo \QDoes it have eight tentacles\N41\Y40\ \QIs its shell almost round\Y35\N34\ \QDoes it quack\Y49\N48\ \Aseagull \QDoes it eat ants\Y47\N46\ \Acat \Alobster \Acrab \QDoes it bite\Y67\N66\ \Awasp \QDoes it have a forked tongue\N43\Y42\ \Aspider \Aoctopus \QDoes it have a nasty smell\Y53\N52\ \Asnake \Aworm \Adolphin \QDoes it build dams\N57\Y56\ \QDoes it bark\N51\Y50\ \Aanteater \Asparrow \Aduck \Adog \Q*×Ä Îòz 4ë2Î221!:6 ,6 ,w, =2:!v":͛6S:":ͪs Acorn BBC BASIC Version 2.20 (C) Copyright R.T.Russell 1983 7{:7!:~0w!":":*:":|( K: -":> Z !872:!8ͧ ͏/|(":9 GK*:|!9ʪ ͎͑ NyʘO*: $r":#RDM(#q#s#r#9 ̓ØANDABSACSADVALASCASNATNAUTOBGETBPUTCOLOURCOLORCALLCHAINCHR$CLEARCLOSECLGCLSCOSCOUNTDATADEGDEFDELETEDIVDIMDRAWENDPROCENDENVELOPEEDoes it have a long neck\Y55\N54\ \Afrog \Atoad \QDoes it have antlers\Y59\N58\ \Agiraffe \Abeaver \Aotter \QDoes it like cheese\Y61\N60\ \Adeer \QDoes it like mud\Y63\N62\ \QCan it talk\Y65\N64\ \Arabbit \Ahippopotamus \Amouse \Aman \Abee \Agnat H,&CA  &FFF4:\ *FX138,0,&CA .not_break JP &100 .error )RST &38:B 255:M "Call to &0005":NOP .osc_inter LD (&FDB0),SP:LD SP,&F280  &F6B7 LD SP,(&FDB0):RET .byte_inter LD (&FDB2),SP:LD SP,&F240  &F88E &LD SP,(&FDB2):RLSEEVALERLERROREOFEORERREXPEXTFORFALSEFNGOTOGET$GETGOSUBGCOLHIMEMINPUTIFINKEY$INKEYINTINSTR(LISTLINELOADLOMEMLOCALLEFT$(LENLETLOGLNMID$(MODEMODMOVENEXTNEWNOTOLDONOFFOROPENINOPENOUTOPENUPOSCLIPRINTPAGEPTRPIPLOTPOINT(PROCPOSPUTRETURNREPEATREPORTREADREMRUNRADRESTORERIGHT$(RNDRENUMBERSTEPSAVESGNSINSQRSPCSTR$STRING$(SOUNDSTOPTANTHENTOTAB(TRACETIMETRUEUNTILUSRVDUVALVPOSWIDTHHIMEMLOMEMPAGEPTRTIMEMi6 ~# (F" * ͱ) C ,(s ~( D (  Q > Z > 7 (::<2:*:Z !W~#Z *:<ЯGN#~#foR Û [:*:R0N ( R8B#^#V":!*:| at line  'R<0=(Z x()T]))7c ~( h>~$(b!(b?(b ~( A~(##I/VN#F#%B>0= U/W~?(!(z>>!z,#m~ ~!:(C!:(<7@&0o~% ~(():##ssing No such Bad  rangevariableOut ofNo  spaceroomMistake,Type mismatch"Not ArraySubscriptSyntax errorEscapeDivision by zeroString too longToo big-ve rootLogAccuracy lostExp)HEX/callArgumentsCan't match  syntaxline #͎ ~(Q#^#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ͅ-ͅ-h-)j <AT]T]͗-c(yAOI!8TER9W( K8I!D98 (ͥ-#x'ͮ-ͥ-,#b'ͮ-'!9Ͷ c(Ͷ x'x'Ͷ <#,=( I.8<<^-0͋-, >.-,˺ɷBB0 J?!o3 >CP/M ErrorO$%3>(X3(>Disk full!!4#(\>X3<3\>X3>X3<\ ?(>Bad name>o33!%>Channel{ȇ_!=7^#Vz> e!4!|q#OͲ4" $#Y4"#(t>Bad string~#`?@#~:+x ~##\~.(" ( (=("(?*(  #| N4y%5~#*(. e(+~ #BBCͲ4~%508:8 A8G0))))_#Ͳ4!6%5( 8,~#(##B .)j8< BB J ~A87?:?0>=<#+-+_͏/#,> ͏/#)>#{{yGͨ/~~ #Ï/!:֍! xĴ,!ŇO ~#fo>!M7!M7nf^V!M7utsr>!M7> >|}7>{}>]lbVI/VU/!M7srut!M7> ~oggoOm>!M7Vux ( #I/!M7>ê !M7Vut##x(I/!M7>ê . .VI/VI/V>y{z}|#%5.( ((~#(~#fo`_4: 64:\={5_*4= -#>\X3< /l 43\~ yX3>Bad command>File exists4ͼ4+ #ͼ4 ȷR>?4 !3\yX3S `_! ~ x> 67{6̀6S :\=v5ABYŚ6CP͚6DIһ5DRIV85ERAS-5ER-5LOAĵ1RENAMG5REG5RESE45SAVi1TYP2*~#:>~Ä>:7> 7~#7 Bad sum>28!g6"9!c6">!>!-?6!_S_z6 !?7w#8!N#(6 [_!; BBC BASIC will run on the BBC Z80 Tube co-processor or Z80 Tube co-processor emulator running CP/M. To enter CP/M insert a suitable CP/M System disk and press - or type: *CPM To run BBC BASIC insert the enclosed disk (or a copy) and type: A>BBCBASIC After a couple of seconds the system will reply: Acorn BBC BASIC Version 2.20 (C) Copyright R.T.Russell 1983 > >>!M7ut66 6>!!M7s6@ 2. MEMORY UTILISATION BBC BASIC (Z80) requires about 16 Kbytes of code space, resulting in a value of PAGE of &3B00. The remainder of the user memory is available for BASIC programs, variables (heap) and stack. Depending on the system configuration, HIMEM can have a value up to &DC00. 3. COMMANDS, STATEMENTS AND FUNCTIONS The syntax of BASIC commands, statements and functions is in most cases identical to that of the BBC Micro version (BASIC 4). The few BBC BASIC (Z80) BBC BASIC (Z80) for the BBC Z80 second processor running CP/M (C) Copyright R.T.Russell 1982-1999 1. INTRODUCTION BBC BASIC (Z80) has been designed to be as compatible as possible with Version 4 of the 6502 BBC BASIC resident in the BBC Micro Master series. The language syntax is not always identical to that of the 6502 version, but in most cases the Z80 version is more tolerant. This version ofdifferences are documented here: CALL CALL sets up a table in RAM containing details of the parameters; the processor's IX register is set to the address of this parameter table. The other processor registers are initialised as follows: A is initialised to the least significant byte of A% B is initialised to the least significant byte of B% C is initialised to the least significant byte of C% D is initialised to the leas Except in the case of a movable string (normal string variable), the parameter address given is the absolute address at which the item is stored. In the case of movable strings (type 129) it is the address of a 4-byte parameter block containing the current length, the maximum length and the start address of the string (LSB first) in that order. Integer variables are stored in twos complement form with their least significant byte first. Fixed strings are storedt significant byte of D% E is initialised to the least significant byte of E% F is initialised to the least significant byte of F% H is initialised to the least significant byte of H% L is initialised to the least significant byte of L% The parameter types are: Code No. Parameter Type Example 0 Byte (8 bits) ?A% 4 Word (32 bits) !A% or A% 5 as the characters of the string followed by a carriage return (&0D). Floating point variables are stored in binary floating point format with their least significant byte first; the fifth byte is the exponent. The mantissa is stored as a binary fraction in sign and magnitude format. Bit 7 of the most significant byte is the sign bit and, for the purposes of calculating the magnitude of the number, this bit is assumed to be set to one. The exponent is st Real (40 bits) A 128 Fixed string $A% 129 Movable string A$ On entry to the subroutine the parameter table contains the following values: Number of parameters 1 byte (at IX) Parameter type 1 byte (at IX+1) Parameter address 2 bytes (at IX+2, IX+3, LSB first) Parameter type ) repeated as often as necessary Parameter address ) ored as an integer in excess 127 format (to find the exponent subtract 127 from the value in the fifth byte). If the exponent byte of a floating point number is zero, the number is an integer stored in integer format in the mantissa bytes. Thus an integer can be represented in two different ways in a real variable. For example the value +5 can be stored as: 05 00 00 00 00 Integer 5 00 00 00 20 82 (0.5 + 0.125) * 2^3 A CALmat documented under CALL; if the fifth byte is zero the value is an integer. Strings are stored as the characters of the string (in the correct order!) followed by a carriage return (&0D). PUT A statement to output data to a processor port. Full 16-bit addressing is available. PUT A%,N% : REM Output N% to port A% USR As with CALL, the processor's registers are initialised as follows: A is initialised to the least significant byte ofL to an address in the &FF00-&FFFF range accesses various OS functions as detailed in section 5. GET This function waits for a character to be typed at the keyboard, and returns the ASCII code. GET can also be used to read data from a processor I/O port; full 16-bit port addressing is available: N% = GET(X%) : REM input from port X% INPUT# The format of data files is different from that used by the BBC Micro, in part to improve compa A% B is initialised to the least significant byte of B% C is initialised to the least significant byte of C% D is initialised to the least significant byte of D% E is initialised to the least significant byte of E% F is initialised to the least significant byte of F% H is initialised to the least significant byte of H% L is initialised to the least significant byte of L% USR returns a 32-bitibility with standard CP/M files. Numeric values are stored as five bytes in the format documented under CALL; if the fifth byte is zero the value is an integer. Strings are stored as the characters of the string (in the correct order!) followed by a carriage return (&0D). PRINT# The format of data files is different from that used by the BBC Micro, in part to improve compatibility with standard CP/M files. Numeric values are stored as five bytes in the fort integer result composed of the processor's H, L, H' and L' registers, with H being the most significant. As with CALL, if the address is in the &FF00-&FFFF range, various OS functions are accessed, as detailed in section 5. 4. RESIDENT Z80 ASSEMBLER The in-line assembler is accessed in exactly the same way as the 6502 assembler in the BBC Micro version of BBC BASIC. That is, '[' enters assembler mode and ']' exits assembler mode. All standard Zilog mnemoni [filespec] List the files which match the (optional) ambiguous filespec. If the filespec is omitted, all .BBC files are listed: *DIR List all .BBC files on the disk *DIR B:*.* List all files on disk B: *DIR *.* List all files on the current disk *DRIVE d: Select drive d as the default drive for subsequent disk operations. *ERA filespec *ERASE filespec Erase (delete) the specified disk file or files. The ecs are accepted: ADD, ADC and SBC must be followed by A or HL. For example, ADD A,C is accepted but ADD C is not. However, the brackets around the port number in IN and OUT are optional. Thus both OUT (5),A and OUT 5,A are accepted. The instruction IN F,(C) is not accepted, but the equivalent code is produced from IN (HL),C The pseudo-ops DEFB, DEFW and DEFM are included. DEFM works like EQUS in the 6502 version. 5. OPERATING SYSTEM INTERFACE The folxtension defaults to .BBC if omitted. *LOAD filespec aaaa Loads the specified file into memory at address aaaa. The load address must be specified. If the extension is omitted, .BBC is assumed. *REN newfile=oldfile *RENAME newfile=oldfile Renames 'oldfile' as 'newfile'. If the extension is omitted, .BBC is assumed. *RESET Reset the disk system (CP/M function 13). This command does not close any files nor does it perform any other housekeeping functlowing resident Operating System ("star") commands are implemented. They may be accessed directly (e.g. *BYE) or via the OSCLI statement (OSCLI "BYE"). Control characters, lower-case characters, DEL and quotation marks may be incorporated in filenames by using the 'escape' character '|'. However, there is no equivalent to the BBC Microcomputer's '|!' to set bit 7. *BYE Returns control to the operating system (CP/M). *CPM Same as *BYE. *DIRion. You should use *RESET after you have changed a disk. *SAVE filespec aaaa bbbb *SAVE filespec aaaa +llll This command saves a specified range of memory to disk. The address range is specified either as start (aaaa) and end+1 (bbbb) or as start (aaaa) and length (llll). If the extension is omitted, .BBC is assumed. *TYPE filespec Type the specified file to the screen. If the extension is omitted, .BBC is assumed. *| comment This is a comment linF, H, L and A registers corresponding to the 6502's P, Y, X and A registers, most significant to least significant. Assuming that the address used is one of the legal OS entry points, the call will be communicated through the Tube to the host processor where it will be executed as normal. The Z80 Tube provides the following entries to the operating system: OSFIND, OSGBPB, OSBPUT, OSBGET, OSARGS, OSFILE, OSRDCH, OSASCI, OSNEWL, OSWORD, OSBYTE, OSCLI at &FFCE to &FFe. Anything following the | is ignored. Any other star commands are passed to the host operating system in the normal way. If you need to pass a star command to the host which happens to have the same name as one of the CP/M command (eg *DIR) then it should be preceded with another star; ie **DIR $ or OSCLI"*DIR $" will cause the host's filing system to set it's directory to '$' rather than result in a CP/M directory listing. CALLs and USRs to addresses in the ranF7. Remember that calls to the filing system entries operate on the host's filing system, not the CP/M filing system. 6. ERROR MESSAGES AND CODES Untrappable: No room RENUMBER space Silly LINE space Sorry Bad program Trappable - BASIC: 1 Out of range 24 Exp range 2 25 3 26 No suchge &FF00 to &FFFF provide access to the machine operating system, as with the BBC microcomputer on its own. In order to achieve compatability with other versions of BBC BASIC, CALL and USR behave differently when addressing this area of memory. The processor's A, H, L and E registers are initialised to the least significant bytes of the integer variables A%, X%, Y% and E% respectively. In the case of USR, the returned 32-bit value is composed of the processor's variable 4 Mistake 27 Missing ) 5 Missing , 28 Bad HEX 6 Type mismatch 29 No such FN/PROC 7 No FN 30 Bad call 8 31 Arguments 9 Missing " 32 No FOR 10 Bad DIM 33 Can't match FOR 11 DIM space 34 FOR variable 12 Not LOCAL 35 13 No PROC 36 No TOY,a3wNE"~_S P/BZnܻJ)Ez\[Җg"J7ADXWhS][KEP0,otD@w9"-jh@ Ha7oqUH-iLOu9Θ/}'w' <[I j`{ SZSul_PsT BPt7g ?8 AAТ$,cڝZy&YКnyh8:WɧLUPDbƠ]Dq`*~ێ5SVGPQ{df؞Jq@D .PUDG2>wa'VcBS{nY <-͒e@c½ 14 Array 37 15 Subscript 38 No GOSUB 16 Syntax error 39 ON syntax 17 Escape 40 ON range 18 Division by zero 41 No such line 19 String too long 42 Out of DATA 20 Too big 43 No REPEAT 21 -ve root 44 22 Log range 45 Missing # 23 Accuracy lost Trappable - OS: 190 Directory ful_ʦj4`_e;X2SeL6%ٞI-QC VдˏhPNJ''8v YƧd}:$k bH.6)H,/2 )[Z`x `F؀4gӞihc{z,ÑQ)4k V0SAw(>xO,9tq`kRZ:%-|~WCjِ~Six(?W~4GU!$f i^'?LKO)uk4ȴgsL\mq6al 214 File not found 192 Too many open files 222 Channel 196 File exists 253 Bad string 198 Disk full 254 Bad command 200 Close error 255 CP/M error 204 Bad name  ?z:Wwf:Zd7\`{"f3~]1&7QǂmѬXKBT^)wd|tp\R]uҮRѧ>sVAV!B^DDñpOO*;-4X1ȭ)xAho}jvzaf1RvP^r-]pZ~wvn.vu1v ! !" CONVERT Version 2.3 :] ‘ CONVERT converts between BBC BASIC internal format (.BBC ) and ASCII (.BAS). Its options are as follows: CONVERT Prints this description. CONVERT filename.BBC Converts from BBC BASIC internal format to ASCII. CONVERT filename.BAS Converts from ASCII to BBC BASIC internal format.  !\$ e!( ͽ v ʶ " MC½ ͈ !6 ~#Ľ ~( 'R<0=(Ľ x()T]))7!~0:#)T]))_~$%(0:?A[?_{?#~ 0˩˙ (,(G8˙" ?a(ˡͥ|Ī ( *(80@( ( (8& ! ! :v Gv W˲xGov W˲xg6#zG{Tw#{?@w#z?@w# >b < Close errorZ >b Z >b g(3 Sorry - file protected>ͽ ǯͽ >ͽ >ͽ ! 4 !6 F v ( (( > w#([ !6 ͥ|[ " 7R6 6 R }ͽ }ͽ |ͽ !6 ~ͽ ~# M Line too long - abort. ** Line number added ** * # ** Line number out of sequence ** ɀANDABSACSADVALASCASNATNAUTOBGETBPUTCOLOURCOLORCALLCHAINCHR$CLEARCLOSECLGCLSCOSCOUNTDATADEGDEFDELETEDIVDIMDRAWENDPROCENDENVELOPEELSEEVALERLERROREOFEORERR Disk full\>b 6< File not found >b >b 6< Directory full>b OF \!6 N  ~ ˹q End of file - abort> ͽ > N ! w ˹q~>ͽ  ~# _>b +fY #ja9 cح,gOV9 nJEt`gIwO "j!Pexߕ}.GˑV]:ڴH=_g-?Ty{WAzjgAuHtH,z;-g!my@5àkR:DdgspQTYCu{*ɞ-T/×?]]Np 䍅$Lj3LuCVVw!E`BXa^{{8^IAzk9u"{=1 wX2>}g<_͔a[h ^uIk?g涚i8*^fo{`e;)9CRC.COM 6.5 14/09/86CRCKLIST???CRCKFILE???-CATALOG???!9" 1,ͫ CRC Ver 6.5 CTL-S pauses, CTL-C aborts :] ¹>2f 2_ ͫ ++ Searching for CRCKLIST file ++]! Ͱʖͫ ++ Searching for CRCKFILE file ++]!# Ͱʖͫ ++ Searching for -CATALOG file ++]!. Ͱ·e·! q‰>.‰#|‰Y‰)‰Ỳ̀gK#Y*Y 3-:f --e·?!  ')V'! 3ÖÖͫ DONE Quantity of file CRC that matche+|S42(%Y Z 4CȂV W(ȳEX;Ob0ddD3="=le RIG!qc\t֋^GHY"u0≅"8;=_ADac'ӬO`MR' 4W!&(0E F&U)GgBo\IטA9V6 u1;kπ-sq=.06(K|jA'yV)7J+=LJ(vZn.qIQEpZ3N%/ŃRiqnؾE-zG4P)F;ޓqz(X}\r &'MD(n#T:MC`7* C6˳tT7.F9H5wS8Ih0R(Pd - :[ :\ Hͫ Quantity of file CRC that did not match - :\ :] ʁͫ Quantity of lines failed parse test - :] :^ ʴͫ Quantity of file(s) not found - :^ * >2e :m2_ F28 2D 2X ! " ! " !" 8 8 <ͫ Directory full÷1,M h!e !]J !eS ͫ --> FILE: XXXXXXXX.XXX CRC = Á:e ͫ File not found:_ F·8 <¯ͫ Cannot close CRCFILE8 ͫ ++ ABORTED ++>:_ F4* }" > 8 <ͫ CaWƸSTu,MY3CVT/Wev:2Ö98w4T LD3m+TkZsߦmlcd#E"#x1_(by29n"5kχnKc~arQ2s6b 2'Fx] V;c%*nH8Ǵȥ pBQ0]nXDz2`yrV8^/kθ]eouxL _>bH61 h#@ )ħ;ѩ= .KRA$2y oFN@AՂ[XƖt,grX =@ќɪ ?0nnot close CRCFILE !8   w# &ͫ DONE* * * }|ڙ!" * {zҋ* 8 …* " W* " !" * * }>* #" :\2\<2e M |2\ͫ File not found. ͫ Checking with file - ! ~QͿ #E͸ ͸ 2[ 2\ 2] 2^ ! 2 C§: :f 7ͫ *** No CRC Files found ***>  w#: <2 Pl: e6ͫ Cannot parse string ! ~Ϳ #͸ !  >  Wy 0Ϳ 0zCRCKLISTCRCsk fullÁ!CRCKLIST$$$Tpr?ԟUVMzȯyXoDP W%V{rps յz1|J?%!gCHR,C904ضp 1"d|cEev; EEHb^ŎW=l eڿYbL>y:epz0!a1PshhˀHp AѰcVw K̸̊U$={4hy/瑘cq7J o\%(g_($$ <p{y>?=J`I AD:ᨗ> |.^T@WTːD:`᭘.vT?'\s; 6 #6^#6! ~ Ϳ #!] 4ø #x'] #e w~VͿ #J>2e ͫ - M ҃ͫ File not found !^ 4z :c G:` µ:b G:a µͫ *Match* 2f ![ 4ͫ <-- is, was --> :b ͗ > Ϳ :c ͗ ͸ 2f !\ 4<ͤ2b ~ ͫ Not a space between CRC values <#ͤ2c G"Y ͒͒= # 2~.#͒T # I~ b #~ b b|̀.̀~0ڏ:ҏ#0~!ڡҡ#AʹOʹ~00  #ɷ\<ͫ ++ OPEN FAILED ++z !"` !&ݼ>y@kH~&ҺA~ejãUEWWVUгsJ;CM޸a3I: ;<$vtoƥ-ߧNjTwFH 5iYr;󚨸I1ucνT# ;ߑt հy{V>KsR yC^ ׺V@3/f4*kq JT7ֿWfYT\PdMGoEU-ebuFBwPX !x GHO3d"Y {➶d!IRUmw0(u:UEh2unNn{;݌biO_?`}XⓍٿO(+}-$IҀV@XEid`ѲɻH)*nWd<ݛ VIyW8 d)i7 g~| xM> u!KBR۠r B`8B_Q!HJ\ JT<0h,{S5Iے@[f" * |7   ʁ\E !~2d #" }  ] :a ͗ > Ϳ :` ͗ ͫ ++ FILE READ ERROR ++ <*` ):d oғ |g}o"` ͠ Ɛ'@'ÿ ~Ϳ #~¬ > Ϳ > _ :_ F{* * }|= !" * {z/ * 8  * " ͫ Disk fullÁ!" * * #" 2h2|:e ~ !\~2s g  \æ !s \ \!g \ \<7=Ɓo&t  ] 2h2|2e ~$#~# x d  0ÿ BUĔBk_#|#bz'9JLs˖$|.LQ6Y&77k`.0jɧ@-@獥<"cb$Cx XӾwo0<(tvX.ݖE]* RTOJ_1Htb%Tλnk!ezx p"iEm1p\ʥ_:U} 66ib1WŹ7dʙ}ШPqCX@F:䃚Ekql^UHQ^,(8Z8ThŒJ[&H+*{+LfD-^a)xxkԀN#\ACG(f;.oe|D.JlxS/?gYI6478lN)%lD #&w&s`_!='aZ@4uR"*V,ȭ'x~!xFxL --> FILE: BBCDIST .MAC CRC = 38 8E --> FILE: BBCBASIC.COM CRC = 65 81 --> FILE: CONVERT .COM CRC = 6F FA --> FILE: MERGE .BBC CRC = 6C 7F --> FILE: ANIMAL .BBC CRC = 53 35 --> FILE: SORT .BBC CRC = 54 C1 --> FILE: SORTREAL.BBC CRC = FA 50 --> FILE: F-RSER2 .BBC CRC = 93 54 --> FILE: F-WSER1 .BBC CRC = 4D E6 --> FILE: F-WSTD .BBC CRC = 64 73 --> FILE: F-WSER2 .BBC CRC = A9 BF --> FILE: F-RAND1 .BBC CRC = 9F 11 --> FILE: F-WESER1.BBC CRC = 1F E1 --> FILE: F-WESdG#ix#C0~E-0iݎ JZ4Dp`k1ΐɤ+9 79? A qhk* ()@+m 7otFґ,Pa=xjٻnB=k\LuG>- 9`}d^K T;wRqP,N{ysaD$!_xv)=`%]B{/{dsO )oWl`AKuŅ- ap&߾!$3et@C0ܐ/񯴟i/!΄) Lv0+|db\XqZKmqdeQ2l `j~WL?-(T)`m<"ܳ\?yӹ??EEwPw%F+WE A$U<߹ݦXt'%)_aM+[I>A`[)&~| k}L&?B@䭛 m%ER2.BBC CRC = 8B 30 --> FILE: F-RSTD .BBC CRC = 35 14 --> FILE: F-RSER1 .BBC CRC = C1 63 --> FILE: F-RAND0 .BBC CRC = 98 C5 --> FILE: F-RAND2 .BBC CRC = B0 98 --> FILE: F-INDEX .BBC CRC = B8 BD --> FILE: READ .ME CRC = 11 E1 --> FILE: ANIMAL .DAT CRC = 08 67 --> FILE: CRC .COM CRC = BC 7B --> FILE: BBCBASIC.TXT CRC = 1F 2AO0w#qSe߅ևme_T pRf3_%v6FqVEnTm pZ5ymc"" name$="DELETE" _delete(i) i=_display(i,name$)  name$=""  : :  LIST IN ALPHABETICAL ORDER  : entry=1   curoff$; * 4 >line_count=0 H R 0,line_count); \_read_data(entry) f_print_data pentry=entry+1 zline_count=line_count+8 temp$=(0) . entry>length line_count>16 temp$<>"" 6_message("Push any key to continue or E to end ")  entry>length ="E"  curoata";55);"Type 1" 5 10);"Search For/Delete an Entry";55);"Type 2" 5 10);"List in Alphabetical Order";55);"Type 3" > 10);"Reorganise the Data File and Index";55);"Type 4";  5,11); 6 "Please enter the appropriate number (0 to 4) "; function$=  clrline$; # function$>"/" function$<"5" function=(function$) " 54,function+5);"<====<<"; &, function tZA,t^B,TVC,dhC 6 function=0 @ J_close_files T #^ "Address Book Files Closed"'' h r: |: n$;  : : ( REORGANISE THE DATA FILE AND INDEX : entry=1 5 0,13);"Reorganising the Data File and Index" ' newdata="ADDRESS.BAK" newindex="NAME.BAK" 6 newdata=0 newindex=0 "Disk Directory Full": #newdata,0 $ ._read_data(entry) 8index(entry)=#newdata B i=2 7 L#newdata,data$(i) V `entry=entry+1 j entry>length tEOFnewdata=#newdata-1 ~#newdata=0 #newdata,EOFnewdata #0 , "Re-naming the Data and Index Files" ' *REN ADDRESS.$$$=A ENTER DATA : flag= temp$="" i=1   _get_data / length=maxrec data$(1)="" flag=: T\B > data$(1)="+" data$(1)="-" _message("Bad Data"): T\B i=_find_place(0,data$(1)) ' i>0 _message("Duplicate Record") ! '"Is this data correct ? "; temp$= :  flag temp$="Y" & flag DbB %0_put_index(i,data$(1),#datanum) : i=2 7 D#datanum,data$(i) N X: b flag l v: :  SEARCH FOR AN ENTRY : i=1   0,11);cteolDDRESS.BAK *REN NAME.$$$=NAME.BAK *REN ADDRESS.BAK=ADDRESS.DTA *REN ADDRESS.DTA=ADDRESS.$$$ *REN NAME.BAK=NAME.NDX *REN NAME.NDX=NAME.$$$ indexnum= "NAME.NDX" datanum= "ADDRESS.DTA" #datanum,EOFdata #datanum=EOFdata+1   : : %( INITIALISE VARIABLES AND ARRAYS 2: <: F: P _initialise Zesc$=(27) dbell$=(7) ncteol$=(5) xcteos$=(4) return$=(13) clrline$=return$+cteol$ curoff$=esc$+"D" curon$=esc$+"C" : 7 The maximum record number, +#indexnum,index$(length),index(length)  #indexnum>EOFindex  index$(length+1)=(&FF) index(length+1)=0  #datanum,EOFdata *#datanum=EOFdata+1 4 >: H: >R WRITE INDEX, MAXREC AND NEW EOF POINTERS AND CLOSE FILES \: f _close_files pEOFdata=#datanum-1 z#datanum=0 #datanum,EOFdata #indexnum=10  i=1 length !#indexnum,index$(i),index(i)  EOFindex=#indexnum-1 #indexnum=0 #indexnum,EOFindex,maxrec #0  : :  WRITE A MESSAGE AT Lmaxrec, is set/read in  PROC_setup/PROC_read_index :  message$(7)  i=1 7  message$(i)  A Name,Phone Number,Address,-- " --,-- " --,-- " --,Post Code :  data$(7)  i=1 7 "data$(i)=30," ") , 6temp$=255," ") @temp$="" J T: ^: h OPEN THE FILES r: | _open_files indexnum="NAME.NDX" datanum="ADDRESS.DTA" 3 indexnum=0 datanum=0 _setup _read_index  : : % SET UP NEW INDEX AND DATA FILES :  _setup  & 0,13);INE 23  :  _message(line$)  x,y $ x= . y= 8 0,23);bell$;line$; B x,y); L V : ` : 'j GET INPUT DATA - LIMIT TO 30 CHAR t : ~ _get_data  i  0,13);cteos$ 2 length=maxrec _message("Address Book Full") i=1 7  10);message$(i);25); temp$  data$(i)=temp$,30)  data$(1)="" i=7    :  : ) FIND AND DISPLAY THE REQUESTED DATA  :  _display(i,name$)  0,12);cteos$ ( i=_find_place(i,name$) :2 i<0 _message("Name Not Known "Setting Up Address Book" maxrec=10 indexnum="NAME.NDX" datanum="ADDRESS.DTA" 6 indexnum=0 datanum=0 "Disk Directory Full": #indexnum,0,maxrec &#datanum,0 &0 index$(maxrec+1),index(maxrec+1) :length=0 Dindex$(0)="" Nindex(0)=0 Xindex$(1)=(&FF) bindex(1)=0 l v: : ( READ INDEX AND LENGTH OF DATA FILE :  _read_index  #indexnum,EOFindex,maxrec ' index$(maxrec+1), index(maxrec+1) index$(0)="" index(0)=0 length=0  length=length+1- Next Highest Given") < _read_data(i) F P _print_data Z =i d : n : %x DELETE THE ENTRY FROM THE INDEX  :  _delete(i)  "Are you SURE ",temp$  0,-1);cteos$;  temp$<>"YES"  i<0 i=-i  i=i length  index$(i)=index$(i+1)  index(i)=index(i+1)   length=length-1   :  :  READ DATA FOR ENTRY i  : " _read_data(i) , PTRdata=#datanum 6 i<0 i=-i @ #datanum=index(i) J data$(1)=index$(i) T i=2 7 ^ #datanum,data$(i) h r #datanum=PTRdtom+1  =i ((22<<FFPPZZddnnxx"ata |  :  :  PRINT data$() ON VDU  :  _print_data  i i=1 7 3 data$(i)<>"" 10);message$(i);25);data$(i)  data$(1)=(&FF) i=7    :  : , PUT A NEW ENTRY IN INDEX AT POSITION i  :  _put_index(i,entry$,ptr) & j 0 i<0 i=-i : j=length+1 i -1 D index$(j+1)=index$(j) N index(j+1)=index(j) X b index$(i)=entry$ l index(i)=ptr v length=length+1   :  : , FIND ENTRY IN INDEX OR PLACE TO PUT IT  :  _find_place(i,entry$)  top,bottom  i<0 i=-i entry$="+" i1 =i-1  entry$="-" i=1 =length  top=length+1  bottom=0  i=(top+1) 2 * entry$<>index$(i) i=_search(entry$)  * entry$=index$(i-1) i=i-1 4 entry$<>index$(i-1) > entry$=index$(i) =i =-i H : R : (\ DO THE SEARCHING FOR FN_find_place f : p _search(entry$) z ' entry$>index$(i) bottom=i top=i " i=(top+bottom+1) 2: round % entry$=index$(i) top=bote$,remark$  name$;" ";remark$ '  :  _modify ( '"(Enter for no change)"'  "Name ",temp$ temp$=temp$,30)  temp$<>"" name$=temp$  "Remark ",temp$ temp$=temp$,50)  temp$<>"" remark$=temp$ #& '"Confirm update record",ans$ 0 _test(ans$) :#fnum,255 D#fnum,name$,remark$ N t (2<FP Z"d$n: h: rosize:wid%=osb(160,10,0)-osb(160,8,0)&FF:hgh%=osb(160,9,0)-osb(160,11,0)&FF:mde%=osb(135,0,0)256: |Bset_ F_RAND0 : ' VERY SIMPLE RANDOM ACCESS PROGRAM (: :2 This program maintains a random access file of names :< and remarks. Each name can be up to a maximum of 30 :F characters long and each remark up to 50 characters. ;P The first byte of the record is set non zero (in fact 6Z &FF) if there is a record present. This gives a 8d maximum record length of 1+31+51=83. (Don't forget n the CRs.) x: : @%=10 temp$=50," ")   0 fnum= "RANDZERO"  fnum=0 fnum= "RAscr: A$,B$:size:A$=132:B$=135:mde%<>7 A$=" ":B$=" " I26::InSc:wid%/4+(ny%>9)+2,"*");" Z80 Disassembler ";wid%-,"*") 0,hgh%-6)A$"RETURN"B$"forward 1"21)A$"+"B$"forward 8"7;A$"DELETE"B$"back 1"7;A$"-"B$"back 8"'A$"L"B$"List d"dd$"y "A$"Q"B$"DUMP/LIST"7; iA$"M"B$"Set Memory address"A$"O"B$"Set code origin"'A$"T"B$"Enter text"8;A$"Y"B$"Enter message "; 8A$"Z"B$"Set machine"4;A$"SPACE"B$"Move past code"; wid%>39 '" N Name display"7"W Address Width S Screen mode"5"0-9, NDZERO" ! fnum=0 "Directory Full": :  " '"Enter record number: "ans$  ans$="0" #fnum:: . ans$="" record=record+1 record=(ans$) #fnum=_ptr(record) _display / '"Do you wish to change this record",ans$ "#fnum=_ptr(record) , _test(ans$) _modify 6 @ J: T: )^ _test(A$) =A$,1)="Y" A$,1)="y" h: r _ptr(record)=record*83 |:  _display  '"Record number ";record' flag=#fnum - #fnum flag=0 "Record not stored": #fnum,nam F_RAND1  SIMPLE DATABASE PROGRAM & Written by R T Russell Jan 1983 (: ;2 This is a simple database program. You are asked for 8< the name of the file you wish to use. If the file :F does not already exist, you are asked to specify the 9P number and format of the records. If the file does 8Z already exist, the file specification is read from d the file. n: x: @%=10   0 7 '"Enter the filename of the data file: "filename$ fnum=(filename$) fnum=0 _setupelds $#fnum,title$(field),size(field) length=length+size(field)+1  field  :  _display  '"Record number ";record' flag=#fnum - #fnum flag=0 "Record not stored":  field=1 fields #fnum,A$(field) ! title$(field);" ";A$(field)  field   :  _modify (  '"(Enter for no change)"' * field=1 fields 4 > title$(field);" "; H ""A$ .R A$="" (11)title$(field);" ";A$(field) \ (A$)<=size(field) f A$<>"" A$(field)=A$ p _readgen base=#fnum: :  " '"Enter record number: "ans$  ans$="0" #fnum:: . ans$="" record=record+1 record=(ans$) #fnum=_ptr(record) _display / '"Do you wish to change this record",ans$ #fnum=_ptr(record) " _test(ans$) _modify , 6 @: )J _test(A$) =A$,1)="Y" A$,1)="y" T: &^ _ptr(record)=base+record*length h: r _setup | "New file." fnum=(filename$) . fnum=0 "Sorry, disk directory full.": 1 "Enter number of fields field #z '"Confirm update record",ans$  _test(ans$) #fnum,255  field=1 fields #fnum,A$(field)  field  ((22<<FFPPZZddnnxx"",$ j7A%=A$,"&FF"):B%=A$,A%,5):B%<&FFCE B%>&FFF9 =A$ tex%=3 A$=A$+" :\ &"+~B% ~%B%=B%-&FFCE:C%=B%+(B%>22)+(B%>25) CB%=(B%3-(B%>27))3-3*(B%=24)+(B%>24 B%<28)-3*(B%=27)-(B%=28) ((ex%1) B$=A$,A%-1) B$=A$+" :\ " nB$=B$+"OS"+"FINDGBPBBPper record: "fields , title$(fields),size(fields),A$(fields)  field=1 fields 1 '"Enter title of field number ";field;": ";  ""title$(field)   6 "Maximum size of field (characters)",size(field) % size(field)>0 size(field)<256  field length=1 #fnum,fields  field=1 fields $#fnum,title$(field),size(field) &length=length+size(field)+1 0 field : D: N _readgen Xlength=1 b#fnum,fields ,l title$(fields),size(fields),A$(fields) v field=1 fiUTBGETARGSFILERDCHASCINEWLWRCRWRCHWORDBYTECLI",(C%3)*4+1,4):B%<>0 B$=B$+"+"+(B%) (ex%1) B$=B$+A$,A%+5) =B$ : Xfile1:o%=O%:"D"dd$"e text file":"File: "f$:ch%=f$:ch%=0 f$" not found":z%=: εa$=get:a$,3)="PC=":z%=par(a$):Ptr%=("&"+a$,4,z%-4)):x%=0::Data%?x%=("&"+a$,z%+1,2)):x%=x%+1:z%=z%+3:a$,z%,1)<>",":Word%=!Data%:O%=Data%-Ptr%:a$;" \ ";DissZ80 a$ ##ch%:#ch%:ch%=0:O%=o%:z%=: : =ݤpar(a$):z%=a$,","):z%0:=z% =a$,":") : 5ݤget:a$=" F_RAND2 : & Written by Doug Mounter - Jan 82 (: %2 EXAMPLE OF A RANDOM ACCESS FILE <: 6F This is a simple inventory program. It uses the /P item's part number as the key and stores: 7Z The item description - character max length 30 'd The quantity in stock - numeric 'n The re-order level - numeric 'x The unit price - numeric 7 In addition, the first byte of the record is used 8 as a valid data flag. Set to 0 if empty, D if the 3 record has been dele":a$=a$+#ch%:a$,1)<" ":=a$,a$-1)  : Tfile2:"D"dd$"e object file":"File: "f$:ch%=f$:ch%=0 f$" not found":z%=: 7"Start addr: &"a$:a$="" ADDR%=0 ADDR%=("&"+a$) (p%=0:o%=O%:z%=0:#ch%=p%::data%?z%=#ch%:z%=z%+1:#ch% z%>7:O%=data%-ADDR%:num%=line(ADDR%):p%=p%+num%:ADDR%=ADDR%+num%:#ch%:#ch%:ch%=0:O%=o%:z%=: 2: < Disassembly routines: F InitZ80 P Data% 4 Z d: n3ݤalu(A%)="ADDADCSUBSBCANDXOROR CP ",A%*3+1,3) x3ݤrot(A%)="RLCRRCRL RR SLASRASLSSRL",A%*3+1,ted or V if the record is valid. 0 This gives a MAX record length of 47 bytes , (Don't forget the CR after the string) : : _initialise !inventry=_open("B:INVENTRY")    5,3);"If you want to:-"' + 10);"End This Session";55);"Type 0" 3 10);"Amend or Create an Entry";55);"Type 1" = 10);"Display the Inventory for One Part";55);"Type 2" =" 10);"Change the Stock Level of One Part";55);"Type 3" @, 10);"Display All Items Below Reorder Level";55);"Type 4" <63) ݤr(A%)="BCDEHLFA",A%+1,1) >ݤdrg(A%)="BCDEHLSPIXAFIY",(A%1)+((xy%*4)((A%6)=4)),2) $ݤreg(A%):xy%=0 A%<>6:=r(A%) A%=6 xy%=0:="(HL)" 7A%=6:num%=num%+1:="(I"+(87+xy%)+rel(Data%?2)+")" #(A%6)=4:="I"+(87+xy%)+r(A%)  =r(A%) +ݤrel(A%):A%<128:="+"+A% =(A%-256) Hݤjr(A%):A%<128:="&"+Hex(Ptr%+A%+2,4) ="&"+Hex(Ptr%+A%+2-256,4) Kݤcc(A%)="NZZ NCC POPEP M ",A%*2+1,2-((A% 1) (A%<4))-(1 (A%>5))) : (ݤDissZ80: Word%=data, Ptr%=address & s%,d%,c%,xy%:! 10);"Recover a Previously Deleted Item";55);"Type 5" -@ 10);"List Deleted Items";55);"Type 6" 1J 10);"Set Up a New Inventory";55);"Type 9" T ^ 5,15);bell$; ;h "Please enter the appropriate number (0 to 6 or 9) "; rfunction$= 3| function$>"/" function$<"8" function$="9" function=(function$) ? function dtA,t^B,TjC,DLD,DFE,TDF,djF,d~F,TpG  function=0   "Inventory File Closed" '' #inventry  : :  AMEND/CREATE AN ENTRY :   to update any more stock levels ? ";  ="N"  $: .: '8 DISPLAY ITEMS BELOW REORDER LEVEL B: Lpartno=1 V ` "j "ITEMS BELOW REORDER LEVEL"' tline_count=2 ~ flag=_getrec(partno,"V") # (flag stockmaxpartno line_count>20 temp$<>"" ; 0,23);bell$;"Push any key to continue or E to end ";   "AMEND/CREATE" partno=_getpartno flag=_getrec(partno,"V") &_display(flag) 0'"Do you wish to "; 9: flag "change this entry ? "; "enter data ? "; *D <>"N" flag=_amend(partno): cteos$ N_write(partno,flag,type)  "CHANGE STOCK" Hpartno=_getpartno Rflag=_getrec(partno,"V") \ f_display(flag) p cteos$; z  0,12);cteol$; ) "What is the stock change ? " temp$ change=(temp$) ( (change)=change stock+change>=0  temp$="" flag=: dhC stock=stock+change _display(flag) '"Is this correct ? "; temp$= :  flag temp$="Y" _write(partno,flag,"V")  return$;bell$; 7 "Do you wantline_count=2 6 @flag=_getrec(partno,"D") J flag D|F T "Part Number ";partno ^ "Description ";desc$' hline_count=line_count+3 r: |partno=partno+1 temp$=(0) 2 partno>maxpartno line_count>20 temp$<>"" ; 0,23);bell$;"Push any key to continue or E to end ";  partno>maxpartno ="E" partno=0  : : 2 DUMMMY RETURNES FOR INVALID FUNCTION NUMBERS :  :  : : * REINITIALISE THE INVENTORY DATA FILE &: 0 D: 0,3);bell$;"Are you saxpartno: =fnum fnum=(name$) ) fnum=0 "Disk Directory Full."!!:  _setup(fnum) =fnum :  SET UP THE FILE  : 5 Ask for the maximum part number required, write 3 it as the first record and then write 0 in to %$ the first byte of every record. . : 8 _setup(fnum) B L 0,12);cteos$;bell$; FV "What is the highest part number required (Max 5000) ",maxpartno ;` maxpartno>0 maxpartno<5000 (maxpartno)=maxpartno j #fnum=0 t #fnum,maxpartno ~ partno=1 maxure you want to set up a new inventory?" BD "You will DESTROY ALL THE DATA YOU HAVE ACCUMULATED so far." GN '"It would be safer to use a new disk in drive B and start a new" X "inventory file."' 4b "If you are SURE you want to do it, enter YES" "" partno=(partno$): DZJ 1F partno=maxpartno partno=0 partno=partno+1 P : Z 35,9);partno;cteol$ ') return$=(13) cteol$=(5) cteos$=(4) clrline$=return$+cteol$ rec_length=47 partno=0 desc$=30," ")  temp$=40," ") * 0 4 >: H: .R OPEN THE FILE AND RETURN THE FILE NUMBER \: 7f If the file already exists, the largest permitted )p part number is read into maxpartno. 9z If it is a new file, file initialisation is carried 2 out and the largest permitted part number is " written as the first record. :  _open(name$) fnum=(name$) $ fnum>0 #fnum,m 6d partno>0 partno   (2<(F2P<ZFdPnZxdnx+A$) A"End address: &"A$: A$="" end%=addr%+&8000 end%=("&"+A$) ?"Address for code address 0000: &"B$: B$<>"" O%=("&"" = , : 6 #inventry,desc$ @ #inventry,stock,reord,price J = T : ^ : 0h CALCULATE THE VALUE OF PTR FOR THIS RECORD r : 2| _ptr(partno)=partno*rec_length+5-rec_length  :  :  AMEND THE RECORD  :  _amend(partno)  clrline$;0,4); ; "Please Complete the Details for Part Number ";partno 4 "Just hit Return to leave the entry as it is"' flag= type="V" ) "Description - Max 30 Chars " temp$ " temp$="DELETE" type="D": =  temp$=temp$,30) " temp$<>"" desc$=t F_RSER : 0 EXAMPLE OF READING A SERIAL CHARACTER FILE (: G2 This program opens a previously written serial file and reads it. <: F: Pphonenos= "PHONENOS" 6Z "File Name PHONENOS Opened as Channel ";phonenos d n x#phonenos,name$,phone$  #phonenos _end  name$,phone$  : _end #phonenos  &;honenosPHONENOSBBC(B%3-(B%>27))3-3*(B%=24)+(B%>24 B%<28)-3*(B%=27)-(B%=28) ((ex%1) B$=A$,A%-1) B$=A$+" :\ " nB$=B$+"OS"+"FINDGBPBBPUemp$:flag= 3 desc$="No Record" desc$="Record Deleted" = ) "Current Stock Level " temp$ %& temp$<>"" stock=(temp$):flag= )0 "Reorder Level " temp$ %: temp$<>"" reord=(temp$):flag= )D "Unit Price " temp$ %N temp$<>"" price=(temp$):flag= X =flag b : l : v WRITE THE RECORD  :  _write(partno,flag,type)  flag  #inventry=_ptr(partno)  #inventry,type & #inventry,desc$,stock,reord,price   :  : DISPLAY THE RECORD TBGETARGSFILERDCHASCINEWLWRCRWRCHWORDBYTECLI",(C%3)*4+1,4):B%<>0 B$=B$+"+"+(B%) (ex%1) B$=B$+A$,A%+5) =B$ : Xfile1:o%=O%:"D"dd$"e text file":"File: "f$:ch%=f$:ch%=0 f$" not found":z%=: a$=get:a$,3)="PC=":z%=par(a$):Ptr%=("&"+a$,4,z%-4)):x%=0::Data%?x%=("&"+a$,z%+1,2)):x%=x%+1:z%=z%+3:a$,z%,1)<>",":Word%=!Data%:O%=Data%-Ptr%:a$;" \ ";DissZ80 a$ ##ch%:#ch%:ch%=0:O%=o%:z%=: : =ݤpar(a$):z%=a$,","):z%0:=z% =a$,":") : 5ݤget:a$="" F_RSER2 : H EXAMPLE OF READING FROM A SERIAL MIXED NUMERIC/CHARACTER DATA FILE (: I2 This program opens a data file and reads numeric and character data < from it. F: ?P When the file is opened its length is read from the first DZ record and used to determine when the end of the data has been Fd reached. A procedure is used to open the file; it sets both the @n file number and the length of the file. In effect it is a "x function returning 2 values. : : 7_open("STATS:a$=a$+#ch%:a$,1)<" ":=a$,a$-1)  : Tfile2:"D"dd$"e object file":"File: "f$:ch%=f$:ch%=0 f$" not found":z%=: 7"Start addr: &"a$:a$="" ADDR%=0 ADDR%=("&"+a$) (p%=0:o%=O%:z%=0:#ch%=p%::data%?z%=#ch%:z%=z%+1:#ch% z%>7:O%=data%-ADDR%:num%=line(ADDR%):p%=p%+num%:ADDR%=ADDR%+num%:#ch%:#ch%:ch%=0:O%=o%:z%=: 2: < Disassembly routines: FInitZ80 P Data% 4 Z d: 3nݤalu(A%)="ADDADCSUBSBCANDXOROR CP ",A%*3+1,3) 3xݤrot(A%)="RLCRRCRL RR SLASRASLSSRL",A%*3+1,3"): Sets both file_num and length stats=file_num EOFstats=EOFfnum 0 "File Name STATS Opened as Channel ";stats   !#stats,name$,age,height,sex$  "Name ";name$  "Age ";age % "Height in centimeters ";height & sex$="M" "Male" "Female"   #stats>EOFstats : " _end ,#stats 6 @: J: >T Open the file and read its length from the first record. D^ Set the file number (stats) and the position of the last valid 4h data byte in the file (eof) - ) ݤr(A%)="BCDEHLFA",A%+1,1) >ݤdrg(A%)="BCDEHLSPIXAFIY",(A%1)+((xy%*4)((A%6)=4)),2) $ݤreg(A%):xy%=0 A%<>6:=r(A%) A%=6 xy%=0:="(HL)" 7A%=6:num%=num%+1:="(I"+(87+xy%)+rel(Data%?2)+")" #(A%6)=4:="I"+(87+xy%)+r(A%) =r(A%) +ݤrel(A%):A%<128:="+"+A% =(A%-256) Hݤjr(A%):A%<128:="&"+Hex(Ptr%+A%+2,4) ="&"+Hex(Ptr%+A%+2-256,4) Kݤcc(A%)="NZZ NCC POPEP M ",A%*2+1,2-((A% 1) (A%<4))-(1 (A%>5))) : (ݤDissZ80: Word%=data, Ptr%=address & s%,d%,c%,xy%:!Die its length-1. r: | _open(name$) file_num=(name$) #file_num,EOFfnum  ave<FFPPZZddnnx i T%=&FF r T%=0 s "** Bad data **"':#G%,T% #F%  ; & i #0A%=#F%:B%=#F%:C%=#F%:D%=#F% #:#G%,D%:#G%,C%:#G%,B%:#G%,A% D#G%,0 N X; b r +lA%=#F%:B%=#F%:C%=#F%:D%=#F%:E%=#F% ?v E%=0 E%=1 "** Underflow **"':A%=0:B%=0:C%=0:D%=0:E%=1 -#G%,A%:#G%,B%:#G%,C%:#G%,D%:#G%,E%-1  ;  s  s$ S%=#F% ! S% N%=1rs ";height sex$=_read & sex$="M" "Male" "Female"   : : > Read a data item from the file. Treat commas and CRs as A data item terminators and Control Z as the file terminator. @" Since we are not interested in reading a record at a time, B, the record terminator CR LF is of no spacial interest to us. 6: @ _read J data$,byte$,byte Tdat$="" ^ hbyte=#compat r byte=&1A #compat: =| (byte=&0A byte=&0D byte=&2C) data$=data$+(byte)  byS%:s$=(#F%)+s$: $ s$,13) "** Bad string **"' #G%,s$  ((22<<FFPPZZddnnxx i T%=&FF r T%=0 s "** Bad data **"':#G%,T% #F%  ; & i #0A%=#F%:B%=#F%:C%=#F%:D%=#F% #:#G%,D%:#G%,C%:#G%,B%:#G%,A% D#G%,0 N X; b r +lA%=#F%:B%=#F%:C%=#F%:D%=#F%:E%=#F% ?v E%=0 E%=1 "** Underflow **"':A%=0:B%=0:C%=0:D%=0:E%=1 -#G%,A%:#G%,B%:#G%,C%:#G%,D%:#G%,E%-1  ;  s  s$ S%=#F% ! S% N%=1te=&0D byte=&2C =data$ +((22<<FFPPdZndnx ,@|(s%)+" "+reg(d%) /ݤz80_C0:d%=5 (s%1)=1:=("FNz80_"+~c%) c%=&CB:=z80_CB "d%=7:="RST &"+Hex(c%&38,2) 9&d%=6 s%<4:num%=2:=alu(s%)+" A,&"+Hex(Data%?1,2) 00d%=6:num%=2:=alu(s%)+" &"+Hex(Data%?1,2) H:(d%3)=1 (s%1)=0:="POP PUSH",(d%4)*4+1,4)+" "+drg(s%-4*(s%>5)) ;Dd%=4:num%=num%+2:="CALL "+cc(s%)+",&"+Hex(Data%!1,4) ;Nd%=2:num%=num%+2:="JP F_RSTD : / EXAMPLE OF READING A COMPATIBLE DATA FILE (: D2 This program opens a data file and reads numeric and character >< data from it. The data is read a byte at a time and the ;F appropriate action taken depending on whether it is a 1P character, a comma, or a control character. Z: d: ncompat=("COMPAT") 2x "File Name COMPAT Opened as Channel ";compat   name$=_read  "Name ";name$ age=(_read)  "Age ";age height=(_read) % "Height in centimete"+cc(s%)+",&"+Hex(Data%!1,4) Xd%=0:="RET "+cc(s%) ,bc%=&C3:num%=3:="JP &"+Hex(Data%!1,4) lc%=&C9:="RET" 3vc%=&D3:num%=2:="OUT (&"+Hex(Data%?1,2)+"),A" 3c%=&DB:num%=2:="IN A,(&"+Hex(Data%?1,2)+")" c%=&D9:="EXX" !c%=&E3:="EX (SP),"+drg(4) !c%=&E9:="JP ("+drg(4)+")" c%=&EB:="EX DE,HL" c%=&F9:="LD SP,HL" ="DIEI",(s%1)*2+1,2) : -ݤz80_CD:num%=3:="CALL &"+Hex(Data%!1,4) 5ݤz80_CB:num%=num%+1:xy%:c%=Data%?3 c%=Data%?1 9d%=c%7:s%=(c%&38)8:c%ssing No such Bad  rangevariableOut ofNo  spaceroomMistake,Type mismatch"Not ArraySubscriptSyntax errorEscapeDivision by zeroString too longToo big-ve rootLogAccuracy lostExp)HEX/callArgumentsCan't match  syntaxline #͎ ~(Q#^#Vz(++7B0@N#V}2:ØO( x  !:>~(#^#Vz(#7Bҗ":=n6Ͳͷ *:[:~(/#N#Fx(q#p# -q#p#++GN $r86#6[:*:Ny(##^# F_WESER1 : E EXAMPLE OF WRITING A TO THE END OF A SERIAL CHARACTER DATA FILE (: F2 This program opens a file and sets PTR to the end before writing < more data to it. F: *P A function is used to open the file. Z: d: "nphonenos=_openend("PHONENOS") 6x "File Name PHONENOS Opened as Channel ";phonenos    "Name ? " name$  name$="" _end  "Phone Number ? " phone$  #phonenos,name$,phone$  : _end #phonenos  : :  Open the fV#":#s#r# > ͱ)DM*:^#V#B^#V#8( Failed at *: S ͼ ͷ ":y2:) program ͪ*:###> }w̓Ø_> iͲ͎_> [:*:RDM!8r1×{:!8( G# ":{:2:ͪ ":( *:|ª !":":1S 1S Ø!W~F#(#~(#~ #~.(( 8~ +xN *:RDMS:[:!9RDM!8ͻ1Ԫ>͎+6+6$*:> N ( +#(i###":*:6ͣ*:":":!l:p6# ~6 6 > FZ xNĬyVĬ~6 ile 'AT END'. : E" PTR is set to the last valid data byte+1 and the file number is H, returned. If the file does not already exist, it is still opened, 6 but PTR is left at 0. @: J _openend(name$) T fnum ^fnum=(name$) #h fnum=0 fnum=(name$): =fnum r#fnum=(#fnum)-128 | last_PTR=#fnum #fnum,dummy$  #fnum dummy$="" #fnum=last_PTR =fnum ave>":";{2:!::: ;2 ;!2D>!:>*:A*:::_7>G{>H7>G#>y>> O7>xF>>*:A F_WESER2 : G EXAMPLE OF WRITING AT THE END OF A SERIAL MIXED NUMERIC/CHARACTER ( DATA FILE 2: I< This program opens a data file, sets PTR to its end and then writes (F numeric and character data to it. P: GZ If the file is being opened for the first time, a dummy length is Ed written as the first record. When the file is closed the first Cn record is changed to the value of PTR. Functions are used to Fx open and close the file. The closing function returns the final , vab: Dl Accept a name from the keyboard and make sure it consists only Cv of spaces and upper or lower case characters. Leading spaces ) are automatically ignored on input. :  _name  name$,FLAG,n  FLAG=  "Name ? " name$  name$="" TBC  I=1 (name$) n=(name$,I,1)) 3 (n=32 n>64 n<91 n>96 n<123) FLAG=  1 FLAG "No funny characters please !!!"  FLAG =name$ :  : J* Accept the age from the keyboard and round to one place of lue of PTR (the length of the file). : D Functions are also used to accept and validate the data before  writing it to the file. : : stats=_open("STATS") 0 "File Name STATS Opened as Channel ";stats   name$=_name  name$="" _end age=_age height=_height sex$=_sex  !"#stats,name$,age,height,sex$ , 6: @ _end 4J "The last byte was written at ";_close(stats) T ^: h: Dr Open the file and, if it exists, set PTR to the end and return decimals. F4 Ages of 0 and less or 150 or more are considered to be in error. >: H _age R age \ f "What age ? " age =150 "No impossible ages please !!!" z age>0 age<150 =(age*10+.5)/10 : : E Accept the height in centimeters from the keyboard and round to F an integer. Heights of 50 or less and 230 or more are considered  to be in error. :  _height  height  ' "Height in centimeters ? " height 4 height<=50 height>=230 D| the file number. If it does not exist, open it, write a dummy < length as the first record and return the file number. :  _open(name$)  fnum,ptr fnum=(name$) 3 fnum>0 #fnum,EOFfnum:#fnum=EOFfnum: =fnum fnum=(name$) #fnum,0 =fnum : : E Write the length of the file to the first record and then close / the file. Return the length of the file. :  _close(fnum)  EOFfnum &EOFfnum=#fnum-1 0#fnum=0 :#fnum,EOFfnum D#fnum N=EOFfnum X: "Verry funny !!!"  height>50 height<230 =(height+.5) : : H$ Accept the sex from the keyboard. Only words beginning with upper B. or lower case M or F are acceptable. The returned string is 8 truncated to 1 character. B: L _sex V sex$,FLAG ` jFLAG= 't "Male or Female - M or F ? " sex$ +~ sex$<>"" sex$=((sex$,1,1)) 95) $ sex$<>"M" sex$<>"F" FLAG= - FLAG "No more sex(es) please !!!"  FLAG =sex$ N GePZZddnnxx F_WSER : 8 EXAMPLE OF WRITING TO A SERIAL CHARACTER DATA FILE (: F2 This program openes a data file and writes serial character data @< to it. The use of OPENOUT ensures that, eaven if the file >#͏/% 88 OGI _ͺ-͏/, ,(>U/) x<=-#͏/zѷG  n;honenosPHONENOSBBCcFRED 0123 23445 DOUG WATTON 882110 NOEL ATTLEBOROUGH 452163 JOHN(?~(_( ~#(#~## ~_(8 xF#8D#+-NORLCEXAFAFRRCRLRRDA'CP/SC7CC?HALvEXEXDEHDENEDIMFRETERETMIMVIM^RRgRLoLDɠCPɡINɢOUTɣLDĨCPĩINĪOUTīLDIҰCPIұINIҲOTIҳLDDҸCPDҹINDҺOTDһBI@REӀSERLRRRRSL SR(SR8POPUSEX(SSUANĠXOҨOҰCиADĀADÈSBØINDEI@OUAJ DJNJCAL& KI!EB9G( 8E,I͏/,(~ ,);\͏/: ͏/#=>( (8'S V~,(U/}!:S #VU/ 0m}G> Z !8~#Z ͏/8~ #͏/"#= +8~, #N ( ### +7bk))!>)#0 = ͏/#>-#m#:(] +*@:!:v(*<:7+#~R ::R*@:"@:w(*<:"<:g(|}(::>Ԇ~# >͆B s - S K> Ɛ'@'s RSREL@]]OP](H(I؆(IBD H I،IASNNPP( IGROAWA_(BC(DEA(B A(D)!!c!!Y!^! $X0F!$-%"!:#!!w!|!"#!-0!+!%"S!h$$ !!!"0 !!E"!H#"#h!)!!/&L&<&&R&&*&!&K'&' '))p)O))(n'_)X'('&H'&' '{))k)J))c(x'Z)b')'v))f)E))U)[(b/[p/lb/lp/2/G#͏/2/ #ʁGx: d/p/=ͺ-{K!9C8͚/&9O~-(+b/p/#ͺ-{K!8Ty(Eoction returns the final value of PTR (the length of the file). : D Functions are also used to accept and validate the data before  writing it to the file. : : stats=_open("STATS") 0 "File Name STATS Opened as Channel ";stats   name$=_name  name$="" _end age=_age height=_height sex$=_sex  !"#stats,name$,age,height,sex$ , 6: @ _end 5J "The final byte was written at ";_close(stats) T ^: h: Er Open the file and write a dummy_>--~7*( /((b/7p/;͏/^b/;p/F%F,F;;,;>FU/-/8#ͅ-ͅ-ͅ-ͅ-ٵo/0>f ,|gI͏/#&(-(+((("(cҁҠ/+:000t.(p% + (G(Nnfnf!&nLځ::o> ## 0!@:O8~#"(  0> ~"#(+>-+.+E>̍+|   Ȑͧ,˼ 1.c(8 D1.'>&1.'&F^V^V80 }ٷO>~# > f| ,˼m|/g}/ length (0) as the first record. | Return the file number. :  _open(name$)  fnum fnum=(name$) #fnum,0 =fnum : : E Write the length of the file to the first record and then close / the file. Return the length of the file. :  _close(fnum)  EOFfnum EOFfnum=#fnum-1 #fnum=0 #fnum,EOFfnum &#fnum 0=EOFfnum :: D: DN Accept a name from the keyboard and make sure it consists only CX of spaces and upper or lower case characters. Leading space F_WSER2 : ? EXAMPLE OF WRITING TO A MIXED NUMERIC/CHARACTER DATA FILE (: E2 This program opens a data file and writes numeric and character D< data to it. The use of OPENOUT ensures that, even if the file 64 n<91 n>96 n<123) FLAG=  1 FLAG "No funny characters please !!!"  FLAG =name$ : : J  Accept the age from the keyboard and round to one place of decimals. F Ages of 0 and less or 150 or more are considered to be in error.  : * _age 4 age > H "What age ? " age |ٴ8->gogoO,-yRR||0-?|"-|E- ( ( # 7ɷ  ͘-͋-͋-ZٷRR͘-ͅ-ͅ-h-)j <AT]T]͗-c(yAOI!8TER9W( K8I!D98 (ͥ-#x'ͮ-ͥ-,#b'ͮ-'!9Ͷ c(Ͷ x'x'Ͷ <#,=( I.8<<^-0͋-, >.-,˺ɷBB0 J?=150 "No impossible ages please !!!" \ age>0 age<150 f=(age*10+.5)/10 p: z: E Accept the height in centimeters from the keyboard and round to F an integer. Heights of 50 or less and 230 or more are considered  to be in error. :  _height  height  ' "Height in centimeters ? " height 4 height<=50 height>=230 "Verry funny !!!"  height>50 height<230 =(height+.5) : : H Accept the sex from the keyboard. Only words beginning witB .)j8< BB J ~A87?:?0>=<#+-+_͏/#,> ͏/#)>#{{yGͨ/~~ #Ï/!:֍! xĴ,!ŇO ~#fo>!M7!M7nf^V!M7utsr>!M7> >|}7>{}>]lbVI/VU/!M7srut!M7> ~oggoOm>!M7Vux ( #I/!M7>ê !M7Vut##x(I/!M7>ê . .VI/VI/V>y{z}|h upper B or lower case M or F are acceptable. The returned string is  truncated to 1 character. $: . _sex 8 sex$,FLAG B LFLAG= 'V "Male or Female - M or F ? " sex$ +` sex$<>"" sex$=((sex$,1,1)) 95) $j sex$<>"M" sex$<>"F" FLAG= -t FLAG "No more sex(es) please !!!" ~ FLAG =sex$ ave<FFPPZZddnnxxշBRRP separated by commas. Each record is terminated by CR LF 0Z and the file is terminated by a Control Z. d: n: ?x Functions are used to accept and validate the data before  writing it to the file. : : 5record$=100," "): Resbe in error. b: l _age v age   "What age ? " age < age<=0 age >=150 "No impossible ages please !!!"  age>0 age<150 =(age*10+.5)/10 : : E Accept the height in centimeters from the keyboard and round to F an integer. Heights of 50 or less and 230 or more are considered  to be in error. :  _height  height  '  "Height in centimeters ? " height 4 height<=50 height>=230 "Verry funny !!!"   height>50 height<230 *=(height+.5) 4erve room for the longest 4name$=20," ") record necessary. It saves 0: on string space. compat=("COMPAT") 2 "File Name COMPAT Opened as Channel ";compat   name$=_name  name$="" _end age=_age height=_height sex$=_sex  3"record$=name$+","+(age)+","+(height)+","+sex$ ,#compat,record$ 6#compat,&0A @ J: T _end ^#compat,&1A h#compat r |: : D Accept a name from the keyboard and make sure it consists: >: HH Accept the sex from the keyboard. Only words beginning with upper BR or lower case M or F are acceptable. The returned string is \ truncated to 1 character. f: p _sex z sex$,FLAG  FLAG= ' "Male or Female - M or F ? " sex$ + sex$<>"" sex$=((sex$,1,1)) 95) $ sex$<>"M" sex$<>"F" FLAG= - FLAG "No more sex(es) please !!!"  FLAG =sex$ Necord$dBPAULINE SMITH,32,153,F only C of spaces and upper or lower case characters. Leading spaces ) are automatically ignored on input. :  _name  name$,FLAG,n  FLAG=  "Name ? " name$  name$="" TfB  I=1 (name$) n=(name$,I,1)) 3 (n=32 n>64 n<91 n>96 n<123) FLAG=  1 FLAG "No funny characters please !!!" & FLAG 0=name$ :: D: JN Accept the age from the keyboard and round to one place of decimals. FX Ages of 0 and less or 150 or more are considered to "d. MERGE UTILITY FOR BBC BASIC n. R.T.RUSSELL, 16-10-1982 x: $ A(1),B(1),C(1),F(1),L(1),A$(1) :   "FILE 1",F1$ F(0)=(F1$)  F(0)=0 "File not found" F(0)<>0 :   "FILE 2",F2$ F(1)=(F2$)  F(1)=0 "File not found" F(1)<>0 :  "OUTPUT FILE",F3$ F3=(F3$) !" F3=0 "Directory full" : ,: 6READ(0):READ(1) @ 7J L(0) ̈́M9 221@:2!o6+6+6!6#6!6#6:G*o .!N6:^*M^!K6!6!6+6' :$::=2K  :ʤ\:ҷ\x'Ͳ:!\͢  :͈'! Ͳ:$: $͈Ͳ!N6' :!Cwͯ !6:^͢c!6{:/>!/H{ͯ :<2Š ::=HҮͯ !6:Ҿ:2 !6::/H͈;!6:> !/> A program using assembler code for a fast string sort. SORTREAL.BBC A program using assembler code for a fast numeric sort. F-????.BBC A set of example programs illustrating file input/output. ANIMAL.BBC An example of a 'learning' program written in BBC BASIC. ANIMAL.DAT The initial data file for ANIMAL.BBC READ.ME This file! To exit BBC BASIC (Z80) type *BYE The Z80 Tube CP/M version of BBC BASIC (Z80) is made available for free download on theHHͯ :!^w:<2:0}:@E}:!S!W6: z!]6:cm!c6:_z!_6l ::,: HHҰͯ : 2ó:E:1:2v!q!*8!*6: >ͦ>ͦ!q:_  !p+q.*   !q*&!p+q*2!p+q*2!p+q*22!p+q*!p+q*!p+q*!p+q*2!p+q* condition that it always be distributed with the above files. BBCBASIC (Z80) and the accompanying files remain the Copyright (C) of R. T. Russell, 1982-2000. Richard Russell, 8th June 2000. Email: richard@rtrussell.co.uk Web: http://www.rtrussell.co.uk/    *}2D" * * *&"!q:UY: Y:ҩ: ʩ:_2ʘ:€!6<:<2!ژ!6 >!]Ҥ; !6:Q::H: !6*M : !6!q:a/>z!This is version 2.20 of BBCBASIC(Z80). The files supplied are as follows: BBCBASIC.COM The BBC BASIC (Z80) interpreter for Tube CP/M systems. BBCBASIC.TXT A plain text documentation file for BBC BASIC (Z80). CONVERT.COM A utility for converting .BBC files to/from .BAS files. CRC.COM A program to test the integrity of the supplied files. CRCKLIST.CRC The data file for CRC.COM. MERGE.BBC A BBC BASIC program for merging program files. SORT.BBC /H:_2:!q:A/>Z!/H8: 2::=O>m:W!Q} Hmd>9>!6:2*M!E ^#V͎ڗO **~2*#"m2m͖ 2m!6m!6m!6 m2mͯ m!62m!62m!62m!62m'2:2:TҒ:2!6*ME:2::^Ҳ:<22ý: 2:} >ͯ :i:2:d*M:[ ÷:S:QHI:N<22: H@"2Í202O> c!6Í202O> ڍ*&O*& !sc*&P :w:·>!ұͯ :22:_!6=!6>'!E!4!p+q*0 !r+s+p+q*~$7*>*>H&>*#"*#"> 2:^R͎:!6!6=2:ʙ!6:“H9Ž>!6-e!6ͻ2=2ʺ-é:>>"ͻ2:!!5ͻ2ͬ!\. . Acorn DFS to CP/M file transfer utility ". (c) R.T.Russell, 03-02-1984 : ( 7 b2''141"Acorn DFS to CP/M file transfer utility"141"Acorn DFS to CP/M file transfer utility"' <: F buffer &7FFF P : &85::': Z: (d "Enter DFS drive/filename:"dfs$' )n "Enter CP/M drive/filename:"cpm$' #x cpm$,".")=0 cpm$=cpm$+".DFS" 1 (cpm$) "File "cpm$" already exists."':  &86: "INFO "+dfs$ : 11:A%=135: X=1 39:X,);:A$=A$+((&FFF4)256): ':size=("&"+A$,29,6-:>>!p+q:,!6*DM9:<!6:z 2W!6D*&L :w:<2Ov*:>=20O> ڒ:0:AO>Ҥ::A }}Hͬ!wͻO`idͻV[2O>2:!X!6:!:=O!L NE!4 E E:/.*&L 6$L9k9.Xͯ *KM^020 :020:121'ͳ':²ͯ !G6!"!"7 *M^n/ :a/:H!6:ͯ !&6)) = size>&8000 "Sorry, file too big for this method."': "*LOAD "+dfs$+" "+~buffer * "SAVE "+cpm$+" "+~buffer+"+"+~size  r=:[ ͱ!N5!6:%:<2*6 * 6å!q!6> !d*&I :]>!4A>:<2O* :w:?†!6!q!6?!:ҠgÐ!q*&*~!6:22: :]Hں:A2O>: 2ͯ " . SHELL SORT ON STRING ARRAYS =. (c) Richard Russell 1982, from an idea by Robin Tracy.  sort 300 (exterr=&209 2 pass=0 1 <P%=sort F[OPT pass*2 PLD A,(IX):DEC A:JP NZ,error "ZLD A,(IX+1):CP &81:JP NZ,error )dLD L,(IX+2):LD H,(IX+3):LD (start),HL HnDEC HL:LD D,(HL):DEC HL:LD E,(HL):DEC HL:LD A,(HL):DEC A:JP NZ,error ExLD HL,(start):ADD HL,DE:ADD HL,DE:ADD HL,DE:ADD HL,DE:LD (end),HL #SRL D:RR E:LD HL,&FFFF:EX DE,HL :.rotate SRL D:RR E: A:SBC HL,DE:ADD HL,DE:JR C,rotate 8EX 000 6-character strings..." r A$(999) 6| I=0 999:A$(I)="PQRS"+(64+(26))+(64+(26)): % I=0 14: A$(I),;:: "etc..."  "Sorting the strings..." : sort,A$(0) : . Call assembly language sort routine. % I=0 14: A$(I),;:: "etc..."  "Finished." Aort @~= A~ Anf"A+V+^+~= A*A"A:!:R8))"A*A"A" A~8DE,HL:ADD HL,HL:ADD HL,HL:LD (spacer),HL:EX DE,HL K.loop LD IY,(start):PUSH IY:ADD IY,DE:LD (check),IY:POP IX:LD (item),IX @.newlen LD A,(IX):CP (IY):JR C,short:LD A,(IY):.short LD B,A A A:JR Z,null:LD E,(IX+2):LD D,(IX+3):LD L,(IY+2):LD H,(IY+3) F.next LD A,(DE):CP (HL):JR C,ok:JR NZ,swap:INC DE:INC HL:DJNZ next $.null LD A,(IY):CP (IX):JR NC,ok 4.swap PUSH IX:POP HL:PUSH IY:POP DE:LD B,4:.move JLD A,(DE):LD C,A:LD A,(HL):LD (DE),A:LD (HL),C:INC HL:INC DE:DJNZ move @LD DE,(check):PUSH IX:P( . SHELL SORT ON REAL NUMERIC ARRAYS =. (c) Richard Russell 1984, from an idea by Robin Tracy.  sort 300 (exterr=&209 2 pass=0 1 <P%=sort F[OPT pass*2 PLD A,(IX):DEC A:JP NZ,error ZLD A,(IX+1):CP 5:JP NZ,error )dLD L,(IX+2):LD H,(IX+3):LD (start),HL HnDEC HL:LD D,(HL):DEC HL:LD E,(HL):DEC HL:LD A,(HL):DEC A:JP NZ,error x; CLD HL,(start):ADD HL,DE:ADD HL,DE:ADD HL,DE:ADD HL,DE:ADD HL,DE BLD (end),HL:SRL D:RR E:LD HL,&FFFF:EX DE,HL:.rotate SRL D:RR E ; A:SBC HL,DE:ADD HL,DEOP HL: A:SBC HL,DE:ADD HL,DE:JR C,ok DPUSH HL:POP IY:LD DE,(spacer):SBC HL,DE:PUSH HL:POP IX:JR newlen 3.ok LD HL,(item):LD BC,4:ADD HL,BC:LD (item),HL :PUSH HL:POP IX:LD DE,(spacer):ADD HL,DE:PUSH HL:POP IY ELD DE,(end):SBC HL,DE:JR C,newlen:LD DE,(spacer):SRL D:LD A,E:RRA 2 &FC:LD E,A: D:LD (spacer),DE:JP NZ,loop:RET =".start W 0:.end W 0:.spacer W 0:.check W 0:.item W 0 ,.error LD A,100: exterr:] 6$P%="Bad sort parameters"+0 @ pass J: T. Test program: ^: +h "Filling 1:JR C,rotate:.loop LD (space),DE GLD H,D:LD L,E:ADD HL,HL:ADD HL,HL:ADD HL,DE:LD (spacer),HL:EX DE,HL ELD IY,(start):PUSH IY:ADD IY,DE:LD (check),IY:POP IX:LD (item),IX ; .newlen EEXX:LD L,(IX):LD H,(IX+1):EXX:LD L,(IX+2):LD H,(IX+3):LD C,(IX+4) EEXX:LD E,(IY):LD D,(IY+1):EXX:LD E,(IY+2):LD D,(IY+3):LD B,(IY+4)  fcp:JR C,ok ; 4.swap PUSH IX:POP HL:PUSH IY:POP DE:LD B,5:.move JLD A,(DE):LD C,A:LD A,(HL):LD (DE),A:LD (HL),C:INC HL:INC DE:DJNZ move @LD DE,(check):PUSH IX:POP HL: A:S COPYRIGHT (C) 1979, DIGITAL RESEARCH DISK OR DIRECTORY FULL$FILE EXISTS, ERASE IT$NEW FILE$** FILE IS READ/ONLY **$"SYSTEM" FILE NOT ACCESSIBLE$BAK$$$BAK$$$-(Y/N)?$NO MEMORY$BREAK "$" AT $1mM"m +!8s~1m!f6BC HL,DE:ADD HL,DE:JR C,ok DPUSH HL:POP IY:LD DE,(spacer):SBC HL,DE:PUSH HL:POP IX:JR newlen ; 3".ok LD HL,(item):LD BC,5:ADD HL,BC:LD (item),HL :,PUSH HL:POP IX:LD DE,(spacer):ADD HL,DE:PUSH HL:POP IY >6LD DE,(end):SBC HL,DE:JR C,newlen:LD DE,(space):SRL D:RR E @LD A,D: E:JP NZ,loop:RET J; @T.fcp LD A,H:XOR D:LD A,H:RLA:RET M:JR NC,fcp0: fcp0:CCF:RET C^.fcp0 LD A,C:CP B:RET NZ:SBC HL,DE:RET NZ:EXX:SBC HL,DE:EXX:RET h; =r.start W 0:.end W 0:.spacer W 0:.check W 0:.item W 0 *|.space *M  *!M 1m! 6!6! 6: 2Ebͽ!e:d\::eH2 H҆ͽ:e2!:d2e:!2dû :!I¬!: :H2 ҮX:h2iҐ:!ʍ:!:!H:!H,!"! 6#~ F)ͷX:! X):i!h)9 e:!:h2jO>F L>!":i!jHҼ*"+M ~ ʼͲ!f6!h6!"! 6F!f6:h2k!iҠ:i2k:j2h:k!hҶ9 æ:h2j!!6:j2he:! 4"Ͳ*"M ~2!O :! *+"W 0:.error LD A,100: exterr:] $P%="Bad sort parameters"+0  pass : . Test program: : @%=20 $ "Filling 1000 real numbers..."  A(999) / I=0 999:A(I)=(0.5-(1))*10^(10-(20)): % I=0 14: A(I);:: " etc..."  "Sorting the numbers..." 9 sort,A(0) : . Call assembly language sort routine. % I=0 14: A(I);:: " etc..."  "Finished." @%=&90A DortB~=šC~šCnf"C+V+^+~=šC*C"C:!:R8SCbk))"C*C"C"Cnf!!6e*!M͛ /$^L:!@OL:! 2͑e:b:! L:h<2hb:! b:hO>!hw:! pX:! …!!6  LÊ!!6ûô:!ʛ͑:! ҩ OҸû:!R†!6G>!!!6 :2.t -? >!!6!6s, !6:xB!6OU2!SB!G6:҃!6:G҃*G& ~2!:G<2G_ Qқ=e  b:!-®! 6:!#¿͇;J:!:!!6Lv:!:Jv: *#"͎:f *g&!lq:l $ !h4:l 1 !h6*lM :hB     !h55!mq:m :hO>H2ny} !m6 !o6:n!oښ *mM !o4‚ !pq:p ڪ >:p :p H:p H!qq*qM͛  ^W :q@2q*qMW   !sp+q*r !up+q *tDM !wp+q*v !zp+q*y2x!|p+q*{2x!~p+q*}2x!p+q*!p+q*!p+q*!p+q*2x!p+q*!6   >>! q* &!p+q*! 6:!B)! >w!"&*o"(R :!C:eR :!DKeX :!K\ͷX :!Lj^ :!Pš͎҇! 6F×͢җ:Ç :!T¨F :!U¾: 2 :!V͎"$DMͩ/ *oDMͩ : 2 :! (::H%^bF : ͎H :!Ay! 6*""&*o"(R͎an͢na! 6R :!F”͢ґ Ä :!J $:2$͢ :=2:<2!*& ~2!ü*""I*M*o/!:":7 e !p+q*DM  =? ) !p+q.*DMF -L *9"`!"b!h6!j6!|6.!=\ -x !e:dʥ *eM \R :xʥ @ *dM \, :x \͕ :x - V :e _ :f w : =e !e:d*eM =e : =e =͕ !]6:x>- !"!76!6!6!66*dM  *dM !6:8!*`*;DM \u 2xʻ>!xҨ- *`*;6:82*`"`:<2w!"`9`h*`*;~2*`#"`"&! 6R*I""ë :!M:H| ! 6>F ͛e: <2 O! Hqy d F : 2! 6*#s#r :!N ͢ *o/ Ҧ Ͷn! 6!"&R! 6o$ Î Ç :!S0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*#"*&DMyxC 1*+":4?w+"$""ͷR: —*$"("҈!"&Ô""&*""&$mڸ*o"(**$"($"O26͛*"M :6w͢:6 *FM8 *FM   Oy2F :FY5>>:!02HO> /!";u*)))*) *H& "PҘ! 6+s#ré! 6"DM!>))덑o|g =±^#V) ^#V|g}o _{ozgi`N#Fogo&og_{_z#W H = LIBX$$$$$$$LIB]>p(>Ww#~)!V}x??2/2&x07>x ?O!_7(?~(_( ~#(#~## ~_(8 xF#8D#+-NORLCEXAFAFRRCRLRRDA'CP/SC7Cg_{_z#W H = LIBX$$$$$$$LIB<&40:=rot(s%)+" "+reg(d%) 8="BITRESSET",(c%64)*3-2,3)+" "+(s%)+","+reg(d%) : ݤz80_DD ݤz80_FD -xy%:num%=1:="DEFB &"+Hex(xy%*&20+&BD,2) '  A$:xy%=(c%&20)&20+1:num%=num%+1 >*c%=Data%?1:d%=c%7:s%=(c%&38)8:A$=("FNz80_"+~(c%&C0)) G4A$,4),"X")+A$,"Y")=0:num%=1:="DEFB &"+Hex(xy%*&20+&BD,2) =A$ >: 6Hݤz80_ED:xy%:num%=1:="DEFB &"+Hex(xy%*&20+&CD,2) 0Rnum%=num%+1:c%=Data%?1:d%=c%7:s%=(c%&38)8 \c%<&10:="DEFW &"+Hex(c%*256+&ED,4)+":\ MOS_"+"QUITCLI BYTEWORDWRCHRDCHFILEARGSBGETBPUTGBPBFINDFF0CFF0DFF0EFF0F",c%*4+1,4) &fc%<&40 c%>&C0:num%=1:="DEFB &ED" 4p(c%&C7)=&42:=alu(3-(s%1)*2)+" HL,"+drg(s%) Iz(c%&CF)=&4B:num%=num%+2:="LD "+drg(s%)+",(&"+Hex(Data%!2,4)+")" F(c%&CF)=&43:num%=num%+2:="LD (&"+Hex(Data%!2,4)+"),"+drg(s%) ((c%&C7)=&40:="IN "+r(s%)+",(C)" %(c%&C7)=&41:="OUT (C),"+r(s%) 0(c%&E7)=&46 s%<>1:="IM "+(s%-1-(s%=0)) '(c%&F7)=&67:="RRDRLD",s%*3-11,3) ((c%&F7)=&46:="RETNRETI",s%*4+1,4) c%=&44:="NEG" P OSFILE=&FFDD:OSBYTE=&FFF4 OSFIND=&FFCE:OSBPUT=&FFD4 newblock=&D000:=newblock ( P=0 1 2P%=newblock 9< (!6 &FFFF)<>newblock [OPT P*3:JP !6:] P%=P%+3 F[OPT P*3 P.cpm_flag:B 0 ZB 0:B 0 d\ Switch flags n.new_load_block xLD DE,(&3ADC):\ Get "LD A,(cpm_flag): 1:JP NZ,&86D LD HL,&3800 LD (load_block),HL INC DE:LD (load_block+2),DE LD A,0:LD (load_block+6),A *LD A,&82: OSBYTE:LD (load_block+4),HL LD HL,load_block:LD A,&FF OSFILE LD H,D:LD L,E:\ H(c%&E7)=&47:="LD "+(65-8*(s%=0)-17*(s%=1))+","+(65-8*(s%=2)-17*(s%=3)) G(c%&E4)=&A0:="LDCPINOT",d%*2+1,2)+(73-5*(s%1))+(32+25*(s%2)) num%=1:="DEFB &ED" e JP new_osc+&11:JP new_osc+&E ] "'"Saving Z80 BASIC base code" , tesL=DE= DEC DE:INC HL .load_loop %INC HL:INC HL:LD A,(HL):LD (DE),A %DEC HL:INC DE:LD A,(HL):LD (DE),A %DEC HL:INC DE:LD A,(HL):LD (DE),A CP &80:JR NC,end_load INC DE:INC HL:INC HL:INC HL ".middle_loop ,LD A,(HL):LD (DE),A 6INC DE:INC HL:CP 13 @JR NZ,middle_loop JJR load_loop T.end_load ^LD H,D:LD L,E hLD (HL),&FF:DEC HL rLD (HL),&FF:DEC HL |LD (HL),0:INC HL JP &883 RET .new_save_block \ HL=filename \ DE= (BC=length) #LD A,(cpm_flag): 2:JP NZ,&3172 LD A,&80: OSFIND CP 0:JR NZ,file_output +RST &38:B 214:M "Can't open file":NOP .file_output LD H,A:LD A,13: OSBPUT .save_loop $INC DE:INC DE:LD A,(DE): OSBPUT CP &80:JR NC,save_end DEC DE:LD A,(DE): OSBPUT DEC DE:LD A,(DE): OSBPUT &INC DE:INC DE:INC DE 0.save_mid_loop :LD A,(DE): OSBPUT $DINC DE:CP 13:JR NZ,save_mid_loop NJR save_loop X.save_end bLD A,0: OSFIND lRET vRET : : : : .load_block W &3800 W &3B00:W &0 W &0:W 0 W &0:W 0 W &0:W 0 ] P%=&869:[JP new_load_block:] P%=&7BB:[ new_save_block:] P%=&F8E4:[LD HL,newblock:]  P%=&5:[JP newblock:] ((22<<FFPPZZddnnxxOSBPUT &INC DE:INC DE:INC DE 0.save_mid_loop :LD A,(DE): OSBPUT $DINC DE:CP 13:JR NZ,save_mid_loop NJR save_loop X.save_end bLD A,0: OSFIND lRET vRET : : : : .load_block W &3800 W &3B00:W &0 W &0:W 0 W &0 > TEST 6?(&81+?&80)=13:A$=$&81,$&81+" "," ",2)+1):?&80=0 ("LINE: '"A$"'" "LINE: '"A$"'" "87 *2 ctrl% 32,data&ݼ>y@kH~&ҺA~ejãUEWWVUгsJ;CM޸a3I: ;<$vtoƥ-ߧNjTwFH 5iYr;󚨸I1ucνT# ;ߑt հy{V>KsR yC^ ׺V@3/f4*kq JT7ֿWfYT\PdMGoEU-ebuFBwPX !x GHO3d"Y {➶d!IRUmw0(u:UEh2unNn{;݌biO_?`}XⓍٿO(+}-$IҀV@XEid`ѲɻH)*nWd<ݛ VIyW8 d)i7 g~| xM> u!KBR۠r B`8B_Q!HJ\ JT<0h,{S5Iے@[fBBCBASIC FILEHAND$TEST BBC:FILE4 BBC9$$$ SUBBUĔBk_#|#bz'9JLs˖$|.LQ6Y&77k`.0jɧ@-@獥<"cb$Cx XӾwo0<(tvX.ݖE]* RTOJ_1Htb%Tλnk!ezx p"iEm1p\ʥ_:U} 66ib1WŹ7dʙ}ШPqCX@F:䃚Ekql^UHQ^,(8Z8ThŒJ[ cD:Tpr?ԟUVMzȯyXoDP W%V{rps յz1|J?%!gCHR,C904ضp 1"d|cEev; EEHb^ŎW=l eڿYbL>y:epz0!a1PshhˀHp AѰcVw K̸̊U$={4hy/瑘cq7J o\%(g_($$ <p{y>?=J`I AD:ᨗ> |.^T@WTːD:`᭘.vT?'\s;BR+< hy=SsbR!.q7C`k R Mm5̅H5(v[QD+ty'B36!хS m wtI|O.7gL%rfɷ-mQnv23T3iD^ɾn~1Ki -~FIA (Y!*,zo*#gQq?Dh=#ڦ`g.FWYj