background image

Summary of Contents for CPC6128

Page 1: ......

Page 2: ...ncludes many enhancements that improve the performance of the system and most existing CP M 2 2 software can take advantage of these facilities without conflict The CP M Plus system incorporates a specific terminal emulation feature whereby software that is configured to use screen handling characteristics _similaLto_VT52and Zenith Z19 Z29 terminals can be installed without further customisation G...

Page 3: ... extensive range as weB as the products ofmany independent vendors AMSOFT A division of CONSUMER ELECTRONICS PLC Copyright 1985 AMSOFT AMSTRAD Consumer Electronicsplc Neither the whole nor any part ofthe information containedherein nor the product described in this manual may be adapted or reproduced in any material form except with the prior written approval of AMSTRAD Consumer Electronics plc AM...

Page 4: ...this guide or any incorrect use ofthe product Dr LOGO CPIM CP M Plus GSX and DR Graph are trademarks ofDigital Research Inc Z80 is a trademark ofZilog Inc IBM and IBM PC are trademarks ofInternational BusinessMachines Inc Z19 Z29 and H89 are trademarks ofZenithData SystemsInc VT52 is a trademark ofDigital Equipment Corp AMSDOS CPC6128 CPC664 and CPC464 are trademarks ofAMSTRAD First Published 1985...

Page 5: ......

Page 6: ... as far away from the screen as possible For maximum data reliability the disc drive section ofthe computer should NOT be placed directly in front ofthe monitor but to the right of it Do not place the computer close to any source of electrical interference 6 Always keep disc drives and discs away from magnetic fields 7 Ifyou are operating a 2 drive system keep the interconnecting ribbon cable to t...

Page 7: ...or writtento 7 Always remember thatformatting a disc will erase any previous contents 8 The internal disc interface occupies a small portion ofthe memory that in some cases was used by commercial writers of cassette based software for the AMSTRAD model CPC464 These cassettes will not operate properly with the 6128 Cassette unit Ifyou have any queries regarding cassette based software compatibility...

Page 8: ...P M Introduction to the Bank Manager Chapter 2 BeyondFoundations Writing a simple program Evolution and afterthoughts Using an array Introducing a menu Loading and saving variables to disc Editing and line numbering I idying upa progmm Chapter 3 Complete List ofAMSTRAD CPC6128 BASIC Keywords Description ofnotation used Alphabetical listing ofkeywords comprising Keyword Formal syntax Example Descri...

Page 9: ...AMSDOS and CP M AMSDOS Introduction to AMSDOS Disc directory Filenamesfiletypes and headers Wild cards Summary ofAMSDOS commands Manipulating and copying files Reference guide to error messages CP M Introductionto CP M Bootiiig CP7M Plus Direct Console Mode Transient programs Managingperipherals Working with CP M 2 2 Chapter 6 Introduction to LOGO What is LOGO Dr LOGO procedures Editing programs a...

Page 10: ...c files Keyboard andjoystick Sound Flow ofcontrol Exception handling System primitives System variables System properties Chapter 7 For Your Reference Cursor locations and control code extensions Interrupts ASCII and graphics characters Key references Sound Error messages BASIC keywords Planners Connections Printers Joysticks Disc organisation Resident System eXtensions RSX s Memory CP M Plus Term...

Page 11: ...er 9 At Your Leisure General The world ofmicrocomputers Hardware and software Comparing computers Some popular misconceptions How a computer deals with your instructions The digital world Bitsand bytes __ The BINARY number system The HEXADECIMAL number system CPC6128 Specificfunctions Character set Variables Logic User defined characters Printformatting Windows Interrupts Data Sound Graphics Graph...

Page 12: ...ices Appendix 1 End User Program Licence Agreement Appendix 2 Glossary of Terms Appendix 3 Some Programs For you Bustout Bomber Telly tennis Electric fencing Amthello Raffles Appendix 4 Index CPC6128 Contents ...

Page 13: ......

Page 14: ...d in accordance with the following code Blue Neutral Brown Live As the colours of the wires in the Mains Lead of this apparatus may notcorrespond with the coloured markings identifying the terminals in your plug proceed as follows The wire which is coloured BLUE must be connected to the terminal which is marked with the letter N or coloured Black The wire which is coloured BROWN must be connected ...

Page 15: ... fitted with the larger 6 pin DIN plug into the rear socket ofthe computer marked MONITOR 3 Connect the lead from the front of the monitor which is fitted with the smaller 5V DC plug into the rear socket on the computer marked 5V DC 4 Connect the lead from the back of the computer which is fitted with a small 12V DC plug into the socket at the front ofthe monitor FRONT OF MONITOR REAR PANEL OF COM...

Page 16: ...PC6128 1 Make sure that the MP2 is not plugged into the Mains supply socket 2 Connect the lead from the MP2 which is fitted with the larger 6 pin DIN plug into the rear socket ofthe computer marked MONITOR 3 Connect the lead from the MP2 which is fitted with the smaller 5V DC plug into the rear socketon the computer marked 5V DC 4 Connect the lead from the MP2 which is fitted with an aerial plug i...

Page 17: ...28K Microco put r v3 1985 A strad Consu er ElectronicsLPdlC and Loco otive Softwaret BASIC 1 1 Ready To avoid unnecessary eye strain adjust the control marked BRIGHTNESS until the display is adequately bright for comfortable viewing without glare or blurring ofthe characters on the screen The BRIGHTNESS control will be found on the lower front panel ofthe GT65 or at the righthand side ofthe CTM644...

Page 18: ...hannel Adjust the corresponding tuning control in accordance with the TV set manufacturer s instructions the signal will be approximately at channel 36 if your TV has a marked tuning scale until you receive a picture that looks like Aftstrad 128H MicrocOMPuter v3 1985 AMstrad ConsuMer Electronics PdlC and LOCOMotive Software Lt BASIC 1 1 Ready Tune in the TV set accurately until the clearest pictu...

Page 19: ... disc drive External amplifier speakers Expansion device s details willbe found inpart 2 ofthis Foundation course Finally check that you have observed the following warnings given at the beginning ofthis manual in the sectionentitled IMPORTANT INSTALLATION NOTES 1 2 4 5 6 7 8 OPERATION NOTE 1 Chapter 1 Page 6 Foundation Course ...

Page 20: ...Further information onjoysticks will be found later in this manual The AMSTRAD Lightpen model LP 1 may be connected to this socket Programs may be loaded from or saved to tape instead ofdisc The commands which instruct the computer to direct data to and from disc or tape are explained later in this manual To connect your cassette unit to the 6128 you will require the AMSOFT CL1lead or any other eq...

Page 21: ... be clipped into the cut outs atthe side ofthe printer plug Details ofprinter operation will be found later in this manual A 2nd disc drive AMSTRAD FD1 The AMSTRAD FD1 may be added to the system as a 2nd disc drive The advantages o a2 driVeSystem wiICbe partlcuw rlY apparenCtothe regular CP M user since many programs are configured to run with the library program disc inserted in one drive and the...

Page 22: ...rive system will then be readyto operate Details of2 drive operation will be found later in this manual External amplifier speakers The 6128 may be connected to a stereo amplifier and speakers to enjoy the full 3 channel capabilities ofthe computer The input lead to your stereo amplifier should be terminated with a 3 5mm stereo jack plug which should be inserted into the socket marked STEREO on th...

Page 23: ...onnected to this socket The AMSOFT speech synthesiser amplifier model SSA2 may also be connected to this socket Details ofconnections to the EXPANSION socket will be found in the chapter entitled For your reference Finally check that you have observed the following warnings given at the beginning ofthis manual in the section entitled IMPORTANT INSTALLATION NOTES 6 7 OPERATION NOTES 4 8 Chapter 1 P...

Page 24: ...sc transfer you use only AMSOFT CF2 compact floppy discs Discs made by leading manufacturers however may also be used Insertion Each side of a disc may be used separately A disc should be inserted with its label facing outward from the drive and withthe side that you wish to use face up Foundation Course Chapter 1 Page 11 ...

Page 25: ...avoid accidental erasure ofvaluable programs Various compact floppy disc manufacturers employ different mechanisms for opening and closing the Write Protect hole The operation may be carried out on the AMSOFT CF2 compactfloppy disc as follows To open the Write Protect hole slide the small shutter located at the left hand corner ofthe disc and the hole will be opened A __________ Write Protect hole...

Page 26: ...ofthe disc using the tip ofa ball pointpen or similar object Slide Lever towards middle of disc Write Protect hole OPEN Note that regardless ofthe method employed to open and close the Write Protect hole opening the hole in all cases facilitates protection against overwriting IMPORTANT Always ensure that the Write Protect holes on your master CP M system discs package are open Foundation Course Ch...

Page 27: ...nected the red indicator on the 2nd disc drive Drive B will illuminate constantly It will extinguish when the main disc drive within the computer Drive A is reading or writing to disc Eject Button Pressing in the Ejectbutton allows you to remove your disc from the drive Finally check that you have observed the following warnings given at the beginning ofthis manual in the sectionentitled IMPORTANT...

Page 28: ...orner ofthe keyboard move the position ofthe cursor the small solid block on the screen Press each of the cursor keys in turn and you will see the cursor move about the __ S creen ________ ____ ___ i RETURN The RETURN key enters the information that you have typed into the computer After the RETURN key is pressed a new line is started on the screen Each instruction that you type into the computer ...

Page 29: ...the letters ab c will also be removed SHIFT 1 There are two SHIFT keys Ifyou press either ofthese and hold it down whilst typing a character acapitaUetteLoLupp_eL LsYIDJJQtwilJ l lP il _o1l1 sg n _ Type in the letter e then hold down the SHIFT key and type in the letter e again On the screen you will see eE Now type in a few spaces by holding down the space bar Try the following using the number k...

Page 30: ... key Type in the following while holding down the SHIFT key abcdef123456 On the screen you will see ABCEDF Ifyou wish to return to small lower case characters again press the CAPS LOCK key once again Ifyou wish to ty in caJ italletters and shifted uppeuase_sYnlhokwithouthaving_to constantly hold down the SHIFT key this can be carried out as follows I _CO_N_TR_OL III _ft_t J Holding down the CONTRO...

Page 31: ...u will see how the letter Fis cleared followed by the letters Gand H This key is used to ESC ape from a function that the computer is in the process of carrying out Pressing the ESC key once will cause the computer to temporarily pause in its function and will continue again ifany other key is pressed __Pressing the ES key twice will cause the computer to completely ESC ape from the function which...

Page 32: ... to carry out the program that you have just typed into the memory On the screenyou will see Syntax error in 10 10 IDrintt abe I his me sagetellsyou in which linethe error has occurred and displays the program line together with the editing cursor so that you can correct the mistake Press the cursor right key until the cursor is over the t in pr in t t Now press the CLR key to remove the unwanted ...

Page 33: ...n you may escape from the program by simultaneously holding downthe CONTROL and SHIFT keys then pressing the ESC key This has the effect ofcompletely resetting the computer and may be used whenever you wish to start afresh You do not need to remove any disc from the drive when resetting the computer in this way Ifthe program hasn t loaded study any error message on the screen to see where you went...

Page 34: ...r software disc inthe drive and type in r u1 1 d i s c RETURN After a few seconds your game will be loaded and ready to play Try typing in run d se with Side 4 ofyour master CPIM system discs package inserted into the drive and you will see and hear the CPC6128 continuous Welcome demonstration When you have finished watching Welcome reset the computer using the CONTROL SHIFn and ESC keys The above...

Page 35: ... Here grammar is referred to as Syntax and the computer will always be kind enough to tell you if you ve made a Sy n t a x err 0 r An introduction to AMSTRAD BASIC keywords In the chapter entitled Complete list ofAMSTRAD CPC6128 BASIC keywords you will find a description of all the keywords found in AMSTRAD BASIC We will introduce some ofthe more commonly used BASIC keywords in this section CLS To...

Page 36: ... than one line in the program these line numbers tell the computer the order in which to carry out or run the program When RETURN is pressed the line is stored in the memory until the program is run Now type in 10 pr i n t h eLL 0 RETURN Notice that when RETURN was pressed he LL0 was NOT printed on the screen but instead was entered into the computer s memory as a one line program To carry out tha...

Page 37: ...is that line 20 ofthe program is telling the computer to go to line 10 and carry on processing the program from there To pause the running of this program press ESC once To start it again press any other key To stop it running so that other instructions can be typed in press ESC twice Now type in c L s RETURN to clear the screen To see the word heLL 0 printed continuously on each line one next to ...

Page 38: ...ry completely hold down the CONTROL SHIFT and ESC keys in that order and the computer will reset INPUT This command is used to let the computer know that it is expecting something to be typed in for example the answer to a question Type the following 10 input how oLd are you age RETURN 20 print you Look younger than age yea r soL d RETURN r un RETURN On the screen you will see what is your age Typ...

Page 39: ...ered was Fred you will see on the screen Hello Fred my name s Ronald Although we used n a me in the above example for the name string variable we could have just as easily used a letter for example a Now we will combine the above 2 examples into one program Reset the computer by pressing CONTROL SHIFT and ESC Type in the following 5 c l s RETURN 10 nput what s you r name a RETURN 20 n pu t lwha t ...

Page 40: ...line 5 we typed in c Ls s instead of c Ls In line 10 we typed in you insteadofyo u r In line 30 we forgot to put a space between say and the quotationmarks There are 3 main methods ofediting a program The first is to simply type in the new line again When a line is retyped and entered it replaces the same numbered line currently in the memory Secondly there is the editing cursor method Lasfly thef...

Page 41: ...Now type in the letter r This will appear on the bottom line only The main cursor has moved but the copy cursor stayed where it was Now press the COPy key until the whole of line 10 is copied Press RETURN and this new line 10 will be stored in the memory The copy cursor disappears and the main cursor positions itself under the new line 10 To correct the second mistake hold down SHIFT and press the...

Page 42: ...e a RETURN 20 i n put what i s you rag e age RETURN 30 i fag e 13 the n 60 RETURN 40 i fag e 20 the n 70 RETURN 50 i fag e 19 the n 80 RETURN 60 print So a you are not quite a tee nag era t age yea r soL d end RETURN 70 print So a you are a teenager at age yea r soL d end RETURN 80 print Oh weLL a you are no L0 n e r_ t_ee_n L r t _ g_e yea r i Q 1d RETURN To check this program is correct type Lis...

Page 43: ...0 for a 1 to 10 RETURN 20 pr i nt 0 per a t ion nu mber a RETURN 30 ne xt a RETURN run RETURN You will see that the operation in line 20 has been carried out 10 times as instruct d by the FOR command in line 10 Note also that the value of the variable a is increasedby 1each time The keyword STEP may be used to inform the FOR NEX T command how much the variable should be stepped per operation For e...

Page 44: ...e number The end of the G0 SUB routine is marked by typing in the instruction RE TURN At this point the computer will return to the instruction that immediately followed the GO SUB command which ithadjust obeyed For example in the following program 10 a 2 20 PRINT here is the a times table 30 FOR b 1 TO 12 40 c a b 50 PRINT a x b c 60 NEXT 70 PRINT 80 I 90 a 5 100 PRINT here is the a times table 1...

Page 45: ...a b 290 PRINT a x b c 300 NEXT 310 PRINT 315 RETURN See how much tedious_typing we ve sayed_ours lyeslWellJiesigIlJl L mb l utine are a principal part of computing They lead to structured programs and develop good programminghabits Always bear in mind when writing sub routines that you do not necessarily have to Jump into the sub routine at the same point i e its beginning Asub routine written fro...

Page 46: ...on The answer will be printed as soon as the RETURN key is pressed Addition use SHIFT and keys for plus Type 3 3 RETURN 6 Note that you do NOT type in the equals sign Type 8 4 RETURN 12 Subtraction useunshifted key for minus Type Type 4 3 RETURN 1 8 4 RETURN 4 Multiplication Use SHIFT and keys for multiply means x Type Type 3 3 RETURN 9 8 4 RETURN 32 Foundation Course Chapter 1 Page 33 ...

Page 47: ...RN 1 Type 2Ql 3 RETURN 6 Modulus use MOD to obtain the remainder portion after integer division TY pe ___ Type 1Ql MO D 4 RETURN 2 9 MO D 3 RETURN Ql Square Root To find the square root of a number use s q r The number that you want the square root ofshouldbe typed inside the brackets Type s q r 16 RETURN this means V16 4 Chapter 1 Page 34 Foundation Course ...

Page 48: ...3 squared 3 i 2 3 cubed 3 i 3 etc Type Type 3 i 3 RETURN this means 33 27 8 i 4 RETURN this means 84 4096 Cube Root You can quite easily calculate cube roots by using a similar method to the last e x a m p l e _ To find the cube root of27 3Y27 Type 27 i 1 3 RETURN 3 To find the cube root of125 Type 125 i 1 3 RETURN 5 Foundation Course Chapter 1 Page 35 ...

Page 49: ...You may think this would be calculated as 3 7 2 7 14 8 7 14 56 4 14 In fact it is calculated as 3 7 2 7 4 3 7 14 4 3 7 3 5 10 3 5 6 5 Prove this bytypinginthis calculation as it is written Type 3 7 2 714 RETURN 6 5 You can change the way the computer calculated this by adding brackets The computer will deal with the calculation inside brackets prior to the multiplication etc outside the brackets P...

Page 50: ... useful to use scientific notation The letter E is used for the exponent of numbers to the base 10 You may use either lower case e or upper case E For example 300 is the same as 3xl02 In scientific notation this is 3 E2 Similarly 0 03 is the same as 3x10 2 In scientific notation this is 3 E 2 Try the following examples You can type in 30 10 RETURN 300 or you cantype 3E1 1E 1 RETURN 300 3000 f000 R...

Page 51: ...xplained in a moment The other point worth mentioning here is the importance of correctly naming disc files Cassette filenames generally conform to very loose standards varying greatly in length being at times omitted Not so with discs Disc filenames must conform strictly to CP M standards and will be explained later in this section Formatting discs for use Before writing any data onto a new blank...

Page 52: ...rive within the computer Drive A Type in I cp m RETURN You will find the bar symbol I by holding down SHIFT and pressing the key After a few seconds you will see the following message at the top ofthe screen CP M PLus Amstrad Consumer ELectronics pLc This is a S i 9 non message indicating that the computer is now under the control of the CP M Plus operating system You will also see the letter A to...

Page 53: ...ed an additional disc drive to the system the message will say Two drives found At the bottom ofthe screen you will see the following Copy 7 Format 4 Verify Exit from program This is known as the main DISC KIT menu The numbers in boxes refer to the function keys at the right hand end of the keyboard marked fQl 11 14 and f7 and pressing one ofthese keys takes you to your selectedmenu choice Note th...

Page 54: ...mputer you will see the message GJ Format as Data Any other key to exit menu At this point you should remove your master CP M system disc and insert the disc that you wish to format The side ofthe disc to be formatted should be placed face up irftne drive Now press the Ykey Y for Yes meaning go ahead and format the disc The disc will be formatted tracks 0 to 39 the current track number being indic...

Page 55: ...at with CPIM reset the computer using CONTROL SHIFT ESC Always keep the master copies ofyour CPIM system discs in a safe place as they are literally the key to your system Later in this manual you will be shown how to make working copies ofyour system discs so that you can keep your master copies safely locked away Formatting on a 2 drive system Follow the instructions above selecting the For ma t...

Page 56: ...tion marks This first field usually contains the name ofthe program The second field is optional You can use up to 3 characters but again no spaces or punctuation The 2fields are separated by a dot Ifyou do not specify a second field the system will automatically label it with a token ofits own such as BA Sfor BASIC files or BIN for binary machine code files As an example of saving to disc write a...

Page 57: ...rams may be loaded from disc then run using the commands loa d 11 f i l e name 11 RETURN run RETURN or they may be run directly using the command run 11 f i le nam e11 RETURN Note that protected programs may be run directly only IAandlB If you are operating an additional disc drive you may specify which Drive A or B that you require a function to be performed onby typing in I a RETURN or I b RETUR...

Page 58: ...here are four ways in which files may be SAVEd by the CPC6128 In addition to ordinary BASIC file saving by s ave f i Le name RETURN there are three alternative methods for more specialised purposes ASCII Files sav e f i Le name a RETURN Adding the suffix a instructs the computer to save the program or data in the form of an ASCII text file This method of saving data applies to files created by wor...

Page 59: ...at which to start execution should the file be run as a program ScreenDump This binary save feature allows data from the screen memory to be stored directly onto disc in the form ofa screen dump The contents ofthe screen will be saved exactly as it is seEm using the command save s ern dum p b 491 52 16384 RETURN where 49152 is the starting address of the screen memory and 16384 is the length ofthe...

Page 60: ...on t worry this is just a quick way ofgetting back to the Rea d y message that tells you the computer is waitingfor your next instruction Now type in mod e 0 RETURN You will see that the characters on the screen are now larger Press the number 1 key again and hold it down until two lines are full of 1 so Ifyou count the number of 1 s on a jip e 3_ou will see there are 20 This means that in Mode 0 ...

Page 61: ... all independently of each other The 27 colours available are listed in Table 1 each with their INK colour reference number For convenience this table also appears on the panel at the top right hand side ofthe computer MASTER COLOURCHART Ink Ink Ink No Colour Ink No Colour Ink No Colour Ink 0 Black 9 Green 18 Bright Green 1 Blue 10 Cyan 19 Sea Green 2 Bright Blue 11 Sky Blue 20 BrightCyan 3 Red 12...

Page 62: ...by using tlie command 80 RDERfollowed by the colour number To change the border to white type in border 13 RETURN So far so good Now for the tricky bit When you first switch on or reset the computer PAP ERnumber 0 and PEN number 1 are always automatically selected This does NOT mean that you look up numbers oand 1on the master colour chart a d away you go The important thing to remember is that 0 ...

Page 63: ...p INK number 24 on the master colour chart Table 1 and you will see that the colour listed is bright yellow i e the colour ofthe characters on the screen when you first switch on DEFAULT SETTINGS Ink Colour Ink Colour Ink Colour Paper Pen No Mode 0 Model Mode2 0 1 1 1 1 24 24 24 2 20 20 1 3 6 6 24 4 26 1 1 5 0 24 24 6 2 20 1 7 8 6 24 8 10 1 1 9 12 24 24 10 14 20 1 11 16 6 24 12 18 1 1 13 22 24 24 ...

Page 64: ...the characters on the screen have changed colour The background colour can also be changed using the INK command We know that PAP ER number 0 is selected at switch on so let s change the colour of the INK in PA PER number 0 to green colour number 9 by typing in the command ink 111 9 RETURN Now let s use a different pen altogether Type in pen 3 RETURN Notice how only the colour of the new character...

Page 65: ...changes the colour of all the previous characters typed in with PEN number 1 Type in c Ls RETURN to clear the screen It should now be possible for you to instruct the computer to return to its original colours TElue border and background with bright yellow characters using the 80 RDER PA PER PEN and INK commands See ifyou can do so Ifyou can t then reset the computer using the CONTROL SHIFT and ES...

Page 66: ...K commands have been pre programmed with an extra colour parameter Type in the following mod e 0 RETURN pen 15 RETURN on the screen you will see the word Rea d y flashing between sky blue and pink Now type in paper 14 RETURN cLs RETURN You will now see that in addition to the word Rea d y flashing between sky blue and pink the background PAP ERis also flashing between yellow and blue PEN and PAP E...

Page 67: ... in this manual BASIC keywords will appear in upper case CAPITAL letters This is how keywords appear when a program is LIS Ted by the computer In general it is preferable that you type instructions or programs using lower case small letters since it will help you spot typing mistakes when Ll STing the program because the mis typed BASIC keyword will NOT be converted to upper case For the remainder...

Page 68: ... print n chr n 30 next n run For your reference the range of characters together with their respective numbers appear in the chapter entitled For your reference LOCATE This command is used to reposition the character cursor to a specified part of the screen Unless changed by the l 0 cat e command the character cursor starts at the top left corner of the screen which corresponds to x y co ordinates...

Page 69: ...r Type in mode 2 run Return to mode 1bytyping in mode 1 Now experiment for yourself modifying the L0 cat e and ch r numbers to position various characters anywhere onthe screen Just for example type in Locate 20 12 print chr 240 You will see an arrow inthe centre ofthe screen Note that inthis instruction 20 was the horizontal x co ordinate in the range 1to 40 12 was the vertical y co ordinate in t...

Page 70: ...n to the display frame scanning frequency Ifthat s a bit technical for you justremember that the command should be used whenever you want to move characters or graphics around the screensmoothly This program can be further enhanced to improve the movement by adding some delayloops and byusing a different returning character symbol Type in Lis t Now add the following lines to the program 70 FOR n 1...

Page 71: ...change the mode by typing in mode 0 pLot 320 200 You will see the dot is still in the centre but is now larger Change the mode again and type in the same command to see the effect inmode 2 mode 2 pLot 320 200 The dobs stillin the centre but is now much smaller Plot several dots over the screen in various modes in order to accustom yourselfwith this command When you have finished return to mode 1 a...

Page 72: ...the program to draw a second rectangle inside the first Type in 60 pLot 20 20 70 draw 20 380 80 draw 620 380 90 draw 620 20 100 draw 20 20 110 goto 110 run Again press ESe twice to breakfrom this program MOVE The M 0VE command operates in a similar manner to PLO T in that the graphics cursor is moved to the position specified by the x y co ordinates however the pixel dot at the new graphics cursor...

Page 73: ...ints ofa circle In previous programs we have plotted points with respect to the bottom left corner of the screen Ifwe wanted to position a circle in the centre ofthe screen we would have to plot the centre of the circle at co ordinates 320 200 then position all points of the circle relative to the centre position by adding onthe centre position co ordinates Aprogram to plot a circle would then be ...

Page 74: ...line 60 of this program is NE XT instead of NE XTa It is permissible to simply type N EXT on its own the computer will work out which FOR expression the NE XTis to be associated with In programs where there are numerous FOR and N XT loops however you may wish to add the variable s name after the word NE XTin order to identify the NE XTstatement when studying the program ORIGIN In the preyious prog...

Page 75: ...a TO 36 STEP 1 6 DRAW 19 SIN a 19 COS a 7 NEXT run This time a line is DRA Wn from co ordinate to co ordinate around the circumference ofthe circle Note how the circle is drawn much quicker thanit isplotted Once again observe the effect of removing the DEG command by deleting line 30 then RUNning the program again FILL The FILL command is used to fill an area ofthe screen which is enclosed by draw...

Page 76: ...e what happens when youtype in f iLL 2 The computer has used pen number 2 to FILL the area bounded by the drawn lines and bythe edges ofthe screen Now alter the program by typing in the following lines and see whathappens 50 draw 50 50 60 move 320 200 70 fiLL 3 run You will note that any gaps in the drawnbollhaarieslettne inkIrom tnepen seep through This point is further demonstrated by FI LLing f...

Page 77: ...INK command then specifies the ink colour for that pen which in this case is the same as for the paper i e colour number 1 Finally type in this demonstration program new 10 MODE 0 BORDER 13 20 MOVE 0 200 DRA L6A _2QJ0_ 30 FOR x 80 TO 560 STEP 80 40 MOVE x 0 DRAW x 400 50 NEXT MOVE 40 300 60 FOR c 0 TO 7 70 MOVER 80 0 FILL c 80 MOVER 0 200 FILL c 8 90 MOVER 0 200 NEXT 100 GOTO 100 run The colours o...

Page 78: ... PEN 1 20 m CINT RND 2 MODE m 30 i1 RND 26 i2 RND 26 40 IF ABS i1 i2 10 THEN 30 50 INK 0 i1 INK 1 i2 60 s RND 5 3 0RIGIN 320 100 70 FOR x 1000 TO 0 STEP 5 80 MOVE 0 0 DRAW x 300 DRAW 0 600 90 MOVE 0 0 DRAW x 300 DRAW 0 600 100 NEXT FOR t 1 TO 2000 NEXT GOTO 20 run 10 MODE 1 BORDER 0 PAPER 0 20 GRAPHICS PEN 2 INK 0 0 i 14 30 EVERY 2200 GOSUB 150 40 flag 0 CLG 50 INK 2 14 RND 12 60 b RND 5 1 70 c RN...

Page 79: ...y st np st r st COS Lc st 210 Lc st Lc st 360 r st 220 IF Lc st 360 THEN 180 230 px st np st 1 px st 1 240 py st np st 1 py st 1 250 NEXT st 260 CLS cj REMAIN 1 cj REMAIN 2 270 cj REMAIN 3 INK 1 2 st 1 280 GOSUB 350 290 LOCATE 1 1 300 EVERY 25 1 GOSUB 510 310 EVERY 15 2 GOSUB 550 320 EVERY 5 3 GOSUB 590 330 ERASE cx cy r Lc np px py NEXT 340 GOTO 340 350 cx cx st cy cy st Lc st 0 360 FOR x 1 TO np...

Page 80: ...MOD 360 0 THEN 430 500 RETURN 510 ik 1 1 RND 25 520 IF ik 1 ik 2 OR ik 1 ik 3 THEN 510 530 INK 1 ik 1 540 RETURN 550 ik 2 1 RND 25 560 IF ik 2 ik 1 OR ik 2 ik 3 THEN 550 570 INK 2 ik 2 580 RETURN 590 ik 3 1 RND 25 600 IF ik 3 ik 1 OR ik 3 ik 2 THEN 590 610 INK 3 ik 3 620 RETURN Foundation Course Chapter 1 Page 67 ...

Page 81: ... has 7 parts parameters The first two ofthese must be used the rest are optional The command is typed in as SOU ND channel status tone period duration volume volume envelope tone envelope noise period Itlooks pretty complicated but ifwe analyse each parameter we can soon get to grips with it Let s look at the parameters oneby one ChannelStatus To keep things simple at the moment regard the channel...

Page 82: ...of 20 which is why the note you justheard lasted 0 2 second i e 0 01 multipliedby 20 To make the note last for 1 second a duration of 100 would be be used to make it last 2 seconds 200 would be used Type in 10 sound 1 239 200 run You will hear the note middle clasting 2 seconds Volume This parameter specifies the starting volume ofa note The number is in the range 0 to 15 A volume figure of 0 is m...

Page 83: ...have created a tone envelope with a reference number of 1 and you wish to use it in a SOU NDcommand then where the parameter tone envelope is required type in 1 Creating a tone envelope will be explained shortly Noise Noise is the last parameter ofthe SOU NDcommand A range ofnoise is available by varying the noise parameter between 1 and 3 1 Add a noise parameter of 2 at the end of the SOU ND comm...

Page 84: ... to 0 after each 1 5 Time perStep This parameter specifies the time between steps in 0 01 second hundredths of a second units The range of time per step numbers is 0 to 255 which means that the longest time between steps is 2 56 seconds 0 is treated as 256 Note therefore that the number ofsteps parameter multiplied bythe time per step parameter shouldn t be greater than the duration parameter in t...

Page 85: ...ength oftime during which the volume varied was only 5 seconds but the durati0n parameter in the SOUND command in line 20 was 1000 i e 10 seconds TrY experimenting yourself to see what type ofsounds you can create Ifyou wish to create a more intricate volume envelope the 3 parameters number of steps size ofstep timeperstep mayberepeatedattheendofthe ENV command up to 4 more times to specify a diff...

Page 86: ...56 seconds 0 is treated as 256 Note therefore that the number ofsteps parameter multiplied hy the time per step parameter shouldn t be greater than the duration parameter in the SOU ND command otherwise the sound will finish before all the tone steps have been passed through In such a case the remaining contents ofthe tone envelope are discarded Likewise if the duration parameter in the SO UN D co...

Page 87: ...by typing in I I 10 env 1 100 2 2 20 ent 1 100 2 2 30 sound 1 142 200 1 1 1 run If you wish to create a more intricate tone envelope the 3 parameters number of steps tone period of step time per step may be repeated at the end of the ENT command up to 4 more times to specify a different section ofthe same envelope Try some more variations for yourself Add some noise to the SOU NDcommand and try ad...

Page 88: ... 9 LINE INPUT 9 LIST 9 PRINT 9 WRITE 9 In addition AMSDOS provides a number ofextra commands for disc management These commands are called external commands and are preceded with a bar symbol I You will find the I symbol by holding down SHIFT and pressingthe j key Some ofthe more common external commands that you will use are la Ib I tap e which canbe sub divided into I tap e i n and I tap e 0 ut ...

Page 89: ...always default to disc operation when switchedon or reset To return to disc operationafter I tap e has been specified type in Idisc Alternatively you may for example wish to load in from cassette and save out to disc You may then use the command Itape in This command tells the computer to read data in from cassette but continue to write data outonto disc by default Similarly to read data in from d...

Page 90: ...ater in this manual in the chapter entitled AMSDOS and CPIM Chapter 5 Copying a Whole Disc The entire contents ofa disc can be copied from one to another using the DI SCKIT 3 program on Side 1ofthe CP M system discs package You may use this method to make back up copies of the master system discs themselves Insert Side 1ofthe system disc package into the computer s disc drive and type Icpm After t...

Page 91: ... key number 0 at this point will exit from the DISC KIT programbacktoCP M Direct Console Mode the A prompt We now want to copy a disc so press function key number 7 f7 BEWARE COPYING ONTO APREVIOUSLY RECORDED DISC WILL ERASE ITS CONTENTS Copying on a I drive system Assuming that you are using a i drive system i e you have NOT connected an additional drive you will then see the message Q Copy Any o...

Page 92: ...ormatted or not formatted at all this will be taken care ofduring copying andyou will see a message such as Disc isn t formatted or faulty Goi ng to format whi le copyi ng Di sc wi II be system format or some other similar message depending upon the discs that you are copying between When the computer is again ready for the disc to copy from it will display the message Insert disc to READ Press an...

Page 93: ...nd NEVER close the write protect holes on your master CPIM system discs package Copying on a 2 drive system Follow the instructions above loading the DI SCKIT 3 program from Side 1 then select the Copy optionfrom the main DISC KIT menu by pressing key 17 Atthis point you will receive a further menu Read from A 8 Read from B 5 Exit menu 2 Copying on a 2 drive system means that you do not have to re...

Page 94: ...the screen and ifthe disc to copy onto is not correctly formatted or not formatted at all this will be taken care ofduring copying After copying the following message will be displayed Copy completed Remove both discs Press any key to continue and you must remove BOTH discs before you can perform any further operations You may then repeat the copying process by typing Y or exit to the main DISC KI...

Page 95: ...C KIT menu by pressing any other key Usingthe DISC KIT program on CP M 2 2 If you wish to format copy or verify discs created on or for the CPC664 or CPC464 DDIl which both use CP M 2 2 a DISC KIT program has been provided on Side 4 of your system discs package for this purpose The program is called DI SCKIT 2 and operates inthe same manner as DI SCKIT 3 justdescribed To run DI SCKIT 2 insert Side...

Page 96: ...r CP M system discs package will be found in Chapters 4 to 9 ahead Finally check that you have observed the following warnings given at the beginning ofthis manual in the sectionentitled IMPORTANT INSTALLATION NOTES 5 6 7 OPERATION NOTES 1 2 3 4 5 6 7 9 Foundation Course Chapter 1 Page 83 ...

Page 97: ...pixel dot on the screen The 6128 s memory allows up to six screen images each in a 16K block to be present in the computer s memory at anyone time The BANK MANAGER provides the facilities for you to juggle and display up to five of the six possible screens from BASIC When you first switch on the screen is displayed from a 16K block ofmemory which we will call Block 1 out ofthe first 64K The other ...

Page 98: ... You are now looking at what used to be stored as Screen 2 in Block 2 Ifthe machine hasjustbeen switched on this will probably be a random pattern To clear this pattern type MODE 1 thentype PRINT THIS IS SCREEN 2 ISCREENSWAP 1 2 Your original text reappears If you now repeat the I SeRE ENS W AP 1 2 command you can see that the contents ofthe two screens are being exchanged You can swap the content...

Page 99: ...y one after another end to end The memory that the strings are stored in can be divided into compartments which are called records A record can be of any fixed length between 2 and 255 characters whereas the length ofa string in BASIC varies according to its contents The purpose of a record is to provide standard sized compartments like a set of pigeon holes in which to store the untidy string inf...

Page 100: ... point at the record after the one that has just been read ready for the next operation Reading the contents of a record does not change it so the record can be read over and over again The syntaxfor I BAN KREA 0 is IBANKREAD r a or IBANKREAD r a n where r is an integer variable in which a code is returned giving information about the operation a is a string variable into which the contents of the...

Page 101: ...to insert Side 1 ofyour system discs package and type RUN BANKMAN Now type IBANKOPEN 20 This sets the record lengthto 20 characters and sets the current record to be O Now type a FIRST ENTRY SPACE 9 which sets up a to be exactly 20 characters long Now type r 0 to initialise r Now type IBANKWRITE r a This will write a into the first record record 0 Now type d SPACE 20 IBANKREAD r d 0 PRINT d The fi...

Page 102: ...l be 3 The purpose of this return code is to provide information about the operation just carried out A successful operation will return a positive number indicating a record number an unsuccessful operation will return a negative number indicating an error code There are two possible errors that can be returned by B ANKW RI TE and BANKREAD These are 1 Indicates that the end of the file has been r...

Page 103: ...tionshould also be made to the string into which the record will be read Ifthe string is longer than the length ofthe record then there will be characters left unchanged at the end ofthe string That is why d was cleared filled with spaces before reading record 0into it It is possible to write a string into a record which is too short to accept the complete string Ifthis happens the excess characte...

Page 104: ... M filenames which means that they count as any character An example ofthis would be a STRING 10 0 IFRED IBANKFIND r a 0 This would find the first occurrence ofthe word FRED lyingbetween the eleventh and fourteenth character positions The first ten characters could contain a phone number or some other information that I BAN KFIN Dwould ignore The number of the record in which the string was found ...

Page 105: ...st elementary disc functions i e LOA 0ing SAVEing CA Taloguing etc together with a few AMSDOS CP M and BANK MANAGER commands The chapters that follow look at the more specialised aspects of computing and AMSTRAD BASIC There s an in depth guide to the disc drive section of the unit with sections on AMSDOS and CP M and you will be started offon the road to a new language Dr LOGO from Digital Researc...

Page 106: ... CLear Screen Try not to be afraid of BASIC and you ll soon find yourself enjoying the business of programming as well as the fruits ofyour endeavours Programming can be a very rewarding exercise especially when you re a beginner experimenting with the machine and the language Always remember that as long as you make sure that you don t accidentally write onto your master CP M system discs nothing...

Page 107: ...w the results ofthe program are to be presented Right let s put finger to keyboard We ll start offwith the title atthe beginning 10 REM teLephone book You don t have to put a title in a program but when you start to accumulate quite a few programs it helps to be able to know at a glance which is which Next we know that we want to be able to IN PUT put in a string of characters somebody s name into...

Page 108: ...ue changes and refers to a different element or name in the NAME array We want two arrays one for NAM E and one for TEL each with a dimension of100 elements Before we can start using an array we must declare its DIMensions at the outset We ll overwrite lines 20 and 30 with these statements 20 DIM NAME 100 30 DIM TEL 100 Having established our variables let s write some program that will firstly en...

Page 109: ...me program to PR I NT the information you ve stored firstly in the form ofa list Add 90 FOR x 1 TO 100 100 PRINT NAME x TEL x 110 NEXT Once again the program doesn t know when to stop before reaching the lOOth element ofthe array so let s add 95 IF NAME x THEN 120 120 PRINT list finished Line 9 5 detects whether NAME x is an empty string and I F so THE N stops printing by bypassing lines 100 and 1...

Page 110: ...tored in the program yesterday And what ifyou want to add some more names and numbers to those already there These are all aspects of the program that you have to think about and find solutions for it s what programming is all about As previously mentioned BASIC is kind enough to let you sandwich afterthoughts into the program but a good programmer will have anticipated these problemsbeforehand An...

Page 111: ...ave added all those RE TURN commands above Do you remember what the RE TU RN command does It makes BASIC return from the sub routine to the point in the program immediately following the appropriate GO SUB command so in this case it returns to the instruction after line 38 which means that the program will continue at line 40 the enter info point We don t wantthat to happen so we must add 39 GOTO ...

Page 112: ... 140 FOR x 1 TO 100 150 IF INSTR NAME x SEARCH 0 THEN 180 160 PRINT NAME x TEL x 170 RETURN 180 NEXT 190 PRINT name not found 200 RETURN You ll see that in certain parts of the program we re starting to run out of lines to insert instructions so let s create some more space and tidy things up by RE NU Mberingthelines Type in RENUM LI ST You should now see 10 REM teLephone book 20 DIM NAME 100 30 D...

Page 113: ...the first element ofthe array that it finds to be empty This time we ll use the new command LE Nto tell us the LENgth of the string We ll specify the following I F the LENgth of NAME x is greater than 0 i e if there s already an entry in that element ofthe array THE Njump to line 180 which steps to the NE XTelement in the array Notice again how similar the above instruction in English is compared ...

Page 114: ...he command AUTO 350 which will start AUT Omatic line numberingfrom the required line 350 OPENOUT data 360 FOR x 1 TO 100 370 WRITE 9 NAME x TEL x 380 NEXT 390 CLOSEOUT 400 PRINT data saved 410 RETURN After you have typed in line 410 and pressed RETURN press ESC to stop the AUT Omatic line numbering Now we need to add an extra number to the list of numbers in the 0 N ms GO SUB command in line 100 T...

Page 115: ...oviding a quick method of continuously editing regularly successive program lines Back to the program We ve now added the instructions to save the information to disc so the final main section ofthis program will load the data back from disc ready for use Therefore we must add yet another menu option to the list of numbers in line 100 Edit line 100 again as follows 100 ON ms GOSUB 120 210 270 350 ...

Page 116: ...am 0 unless otherwise instructed we won t use stream 0 for our little window otherwise everything that the program prints will be sent to it Instead we ll specify another stream between 1 and 7 and as you can see we ve chosen 1 The four numbers that follow 1 tell the computer what size the WIN D0 W should be and it couldn t be easier the numbers specify the left right top and bottom edges ofthe wi...

Page 117: ...program as BASIC will not pass to next line until a key is pressed So there it is the finished program Or is it Well you could make it have the facility to amend and delete names and phone numbers to sort the list into alphabetical order to print out the list on a printer or if you re really ambitious to make the program produce the signals to automatically dial the number after you ve typed in th...

Page 118: ... 170 IF INKEY THEN 170 180 GOTO 40 190 FOR x 1 TO 100 200 CLS 210 IF LEN NAME x 0 THEN 260 220 PRINT press RETURN to end input 230 INPUT name NAME x 240 IF NAME x THEN 270 250 INPUT phone TEL x 260 NEXT 270 PRINT no more input 280 RETURN 290 FOR x 1 TO 100 300 IF NAME x THEN 330 310 PRINT NAME x TEL x 320 NEXT 330 PRINT List finished 340 RETURN 350 INPUT find SEARCH 360 FOR x 1 TO 100 370 IF INSTR...

Page 119: ...ITE 9 NAME x TEL x 460 NEXT 470 CLOSEOUT 480 PRINT data saved 490 RETURN 500 OPENIN data 510 FOR x 1 TO 100 520 INPUT 9 NAME x TEL x 530 NEXT 540 CLOSEIN 550 PRINT data Loaded 560 RETURN run Chapter 2 Page 14 Beyond Foundations ...

Page 120: ... given For example the command END takes the form END and you must type in the word END literally Where an item is enclosed in angled brackets for example line number you are NOT required to type the brackets nor the words within them The example above shows youthe type ofdata required in the command For example EDI T line number means that you should type in EDIT HH J Round brackets MUST be typed...

Page 121: ...characters long Numeric data can be either integer or relll Integer data is held in the range 32768 to 32767 and real data is held to a little over nine digits of precision in the range 1 7E 38 withthe smallestvalue above zero approximately 2 9E 39 A numeric expression is any expression that results in a numeric value It may simply be numbers or it may be a numeric variable or it maybe numbers ope...

Page 122: ...Ted The examples shown in this chapter use UPPER CASE since this is how the program will appear when LIS Ted Hence you should enter using lower case as you will be able to spot typing errors more readily since the mis typed keyword will still be displayed inlower case when LIS Ted For a comprehensive guide to AMSTRAD CPC6128 BASIC see the Concise BASIC specificationSOFT 967 Keywords ABS AB S numer...

Page 123: ... timer 0 the default timer has the lowest Each ofthe timers may have a sub routine associated with it Further information concerning interrupts will be found in part 2 of the chapter entitled Atyour leisure Associatedkeywords EVERY REMAIN RETURN AND argument AND argument IF aLan bob AND dog cat THEN PRINT correct ELSE PRINT wrong correct I F bob aLan wrong IF aLan bob wrong PRINT1AND1 1 PRINT0AND0...

Page 124: ...onal line number parameter sets the first line to be generated in case you wish to generate lines from a particular point in the program If the parameter is omitted line numbers will be generated from line 1121 onwards The optional increment sets the number of lines to leave before generating the following line number Ifthe parameter is omitted the line numbers will increase by 1121 each time Ifa ...

Page 125: ...willbe produced in as many digits as are required The unsigned integer expression to be converted into binary form mustyield a value inthe range 32768 to 65535 Associated keywords DEC HEX STR BORDER B0 RDER colour colour 10 REM 729 border combinations 20 SPEED INK 5 5 30 FOR a 0 TO 26 40 FOR b 0 TO 26 50 BORDER a b CLS LOCATE 14 13 60 PRINT border a b 70 FOR t 1 TO 500 80 NEXT t b a run COMMAND Ch...

Page 126: ... space left on the disc is also displayed together with Drive and User identification Cataloguing does not affect the program currently inmemory Associated keywords LOA D RUN SAVE CHAIN CH AI N filename line number expression CHAIN testprog bas 350 COMMAND Loads a program from disc into the memory replacing the existing program The new program then commences running either from the beginning or fr...

Page 127: ... the new program lines PrJtected files S AVEd by p can NOT be loaded and run by CH AI N MER GEing Associated keywords CH AIN DEL ETE LOA D MER GE CHR CHR integer expression 10 FOR x 32 TO 255 20 PRINT x CHR x 30 NEXT run FUNCTION Converts an integer expression in the range 0 to 255 to its CHaRacter tring equivalent using the AMSTRAD character set shown in part 3 ofthe chapter entitled For your ref...

Page 128: ... previously typed input from the keyboard still in the keyboard buffer To see the effect of this command RUN the above program and type in letters when asked to do so Then delete line 50 of the program and RUN again noting the difference Associated keywords INK EY IN KE Y JOY CLG CLG ink LOCATE 1 20 CLG 3 COMMAND CLears the Graphics screen to the graphics paper colour Ifthe ink is specified the gr...

Page 129: ...m window to its paper ink Ifno stream expression is given screenstream i cleared Associatedkeywords CLG INK PA PER WIN 0OW CONT CONT CONT COMMAND CON Tinues program executIOn either after the ESCI key has been pressed twice or after a STOP command has been encountered in the program CON Twill only continue to execute the program ifit has not been altered and ifit is not a protected program Directc...

Page 130: ...null string is returned Associated keywords L0 CAT E cos COS numeric expression DEG PRINT COS 45 0 707106781 FUNCTION Calculates the COS ine ofthe numeric expression Note that DEG and RA D can be used to force the result of the above calculation to degrees or radians respectively Associated keywords AT N DE G RA D SIN CREAL eRE AL numeric expression 10 a PI 20 PRINT CINT a 30 PRINT CREAL a run 3 3...

Page 131: ...the cursor be turned offwhen printing text to the screen Either switch parameter may be omitted but not both If a switch parameter is omitted that particular switch state is not changed Associated keywords L0 CAT E DATA DATA list of constant 10 FOR x 1 TO 4 20 READ name surname 30 PRINT name surname 40 NEXT 50 DATA Hi Lda Ogden Bet Lynch 60 DATA Rita Fairclough Mavis Ri Ley run COMMAND Declares co...

Page 132: ...00 20 DEF FNcLock INT TIME 300 t 30 EVERY 100 GOSUB 50 40 GO TO 40 50 PRINT program was run 60 PRINT FNcLock seconds ago 70 RETURN run COMMAND 0 EFines a FuNction BASIC allows the program to define and use simple value returning functions 0 EF FNis the definition part ofthis mechanism and creates a program specific function which works within the program in the same way that for example COS operat...

Page 133: ...re may be an inclusive range offirst letters such as DEFINT a z Associated keywords DE FREA L DE FSTR DEFREAL DEFREA L list of letter range DEFREAL x a f COMMAND Sets the DE Fault for a variable to type REA L When a variable is encountered without an explicit type marker the default type is assumed This command sets the default for variables with the specified first letter s to type REA L There ma...

Page 134: ...st letter s to type STRing There may be a list offirst letters such as DEFSTR a b c or there may be an inclusive range offirst letters such as DEFSTR a z Associated keywords DEFl NT DEFREA L DEG DEG DEG COMMAND Sets DEGrees mode of calculation The default condition for the functions SIN COS TAN and AT Nis radians DE Gresets BASIC to degrees until instructed otherwise by the commands RA D and NEW C...

Page 135: ...LETE 50 or DELETE which deletes the whole program Associated keywords CH AI N MER GE RE NUM DERR DERR LOAD xyz abc XYZ ASC not found Ready PRINT DERR 146 FUNCTION Reports the last error code returned by the disc filing system The value of DERR may be used to ascertain the particular Disc ERRor that occurred See the listing oferror messages given in the chapter entitled For your reference Associate...

Page 136: ... sub routine Note that entering an interrupt sub routine automatically disables interrupts ofan equal or lower priority The command is used to make the program literally execute without interruption for example when two routines within a program are competing for use ofresources In the example above the main program and the interrupt sub routine are competing for use ofthe graphics display Fur the...

Page 137: ...re one variable name is used with a range of subscript numbers S0 that each element of the array has its own individual value Control of the array can then be achieved by for example FOR NE XTloops which can step through the array processing each element in turn Note that the lowest value ofthe subscript is zero Le the first available element in the array Arrays can be multi dimensional and each e...

Page 138: ...e ink being written interacts with that already on the graphics screen The 4 inkmode s are 0 Normal 1 XOR eXclusive OR 2 AND 3 0R Associated keywords DRAW R GRAP HIe S PEN MASK DRAWR DRAW R x offset y offset ink ink mode 10 CLS PRINT coming upstairs 20 MOVE 0 350 FOR n 1 TO 8 30 DRAWR 50 0 40 DRAWR 0 50 50 NEXT MOVE 348 0 FILL 3 60 GOTO 60 run COMMAND Draws a line on the graphics screen from the c...

Page 139: ... together with the cursor ready for editing Associated keywords AUT 0 LI ST El El El COMMAND Enables I nterrupts which have been disabled by the DI command If interrupts are disabled in an interrupt sub routine they are automatically re enabled when BASIC encounters the RE TURN command at the end of the sub routine Further information concerning interrupts will be found in part 2 of the chapter en...

Page 140: ...ith the SOU ND command If the envelope number is negative in the range 1 to 15 the envelope repeats until the end ofthe duration ofthe SOU NDcommand Each ofthe envelope section s may contain either 2 or 3 parameters If3 parameters are used these are number ofsteps step size pause time Parameter 1 number ofsteps This parameter specifies how many different steps oftone pitch you want the sound to pa...

Page 141: ...255 where 0 is treated as 256 or 2 56 seconds General Note that the total length of all the pause time s should not be greater than the duration parameter in the SOU NDcommand otherwise the sound will finish before all the tone steps have beenpassed through In such a case the remaining contents of the tone envelope are discarded Likewise if the duration parameter in the SOU ND command is longer th...

Page 142: ...tion of a note which lasts 10 seconds you may wish to have 10 volume steps of 1 second each In such a case the number ofsteps parameter used shouldbe 10 The available range of number ofsteps is 0 to 127 Parameter 2 step size Each step can vary in size from a volume level of 0 to 15 with respect to the previous step The 16 different volume levels are the same as those you will hear in the SOU ND co...

Page 143: ... before all the volume steps have been passed through In such a case the remaining contents ofthe volume envelope are discarded Likewise if the duration parameter in the SOU ND command is longer than the total length of all the pause time s the sound will continue after all of the volume steps have been passed through and will remain constant at the final level Up to 5 different envelope section s...

Page 144: ...name DIM a 100 b 100 ERASE a b COMMAND Erases the contents of an array no longer required reclaiming the memory for other use Associated keywords DI M ERL ERL 10 ON ERROR GOTO 30 20 GO TO 1000 30 PRINT error is in line ERL 40 END run FUNCTION Reports the Line number of the last ERror encountered In the above example you will see that the error is in line 213 and has been reported so by the ER L fu...

Page 145: ...ting oferror messages 1 to 32 is given in the chapter entitled For your reference BASIC will treat the ERR 0 R as if it had been detected as genuine and will jump to any error handlingroutine as well as reporting the appropriate values of ERR and ER L ERR 0 Raccompanied by an integer expression in the range 33 to 255 can be used to create customised error messages as shown in the following example...

Page 146: ...eisure Associated keywords AFT ER REM AI N EXP EX P numeric expression PRINT EXP 6 876 968 743625 FUNCTION Calculates E to the power given in the numeric expression where E is approximately 2 7182818 the number whose natural logarithm is 1 Associated keywords LOG FILL FILL ink 10 MODE 0 20 FOR n 1 TO 500 3111 PR1NT 0 4111 NEXT 5111 pencolour 2 RND 13 60 FILL pencolour 7111 GOTO 50 run COMMAND Fill...

Page 147: ...g the control variable between a start and end value Ifthe STEP size is not specified 1 is assumed The STEP size may be specified as a negative numeric expression in which case the value of the start parameter must be greater than that ofthe end parameter otherwise the control variable will not be stepped FOR NEX T loops may be nested i e one may be carried out within another within another and so...

Page 148: ...lay The overall effect of this is that character or graphics movement on the screen will appear to be smoother without flickering or tearing Associated keywords TAG TAG 0 FF FRE FRE numeric expression FRE string expression PRINT FRE 0 PRINT FRE FUNCTION Establishes how much FREe memory remains unused by BASIC The form FRE forces a garbage collection before returning a value for available space NOT...

Page 149: ... I CS PAPE R ink 10 MODE 0 20 MASK 15 30 GRAPHICS PAPER 3 40 DRAW 640 0 run COMMAND Sets the ink ofthe graphics paper i e the area behind graphics drawn on the screen When drawing continuous lines the graphics paper will not be seen In the above example the MASK command enables a broken line to be drawn and the graphics paper to be seen The graphics paper s ink in the range 0 to 15 is used for the...

Page 150: ...SPA PER INK MASK TAG TAG 0 FF HEX HEX unsigned integer expression field width PRINT HEX 255 4 00FF FUNCTION Produces a tring of HEXadecimal digits representing the value ofthe unsigned integer expression using the number ofhexadecimal digits instructed by the field width in the range 0 to 16 Ifthe number ofdigits instructed is too great the resulting expression will be filled with leading zeros if...

Page 151: ...90 PRINT c 1 guesses run COMMAND Determines whether the logical expression is true in which case the first option part is executed If the logical expression is false any option part specified in the EL SE clause is executed otherwise BASIC passes onto the next line I F THE Ncommands may be nested to any depth and are terminated by end ofline Therefore it is NOT possible to have further statements ...

Page 152: ...he SPEEDIN Kcommand Associated keywords GRAPHICS PAPER GRAPHICS PEN PAPER PEN SPEED INK INKEY INK EY integer expression 10 IF INKEY 55 32 THEN 10 20 PRINT You I ve pressed SHI FT and V 30 CLEAR INPUT run FUNCTION I Nterrogates the KEYboard to report which keys are being pressed The keyboard is scanned every 0 02 fiftieth second The function is useful for spotting whether a certain key is down or u...

Page 153: ...eLected 90 PRINT You have seLected run Y N 80 90 YES END NO specifiedkey UP DOWN DOWN DOWN DOWN FUNCTION I Nterrogates the KEYboard returning the current tring reflecting any key that is pressed Ifno key is pressed INK EY returns an empty string In the above example lines 40 and 70 tell the program to loop back to line 30 after interrogating the keyboard string Associated keywords CLEA R I NPUT IN...

Page 154: ...l otherwise occur after the command is executed The separator must either be a semicolon or comma A semicolon causes a question mark to be displayed a comma suppresses the questionmark Ifan entry is made that is ofthe wrong type such as ifthe letter 0 is typed instead ofa o zero when I NPUTing a numeric variable then BASIC will respond with Redo from start and any original prompt text that you pro...

Page 155: ...rched for string does not occur within the searched string then 0 is reported The position at which to start searching the searched string is optionally specifiable using the startposition parameter which must yield an integer number in the range 1to255 Associated keywords none INT I NT numeric expression PRINT INT 1 995 2 FUNCTION Rounds the number to the nearest smaller I NTeger removing any fra...

Page 156: ...sociatedkeywords CLE AR IN PU T IN KE Y I EY KEY expansion token number string expression KEY 11 border 13 paper 0 pen 1 ink 0 13 ink 1 0 mode 2 list CHR 13 now press the ENTER key COMMAND Assigns the string expression to the key s expansion token number specified Thirty two expansion tokens are supported in the range 0 to 31 these occupying the key values 128 to 159 Keys 128 0 on numeric keypad t...

Page 157: ...hand side ofthe computer or to the chapter entitled For your reference The normal shifted and control parameters should contain the values required to be returned when the key is pressed alone together with SHIFn and together with CONTROL respectively Each ofthese parameters is optional The repeat parameter enables you to set the key auto repeat function on or off 1 or 0 the rate ofauto repeat bei...

Page 158: ... LE N string expression 10 LINE INPUT Enter a phrase a 20 PRINT The phrase is 30 PRINT LEN a characters Long run FUNCTION Returns the total number of characters i e the LENgth ofthe string expression Associated keywords none LET LET variable expression LET x 100 COMMAND Assigns a value to a variable A remnant from early BASICs where variable assignments had to be seen coming Has no use in AMSTRAD ...

Page 159: ...e keyboard is terminated by pressing the RETURN key LIN E IN PUT from disc or cassette stream 9 is terminated by a received carriage return or by the string variable being assigned 255 characters whichever is the sooner Associated keywords I NPUT LIST LIS T line number range stream expression LIST 100 1000 1 COMMAND Lists program lines to the given stream Stream 0 is the default screen stream and ...

Page 160: ...T be loaded using the LOA 0 command as it will be immediately deleted from memory Instead use the RUN or CH AIN co mands Associated keywords CH AIN CHAI N MER GE MER GE RUN SAVE LOCATE L0 CAT E stream expression x co ordinate y co ordinate 10 MODE 1 20 FOR n 1 TO 20 30 LOCATE n n 40 PRINT CHR 143 Location 50 PRINT n n 60 NEXT run COMMAND Locates the text cursor at the stream indicated to the posit...

Page 161: ... expression which must be greater than zero Associated keywords EX P LOG LOWER LOW ER string expression 10 a SEE HOW THE LE TT ERS CH ANGET 0 20 PRINT LOWER a LOWER CASE run FUNCTION Returns a new string expression which is a copy ofthe specified string expression but in which all alphabetic characters in the range A to Zare converted to lower case The function is useful for processing input which...

Page 162: ...the bits in each adjacent group of8 pixels to ON 1 or OFF 0 The first point setting determines whether the first point ofthe line is to be plotted 1 or not plotted 0 Either ofthe parameters may be omitted but not both Ifa parameteris omitted that particular setting is not changed Associated keywords DRAW DRAWR GRAPHICS PAPER GRAPHICS PEN MAX MAX list of numeric expression 10 n 66 20 PRINT MAX 1 n ...

Page 163: ...y Note that line numbers in the old program which exist in the new program to be MER GEd will be over written by the newprogram lines Protectedfiles S AV Ed by p can NOTbe ME RG Edinto the currentprogram Associated keywords CHAIN CHAIN MERGE LOAD MID MID string expression start position sub string length 10 MODE 1 Z0NE 3 20 a ENCYCLOPAEDIA 30 PRINT Show me how to speLL a 40 PRINT OK PRINT 50 FOR n...

Page 164: ...RIG HT MID MI D string variable insertion position new string length 10 a heLLo 20 MID a 3 2 XX 30 PRINT a run heXXo new string expression COMMAND Inserts the new string expression into the string specified by the string variable commencing at the dnsert position and occupying new string length number ofcharacters Note that when using MID as a COMMAND a string variable such as a must be used and N...

Page 165: ...ssion 10 m m 1 IF m 2 THEN m 0 20 MODE m 30 PRINT this is mode m 40 PRINT now press a key 50 IF INKEY THEN 50 ELSE 10 run COMMAND Changes the screen mode 0 1 or 2 and clears the screen to ink 0 which may not be the current paper ink All text and graphics windows are reset to the whole screen and text and graphics cursors are homed to their respective origins Associated keywords 0 RIG IN WIN DO W C...

Page 166: ...MOV ER 0 RIG I N XPO S YPO S MOVER M0 VER x offset y offset ink ink mode 10 MODE 1 TAG MOVE 0 16 20 PRINT Life has its 30 FOR n 1 TO 10 40 MOVER 32 16 50 PRINT ups NEXT PRINT and 60 FOR n 1 TO 10 70 MOVER 64 16 80 PRINT downs NEXT run COMMAND Moves the graphics cursor to a point relative to its current position The relative position is specified by x offset and y offset The optional ink parameter ...

Page 167: ...mous or may refer to its matching FOR Note from the above example that the list of variable s must appear in reverse order to their matching FOR commands so that nested loops do not overlap Associated keywords FOR STEP TO NOT NOT argument IF NOT aLan bob THEN PRINT correct ELSE PRINT wrong wrong IF NOT cat dog THEN PRINT correct ELSE PRINT wrong corre ct PRINT NOT 1 o PRINT NOT 0 1 OPERATOR Perfor...

Page 168: ...e you should SAVEsuch a program before RUNning it ON BREAK CaNT may be disabled within a program by ON BREAK STOP Associated keywords ON BREAK GOSUB ON BREAK STOP ON BREAK GOSUB ON BREAK GOSUB line number 10 ON BREAK GOSUB 40 20 PRINT program running 30 GOTO 20 40 CLS PRINT Pressing ESC If 50 PRINT twice caLLs GOSUB routine 60 FOR t 1 TO 2000 NEXT 70 RETURN run COMMAND Instructs BASIC to jump to t...

Page 169: ...ne 65 in the 0 N BR EAK sub routine Associated keywords ON BR EAK CONT ON BR EA K GOS UB ON ERROR GOTO ON ERROR GOTO line number 10 ON ERROR GOTO 60 20 CLS PRINT If error is found 30 PRINT then List the program 40 FOR t 1 TO 4000 NEXT 50 GOTO 100 60 PRINT Error detected in Line 70 PRINT ERL PRINT LIST run COMMAND Jumps to the specifi d line number when an error is detected in the program The form ...

Page 170: ...E m RETURN run COMMAND Selects a sub routine line to jump to depending upon the value of the selector which should be a positive integer expression in the range 0 to 255 The order ofthe selector values determines the line number to be selectedfrom the list of line number s In the above example selecting 1 makes BASIC jump to line 90 selecting 2jumps to line 110 and3jumpstoline 130 If the value of ...

Page 171: ... number to be selected from the list of line number s In the above example selecting 1 makes BASIC jump to line 80 selecting 2jumps to line 90 and 3jumpsto line 100 If the value of the selector is zero or is higher than the amount of line number s listed in the command then no line will be selected Associated keywords none ONSQGOSUB ON SQ channel GO SUB line number 10 ENV1 15 1 1 20 ON SQ 1 GOSUB ...

Page 172: ...OSEIN PRINT The 2 values are 40 PRINT PRINT a a run COMMAND 0 PENs an I Nput file from disc for use in the current program The I Nputfileto 0 PEN must be an ASCII file The above example will only work after you have created the file shown in the next example under 0 PEN 0 UT Associatedkeywords CLO SE I N EO F OPENOUT OPE N0 UT filename 10 REM OPEN an OUTput file to disc 20 INPUT give me a number v...

Page 173: ...ciatedkeywords AND NOT X0 R ORIGIN OR I GIN x y left right top bottom 10 MODE 1 BORDER 13 TAG 20 ORIGIN 0 0 100 540 300 100 30 GRAPHICS PAPER 3 CLG 40 FOR x 550 TO 310 STEP 10 50 MOVE x 206 60 PRINT This is a graphics window 70 FRAME NEXT GOTO 40 run COMMAND Sets the graphics origin points 0 0 to the position specified by the co ordinates x and y A graphics window s dimensions may also be set by s...

Page 174: ... 7 12 PRINT paper p 50 FOR t 1 TO 500 NEXT t p run COMMAND Sets the background ink for characters When characters are written to the text screen the character cell is filled with the paper ink in the range 0 to 15 before the character is written unless the transparentmode has been selected If the stream expression is omitted the PAP ERink for stream III is assumed by default The number ofdifferent...

Page 175: ...ess specified not the ROM and will be in the range 00 to FF 0 to 255 Associated keywords PO KE PEN PEN stream expression ink background mode 10 MODE 0 PAPER 0 INK 0 13 20 FOR p 1 TO 15 30 PEN p PRINT SPACE 47 pen p 40 FOR t 1 TO 500 NEXT t p GOTO 20 run COMMAND Sets the ink in the range 0 to 15 to be used when writing to the given screen stream stream 13 ifnot specified The background mode paramet...

Page 176: ... x NEXT 60 ORIGIN 0 0 t TIME 700 WHILE TIME t 70 PLOT RND 640 RND 400 WEND 80 PLOT RND 640 RND 400 2 90 GOTO 90 run COMMAND Plots a point on the graphics screen at the absolute position specified in the x y co ordinates The ink in which to plot the point may be specified in the range oto 15 The optional ink mode determines how the ink being written interacts with that already on the graphics scree...

Page 177: ... position The ink in which to plot the point may be specified in the range 0 to 15 The optional ink mode determines how the inkbeing written interacts with that already on the graphics screen The 4 ink mode s are 0 Normal 1 XOR eXclusive OR 2 AND 3 0R Associatedkeywords GRA PHI CS PEN PLO T POKE PO KE address expression integer expression 10 FOR m 49152 TO 65535 20 POKE m 100 30 NEXT run COMMAND W...

Page 178: ...xpression MUSTbe specified and does NOT default to 0 PO S 8 reports the current horizontal carriage position for the printer where 1is the extreme left hand edge PO S 9 reports the logical position in the disc file stream i e the number of printing characters sent to the stream since the last carriage return Associated keywords VP0 S WIN DO W PRINT PR I NT stream expression list of print items 10 ...

Page 179: ...ist of print item 10 PRINT this is spc function 20 FOR x 6 TO 15 30 PRINT SPC 5 a SPC x b 40 NEXT 50 PRINT this is tab function 60 FOR x 6 TO 15 70 PRINT TAB 5 a TAB x b 80 NEXT run SPCprints the number of spaces specified in the integer expression and will print any following print item immediately next to the spaces assuming that the following print item will fit onto the line Hence it is not ne...

Page 180: ...ric Formats Withinthe number Each specifies a digit position Example template Specifies the position ofthe decimal point Example template Specifies one digit position May appear BEFORE the decimal point only Specifies that digits before the decimal point are to be divid d into groups of three for thousands separated by commas Example template Around the number Specifies two digit positions Specifi...

Page 181: ...Example template The sign may only appear at the END ofa template It specifies that is to be printed after any negative number and exponent part If the number is positive a space will be printed A sign is printed before a negative number by default unless countermanded by the use of this template Example template t t t t Specifies that the number is to be printed using the exponent option The t t ...

Page 182: ...nted where x is equal to the length ofthe template including the back slashes Example template Specifies thatthe entire string is to be printed as is Example template The format template for a string may not exceed 255 characters Both numeric and string format template s may be represented by string variables for example 10 a 20 b 30 PRINT USING a 12345 6789 40 PRINT USING b pence run Further info...

Page 183: ...random number generator either to the specified value or to a value entered by the user ifthe numeric expression is omitted RAN DO MI ZE TI ME produces a sequence that is difficult to repeat Associated keywords RN D READ REA D listof variable 10 FOR n 1 TO 8 20 READ a c 30 PRINT a SOUND 1 c NEXT 40 DATA here 478 are 426 8 379 notes 50 DATA 358 of 319 a 284 musicaL 253 scaLe 239 run COMMAND Reads d...

Page 184: ...d C 7 Releases channel A and Band C Further information concerning sound will be found in part 2 ofthe chapter entitled At your leisure Associated keywords SOU ND REM REM rest ofline 10 REM Intergalatic Hyperspace Mega Monster Invaders Deathchase by AMSOFT 20 REM Copyright AMSOFT 1985 COMMAND Inserts aRE Mark into a program The rest ofline is ignored by BASIC and may contain any characters includi...

Page 185: ... NUMbers program lines The parameter old line number specifies the current existing line number at which renumbering is to commence If old line number is omitted renumbering will commenr p from the beginning ofthe program The parameter new line number specifies the new starting line number for the renumbered lines If new line number is omitted the renumbered program will start at line 10 The param...

Page 186: ...ated keywords DATA REA D RESUME RES UM E line number 10 ON ERROR GOTO 60 20 FOR x 10 TO 0 STEP 1 PRINT 1 x NEXT 30 END 40 PRINT go here after error 50 END 60 PRINT error no ERR in line ERL 70 RESUME 40 r un COMMAND Resumes normal execution of a program after an error has been trapped and processed by an 0N ERR 0R GOT 0 command Ifthe line number to RES UMEat is not specified the program will re com...

Page 187: ...0N ERR 0R GOT 0 command RES UMEN EX T will re commence execution from the line after that in which the error was first trapped Associatedkeywords DERR ERL ERR ERROR ON ERROR GOTO RESUME RETURN RETURN 10 GOSUB 50 PRINT after the gosub END 50 FOR n 1 TO 20 60 PRINT sub routine 70 NEXT PRINT 80 RETURN run COMMAND Marks the end ofa sub routine BASIC returns from the sub routine to the statement immedi...

Page 188: ...returned Associated keywords LE FT MI D RND RND numeric expression 10 RANDOMIZE 20 FOR x 1 TO 1 STEP 1 30 PRINT rnd parameter x 40 FOR n 1 TO 6 50 PRINT RND x 60 NEXT n x run FUNCTION Returns the next RaN Dom number m sequence if the numeric expression has a positive value or is not specified If the numeric I xpression yields a value of zero RN D returns a copy of the last random number generated ...

Page 189: ... string expression RUN disc COMMAND Loads a BASIC or binary program from disc and commences execution Any previously loaded BASIC program is cleared from the memory Protected BASIC programs may be run directly in this manner Associated keywords LOA D RUN RUN line number RUN 200 COMMAND Commences execution of the current BASIC program from the specified line number parameter or from the beginning o...

Page 190: ...ddress 8 0 0 0 the length of the file being 30 0 0 bytes the optional entrypoint address being 8 0 01 COMMAND Saves the program currently in the memory to disc A Binary file is an area ofmemory saved to disc The Binary parameters are start address file length entrypoint The screen memory can be saved as a Binary file This is known as a screen dump and canbe performed using the command SAVE screen ...

Page 191: ...s zero and returns 1 if numeric expression is greater than zero Associated keywords AB S SIN SIN numeric expression 10 CLS DEG ORIGIN 0 200 20 FOR n 0 TO 720 30 y SIN n 40 PLOT n 64 720 198 y NEXT 50 GOTO 50 run FUNCTION Calculates the S I Ne ofthe numeric expression Note that DEG and RA D can be used to force the result of the above calculation to degrees or radians respectively Associated keywor...

Page 192: ...A Bit 4 decimal 16 rendezvous with channel B Bit 5 decimal 32 rendezvous with channel C Bit 6 decimal 64 hold sound channel Bit 7 decimal 128 flush sound channel Most significantbit Hence a channel status parameter of6 8 for example would mean Send to channel C 4 with a hold state 64 Parameter 2 tone period This parameter defines the pitch ofthe sound or in other words what note it is i e do re mi...

Page 193: ...mand Refer to the description ofthe EN Vcommand Parameter6 tone envelope To make the tone or pitch vary within the duration ofthe note you can specify a tone envelope using the separate command ENT You can in fact create up to 15 different tone envelopes referenced in the range 1 to 15 The tone envelope parameter calls up the appropriate tone envelope reference number for use in the SOU NDcommand ...

Page 194: ... 1 period 2 10 BORDER 7 18 20 FOR i 30 TO 1 STEP 1 30 SPEED INK i i 40 FOR t 1 TO 700 NEXT t i run COMMAND Sets the rate ofalternation between two ink colours specified in an INK or 80 RDERcommand period 1 specifies the time in units of0 02 fiftieths second for the first colour to be used period 2 sets the time for the second colour You must exercise careful judgement to avoid mesmeric effects whe...

Page 195: ...ts default SPEED KEY setting of 30 2 This canbe achieved by the command KEY 0 SPEED KEY 30 2 CHR 13 which will reset SPE ED KEY to its default values when the 0 key on the numeric keypad is pressed Associated keywords KEY DEF SPEED WRITE SPE ED W RI TE dnteger expression SPEED WRITE 1 COMMAND Sets the speed at which data is to be saved or written to a cassette unit ifconnected The cassette can be ...

Page 196: ... at the head ofthis queue the head ofthe queue is held the channel is currently active where BitO is the least significantbit and Bit 7 is the most significantbit It can be seen therefore that if Bit 6 is set Bit 7 cannot be set and vice versa Similarly ifBits 3 4 or5 are set Bits 6 and 7 cannot be set Further information concerning sound will be found in part 2 ofthe chapter entitled At your leis...

Page 197: ...med by the CON T command STOP may be used to interrupt the program at a particular point when de bugging Associated keywords CON T END STR STR numeric expression 10 a FF REM 255 hex 20 b X1111 REM 15 binary 30 c 40 PRINT c STR a b c run 270 FUNCTION Converts the numeric expression to a decimal STRing representa tion Associated keywords BIN DEC HEX VAL Chapter 3 Page 78 Complete List of Keywords ...

Page 198: ...MBOL SYM B0 L character number list of row 10 MODE 1 SYMBOL AFTER 105 20 row1 255 REM binary 11111111 30 row2 129 REM binary 10000001 40 row3 189 REM binary 10111101 50 row4 153 REM binary 10011001 60 row5 153 REM binary 10011001 70 row6 189 REM binary 10111101 80 row7 129 REM binary 10000001 90 row8 255 REM binary 11111111 100 PRINT Line 110 re defines the Letter i 105 Type in some i IS and see T...

Page 199: ...has a binary representation of 00000001 Where the 1 appears the section of the character is printed in the PEN colour where a 0 appears the section ofthe character is not visible because it is printed in the PA PER colour Therefore the top row ofthis newly defined character has a dot in the top right hand corner Continuing this example we will specify the other 7 parameters as 3 7 1 5 3 1 63 0 0 t...

Page 200: ...ill regard it as the equivalent of the previous character Further information concerning user defined characters will be found in part 2 ofthe chapter entitled At your leisure Associated keywords SYMB0 L AFT ER SYMBOL AFTER SYMB0 L AFT ER integer expression 10 CLS 20 SYMBOL AFTER 115 30 PRINT Line 40 re defines the s 40 SYMBOL 115 0 56 64 64 48 8 8 112 50 PRINT to s 60 PRINT Cancel this defintion ...

Page 201: ... MOVE x y 50 FOR f x TO 640 STEP RND 7 3 60 MOVE f y PRINT a FRAME NEXT 70 FOR b 640 TO x STEP RND 7 3 80 MOVE b y PRINT a FRAME NEXT 90 GOTO 40 run COMMAND Sends any text specified for the given stream expression to be printed at the graphics cursor position This allows text and symbols to be mixed with graphics or moved pixel by pixel as opposed to character by character The stream expression de...

Page 202: ...n stream expression stream 0 if not specified and re directs text to the previous text cursor position used before TAG was invoked Associated keywords TAG TAN TAN numeric expression PRINT TAN 45 1 61977519 FUNCTION Calculates the TANgent ofthe numeric expression which must be in the range 200000 to 200000 Note that DEG and RA Dcan be used to force the result of the above calculation to degrees or ...

Page 203: ...tion Associated keywords MOV E MOV ER TES TR XPOS YPOS TESTR TEST R x offset y offset 10 MODE 0 FOR x 1 TO 15 LOCATE 1 x 20 PEN x PRINT STRING 10 143 NEXT 30 MOVE 200 400 PEN 1 40 FOR n 1 TO 23 LOCATE 12 n 50 PRINT pen TESTR 0 16 NEXT run FUNCTION Moves the graphics cursor by the amount specified in the x and y offset s relative to its current position and reports the value of the ink at the new l...

Page 204: ...r minute tick 120 WEND 130 tick 0 second 0 minute minute 1 140 GOTO 50 150 WEND 160 minute 0 hour hour 1 170 WEND 180 hour 1 190 GOTO 60 run FUNCTION Reports the elapsed time since the computer was last switched on or reset excludingperiods when reading or writing to disc Each second ofreal time is equal to the returned value TI ME 3ee Associated keywords AFT ER EVE RY WEN D W HI LE TO See FOR Com...

Page 205: ...curs Associated keywords none UNT UN T address expression PRINT UNT FF66 154 COMMAND Returns an integer in the range 32768 to 32767 which is the twos complement equivalent ofthe unsigned value ofthe address expression Associatedkeywords Cl NT FI X I NT ROU ND UPPER UP PER string expression 113 CLS a my how you ve grown 213 PRINT UPPER a run FUNCTION Returns a new string expression which is a copy ...

Page 206: ... decimal point followed by non numeric characters a T y Pe m s m ate h error 13 will be reported Associated keywords STR VPOS VP0 S stream expression 10 MODE 1 BORDER 0 LOCATE 8 2 20 PRINT use cursor up down keys 30 WINDOW 39 39 1 25 CURSOR 1 1 40 LOCATE 1 13 50 IF INKEY 0 1 THEN PRINT CHR 11 60 IF INKEY 2 1 THEN PRINT CHR 10 70 LOCATE 1 3 24 80 PRINT 1 text cursor 90 PRINT 1 vertical position 100...

Page 207: ...ords I NP OU T WEND WEND WEND COMMAND Marks the end ofthe body ofprogram which is to be executed within the W HI LE loop WEN Dautomatically selects the W HI LE command it is to be associated with Associated keywords T I ME W HI LE WHILE W HI LE logical expression 10 CLS PRINT Ten second timer t TIME 20 WHILE TIME t 3000 30 SOUND 1 0 100 15 40 WEND SOUND 129 40 30 15 run COMMAND Repeatedly executes...

Page 208: ...10 MODE 0 BORDER 0 REM testcard 20 INK 0 0 INK 1 25 INK 2 23 INK 3 21 30 INK 4 17 INK 5 6 INK 6 2 INK 7 26 40 PAPER 0 CLS 50 PAPER 1 WINDOW 2 4 1 18 CLS 60 PAPER 2 WINDOW 5 7 1 18 CLS 70 PAPER 3 WINDOW 8 10 1 18 CLS 80 PAPER 4 WINDOW 11 13 1 18 CLS 90 PAPER 5 WINDOW 14 16 1 18 CLS 100 PAPER 6 WINDOW 17 19 1 18 CLS 110 PAPER 7 WINDOW 2 19 19 25 CLS 120 GOTO 120 run COMMAND Specifies the dimensions ...

Page 209: ...se should NOT be preceded by a stream director The command may be used to re direct messages produced by BASIC which are normally always sent to stream 0 Further information concerning windows will be found in part 2 of the chapter entitled At your leisure Associated keywords WIN D0W WRITE W RI TE stream expression write list 10 REM write variabLes onto disc 20 INPUT give me a number variabLe a 30...

Page 210: ... XOR argument X0 R argument IF aLan bob XOR dog cat THEN PRINT correct ELSE PRINT wrong wrong IF bob aLan XOR cat dog THEN PRINT correct ELSE PRINT wrong wrong IF aLan bob XOR cat dog THEN PRINT correct ELSE PRINT wrong correct PRINT XOR 0 PRINT 0 XOR 0 0 PRINT XOR 0 1 OPERATOR Performs bit wise boolean operation on integers Result is 1 unless both argument bits are the same eXclusive 0 R Further ...

Page 211: ...Reports the current vertical Y PO Sition ofthe graphics cursor Associated keyword M0VE M0VER 0 RIG IN XP0S ZONE Z0NE integer expression 10 CLS FOR z 2 TO 20 20 ZONE z 30 PRINT X X ZONE z NEXT run COMMAND Changes the width ofthe print zone specified in PR IN Tstatements by using a comma between print items The default setting of the print zone is 13 columns but may be changed as specified in the in...

Page 212: ...perating with a BASIC only disc Turnkey AMSTRAD BASIC application Installing a Turnkey CPIM Plus application Getting Started with GSX Operating with CPIM 2 2 Part 7 of the Foundation course described how to format a blank system disc which you can use for BASIC and games as well as CP M Part 10 of the Foundation course showed you how to make exact copies of discs with the DI SCKIT 3 program on Sid...

Page 213: ...it has to be emphasised that the library discs that you use MUST BE COPIES made from the master discs package supplied with the computer Remember that if you are usinK a new blank disc to copy onto the DI SCKIT 3 program on Side 1 will format for you as well as doing the copying Gettingstartedwith CP M Plus You will be used to AMSTRAD BASIC appearing when your CPC6128 is switched on The BASIC will...

Page 214: ... command lines can be edited in much the same way as a line of BASIC Full details of SET KEY Sare given in Chapter 5part 2 A Helping Hand Side 3 of your system discs package has a special program called Help which is designed to be an electronic instruction manual for CP M Plus utility programs To activate this facility insert Side 3 and type at the A prompt HELP and the Help program will prompt y...

Page 215: ...en a new prompt will show that PIP has loaded correctly Normally you will copy files from a Source disc in Drive A to a Destination disc in Drive B We have already seen that in a single drive system Drives A and B are the same mechanism To copy one file for example SUB MIT CO M type after the prompt B A SUBMIT COM To copy all the files from the Source disc to the Destinationdisc use the command 8 ...

Page 216: ...or around The 6128 is provided with a built in terminal emulator when running CP M Plus programs and the characteristics are different from the Control Codes supported by BASIC Sometimes the package that you buy will have already been installed for the AMSTRAD system or cater for it by offering an installation compatible with the 6128 If available simply follow the instructions provided with the s...

Page 217: ...128 supports a wide range of control codes suitable for customising a software package to run with CP M Most data processing and many other packages require to be able to print messages at any part ofthe screen to accept input from any part ofthe screen and to generally understand cursor controls If your package has already been customised for the AMSTRAD system then you need not concern yourselff...

Page 218: ...en to and includingthe cursor position ESC p lB 70 27 112 Enter inverse video ESC q lB 71 27 113 Exit inverse video Configuringthe Input to the package The programs in the package will expect to be able to interrogate the keyboard Most ofthe keys on the 6128 keyboard return standard values except for the cursor keys It is possible to use the SET KEY S utility to re define the codes produced by the...

Page 219: ... PAYROLL Ifany configurations require to be set up then perhaps a SUBmitfile will be provided An example of this is the file LOG 0 3 SUB on Side 3 This is invoked with the command SUBMIT LOG03 The contents ofthe file canbe seenby typing TYPE LOG03 SUB which gives SETKEYS KEYS DRL LOG03 SETKEYS KEYS CCP to re assign the keyboard to run the Dr LOGO program to restore the keyboard Autostarting a Turn...

Page 220: ...ecipe of up to three output device drivers in reverse order oftheir size 21a ddfxLr7 11a ddhp7470 01a ddmode2 02 a ddmode 1 03 a ddmode0 Epson 7bit printer pen plotter screen in mode 2 screen in mode 1 screen in mode 0 The numbers tell GSX what type of device driver each is Printer Plotter Screen Only one device driver at a time is actually loaded into the same area of memory which is why GSX need...

Page 221: ...r running a program It is therefore normal to use System Discs The single drive file copier FI LEe 0 PYhas to be used instead of PIP ifyou do not have a second drive It is only recommended that you use CP M 2 2 ifyou have software already running on AMSTRAD models CPC664 or CPC464 DDIl whose software is not in some way compatible with CPIM Plus Warning Some CPC664 CPC464 DDI l CP M 2 2 Application...

Page 222: ...s they may be omitted altogether The following list describes the differences in the operation of each of these BASIC commands Descriptions of the commands themselves will be found in the chapter entitled Complete list ofAMSTRAD CPC6128 BASIC keywords CAT Youwill be instructed Press PLAY then any key whereupon you should press the PLAY button on your cassette unit followed by one of the keys on th...

Page 223: ...e 2 The VOLUME or LEVEL control on your cassette unit is not correctly adjusted 3 The tape quality is poor or the tape is worn 4 The tape has been subjected to a magnetic field by being placed close to a loud speaker television set etc 5 You are attempting to read a cassette which has not been created for use on AMSTRAD computer systems CHAIN CHAINMERGE LOAD MERGE RUN You need not specify the file...

Page 224: ...d you will not be required to press any key for the file to load You must make sure that the PLAY button on your cassette unit is down Ifyour programs use the mark and are also required to run on disc the mark will be ignored during disc operation when the disc filename is being read Note that the mark does NOT occupy one of the character positions in the cassette or discfilename Abandoning the co...

Page 225: ... from the file The screen will display the loadingmessages Loading FILENAME bLock 1 and other block numbers in turn as the file is loaded If the first character of the filename in the 0 PEN I Ncommand is then the above messages will be suppressed and you will not be required to press any key for the file to load You must make sure that the PLAY button on your cassette unit is down If your programs...

Page 226: ...K bytes to cassette If the file buffer is partly full and the command CLOS EO UT is encountered the computer will save the remaining contents of the file buffer to cassette issuing the prompt Press REC and PLAY then any key The screen will display the saving message Sav i n9 FI LE NAME b L0 c k x Ifthe first character ofthe filename in the 0 PEN 0 UT command is then the above messages will be supp...

Page 227: ...ing it CAT alog the tape to verify that the program has been saved successfully 6 Ensure that your cassette unit is periodically maintained and that the tape heads are regularly cleaned SAVE You need not specify the filename if you wish the program to be saved as an Unna med f i Le Example command SAVE You will be instructed Press REC and PLAY then any key whereupon you should press the RECORD and...

Page 228: ...n in Read the paragraph entitled Successful saving earlier in this section SPEED WRITE The command operates only on cassette and can be issued while the computer is set to disc operation Error messages Note that error messages 7 21 24 25 27 and 32 see part 6 ofthe chapter entitled For your reference will be generated during cassette operation ifappropriate AMSDOS external commands Input and output...

Page 229: ......

Page 230: ...ting and copying files Reference guide to error messages Introduction AMSDOS extends the AMSTRAD BASIC supplied with your computer by providing a number of external commands which are identified by the preceding I bar symbol AMSDOS allows the user to change discs freely as long as no files are in use in which case an error message will be displayed and there could be a loss of data ifthe open file...

Page 231: ...t drive Unlike CP M 2 2 there is no need to log in a disc Changing a disc while it is still being written to may corrupt the data on the disc Ifa disc is changed while there are still files open on it then as soon as AMSDOS detects this all the open files on the drive will be abandoned and an error message produced Any data yet to be written will be lost and the latest directory entry will not be ...

Page 232: ...e BA S Astyles Program or area of memory saved by AMSDOS using SAV E filename B binary parameters style Old version of a file where AMSDOS or a utility program has saved a newer version of a file using an existing name This allows the user to back track to the previous BAcK up version ifrequired Command file CP M utility programs are all ofthis filetype Instruction file for the CP M SUB MI T progr...

Page 233: ...c command 0 PEN I Nwill search for files in the same order as LOA D ifnofile type is specified Filenames on two drives On a 2 drive system i e if an additional drive has been connected to the computer files can exist on either drive The computer will not automatically look for a file on both drives so the user must specify which drive to use You can either employ the IA or I Bor I DRI VEcommands f...

Page 234: ... filename is specified for a particular operation AMSDOS scans the disc directory looking for a name which exactly matches However it is possible where the command allows to perform the operation on a group of files where some of the characters in the filenames can be don t care This is shown by using the character in the don t care position Ifthe whole block or remainder of the whole block ofany ...

Page 235: ...to disc 10 dumpfi Le fLagdump srn 20 MODE 1 BORDER 0 30 DIM coLour 2 40 FOR i 0 TO 2 50 READ coLour i REM get coLours from DATA statement 60 INK i coLour i 70 NEXT 80 ON ERROR GOTO 430 90 OPENIN param dat I test if fi Le exists 100 CLOSEIN ON ERROR GOTO 0 110 IF errnum 32 AND DERR 146 THEN CLS GOTO 160 I fiLe doesnt exist 120 CURSOR 1 PRINT liDo you want to overwrite oLd fi Le Y N 130 a INKEY ON I...

Page 236: ...ny inherent significance The file PAR AM DAT will be an ASCII data file without a header whilst FLA GDUM P SRN is an AMSDOS binary file with a header Note how the program deliberately tries to read from the file PAR AM DAT before writing to it in order to establish ifthe file already exists Ifthe file does NOT exist then an error is reported by BASIC the error is trapped by the program and executi...

Page 237: ...gram executing a MOD Ecommand and thereafter being careful not to cause the screen to scroll 10 DIM coLour 15 REM Provision for 16 coLours 20 OPENIN param dat 30 INPUT 9 fi Lename screenmode 40 i 0 50 WHILE NOT EOF 60 INPUT 9 coLour i 70 INK i coLour i 80 i i 1 90 WEND 100 CLOSEIN 110 MODE screenmode BORDER 0 120 LOAD fi Lename run Summary ofAMSDOS external commands lA lA COMMAND Set default drive...

Page 238: ...ide 1 will load CP M Plus whereas copies of Side 4 will load the olderCP M 2 2 operating system IDIR I DI R string expression IDIR BAS COMMAND Display the disc directory In CP M style and free space Ifthe string expression is omitted the wild card is assumed I DISC IDISC COMMAND Equivalent to the two commands IDI SC I Nand IDI SC 0UT I DISC IN IDISC IN COMMAND Use disc as file input medium I DISC ...

Page 239: ...ile a new name Any other file with the chosen new name must not already exist Wild cards are not permitted The USE R see IUS ER ahead parameter may be specified within the string expression s to override any default settings For example the command REN 0 NEW BA S 1 5 0 LD BA S will rename the file in USE R 1 5 called 0 LD BA S to a file called N EW BA S in USE R 0 regardless of any default or prev...

Page 240: ... R number 15 although the name of the file itself E XAMPLE BA S is not changed Copying files from disc to disc AMSDOS fues with hea ders It is possible to copy this type offile in the CP M environment using PIP see part 2of this chapter Any file created by AMSDOS which has a header record see AMSDOS headers previously described will be copyable as a whole disc to disc but in general the contents o...

Page 241: ...en CP M 2 2 on Side 4 ofyour system discs package must be used CP M 2 2 contains the utilities CLOA Dand CSAVEfor these purposes and are used as shown in the tables ahead File copying procedures The tables ahead cover copying files of all sorts between disc and tape if connected It assumes that no additional disc drive is connected It is not possible to copy protected BASIC programs to and from ta...

Page 242: ...Opy FROM ASCIIdata on tape Binary on tape H HIMEM TAPE MEMORY s 1 LOAD FILE change tapes SAVE FILE B s I r DIS C MEMORY H note 2 Insert CP M 2 2 disc CPM CLOAD FILE TEMP change tapes CSAVETEMP FILE ERA TEMP AMSDOS note 1 Insert CP M 2 2 disc CPM CLOAD FILE AMSDOS H HIMEM TAPE MEMO RY s 1 LOAD FILE DISC SAVE FILE B s L r MEMORY H note 2 note 1 Requires free disc spacefor temporary file TEMP note 2 ...

Page 243: ... FILE change discs SAVE FILE A H HIMEM MEMORY s 1 LOAD FILE ITAPE SAVE FILE B s 1 r 1 IDISC MEMORY H note 2 InsertCPIM 2 2 disc ICPM Insert CPIM 2 2 disc ICPM CSAVE FILE AMSDOS CSAVE FILE AMSDOS note 3 InsertCPIM Plus disc ICPM PIP B FILE AMSDOS InsertCPIM Plus disc ICPM PIP B FILE AMSDOS InsertCPIM Plus disc ICPM PIP B FILE AMSDOS note 2 s is start address offile I is length r is optional run add...

Page 244: ...pected and possibly inconvenientresults C causes the operation to be cancelled which will often lead to a further error message Error message meanings Unknown command The command is not spelt correctly Bad command The command cannot be carried out for some reason Syntax error or inappropriate hardware configuration iilename a Lrea dye x s t s User is trying to rename a file with a name that s alre...

Page 245: ...ttempt has been made to write on a disc with the Write Protect hole open To use the disc eject close the write protect hole re insert the disc and then type R Dr ve drive rea d fa l Hardware error reading disc Recommended action is to eject and re insert the disc then type R Dr ve drive wr t e fa l Hardware error writing disc Recommended action is to eject and re insert the disc then type R Fa led...

Page 246: ...means that there are thousands of applications packages available for you to choose from and a whole wealth ofknowledge and experience for you to draw upon Full details ofCP M Plus including information on how to write your own programs and information on the AMSTRAD implementation ofCP M Plus are contained in SOFT971 A Guide to CP M Plus as well as other AMSOFT and independent publications Introd...

Page 247: ...lly appear on the bottomline ofthe screenin a banner form CP M Plus on the disc The major part of CP M Plus resides in a special file which has the filetype EMS and is found on Side 1 of the system discs package The computer loads CP M from this file into the memory using a two stage process Initially the AMSDOS command I CPM loads the first sector oftrack O On a system disc this sector has been a...

Page 248: ...fter running the command SETKEYS KEYS CCP where both the transient program SET KEY S CO M and the command file KEY S CCPare found on Side 1ofthe systemdiscs package Control Code CONTROl A CONTROl B CONTROl C CONTROl E CONTROl F CONTROl G CONTROl H CONTROl 1 CONTROl J Key Action Q Moves the cursor one character to the left CONTROl Q Moves the cursor to the beginningofthe or line Ifthe cursor is alr...

Page 249: ...d oftext Filenames Many of the commands take filenames as a parameters and where specified the filename may contain wild cards see the section entitled Wild cards in part 1ofthis chapter All filenames will be forced to upper case Direct Console Commands and most utility programs do NOT require that filenames are contained in double quotes Remember that filenames can have an A or B prefix to force ...

Page 250: ...ntry in the disc directory Wild cards are permitted Files set with the S YS attribute will not be listed DIR DIR B will list files on the default drive will list files on Drive B will list files oftype BA S will list files oftype BA S on Drive B DIR BAS DIR B BAS DIR PIP COM will list only the file PIP CO M ifit exists DIRSYS or DIRS command DI RSYS or DI RS lists only those directory entries with...

Page 251: ... NEWNAM E BAS onDriveB TYPE orTYPcommand TYPE asks for the specified file to be TYPEd onto the screen If the file is not an ASCII textfile unpredictable and possibly undesirable side effects may occur TYPE KEYS CCP will display the file KEY S CCP USERorUSE command USE R changes the current user number CPIM Plus starts with the current user number set to O Normally you can only access files identif...

Page 252: ...mmands on a single line where the commands are separated by an exclamation mark For example LANGUAGE 3 SETKEYS KEYS WP Peripheral Management DI SCKIT 3 is a complete disc formatter copier and checker It is quicker to format whilst copying than to format and then copy Comprehensive menus indicate which keystrokes mainly from the function key area of the keyboard should be made Vendor format discs a...

Page 253: ...e colours can be changed by the PAL ET TE command which takes a number ofparameters one for each ink ink 0 includes the background and border area ink 1 is for the text Each colour is represented by a number in the range 0 to 63 which can be used to gauge the colour s intensity brightness on a green monitor It is possible to specify any number ofinks from one to sixteen although only the first two...

Page 254: ...uitable codes to be assigned to keys and to expansion tokens The actual codes must be written into a file whose name is then presented to the SET KEY Scommand The command file can be created by a text editor by PIP or even from BASIC For example SETKEYS KEYS TST where the file KE YS TSTcontains E 8C D I RiM expansion token 12 8 N S C t H backspace CONTROl H ASCII 08 will firstly redefine the CONTR...

Page 255: ...II characters in the chapter entitled For your reference A useful initialising code for many printers is the value 15 setting the printer into condensed printing The command PRINT 8 CHR 15 would set this in BASIC In CPfM issue the command SETLST CONDENSE where the file CON DEN SE contains anyone ofthe following as a single line oftext t I SI I to t 1 FI t I 15 I which are all interpreted as the de...

Page 256: ... a single channel serial Input Output interface RS232 Its vital statistics can be examined by typing the command SET S10 with no parameters SETSIO or canbe set using a command which may include any or all ofthe selections SETSIO RX 1200 TX 75 PARITY NONE STOP 1 BITS 8 HANDSHAKE ON XOFF OFF which would set a new configuration Baud rates and X0 N X 0 FFstatus are also affected by one ofthe assignmen...

Page 257: ...e two commands GET filename and PU T filename re direct console input or output and printer output instructing them to use a file rather than the device channel PIP The PIP utility Peripheral Interchange Program allows you to transfer information between the computer and its peripherals In general the form ofthe command is PIP destination source The source and destination can be either a filename ...

Page 258: ...ination disc We can load in PIP from System disc Side 1 remove the System disc and then insert the discs that we are going to use during the copying To exit from PIP press RETURN atthe prompt Note that PIP can be used to copy files from one disc to another on a single drive system prompts will be automatically issued to change the disc The source and destination drive identifiers must differ Syste...

Page 259: ...T A RO setfiles or a drive to Read Only status to prevent accidental erasure The commands SET COM RW SET KEYS CCP RW SET A RW reset files or a drive to Read Write status The commands SET COM SYS SET KEYS CCP SYS give files the System attribute Files with this attribute are not shown by the DI R command D I RS or DI RSYS is required However the files are still available for use and in addition ifth...

Page 260: ...and on Side 2 of your system discs package The commands INITDIR SET CREATE ONJ or SET ACCESS ONJ and SET U PDATE 0NJ together with DIR FULL will initiate and display date and time stampingon the default drive Typing in DATE SET is then required each time CP M Plus is started to set the clock Once set the clock will keep reasonable time updated automatically by the 6128 and inspected by DATE and DA...

Page 261: ... the date each time CP M Plus is started This is a prime application for a suitable PRO FI LE SUB file SUB MI T is required to execute files of individual commands automatically The contents ofthe command files are text and it is possible to include input to programs ifthe first character on those lines in the SUB file is The drive size amount of space and number of directory entries left on a dis...

Page 262: ...r an additional drive Drive B this takes place the first time that the disc in Drive B is accessed after Drive A has been logged in Should you try writing to a disc that has not been logged in the infamous error message Bdos Err on drive RIO will be displayed Press any key to continue If the changed disc was also of a different format then a read or write error will occur Type Cto continue If you ...

Page 263: ...M SYS STAT SECRET BAS SYS set a file to System status so that it is invisible to directory listings and file copying programs The file will still be available for all other purposes The commands STAT COM DIR STAT SECRET BAS DIR set a file to Directory status reversing the System assignment The utility FI LEe 0 PY allows you to copy files from one disc to another using a single drive It copes with ...

Page 264: ...TTER MYLETTER TXT CS AVE Cassette SAVE can take three parameters The first is the source disc filename and the second is the destination cassette filename enclosed in double quotes If the destination filename is omitted the cassette file will have the same name as the disc file If the first character of the cassette filename is then the normal cassette messages will be suppressed Ifboth filenames ...

Page 265: ...cimal 32 can be typed into strings by typing a t followed by a suitable characterfrom the set A Z _ The following options are those more commonly requiring attention InitiaL command buffer Any characters entered here will appear as if they had been typed into the Direct Console Mode when CP M is first loaded This has the effect of auto running a particular program at that time Remember to include ...

Page 266: ...ction on any other CP M system although other manufacturers may supply similar utilities often with the same names customised for their hardware The following CP M 2 2 programs are also available on Side 4 for specialist use and it is recommended that the user consult SOFT159 A Guide to CP M or other reference works ASM DOT DUMP EO LOAD MOVCPM SUBMIT XSUB 8080 Assembler 8080 Assembly code debuggin...

Page 267: ......

Page 268: ...ve ever programmed before LOGO is a powerful programming language that is rapidly gaining popularity because it is so easy to learn and use You use procedures as building blocks to create LOGO programs Dr LOGO itselfis a collection ofprocedures called primitives that you use to build your own programs During the 1970s a team ofcomputer scientists and educators under the direction of Seymour Papert...

Page 269: ...w seconds you will see the opening Welcome message followed by the question mark prompt Dr LOGO for CP M 2 2 NOTE The version of Dr LOGO which you will find on Side 4 of your master package has been provided in case you require a copy ofDr LOGO to operate with CP M 2 2 used on AMSTRAD models CPC664 and CPC464 DDIl It is therefore not generally recommended to use the Side 4 version of Dr LOGO on th...

Page 270: ...rt 90 and the turtle will move 90 degrees to the right Now type in fd 60 and another line will be drawn the same length at right angles to the first line Experiment with the simple instructions f d b k short for back r t and Lt short for left to see what happens on the screen Dr LOGO Procedures Aprocedure is a list ofinstructions that tells Dr LOGO how to do a task You will probably write your fir...

Page 271: ...LOGO allows us to type in a whole set ofcommands together so the instructions square rt 45 square will draw two squares the second at a 45 degrees angle to the first Procedures with parameters It is possible to make a procedure to which we can say how much in the same way that we can say how much to a built in procedure To make a procedure thatwill draw squares ofdifferent sized sides the definiti...

Page 272: ... passing values to a procedure First define a new procedure called triangle to triangLe repeat 3 fd edge rt 120 end We can test this by typing make edge 100 triangLe Ifwe want to know the value remembered by e d 9 e we canjust type e d 9 e after the promptandDr LOGO will print the value Finally we can use our variable e d 9 e in a new procedure to draw a pattern Notice how the value of e d 9 e is ...

Page 273: ... edit the text in front ofyou on the screen Characters will be inserted into the text at the cursor position To edit an already existing procedure use the command ed and Dr LOGO will display the old version of the procedure on the screen You may then use the previously described methods to move the cursor around the screen and change the text Try editing the procedure pat t ern by typing ed patter...

Page 274: ... part 7ofthe Foundation course to see how much free space there is on a disc Now work through the following sections and try some of the examples you won t understand everything first time As you learn about Dr LOGO you will be able to use more and more ofthe commands When you have finished with Dr LOGO type bye Summary ofDr LOGO primitives The following section groups together alphabetical lists ...

Page 275: ...he inputword bf asc G 71 asc g 1133 but first Outputs all butthe first element in the input object bl bf srn les m le s bf 1 2 3 2 3 butlast Outputs all but the last element in the inputobject bl srn les srn le bl 1 2 3 4 1 2 3 char Outputs the character whose ASCII value is the input number char 83 S Chapter 6 Page B Introduction to Logo ...

Page 276: ...puts FA LS E first emptyp TRUE emptyp TRUE emptyp x FA LS E make x emptyp x TRUE Outputs the first element ofthe input object removes list s outerbrackets put first zebra z first 1 2 3 1 firstput Outputs a new object formed by making the first input object the first element in the second object fput IfS mi Les sm Les fput 1 2 3 1 2 3 Introduction to Logo Chapter 6 Page 9 ...

Page 277: ...d with all alphabetic characters in lower case see also u c list Lc SOUTH south Outputs a list made up ofthe input objects retains list s outer brackets compare with se List 1 234 1 2 3 4 List big feet big feet List listp Outputs TRUE ifthe input object is a list otherwise outputs FA LSE Listp mother FALSE Listp father brother sister TRUE Chapter 6 Page 10 Introduction to Logo ...

Page 278: ...mberp y onLy TRUE memberp chocoLate vani LLa chocoLate strawberry FA LS E memberp chocoLate vani LLa chocoLate strawberry TRUE numberp Outputs TRUE ifthe input object is a number numberp 374 926 TRUE numberp six FALSE numberp first 2 4 6 8 TRUE piece Outputs an object that contains the specified elements ofthe input object piece 4 7 Kensington sing piece 2 4 Nana John MichaeL Wendy TinkerbeLL John...

Page 279: ...sing SH1FT 0 shuffle Outputs a listthat contains the elements ofthe input list in random order shuffle a b c d c b d a ue Outputs the mput word with all alphabetic characters in upper case compare with Le uc jones JONES where Outputs a number calculatedfrom the mostrecent successful me mb e r p expression memberp v river TRUE show where 3 word Outputs a word made up ofthe input words word sun shin...

Page 280: ...tputs the arc tangent in degrees ofthe input number cos arctan 0 o arctan 1 45 Outputs the cosine ofthe input number ofdegrees cos 60 0 5 int Outputs the integer portion ofthe input number int 4 3 1 quotient Outputs the integer division ofthe two input numbers quotient 14 4 3 14 4 3 5 Introduction to Logo Chapter 6 Page 13 ...

Page 281: ...s a subsequentrandom expression reproduce the same random sequence repeat 10 type random 10 char 9 J 1 3 7 5 3 2 0 4 2 6 repeat 10 type random 10 char 9 J 4 9 9 1 0 6 1 3 5 1 rerandom repeat 10 type random 10 char 9 J 5 2 9 0 3 1 6 2 3 7 rerandom repeat 10 type random 10 char 9 J 5 2 9 0 3 1 6 2 3 7 round Outputs the input number rounded offto the nearest integer round 3 333333 3 round 3 5 4 Chapt...

Page 282: ... 5 Outputs the sum ofthe input numbers 2 2 4 2 2 4 Outputs the difference ofthe two input numbers 10 5 5 10 5 5 Outputs the product ofinput numbers 4 6 24 4 6 24 Outputs the quotient of the two input numbers 25 5 5 25 5 5 Introduction to Logo Chapter 6 Page 15 ...

Page 283: ...ession is true or not 3 4 TRUE not 3 3 FA LS E Outputs FA LSE ifall input expressions are false or TRUE FALSE TRUE or 3 4 1 2 FALSE Outputs TRUE ifthe two input objects are equal otherwise outputs FA LSE LOGO LOGO TRUE 1 2 FALSE Outputs TRUE if the first input word is greater than the second otherwise outputs FA LS E 19 20 FALSE 20 19 TRUE Chapter 6 Page 16 Introduction to Logo ...

Page 284: ...cessible only to the current procedure and the procedures it calls locaL x y z make Makes the input named variable the value ofthe input object make side Sl l side Sl l namep Outputs TRUE ifthe input word identifies a defined variable make fLavour chocoLate flavour chocoLate namep fLavour TRUE namep chocoLate FALS E Introduction to Logo Chapter 6 Page 17 ...

Page 285: ...heLLoJJ end po say heLLo to say heLLo pr heLLo text say heLLo J pr heLLoJJ end Indicates the end ofa procedure definition must stand alone at the beginning ofthe last line po to square repeat 4 fd 50 rt 90J end square defined square print out Displays the definition s ofthe specified procedure s or variable s po square to square repeat 4 fd 50 rt 90J end make x 3 po x x is 3 Chapter 6 Page 18 Intr...

Page 286: ...efined text star repeat 5 fd 30 rt 144 fd 30 It 72 Indicates the beginning ofa procedure definition to square repeat 4 fd 50 rt 90 end square defined Editing ed edit Loads the specified procedure s and or variable s into the screen editor s buffer ed square edall Loads all the variables and procedures in the workspace into the screen editor s buffer and enters the screen editor edall Introduction ...

Page 287: ...choing text to the printer copyoff Text Screen ct clear text Erases all text in the window that currently contains the cursor then positions the cursor in the upper left corner ofthe window ct cursor Outputs a co ordinate list that contains the column and line numbers ofthe cursor s position within the text window ct cursor 0 1 type The current cursor position is show cursor The current cursor pos...

Page 288: ... the input text screen co ordinate list ct to picture make x random 2111 make y random 12 setcursor list x y pr end picture setsplit Sets the number oflines in the split screen setsplit HI show Displays the input object on the text screen retains list s outer brackets follows input with a carriage return compare with p rand t y pe ts show a b c a b c text screen Selects a full text screen ts Intro...

Page 289: ...AMSTRAD BASIC In other words all screen positions will be rounded to the nearest even numbered screen dot Red green and blue colours can have amounts ofO 1 or 2 clean Erases the graphic screen without affecting the turtle cs fd 50 cLean clear screen Erases the graphic screen and puts the turtle at 0 0 heading north with the pen down dot rt 90 fd 50 cs Plots a dot at the position specified by the i...

Page 290: ...s not on the screen cs setpc 1 dot 50 50 setpc 2 dot 50 50 setpc 3 dot 50 50 dotc 50 50 2 dotc 50 50 o dotc 1000 3000 1 fence Establishes a boundary that limits the turtle to the visible graphic screen win d 0 w removes the boundary fence fd 300 Turtle out of bounds Introduction to Logo Chapter 6 Page 23 ...

Page 291: ...2 2 setbg Sets the graphic screen backgroundto the colour assignedto the input colour number sf 0 SS 5 FENCE 1 This shows that the background is set to zero pa l 0 0 0 1 setbg 2 sf 2 SS 5 FENCE 1 setpal set palette Sets the pen colour palette Assigns an amount ofred green and blue to apen setpal 3 1 1 2 pa l 3 1 1 2 Chapter 6 Page 24 Introduction to Logo ...

Page 292: ... state indicates SS split screen FS full screen or TS text screen split size is the number of text lines displayed on the split screen s text window and window state indicates WIN DO W W RAP or FEN CE mode scrunch is the aspect ratio of the screen and defaults to 1 It can be reset using set s c run c h not available under CP M 2 2 sf 0 SS 5 FENCE 2 5 ss split screen Displays a window oftext on the...

Page 293: ... bk back MO ves the turtle the input number of steps in the opposite direction of its heading fd cs fd 150 bk 50 forward Moves the turtle the input number of steps in the direction of its current heading fd 80 home Returns the turtle to position 0 0 the centre of the graphic screen heading 0 north f d 100 rt 45 fd 100 home Chapter 6 Page 26 Introduction to Logo ...

Page 294: ...t Lt 90 pd pen down Puts the turtle s pen down the turtle resumes drawing pe fd 20 pu fd 20 pd fd 20 pen erase Changes the turtle s pen colour to the background colour the turtle erases drawn lines fd 50 pe bk 25 fd 50 pd fd 25 pU pen up Picks the turtle s pen up the turtle stops drawing fd 30 pu fd 30 pd fd 30 Introduction to Logo Chapter 6 Page 27 ...

Page 295: ...o the right rt 90 seth set heading Turns the turtle to the absolute heading specified by the input number of degrees positive numbers turn the turtle clockwise negative numbers turn the turtle counter clockwise seth 90 setpc set pen colour Sets the turtle s pen to that specified by the input number setpc 1 setpos set position Moves the turtle to the position specified in the input co ordinate list...

Page 296: ...ifhidden tf ht fd 50 st turtle facts Outputs information about the turtle The format is xcor ycor heading penstate pencolour n shownp where xcor is the turtle s x co ordinate ycor is the turtle s y co ordinate heading indicates the compass direction the turtle is facing shownp is TRUE ifthe turtle is visible penstate indicates PD pen down PE pen erase PX pen exchange or PU pen up pencolour n ident...

Page 297: ... specifiedprocedure s from the workspace er square erall Erases all the procedures and variables from the workspace eraLL em erase name Erases the specifiedvariable s from the workspace make side 100 make angLe 45 side angLe 100 45 ern side angLe side side has no vaLue nodes Outputs the number offree nod s in the workspace nodes Chapter 6 Page 30 Introduction to Logo ...

Page 298: ...nd variables in the workspace poall pons Displays the names and values ofall global variables in the workspace pons medium is 40 small is 20 large is 80 pops Displays the names and definitions ofall procedures in the workspace pops recycle Frees as many nodes as possible and re organises the workspace recycle nodes Introduction to Logo Chapter 6 Page 31 ...

Page 299: ...ake height 72 gprop height APV 72 plist property list Outputs the property list ofthe input named object pList height APV 72 pprop put property Puts the input property pair into the input named object s property list pps pprop master APV Scott master Scott Displays the non standard property pairs ofall objects in the workspace pprop SaLLy extension 213 pps SaLLy s extension is 213 pList SaLLy exte...

Page 300: ...TARS changef boxes square d i r BOXES CIRCLE STARS defaultd Outputs the name ofthe current default drive dir defauLtd A directory Outputs a list of Dr LOGO file names on the default or specified disc accepts wild cards dir a Study part 1 ofthe chapter entitled AMSDOS and CP M for the use of wild card characters Note that the wild card is not supported in Dr LOGO Introduction to Logo Chapter 6 Page...

Page 301: ...pie save Writes the contents ofthe workspace to the input named disc file save shapes NOTE Before saving insert a formatted disc with enough free space for the file that you wish to save Do not save files onto your master system disc indeed you should NEVER evenrisk writing to itby closing its write protectholes Ifyou are using the CPIM 2 2 version ofDr LOGO on Side 4 ofyour master package you can...

Page 302: ... ofyour master package you cannot change discs mid session so it is vital that your CP M 2 2 Dr LOGO working disc has plenty offree space for programs setd set drive Makes the specified drive the default drive defauLtd A d i r BOXES CIRCLE STARS setd b defauLtd B d i r TRIANGLE HOUSE I eyboard and Joystick buttonp button pressed Outputs TRUE if the button on the specified joystick is down numbers ...

Page 303: ...he positions ofthejoystickare indicated as follows Value returned 255 o 1 2 3 4 5 6 7 paddLe 0 255 Meaning Nothing pressed Up Up and right Right Down and right Down Down andleft Left Up and left The fire buttons are tested by but ton p re read character Outputs the first character typed at the keyboard make key re then press Xkey key X Chapter 6 Page 36 Introduction to Logo ...

Page 304: ...peat 3 fd 60 rt 120J Sound The sound commands are unique to the AMSTRAD implementation ofDr LOGO and are similar to their AMSTRAD BASIC counterparts Refer to part 9 ofthe Foundation course for further information sound Put a sound into the sound queue The format is channel status tone period duration volume volume envelope tone envelope noise The parameters after duration are optional sound 1 20 5...

Page 305: ...t have been set to a hold state in a sou nd command The channels to release are indicated as follows Input value o 1 2 3 4 5 6 7 reLease Channels released None A B AandB C AandC BandC AandBandC Flow ofControl bye Exits the current session ofDr LOGO bye co Ends a pause caused by CONTROL Z p a use or ERR ACT co Chapter 6 Page 38 Introduction to Logo ...

Page 306: ...tions must be literal lists enclosed in brackets if a b pr a is bigger pr b is bigger label Identifies the line to be executed after ago expression with the inputword LabeL Loop op output Makes the input object the output ofthe procedure and exits the procedure at that point op resuLt repeat Executes the input instruction list the input number oftimes repeat 4 fd 50 rt 90 Introduction to Logo Chap...

Page 307: ...e execution for the amount oftime specified by the input number The amount oftime input number 1160 seconds wait 200 Exception handling catch Traps errors and special conditions that occur during the execution of the input instruction list catch error J pr Cl am here I am here error Outputs a list whose elements describe the most recent error catch error do until error show error Chapter 6 Page 40...

Page 308: ...s the execution of the current procedure to allow interaction with the interpreter or editor i1 size 5 pause throw Executes the line identified by the input name in a previous cat c h expression throw TOPLEVEL trace Turns on trace monitoring ofprocedure execution trace watch Turns on watch monitoring ofall or specified procedure s watch Introduction to Logo Chapter 6 Page 41 ...

Page 309: ...e first input number examine Displays the contents ofthe absolute memory location specified in Retrieves the current value ofthe input numbered port out Sends the input value to the input numberedport System Variables ERRACT When TRUE causes a pause when an error occurs then returns to TOP LE VEL FALSE System value Chapter 6 Page 42 Introduction to Logo ...

Page 310: ...perties APV Associated property value the value ofa global variable DEF Definition ofa procedure ENL End ofa procedure line that is broken by a carriage return or spaces EMT Beginningofa procedure line that is brokenby a carriage return and spaces PRM Identifies a primitive REM Olj Remarks or comments Introduction to Logo Chapter 6 Page 43 ...

Page 311: ......

Page 312: ...Joysticks Disc organisation Resident System eXtensions RSX s Memory CP M Plus Terminal Emulator CP MPlusCharacterSet For a complete guide to the BASIC and firmware for the CPC6128 consult AMSOFT manuals SOFT 967 and SOFT 968 respectively Part 1 BASIC Cursorlocations and control code extensions In a variety of applications programs the text cursor may be positioned outside the current window Variou...

Page 313: ...zero or negative which are offto the left or above the window Character values in the range 0 to 31 sent to the text screen do not produce a character on the screen but are interpreted as CONTROL CODES and should not be injudiciously applied Some of the codes alter the meaning of one or more of the following characters which are the code s parameters A control code sent to the graphics screen will...

Page 314: ...r switch parameter value of1 Note that to display a cursor from within a BASIC program other than the automatic cursor generated when BASIC is awaiting keyboard input a CUR S0 R command with a system switch parameter value ofl must be used 04 4 EOT Oto2 Set screen mode Parameter taken MOD 4 Equivalent to a MOD E command 05 5 ENQ Oto255 Send the parameter character to the graphics cursor 06 6 ACK E...

Page 315: ...aper Ink Parameter taken MOD 16 Equivalent to PAP ER command Set Pen Ink Parameter takenMOD 16 Equivalent to PEN command Delete current character Fills character cell with current Paper Ink Clearfrom left edge ofwindow to and including the current character position Fills affected cells withthe current Paper Ink Clearfrom and including the current character position to the right edge ofwindow Fill...

Page 316: ...valent to a Oto255 SYMB0 Lcommand Takes nine Oto255 parameters The first parameter Oto255 specifies which character s Oto255 matrix to set The next eight Oto255 specify the matrix The most Oto255 significantbit ofthe first Oto255 byte corresponds to the top lefthand pixel ofthe character cell the least significant bit ofthe last byte corresponds to the bottom right hand pixel ofthe character cell ...

Page 317: ...nt window Equivalent to a LO CAT Ecommand The first parameter gives the columnto move to the second gives the line The housekeeping of the 6128 is provided by a sophisticated real time operating system The operating system directs the traffic through the computer from the input to the output It primarily interfaces between the hardware and the BASIC interpreter for example the ink flashing functio...

Page 318: ... Timer 1 Timer 0 Interrupts should be included after considering the consequences of possible intermediate variable states at the point of interruption The interrupt sub routine itself should avoid unwanted interaction with the state of variables in the main program The sound queues have independent interrupts of equal priority Once a sound interrupt has started it is not interrupted by any other ...

Page 319: ...F 113 161 71 q 14 016 OE SO CTRL N 64 100 40 114 162 72 r 15 017 OF SI CTRL O 65 101 41 A 115 163 73 5 16 020 10 DLE CTRL P 66 102 42 B 116 164 74 t 17 021 11 DC1 CTRL Q 67 103 43 C 117 165 75 u 16 022 12 DC2 CTRL R 66 104 44 D 116 166 76 v 19 023 13 DC3 CTRL S 69 105 45 E 119 167 77 w 20 024 14 DC4 CTRL T 70 106 46 f 120 170 76 x 21 025 15 NAK CTRL U 71 107 47 G 121 171 79 Y 22 026 16 SYN CTRL V ...

Page 320: ...xt to one another See the section User Defined Characters in the chapter entitled At your leisure 33 H21 X00100001 11 11 l1li 34 H22 X00100010 35 H23 X00100011 32 H20 X00100000 36 H24 X00100100 37 H25 X00100101 41 H29 X00101001 38 H26 X00100110 42 H2A X00101010 39 H27 X00100111 43 H2B X00101011 45 H2D X00101101 For your reference 46 H2E X00101110 47 H2F X00101111 40 H28 X00101000 44 H2C X00101100 ...

Page 321: ...apter 7 Page 10 50 H32 X00110010 54 H36 X00110110 51 H33 X00110011 55 H37 X00110111 58 H3A X00111010 62 H3E X00111110 66 H42 X01000010 59 H3B X00111011 63 H3F X00111111 67 H43 X01000011 52 H34 X00110100 56 H38 X00111000 60 H3C X00111100 64 H40 X01000000 68 H44 X01000100 For your reference ...

Page 322: ... reference 70 H46 X01000110 74 H4A X01001010 78 H4E X01001110 82 H52 X01010010 86 H56 X01010110 71 H47 X01000111 75 H48 X01001011 72 H48 X01001000 11 11 11 I 11 76 H4C X01001100 79 H4F X01001111 80 H50 X01010000 83 H53 X01010011 87 H57 X01010111 84 H54 X01010100 88 H58 X01011000 Chapter 7 Page 11 ...

Page 323: ...er 7 Page 12 90 H5A X01011010 94 H5E X01011110 98 H62 X01100010 102 H66 X01100110 106 H6A X01101010 91 H5B X01011011 95 H5F X01011111 99 H63 X01100011 103 H67 X01100111 107 H6B X01101011 92 H5C X01011100 96 H60 X01100000 100 H64 X01100100 104 H68 X01101000 108 H6C X01101100 For your reference ...

Page 324: ... reference 110 H6E X01101110 114 H72 X01110010 118 H76 X01110110 122 H7A X01111010 126 H7E X01111110 111 H6F X01101111 115 H73 X01110011 119 H77 X01110111 123 H7B X01111011 127 H7F X01111111 112 H70 X01110000 116 H74 X01110100 120 H78 X01111000 124 H7C X01111100 128 H80 Xi 0000000 Chapter 7 Page 13 ...

Page 325: ...7 Page 14 130 H82 Xi0000010 134 H86 X10000110 138 H8A X10001010 142 H8E X10001110 146 H92 X10010010 131 H83 X10000011 135 H87 X10000111 139 H8B X10001011 143 H8F X10001111 147 H93 X10010011 132 H84 Xi00001 00 136 H88 Xi0001000 140 H8C X10001100 144 H90 Xi0010000 148 H94 X10010100 For your reference ...

Page 326: ...r reference 150 H96 X10010110 154 H9A X10011010 158 H9E X10011110 162 HA2 X10100010 166 HA6 X10100110 151 H97 X10010111 155 H9B X10011011 159 H9F X10011111 163 HA3 X10100011 167 HA7 X10100111 152 H98 X10011000 156 H9C X10011100 160 HAO Xi0100000 164 HA4 X10100100 168 HAS X10101000 Chapter 7 Page IS ...

Page 327: ...r 7 Page 16 170 HM X10101010 174 HAE X10101110 178 HB2 X10110010 182 HB6 X10110110 186 HBA X10111010 171 HAB X10101011 175 HAF X10101111 179 HB3 X10110011 183 HB7 X10110111 187 HBB X10111011 172 HAC X10101100 176 HBO X10110000 180 HB4 X10110100 184 HB8 X10111000 188 HBC X10111100 For your reference ...

Page 328: ...r your reference 190 HBE 10111110 194 HC2 11000010 198 HC6 11000110 202 HCA 11001010 206 HCE 11001110 191 HBF 10111111 195 HC3 11000011 199 HC7 11000111 203 HCB 11001011 207 HCF 11001111 192 HCO 11000000 196 HC4 11000100 200 HC8 11001000 204 HCC 11001100 208 HDO 11010000 Chapter 7 Page 17 ...

Page 329: ...010 214 HD6 X11010110 218 HDA X11011010 222 HDE X11011110 226 HE2 X11100010 III11111 211 HD3 X11010011 215 HD7 X11010111 11 219 HDB X11011011 223 HDF X11011111 227 HE3 X11100011 212 HD4 X11010100 III III III III II1II II1II1 II1II 216 HD8 X11011000 11 220 HDC X11011100 224 HEO X11100000 228 HE4 X11100100 For your reference ...

Page 330: ...r your reference 230 HE6 11100110 234 HEA 11101010 238 HEE 11101110 242 HF2 11110010 246 HF6 11110110 231 HE7 11100111 235 HEB 11101011 239 HEF 11101111 243 HF3 11110011 247 HF7 11110111 232 HE8 11101000 236 HEC 11101100 240 HFO 11110000 244 HF4 11110100 248 HF8 11111000 Chapter 7 Page 19 ...

Page 331: ...249 HF9 X11111001 253 HFD X11111101 Chapter 7 Page 20 250 HFA X11111010 254 HFE X11111110 251 HFB X11111011 255 HFF X11111111 252 HFC X11111100 For your reference ...

Page 332: ...Part 4 I ey references Default ASCII values HEX JOYSTICK 0 IFIRE21r RE 11 58 5A 58 5A For your reference JOYSTICK 1 26 36 Chapter 7 Page 21 ...

Page 333: ... A 11 N A 11 N A IEJEJEJEJEJEJEJEJEJGI1 11I N A 1111 N lA 181 N A 11 li 11 N A 11 N A 11 N A I EXPANSION DEFAULT SETTING CHARACTER CHARACTER ASCII VALUE 0 128 0 30 1 129 1 31 2 130 2 32 3 131 3 33 4 132 4 34 5 133 5 35 6 134 6 36 7 135 7 37 8 136 8 38 9 137 9 39 10 138 2E 11 139 RETURN OD 12 140 RUN RETURN 52 55 4E 22 OD Note Expansion characters 13 to 31 141 to 159 have a null value by default Th...

Page 334: ... eyandjoysticknumbers JOYSTICK 0 JOYSTICK 1 IFIRE211 FIRE 1 I 76 77 IFIRE2jj FIREl j 52 53 For your reference Chapter 7 Page 23 ...

Page 335: ...EQUENCY PERIOD RELATIVE ERROR C 16 352 3822 0 007 C 17 324 3608 0 007 D 18 354 3405 0 007 D 19 445 3214 0 004 E 20 602 3034 0 009 Octave 4 F 21 827 2863 0 016 F 23 125 2703 0 009 G 24 500 2551 0 002 G 25 957 2408 0 005 A 27 500 2273 0 012 A 29 135 2145 0 008 8 30 868 2025 0 011 NOTE FREQUENCY PERIOD RELATIVE ERROR C 32 703 1911 0 007 C 34 648 1804 0 007 D 36 708 1703 0 022 D 38 891 1607 0 004 E 41...

Page 336: ... D 146 832 426 0 081 D 155 564 402 0 058 E 164 814 379 0 057 Octave l F 174 614 358 0 019 F 184 997 338 0 046 G 195 998 319 0 037 G 207 652 301 0 005 A 220 000 284 0 032 A 233 082 268 0 055 B 246 942 253 0 038 NOTE FREQUENCY PERIOD RELATIVE ERROR C 261 626 239 0 046 MiddleC C 277 183 225 0 215 D 293 665 213 0 081 D 311 127 201 0 058 E 329 628 190 0 206 F 349 228 179 0 019 Octave 0 F 369 994 169 0 ...

Page 337: ... 45 0 574 Octave 2 F 1479 978 42 0 548 G 1567 982 40 0 350 G 1661 219 38 0 992 A 1760 000 36 1 357 A 1864 655 34 1 417 B 1975 533 32 1 134 NOTE FREQUENCY PERIOD RELATIVE ERROR C 2093 004 30 0 462 C 2217 461 28 0 662 D 2349 318 27 1 469 D 2489 016 25 0 441 E 2637 021 24 1 246 F 2793 826 22 1 685 Octave 3 F 2959 955 21 0 548 G 3135 963 20 0 350 G 3322 438 19 0 992 A 3520 000 18 1 357 A 3729 310 17 1...

Page 338: ...er is invalid in some way 6 OverfLow The result of an arithmetic operation has overflowed This may be a floating point overflow in which case some operation has yielded a value greater than 1 7E t 38 approx Alternatively this may be the result of a failed attempt to change a floating point number to a 16 bit signed integer 7 Memory fuLL The current program or its variables may be simply too big or...

Page 339: ...mode 13 Type mismatch A numeric value has been presented where a string value is required or vice versa or an invalidly formed number has been found in REA Dor I NPUT 14 String space fuLL So many strings have been created that there is no further room available even after garbage collection 15 String too Long String exceeds 255 characters in length May be generated by appending strings together 16...

Page 340: ...outine 20 Unexpected RESUME RES UMEis only valid while in error processingmode i e in an 0 N ERR 0 R GOT 0 routine 21 Direct command found Whenloading a file a line without a line number has been found 22 Operand missing BASIC has encountered an incomplete expression 23 Line too long A line when converted to BASIC internal form becomes too big 24 EOF met An attempt has been made to read past end o...

Page 341: ...t find aWE NDto match a W HI LE command 30 Unexpected WEND Encountered aWE NDwhen not in a W HI LE loop or aWE NDthat does not match the current W HI LE loop 31 Fi Le not open See the section ahead entitled Disc errors 32 Broken in See the section ahead entitled Disc errors AMSDOS Disc errors There are several errors that may occur during the processing of any filing operations BASIC handles all s...

Page 342: ... detected IfAMSDOS has already reported an error then bit 7 is set hence the value of DERR is offsetby 128 Other values returned by DERR originate from the disc controller and are bit significant always with bit 6 set Bit 7 indicates whether the error has been reported by AMSDOS as explained above The significance ofeachbitis as follows Bit Significance o Address mark missing 1 Notwritable disc is...

Page 343: ...R 31 THEN PRINT are you sure you ve typed line 20 correctly END 1030 IF amsdoserr 20 THEN PRINT disc is full suggest you use a new data disc END 1040 IF amsdoserr X01001000 THEN PRINT put a disc in the drive then press a key WHILE INKEY WEND RESUME 1050 END Part 7 BASIC Keywords The following is a list ofall AMSTRAD CPC6128 BASIC keywords As such they are reserved and canNOT be used as variable na...

Page 344: ...TO 0 ON SQ OPENIN OPENOUT OR ORIGIN OUT PAPER PEEK PEN PI PLOT PLOTR POKE POS PRINT RAD RANDOMIZE READ RELEASE REM REMAIN RENUM RESTORE RESUME RETURN RIGHT RND ROUND RUN SAVE SGN SIN SOUND SPACE SPC SPEED SQ SQR STEP STOP STR STRING SWAP SYMBOL TAB TA i TAGOFF TAN TEST TESTR THEN TIME TO TROFF TRON UNT UPPER USING VAL VPOS WAIT WEND WHILE WIDTH WINDOW WRITE XOR XPOS YPOS ZONE For your reference Ch...

Page 345: ...Part 8 Planners Text and window planner MODE 0 20 columns l l t t e i i i i l l Chapter 7 Page 34 For your reference ...

Page 346: ...ext and window planner MODE 1 40 columns iil iil III ill ill ill il III i i l l j f j l l g III ill l l N ill ill 11 11 l l l j N N ii ii i i i i i i 1 1 t t i l i l For your reference Chapter 7 Page 35 ...

Page 347: ...r MODE 2 80 columns li li I I i i 1t 1t 18 18 18 18 S S S l Ii Ii ill ill ill ill ill ill l l 5 5 11 11 11 3 f fi fi III III II II j j ii ii III III III i ii 1j 1j fii fii l l i2 e i2 i2 Chapter 7 Page 36 For your reference ...

Page 348: ...Sound envelope music planner o For your reference Chapter 7 Page 37 ...

Page 349: ...SOCKET 12VDCPLUG t PRINTER SOCKET r EXPANSION SOCKET Lr L JOYSTICKSOCKET Joystick Socket VIEWED FROM REAR 2 3 4 5 0 0 6 7 8 9 PIN 1 UP PIN 6 FIRE 2 PIN 2 DOWN PIN 7 FIRE 1 PIN 3 LEFT PIN 8 COMMON PIN 4 RIGHT PIN 9 COM 2 PIN 5 SPARE Chapter 7 Page 38 For your reference ...

Page 350: ...PIN 4 SYNC PIN 2 GREEN PIN 5 GND PIN 3 BLUE PIN 6 LUM RIGHT I y LEFT II GND LEFT PIN 1 LEFT CHANNEL PIN 2 RIGHT CHANNEL PIN3GND VIEWED FROM REAR 0 3 o 0 5 0 2 4 PIN 1REMOTE SWITCH PIN 4 DATA IN PIN2GND PIN 5 DATA OUT PIN 3 REMOTE SWITCH RIGHT GND For your reference Chapter 7 Page 39 ...

Page 351: ... PIN 28 MREO PIN 45 RAMDIS PIN 12 A6 PIN 29 M1 PIN 46 CURSOR PIN 13 A5 PIN 30 RFSH PIN 47 L PEN PIN 14 A4 PIN 31 IORO PIN 48 EXP PIN 15 A3 PIN 32 RD PIN 49 GND PIN 16 A2 PIN 33 WR PIN 50 J PIN 17 Al PIN 34 HALT Disc Drive 2Socket VIEWED FROM REAR d 3 5 7 9 D V n v PIN1 READY PIN18 GND PIN2 GND PIN19 MOTOR ON PIN3 SIDE 1SELECT PIN20 GND PIN4 GND PIN21 N C PIN5 READ DATA PIN 22 GND PIN6 GND PIN23 DR...

Page 352: ...printer The printer cable is simply constructed as a one to one connection between the PRINTER socket at the rear of the computer and the connector on the parallel printer Note that there are two less fingers on the computer printed circuit board than on the printer connector This is to allow the use of a standard printed circuit board edge connector The actual pin interface details are illustrate...

Page 353: ...ics operation together with the printing ofcomplete screen dumps Printer configuration Afacility is provided whereby special characters which may appear on the screen and which are supported by the AMSTRAD DMP2000 and DMP1 will be printed even though the character codes for the screen and printer may be different The majority of these symbols will only be available when the printer is switched to ...

Page 354: ...NKEY Note that in the majority ofcases the main fire button on ajoystick is interpreted as Fire 2 by the 6128 The functions JOY Ql and JOY 1 enable direct inspection ofthe first and second joysticks repectively The function returns a bit significant result which indicates the state ofthejoystickswitches atthe last keyboard scan The table below indicates the values returned by bothjoysticks The JOY...

Page 355: ... a different format on each side Common to all formats Single sided the two sides ofa 3 inch disc are treated separately 512 byte physical sector size 40 tracks numbered 0to 39 1024byte CP M block size 64 directory entries SYSTEM format 9 sectors per track numbered 41 to 49 2reserved tracks The system format is the main format supported since CP M can only be loaded from a system format disc CPIM ...

Page 356: ...an external command is a way of extending the repertoire of the BASIC by adding new commands signalled by a I prefix The machine instructions for the AMSDOS new commands are included in a ROM and the necessary housekeeping to add the commands is carried out automatically when the 6128 starts BASIC It is also possible to add further external commands after BASIC has started by loading the machine i...

Page 357: ...IC 1 1 The user defined characters are initially positioned immediately above HIMEM HIMEM may be altered by a MEM0 RYcommand but is also automatically lowered by 4K to create a buffer whilst AMSDOS files are open The number of user defined characters can only be altered ifHIMEM is unchanged since the last time they were set unless the last time they were set to no user defined characters by a SYMB...

Page 358: ...s 140 CALL rsxaddress I Log on rsx 150 SYMBOL AFTER 140 I restore user defined characters 11 I I I FIRMWARE DATA AREA JUMP BLOCK BASIC DATA AREA DISC ROM DATA AREA ANY OTHER RQMS DATA AREA I I I I I I I I I I I I I I I I I I Lj Memory Map with RSX loaded in recommended position Additional 110 Most I O port addresses are reserved by the computer in particular addresses below 7FFF should not be used...

Page 359: ... 2 and were chosen both to be simple to use and to reflect the facilities available in the Firmware Text VDU These facilities are unique to AMSTRAD computers and software must therefore be adaptedto their use In the Business and Commercial environment ofCP M Plus software it is normal to expect a range of standard Text VDU facilities in order that software is easily portable and installable from o...

Page 360: ...ding to control codes 00 to IF Note that many applications languages expand the control code 09 TAB to a number ofspaces and therefore the sequence ESC TAB will often not display the character for 09 ESC O ESC 1 ESC 2 n Disable status line Disc system messages will appear with CRT output CRT may use the bottomline ofthe screen Enable status line Disc system messages will appear on the bottom line ...

Page 361: ...C J Erase to end ofpage Includes character at cursor position The cursor position is unaffected ESC K Erase to end of line Includes character at cursor position The cursorposition is unaffected ESC L Insert Line All rows below and including the cursor line are scrolled down The cursor row is cleared The cursor position is unaffected ESC M Del te line All rows below and including the cursor row are...

Page 362: ... screen The colour is specified as above Erase to beginning of page Includes character at cursor position The cursor position is unaffected Enable cursor blob To prevent unsightly flashing the cursor is not turned on during normal text outputting until 1110 second after the last character was written Disable cursor blob Save the cursor position Restore cursor position as saved by ESCb Erase line T...

Page 363: ...haracter set into a form where they can be printed when a language selection is made on the printer The facility is somewhat limited because very few printers foreign characters actually appear in the BASIC character set Although this printer translation scheme still operates under CP M Plus the character set has been enhanced to allow an almost complete correspondence between the screen character...

Page 364: ... dealing with 7 bit software Nearly all available software including most CP M Plus utilities Word processors and languages operate with only a 7 bit character set In the UK it is fairly well accepted that the disappears to be replaced by the not only in word processing where it is regarded as desirable but also in program listings e g LIS T 8 where it is regarded as undesirable However in time ev...

Page 365: ...n IH 6jj B E H lil1lUII116 c ifi lilijn JIBI liHli D ii i1iiiIHI iiiil E 1 i B I iiili iiHHj F iHi i if ni iHI Characters 128to 255 80 to FF The Standard CPIM Plus Character Set USA Software which is capable of operating with 8 bit characters may use this character set to access all of the foreign language characters at once without having to specifically change language In this way all the bar an...

Page 366: ...er the BASIC ROM or the disc ROM into play instead of Block 3 This switching takes place automatically when the BASIC or firmware is required Bank switching ofRAM merely extends this concept to include the overlaying of RAM rather than ROM The switching is taken care of by an assembler program The program BAN KMAN BA S is provided on Side 1 of the system discs package If the program is run after B...

Page 367: ...bly the middle of your BASIC program is preserved and is restored when the BANK MANAGER has finished There are three other bank selections possible apart from the five shown below but they are only useful to the implementationofCP MPlus Hardware bank switching The BANK MANAGER supports two commands for moving screen fulls of information between one block and another Blocks 4 to 7 are switched in a...

Page 368: ...ond 150 TIME counts The screen number s required are 1 the normal screen and then either 2 3 4 or 5 Copy and swap operations where the source or destination is screen 1 will operate much faster Be careful of the screen hardware roll effect as experienced when dealing with disc screen dumps It should be arranged that all the screen images are constructed and viewed with screen 1 set to the same har...

Page 369: ...lthough 2 bytes is recommended as the minimum Once the RAMrecord length has been established each record can be accessed by its RAMrecord number It is perfectly acceptable to write the RAMfile using one record length and read itbackusing another NOTE The RAMfile must contain only data there is NO facility for it to contain program instructions As is common with random access disc filing schemes th...

Page 370: ...ommand I BAN KREA D returncode stringvariable RAMrecord number reads a record into the stringvariable from the RAMfile The RAMrecord number specifies which record is to be read If the parameter is omitted then the current record number is used The current record number is then set to point at the nextrecord Ifthe record contents do not completely fill the string variable then old characters which ...

Page 371: ...e that point Ifthe search is successful then the current record number is set to point at the record where the match was found otherwise it remains unaffected return code is an integer variable which returns the record number where the match was found if the operation was successful or a negative error code if the search operationhas failed in some way 1 End of File The starting record number s ad...

Page 372: ... IF The database takes some time to create butthen 64K is a lot ofmemory to fill 10 ANAGRAMS by ROLAND PERRY 20 copyright c AMSOFT 1985 30 40 Remember to RUN BANKMAN before running program 50 60 70 MODE 2 80 DEFINT a z 90 r 0 IBANKOPEN 7 100 INPUT What 7 letter word to scramble s 110 IF LEN s 7 THEN 100 120 PRINT Please wait 130 LOCATE 1 5 PRINT Computing 140 FOR c1 1 TO 7 150 FOR c2 1 TO 7 160 IF...

Page 373: ...360 NEXT c3 370 NEXT c2 380 NEXT c1 390 lastrec r 400 REM now look them up 410 r 0 g SPACE 7 420 PRINT INPUT What match do you require use as wil d card m 430 m LEFT m 7 440 FOR x 1 TO LEN m 450 IF MID m x 1 THEN MID m x 1 CHR 0 460 NEXT 470 IBANKFIND r m 0 lastrec 480 IF r 0 THEN GOTO 420 490 IBANKREAD r g 500 PRINT g 510 IBANKFIND r m r 1 lastrec 520 GOTO 480 Chapter 8 Page 8 More About the Bank...

Page 374: ...n features of the way that the computer behaves are produced by courtesy of the hardware things like the coloured display on the TV set or monitor It s up to the software to make use of these hardware capabilities to produce specifically designed characters and shapes on the screen The hardware actually directs the beam of electrons at the electro luminescent surface on the inside ofthe screen of ...

Page 375: ...and like any language it comes in a variety oflocal dialects The version in the 6128 is one ofthe most widely compatible dialects ufBASIC arid will also run programs writtenfor operation under the CPIM disc operating system It is a very fast implementation of BASIC in other words it performs its calculations quickly and whilst you may not be too concerned that one computer may take 0 05 of a secon...

Page 376: ...ional disc drive a cassette data motor control socket facilities for up to two joysticks a stereo sound output and a comprehensive expansion bus that canbe used to attach a serial interface AMSTRAD model RS232C a MODEM a speech synthesiser AMSTRAD model SSA2 a lightpen etc 4 Sound The sound features ofa computer determine whether or not it sounds like a bluebottle in a empty cocoa tin or ifit can ...

Page 377: ...t least for the time being Until the price of high speed memory falls dramatically it will eventually small computers have to make do with a relatively small amount of memory available to control the screen display which results in lower resolution and jerkier movements Thoughtful hardware design and good programming can go a long way to making the best of this situation but we are still a fair wa...

Page 378: ...ut to do this you must have first loaded a word processor program into the machine s memory The computer seems to combine several items of equipment that have become familiar around the home and office such as the TV like screen and the keyboard You must remember that the similarities are generally strictly superficial and that the computer is a combination of familiar looking hardware that has an...

Page 379: ...on Don t be mislead by the plain language used in computing it is not a literary subject but a precise science and apart from the syntax of the wording the structure ofthe communication is very straightforward and not in the least confusing or ambiguous Teachers ofcomputing have not yet managed to make an art form out oftrying to analyse the exact meaning intended by a programmer in his program co...

Page 380: ...cold and clinical message Syntax error This is not as restrictive as it first appears since the language ofBASIC the syntax is primarily designed to manipulate numbers the numeric data The words are essentially an extension of the familiar mathematical operators etc and the most important concept for newcomers to grasp is the fact that a computer can only work with numeric data Information that is...

Page 381: ...ybe or perhaps The process of switching between these two distinct states is the essence ofthe term digital and is sometimes referred to as toggling In the world of nature most processes move gradually from one completely stable state to another in a linear progression In other words the transition is made by following the path of a line between the two states in an ideal digital environment the s...

Page 382: ...e only two numbers available are 0 or 1 how then do you count beyond1 Bits and Bytes We just happen to be used to understanding numbers based on the decimal system where the reference point is the number 10 i e there are ten digits available to represent quantities in range from 0 to 9 which is used in preference to the expression 1 to 10 The system where numbers range from 0 to 1is the binary sys...

Page 383: ...table means of handling the memory two bytes are used to provide a method of addressing memory which is in the form ofarray with a horizontal and vertical address by which the elements ofthat array canbe located 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 1 1 6 7 8 9 The array can locate up to 10xl0 items ofinformation using address numbers that lie in the range 0 to 9 The item stored at position 3 5 is a 1 a...

Page 384: ... the bedrock ofcomputer operation in the foreseeable future The certainty and simplicity that comes from working in only two states will prevail over the enormously increased complexity that wouldresult from any other number base However Simple and elegant as it is binary notation is longwinded and prone to inaccuracy as it cannot be easily read at a glance Binary has a number of associated counti...

Page 385: ...mers get to programming directly in machine code since the assembly language program allows the programmer to use simple letter mnemonics to specify the actual machine code numbers When using hex you must first work out the value of the first digit to obtain the number of 16 s in the final number and then add the remainder designated by the second half of the hex notation to obtain the total decim...

Page 386: ...pacityto remember both the data that has been input and the intermediate results ofthe many thousands of very simple sums along the way to the result If you want to pursue the theory of your computer there are literally thousands of books available on the subject of computing Some will tend to leave you more confused than you were wh n you started reading them but a few will actually lead you alon...

Page 387: ... Using the Extra Memory Abit ofcharacter As you type at your 6128 keyboard you should not take for granted the fact that recognisable letters and numbers etc appear on the screen After all we ve already discussed the fact that your computer is not a typewriter What s actually happening is a result ofyou pressing a combination ofelectrical switches The electrical signals produced when you press the...

Page 388: ...arily a system that ensures the data sent from one computer to another is in a recognisable form The chapter entitled For your reference lists the ASCII display range together with the additional characters available on the 6128 and the corresponding numeric codes Howwe get there You are by now probably quite familiar with the program 10 FOR n 32 TO 255 20 PRINT CHR n 30 NEXT which makes the compu...

Page 389: ...s 32 it should return to the line where the FOR is located and do the same again with the NE XT value that it assigns to the variable n This process is known as looping and is one ofthe most vital and fundamental aspects of computer programming and operation It saves typing long repetitious sequences manually and you will quickly come to use it inyour ownprogramming When this FOR NEXT loop reaches...

Page 390: ...once you do many things about computing will fall into place and the elegant structure of the numbering system will become apparent Ifyou are unsure about the binary and hexadecimal numbering systems we suggest thatyou thoroughly read part 1 ofthis chapter ifyou have not already done so Once the computer has translated the pressing ofthe Akey into the type ofnumber it understands it looks into tha...

Page 391: ... description and use is entirely well er logical but it is notoriously difficult to describe logic in simple terms without the precision ofconcise definitions The two halves of the logical expression are known as the arguments A logical expression comprises argument logical operator argument where argument is NOT argument or numeric expression or relational expression or logical expression Both th...

Page 392: ...a selfexplanatory application 10 INPUT The number of the day day 20 INPUT The number of the month month 30 IF day 25 AND month 12 THEN 50 40 CLS GOTO 10 50 PRINT Merry Christmas OR works on bits as well where the result is 1 unless both bits from the arguments are 121 in which case the result is 121 Using the same numbers as for the AND example PRINT 1000 OR 10 1002 Bit wise 1010 1111101000 Result...

Page 393: ...The bit representation for 1 is all bits of the integer 1 for 13 all bits of the integer 13 The result of a logical operation on two such arguments will yield either 1for True or 13 for False Check this by adding lines 613 and to the above program 613 PRINT NOT month 12 OR month 1 713 PRINT Cmonth 12 OR month 1 and when the program is run entering 29 for the day and say 2 for the month will produc...

Page 394: ...101 B5 128 32 16 4 1 181 10110001 B1 128 32 16 1 177 11111111 FF 128 64 32 16 8 4 2 1 255 the command is SYMBOL 240 8 60 66 165 129 181 177 255 or SYMBOL 240 08 3C 42 A5 81 B5 B1 FF or SYMBOL 240i X00001000 X00111100 X01000010 X10100101 X10000001 X10110101 X10110001 X11111111 To print the user defined character you would type PRINT CHR 240 Finally to group blocks ofcharacters together you may for ...

Page 395: ... semicolonor a comma The semicolon causes direct continuation ofprinting while a comma forces printing to continue in the next zone The initial zone width is 13 but may be changed using the Z0 NEcommand PRINT 3 4 5 3 4 5 PRINT heLLo there he LL 0 there PRINT heLLo there he Llo PRINT 3 4 5 3 ZONE 4 PRINT 3 4 5 3 4 5 there 4 5 Apoint to note here is the fact that positive numbers are printed with a ...

Page 396: ...inter ifconnected Stream 9 directs output to a disc or cassette file Note however that the W RI TE command should be used instead of PRI NTfor this purpose PRINT hello hello window 0 PRINT 0 hello he II 0 also window 0 PRINT 4 hello hello window 4 At the top ofthe screen PRINT 8 hello hello on the printer Ifconnected TAB and SPCare fine for simple print formats but to specify a more detailed forma...

Page 397: ... the edges ofthe paper MODE 1 LOCATE 39 1 PRINT too Long line 1 too L0 ng line 2 MODE 1 LOCATE 39 1 PRINT USING too Long to line 1 o Long line 2 A large number oftemplates are available for the printing ofnumbers Probably the simplest is PR I NT US I NG one digit is printed for each that appears in the template PRINT USING 123 123 The position ofthe decimalpoint may be includedby the use of PRINT ...

Page 398: ...added with floating asterisks by the use of inthe template PRINT USING 12 22 12 2 This may be combined with the currency symbols and then only one currency symbolis used i e etc or etc A at the start of the template specifies to always print the sign of the result before the first digit A at the end ofthe template prints a trailing sign A can only be placed at the end ofthe format and specifies th...

Page 399: ...rmal BASIC prompts and inessages for example Re a dy are produced in window zero The hash symbol precedes this number to identify it as being a stream director The next four numbers specify the left right top and bottom limits ofthe window These values are column and row numbers so they must lie in the range 1 to 80 for left right and 1 to 25 for top bottom The following example will define WIN D0...

Page 400: ...LLo there These words will appear at the top of the green rectangle rather than on the following line as would have happened if PRINT heLLo there had been used While typing in the earlier command you will have noticed that part ofthe green window was overwrittenby thetext If you want all the normal BASIC messages to appear in window 4 then it can be swapped with the default window QI byuse ofthe W...

Page 401: ...d so if after using windows you find that the cursor ends up in a very small window just type in MOD E 1 as shown MODE 1 WINDOW 20 21 7 18 MO DE 1 Don t worry about the word M 0 DE being split up it will still work and don t forget to leave a space between MOD Eand 1 Now that you know a little about the way in whichwindows operate try typing inthe following shortprogram 10 MODE 0 20 FOR n 0 TO 7 3...

Page 402: ...ASIC which means that AMSTRAD BASIC is capable of performing a number of simultaneous but separate operations within a program Such a facility is sometimes referred to as multi tasking and it is implemented by the application of the commands AFT ER and EVERY This facility is also clearly demonstrated in the way in which sound may be handled throughfacilities such as queues andrendezvous Every aspe...

Page 403: ...ND 400 20 AFTER x 3 GOSUB 80 30 EVERY 25 2 GOSUB 160 40 EVERY 10 1 GOSUB 170 50 PRINT test your reflexes 60 PRINT press the space bar 70 IF flag 1 THEN END ELSE 70 80 z REMAIN 2 90 IF INKEY 47 1 THEN 110 100 SOUND 1 900 PRINT cheat GOTO 150 110 SOUND 129 20 PRINT NOW t TIME 120 IF INKEY 47 1 THEN 120 130 PRINT you took 140 PRINT TIME t 300 seconds 150 CLEAR INPUT flag 1 RETURN 160 SOUND 1 0 50 PRI...

Page 404: ...12 14 21 run In the same way that different items in an I NPUT statement are separated by commas so it is with items in a DATAstatement In addition to numeric values constantstrings may also be held in DATAstatements 10 DIM a 8 20 FORi 0 TO 8 30 READ a i 40 NEXT 50 FOR 0 TO 8 60 PRINT a i 70 NEXT 80 DATA The quick brown fox jumps over the lazy dog run You may notice that although the DATA contains...

Page 405: ... from the point atwhichthe first REA Dstops 10 DATA 123 456 789 321 654 2343 20 FOR i 1 to 5 30 READ num 40 total total num 50 NEXT 60 READ total2 70 IF total total2 THEN PRINT the data is ok ELSE PRINT there is an error in the data run Try editing line 10 so that one ofthe first 5 numbers is wrong then run the program again This technique ofadding an extra value to the end of DATAstatements which...

Page 406: ...s in line 60 will produce 9 then 1 These values are ofcourse valid strings but the result is not exactly what was planned One method by which the program could be forced to work properly would be to include the following commands 15 RESTORE 80 45 RESTORE 90 The RES TOR Estatement will move the DATA reading pointer to the line specified and can therefore be used in a conditional statement to pick a...

Page 407: ...3 3010 DATA 190 191 192 193 194 etc Another example use of DATA REA Dand RES TOR E might be in a program that plays a tune Tone period values may be REA D from DATA statements and RES TOR Eused to make a section repeat by movingthe pointer back to the beginning ofa certainpart ofthe music data 10 FOR i 1 TO 3 20 RESTORE 100 30 READ note 40 WHILE note 1 50 SOUND 1 note 35 60 READ note 70 WEND 80 NE...

Page 408: ...d gives the duration of the note in units of a hundredth ofa second The value can generally be anywhere in the range 1 to 32767 However if the value is zero then the length of the note will be determined by the envelope used more ofthis later lfthe value is negative then it indicates how many times the envelope should be played so 3 would mean repeat the volume envelope three times again this will...

Page 409: ... be played on channels A and B then this would become C B A o 1 1 And the binary number 011 is the same as 0 4 1 2 1 1 3 So the SOUN D command would be SOUND 3 142 This is of course the same value that would be found if you just added up the numbers for the channels to play on remember A 1 B 2 C 4 So to play on A and B the channel number is givenby 1 2 3 Ifyou didn t understand that don t worry As...

Page 410: ...rected to each of the channels in this case 90 200 went to both A and B The alternative method is to use the following SOUND 1 200 2000 SOUND 1 16 90 200 SOUND 2 8 140 400 Here the second note on A is made to rendezvous with the sound on B and the sound on B is made to rendezvous with the note on A The advantage here is clear although the second note on A was different to the note on B the two wer...

Page 411: ...or a time after which it fades away to zero It is possible to give an envelope of this nature to the notes produced by the SOU NDcommand The associated EN Vcommand is used to do this First let s look at a simple example ENV 1 5 3 4 5 3 8 SOUND 1 142 0 0 1 The EN V must come before the SOU NDcommand for which it is used To use this envelope in a SOU NDcommand its number is included as the fifth par...

Page 412: ...ngth of each of these steps is 1 hundredth of a second The second section consists of 20 steps but with 0 zero reduction or increase in the volume i e constant volume per step Again the length ofeach ofthese steps is 1 hundredth ofa second Finally the third section has 10 steps each increases the volume by 1 and once again each step is 1 hundredth ofa second long The SOU N0 command has a starting ...

Page 413: ...including the first that identifies which ofthe 15 envelopes 1 to 15 is being created Ifthe steps up or down cause the volume to go above 15 or below 0 then the value will wrap around so the step above 15 is 0 and the step below 0 is 15 ENV 3 9 5 20 SOUND 1 142 0 0 3 This simple envelope produces 9 steps each step increasing the volume by 5 and each step lasting 20 hundredths of a second After the...

Page 414: ...envelope to give a characteristic shape we may also want to define a characteristic tone pattern to include things such as vibrato where the sound wavers about the main tone ofthe note This is done in a very similar way to that in which volume envelopes are defined Tone envelopes are defined using the ENT command For example ENT 1 5 1 1 5 1 1 SOUND 1 142 10 15 1 A tone envelope is called into the ...

Page 415: ... made to repeat throughout the time that the note is playing This is done by specifying a negative envelope number the positive equivalent ofwhich mustbe usedin the SOU NDcommand ENT 5 4 1 1 4 1 1 SOUND 1 142 100 12 5 This will produce a vibrato effect on the note When defining tone envelopes it is usually best ifthey can be made to vary symmetrically about the initial tone period so that when the...

Page 416: ...e Now that we can hopefully use the SOU ND ENVand ENT commands to their full we can look at various other associated commands and functions In describing the channel number of the SOU NDcommand you will remember that by adding 64 to it the sound was marked as held so that it would remain in the queue without playing until released The way in which a sound canbe released is by use ofthe RE LEA SEco...

Page 417: ...RINT heLLo run You will notice that the word h ell 0 does not appear instantly but only after the first three sounds This is because program execution cannot continue until there is a free space in the queue The BASIC contains an interrupt mechanism rather like that used in the AFT ER and EVE RY commands and in 0 N BREA K G0 SUB This enables you to specify a sound playing sub routine that is only ...

Page 418: ...the value returned have the following significance BIT DECIMAL MEANING 0 1 2 3 1 2 4 8 Number offree spaces in the queue Note at head ofqueue is marked to rendezvous with A Note at head ofqueue is marked to rendezvous with B Note at head ofqueue is marked to rendezvous with C Top note in queue has hold bit set the queue is held A note is currentlyplaying 4 5 6 7 16 32 64 128 Try this simple exampl...

Page 419: ...AD ch2 50 CLS 60 Spd 12 70 scale a b b c c d e e f f g g 80 ENV 1 2 5 2 8 1 10 10 0 15 90 ENV 2 2 7 2 12 1 10 10 0 15 100 ENT 1 1 1 1 2 1 1 1 1 1 110 DEF FNM s s MID s s 1 120 ch1 1 GOSUB 200 130 ch2 1 GOSUB 380 140 IF ch1 ch2 0 THEN 140 150 END 160 DATA 777 70c 6a7 647 5ed 598 170 DATA 547 4fc 4b4 470 431 3f4 180 DATA 4cr4f4f1f1g1A1 B2C2f4g2g1A1 B6A2Cr1f1g1f1g1a1 b1A1 b2C2g2A2g2f1g1a2g2f6e2c2e2c2...

Page 420: ...THEN ch2 I1I RETURN ELSE l2 VAL p2 43111 ch2 ch2 1 44111 n2 FNM ch2 ch2 45111 ch2 ch2 1 46111 IF n2 OR n2 THEN 53111 47111 n2 n2 48111 nd2 1 INSTR scale LOWER n2 2 49111 IF ASC RIGHT n2 1 96 THEN 02 4 ELSE 02 8 5111111 SOUND 2 r2 scale nd2 02 Spd l2 11I 2 51111 ON SQ 2 GOSUB 38111 52111 RETURN 53111 n2 n2 FNM ch2 ch2 54111 ch2 ch2 1 55111 GOTO 48111 run Graphically speaking This section describes ...

Page 421: ...MOVE 0 2 FILL 3 Line 80 puts the graphics cursor just inside one ofthe two halves of the square and fills it with ink 3 The boundary ofthe fill is the edge ofthe graphics window in this case also the edge ofthe square and anything drawn in the current graphics pen 3 or anything drawn inthe inkbeing usedto fill also 3 Now RUN the resulting program To prove the point about fill edges add line 70 bel...

Page 422: ... ink In our example we will use a binary constant called up by the X indicating that we want four pixels drawn in the middle ofeach 8 pixel group with the two either side not drawn This will give a dashed line with four pixels on and four pixels off To do this add 9 MASK X 1111 run But hold on a moment This program does not give us a smooth continuation of the dotting around the corners as we expe...

Page 423: ...nt or opaque by a 0 parameter Alter line 70 to read 70 GRAPHICS PEN 1 1 run and observe the result As well as drawing lines and plotting points it is possible to write normal text characters at the position ofthe graphics cursor This has the advantage that we can position the characters with much greater accuracy within one pixel rather than within 8 pixels and also that we can draw characters wit...

Page 424: ...nds as the line drawing Thus currently the name is written in GRAP HIe S PEN 1 and is transparent The command 150 GRAPHICS PEN 1 0 run will switchback to opaque paper whilst 150 GRAPHICS PEN 0 1 run will write with ink number 0 transparently Now delete line 150 and RUN again Ink number 1 transparent mode previously set in line 70 will be restored to the graphics pen Transparent characters It is al...

Page 425: ...ed printing is also executed twice in lines 170 and 190 The FRAME commands cause enough delay to make the effect visible Note the use in line 90 of commands without a first parameter This is quite in order in these commands and simply leave the current settings ofthe first parameter unchanged The third parameter 1 of the M 0VE command in line 220 sets the GRAP HI CS PEN to 1 overriding the 3 set i...

Page 426: ...ning the character printed at the bottom left hand corner and reproducing what is found in big block graphics The numbers are written in turn using inks 1 2 4 and 8 with the OR mode turned on in this case with a control character sequence see line 50 Lines 160 onwards rotate the palette according to a mathematical formula which results in one block graphics number at a time being displayed The ink...

Page 427: ...N INK i 0 ELSE INK i 26 200 NEXT i p 210 GOTO 160 220 INK 1 26 run Colourplane sprites In the example above we have seen how having written graphics in inks 1 2 4 and 8 an animation effect can be produced by colour changing If the same inks are used but the colours set up in a different way then a completely different effect can be produced This effect is known as colour planes and is demonstrated...

Page 428: ...HICS PEN 13 1 MOVE x2 115 hL 2 PRINT pL 300 NEXT 310 GOTO 210 320 MOVE cx 100 330 FOR x 0 TO 360 STEP 10 340 DRAW cx SIN x 50 10 RND 100 COS x 25 10 RND 1 350 NEXT 360 DRAW cx 100 MOVE cx 90 FILL 1 370 RETURN 380 ENT 1 1 1 1 390 SOUND 1 25 400 15 1 15 400 FOR y 100 hr TO 132 STEP 2 410 GRAPHICS PEN 7 1 MOVE x y 2 PRINT pr 420 GRAPHICS PEN 8 1 MOVE x y 2 3 PRINT pr 430 NEXT 440 GOTO 70 run To expla...

Page 429: ...ogram that makes use ofthe extra 64K ofRAM in the 6128 10 SCREEN DESIGNER by DAVID RADISIC 20 copyright c AMSOFT 1985 30 40 Remember to RUN BANKMAN before running program 50 60 70 ON ERROR GOTO 2740 80 DEFINT a x 90 MODE 1 ch 127 cmnd 1 pn 0 0 pn 1 26 pn 2 15 pn 3 6 pn 4 0 pn 1 norx 1 menu 1 zzz HIMEM 100 DIM command 22 110 norx 0 Normal norx 1 XOR norx 2 Trans p norx 3 XOR 120 RESTORE READ cmnds ...

Page 430: ...G x 320 y 200 GOTO 390 370 IF cmnd 2 THEN RUN 70 380 ON cmnd 2 GOSUB 1240 1410 1520 1640 1840 1860 1950 2020 2090 2120 2170 2200 2660 2660 2660 2660 2390 2 330 2200 390 IF tx 0 AND ty 0 THEN 200 400 IF fLag 0 THEN 440 410 GOSUB 630 420 GOSUB 680 FRAME GOSUB 680 430 GOTO 200 440 MOVE tempx tempy pn 1 450 ON fLag GOSUB 470 490 550 640 460 GOTO 200 470 PLOT x y GOSUB 630 PLOT x y 480 RETURN 490 DRAW ...

Page 431: ...0 MASK 255 0 IF i THEN GOSUB 2150 i RETURN MOVE xx 4 yy pn 1 DRAW xx 4 yy MOVE xx yy 4 DRAW xx yy 4 MOVE xx yy xorn RETURN nx 1 GOSUB 1220 FRAME GOSUB 1220 IF i THEN nx norx GRAPHICS PEN pn 1 GOSUB 1220 i THEN 760 IF fLag 6 IF moved 0 247 THEN AND j AND j CHR 240 OR j CHR ch ASC j moved 1 880 IF moved 0 890 LOCATE 5 2 THEN RETURN 900 FOR i ch 5 TO ch 5 910 PEN ABS i ch 1 920 ch CHR 1 CHR ABS i 256...

Page 432: ...BORDER pn pn RETURN 1170 IF tx 0 THEN ch ABS ch 255 MOD 256 1180 IF ty 0 THEN ch ABS ch 246 MOD 256 1190 IF tx 0 THEN ch ch 1 MOD 256 1200 IF ty 0 THEN ch ch 10 MOD 256 1210 tx 0 ty 0 RETURN 1220 TAG MOVE xx 8 yy 6 pn nx PRINT CHR ch TAGOFF 1230 RETURN 1240 C 1250 IF flag 1 THEN 1290 1260 ro 1 GOSUB 2240 1270 tempx x tempy y flag 1 1280 RETURN 1290 IF tempx x AND tempy y THEN 1390 1300 PLOT x y 1 ...

Page 433: ...edgecoL FILL fi LLer 1600 fLag 0 i 1610 RETURN 1620 i INKEY IF i 0 OR i 3 AND i THEN 1 620 1630 RETURN 1640 I T 1650 IF fLag 3 THEN 1700 1660 fLag 3 ro 5 GOSUB 224J 1670 tempx x tempy y 1680 x 0 y 0 1690 RETURN 1700 IF triside 0 THEN 1770 1710 ro 6 GOSUB 2240 1720 MOVE 0 0 pn 1 GOSUB 590 1730 tempxx tempx x tempyy tempy y x x 2 y 20 1740 triside 1 1750 GOSUB 550 GOSUB 590 1760 RETU RN 1770 IF norx...

Page 434: ...N 1990 FOR 0 TO 3 INK pnC NEXT BORDER pn 4 2000 IF pn 4 THEN pn 1 2010 CLS RETURN 2020 A 2030 IF flag 6 THEN 2070 2040 tempx 0 tempy 0 CLS 2050 undraw 1 flag 6 norx 1 moved 1 2060 RETURN 2070 flag 0 2080 RETURN 2090 N 2100 norx 0 2110 RETURN 2120 E 2130 GRAPHICS PEN pn 0 TAG MOVE xx 8 yy 6 0 PRINT TAGOFF 2140 RETURN 2150 SPACE 2160 PLOT x y pn norx RETURN 2170 X 2180 norx 1 2190 RETURN 2200 M 2210...

Page 435: ...C000 2430 GOSUB 2570 2440 GOSUB 2260 2450 RETURN 2460 CLS LOCATE 10 3 PRINT RETURN to Abort 2470 LOCATE 1 1 PRINT Enter FiLename 2480 INPUT f Lename IF f Lename THEN RETURN 2490 n INSTR f Lename IF n 0 THEN 2520 2500 IF n 1 THEN 2460 2510 f Lename LEFT f Lename n 1 2520 fi Lename LEFT fi Lename 8 scn 2530 CLS 2540 RETURN 2550 FOR 0 TO 4 POKE C000 i pn NEXT 2560 RETURN 2570 FOR 0 TO 4 pn PEEK C000 ...

Page 436: ... DATA Circle Box Edge colour Filler colour Triangle 1 Triangle 2 Line The two RSX commands I SeRE ENCO PY and I SeRE ENS W AP used in this program are provided by the Bank Manager utility on Side 1 of your system discs package The commands facilitate the copying and swapping of the various screens between the appropriate memory blocks and between the two 64K banks ofmemory You must therefore run t...

Page 437: ...Retrieve a screen E to Exchange screens RETURN to abortthe operation Iffor example you wish to store the current screen into memory number 2 then type 2 followed by S When returning to the alternative menu after a R estore S ave or a screen manipulation typing Magainwill toggle back to the original menu Screen Designer provides a range of drawing facilities including boxes circles triangles lines ...

Page 438: ...on on the CPIM operating system andthe Dr LOGOlanguage Finally we provide a set of 4 appendices which comprise the CPIM End User Licence Agreement a glossary of terms some games programs listings and a comprehensive index to the manual We hope that you have found this manual informative and interesting andthankyou forpurchasingthe CPC6128 At your leisure Chapter 9 Page 65 ...

Page 439: ......

Page 440: ...achine means the single microcomputer on which you use the program Multiple CPU systems require additional licences 3 Program means the set of programs documentation and related materials in this package together with all ancillary updates and enhancements supplied by DRI to you regardless of the form in which you may subsequently use it and regardless ofany modification whichyou make to it 4 AMST...

Page 441: ...other party agrees to a accept the terms and conditions of this Agreement b sign and forward to DRI a copy of the registration card and c pay the then current transfer fee If you transfer the program you must at the same time either transfer all copies including the original whether in printed or machine readable form to the same party or destroy any copies not transferred this includes all modifi...

Page 442: ... DRI OR AMSTRAD ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING REPAIR OR CORRECTION Neither DRI nor AMSTRAD warrant that the functions contained in the program will meet your requirements or that the operation of the program will be uninterrupted or errorfree However AMSTRAD warrants the diskette on which the program is furnished to be free from defects in materials and workmanship under normal...

Page 443: ...e any questions concerning this Agreement you may contact DRI by writing to Digital ResearchInc p a Box 579 Pacific Grove California 93950 THIS AGREEMENT CANNOT AND SHALL NOT BE MODIFIED BY PURCHASE ORDERS ADVERTISING OR OTHER REPRESENTA TIONS BY ANYONE AND MAY ONLY BE MODIFIED BY A WRITTEN AMENDMENT EXECUTED BY YOU AND AN AUTHORISED OFFICER OF DRI AND AMSTRAD YOU ACKNOWLEDGE THAT YOU HAVE READ TH...

Page 444: ... and with other users of home computers in order to exchange software get data and information etc Address The number in an instruction that identifies the location of a cell in a computer s memory By means of its address a particular memory location can be selected so that its contents can be found and read in the case of RAM both written nd read Adventure game A cult with some and a bore to othe...

Page 445: ... than instantaneously Computers are digital devices most of the natural world is based on analogue principles thus the computer has to perform an analogue to digital AID conversionbefore it canprocess data from an analogue source Animation Cartoons are the best known form ofanimation computer animation is based on the concept ofmoving graphics to simulate the idea of live movement Applications pro...

Page 446: ...the numbers letters and other symbols that can be entered from the computer s keyboard or invoked using a variety ofothercommands Assembler The practical method for programming in machine code where the machine code instructions are invoked by mnemonics letters that suggest the function being performedby the correspondingmachine code routine Backup A duplicate copy of information used as a safegua...

Page 447: ...nit for measuring the rate at which digital data is transmitted inserial communicationsystems BCD Binary Coded Decimal A coding system for decimal numbers in which each digit is representedby a group offourbinary digits BDOS Basic Disc Operating System This is the part of the CP M operating system whichprovides an interface for a user program to use the functions ofCP M Benchmark A standard task t...

Page 448: ... Usually signified as 1 or O Boot The process ofloading an operating system into memory When CP M is started from BASIC a small boot program is loaded automatically from the disc which then loads the rest ofthe operating system into memory Booting orBootstrapping Programs and operating systems don t load themselves they are bootstrapped by a small routine in ROM usually that initiates the loading ...

Page 449: ...r and graphics to provide an electronic drawing board although any calculation performed on a computer in pursuance ofa design comes under the heading ofCAD CAE Computer Aided Education Further nourishment for the buzzphrases of computing The use of the computer to help with education CAI Computer Aided Instruction and CAL Computer Aided Learning are two aspects ofCAE Cartridge A specially package...

Page 450: ... can be stored or manipulated as a single unit e g a word or a collectionofwords Chip A misleading but popular reference to any form of monolithic electronic integrated circuit The chip is actually a small slice of specially processed silicon material onwhichthe circuitis fabricated Clock The reference timing system in the computer used to synchronise and schedule the operations of the computer A ...

Page 451: ...n the screen and the system awaits input of a CP M or utility command Corruption The destruction or alteration of the contents of a disc file or memory in an undesirable and potentially unrecoverable manner CP M Control Program for Microcomputers A disc based operating system by Digital Research that provides a standard systems interface to software written for a wide range ofmicroprocessor based ...

Page 452: ...es the collection of data from any outside sources that are linked in some way to a central computer Debugging The process of fixing the bugs in a program by a combination of suck it and see and more scientific methods Decimalnotation Also known as the Denary system for numbers with base 10 using the digits to 9 representing numbers ofunits tens hundreds thousands and so on Default The value assum...

Page 453: ...velope with access for the reading head provided by a window On a 3 disc the window is covered by a metallic shutter which automatically slides across when the disc is out ofthe disc drive Disc drive The mechanism used to spin and access the data on the surface ofthe disc Documentation The manuals that are supplied with computers or software to explain how th y are operated DOS Disc Operating Syst...

Page 454: ...rtext Editor A program that is usually in the ROM of the computer which enables the editing process tobe carried out EPROM Erasable Programmable Read only Memory Similar to the PROM except that the data contained in the chip can be erased by ultra violet light and new program recorded An EEPROM is similar except that it may be electronically erased Expression A simple or complex formula used withi...

Page 455: ...eal number manipulated and stored with its decimal point permitted to settle in the required position The method is particularly useful when dealing with large numbers Floppy disc See Disc Flowchart A diagrammatic representation of the progression of program steps and logical processes tracing the sequence ofevents during program execution Forth A high speed programming language with speed and com...

Page 456: ...aphics Not to be confused with graphics characters which are still part of the character set and are printed at the text cursor Graphics mode Early microcomputers required to be specifically set to either handle characters or graphics Modern personal computers are capable of mingling text and graphics simultaneously Graphics tablet A device that plots the co ordinate points of a given picture or d...

Page 457: ...IEEE 488 One of the standard Interfaces for connecting devices to a microcomputer Similar to but not wholly cOlllpatible with the Centronics parallel interface Information technology Anything relating to the use of electronics in the processing of information and communications wordprocessing data communications PRESTEL etc Initialise Switch on a system or declare specific values for variabl s bef...

Page 458: ...ic circuit components miniaturised and built onto a single piece ofsilicon See also Chip Intelligent tenninal A terminal where as well as handling the requirements of the computer s input and output local processingpoweris also available when the terminal is offline Interactive Usually a reference to programs where the hardware computer prompts the user to provide various types of input ranging fr...

Page 459: ...onditionis fulfilled Joystick An input device that generally replaces the function of the cursor keys and makes games playingfaster and easier K A short form of the metric measure prefix for 1000 kilo which in computing has come to be widely used to refer to a kilobyte which is actually 1024 decimal inview ofthe binary association of2 raisedto the power oflO Keyboard The matrix of alphanumeric key...

Page 460: ...physical form For example the CP M logical device LS T may be assigned to the Centronics port or perhaps the VDU LOGO The name of a programming language derived from the Greek word logos which means word Logo is designed to teach the fundamentals of computer programming Loop A process in a program that is executed repeatedly by the computer until a certain condition is satisfied Low level language...

Page 461: ...al rows with each item individually accessible Either known as RAM random access memory where information can be both stored and retrieved or ROM where the information may be read but not re written in another form Discs and tape are examples of bulk memory although the term has evolved to mean the memory that is directly addressedby the CPU Memory map The layout of the memory showing the various ...

Page 462: ...creen Originally designed to overcome the fear ofkeyboards and make software appearmore userfriendly MSB The Most Significant Bit of a binary number i e the bit at the left end of the binary expression Network When two or more computers are linked together to exchange data and information eitherby wiring or via MODEMs Nibble Half a byte a four bit expression Each of the hexadecimal digits in the e...

Page 463: ...from three Bits Offline A computer peripheral usually a display terminal or a printer that is not actively connectedto or accessible by the mainprocessing unit On line The opposite ofOffline Operating system The attendant in the parking lot referred to under the entry for Memory Software that allocates precedence and timingto the operations ofthe computer Operator The part of an arithmetic express...

Page 464: ...nsferred many times more quickly using a parallel interface than it is through a serial interface since the serial interface must first format each byte andframe it with synchronisationinformation Pascal A high level structured programming language that must be compiled before it will execute and therefore runs very quickly Generally the next language that the keenBASIC student will pursue PEEK Th...

Page 465: ...teral use means the ability for software to operate on different makes of computer usually as a result of a compatible operating system such as Digital Research s CP M Primitives Procedures operations or commands that make up Dr Logo the built in procedures Printer Anyhardcopy method for printingout text Procedure A series of expressions or program statements that dictate how to perform a particul...

Page 466: ...of converting the domestic mains electricity supply into the necessary voltages to operate the computer and peripheral devices QWERTY keyboard The colloquial term to describe a keyboard with the conventional UK or US typewriter key layout RAM Random Access Memory Memory that may be both read from and written to using the internal circuitry of the computer during the normal course of program execut...

Page 467: ... occur before your eyes as opposed to those which only become evident after the termination ofthe process that producedthem Record A group ofbytes in a file CP M uses 128byte records Recmsion The series ofrepeated steps also sometimes imprecisely described as reciprocation within a program or routine in which the result of each repeated cycle of events is related to the previous one Refresh To upd...

Page 468: ...ulations on large numbers Reverse Polish notation RPN A method of describing arithmetic operations favoured by some calculator manufacturers where the operators are placedbehind the values to which they apply RF Modulator The means by which the video signals from the computer are encoded and transmitted to the aerial ofa standardTV set ROM Read Only Memory Generally with reference to semiconductor...

Page 469: ...ay fills up to the bottom and needs to make space for the next line ofentry or output to appear Sector Ablock ofdata on a disc The AMSTRAD disc systemuses a sector size of512 bytes Separator A separator performs the same function as a delimiter i e marking the boundary between reserved words and other elements ofthe program or data Serialinterface Although this term nearly always refers to an RS23...

Page 470: ...ulated speech using a combination ofhardware and software Spreadsheet A program that allows rows and columns ofnumbers to be entered and arithmetically manipulated Changing one entry causes all the associated calculations to be re run and produces an updated result Sprite A screen character that moves freely around the display generated by specific hardware or software that allows it to appear and...

Page 471: ...o bottom with clearly described steps Sub routine See routine Syntax error When the rules of the program are broken by the incorrect use of keywords and variables BASIC will prompt the user with this message Systemtracks Tracks reserved onthe disc for the CPIM system Terminal A keyboard input device with either a VDU screen or teletype typewriter output system TPA Transient Program Area An area in...

Page 472: ...he truth table lists the possible results of a logical operation I FA B THE Ne accordingly Turnkey A word used to describe a program which executes automatically when the system is booted Turtle A graphic symbol in the shape ofan arrow head that functions as a graphic cursor on the Dr Logo graphic screen Turtle graphics The graphics image left on the screen by the movement of a turtle As the turtl...

Page 473: ...ing CP M A warm start reinitialises the disc sub system and returns control to CP Mready for commands to be entered Wildcardcharacter Either of the characters or Dr Logo only supports the character The wildcard character simply means any number of s Whenreferencing files wildcard characters are used to make up an ambiguous file name Any s in the file name refer to any alphabetic or numeric charact...

Page 474: ... MOVE 610 32 DRAWR 0 400 1 140 PEN 3 LOCATE 3 1 PRINT STRING 36 143 150 PEN 2 LOCATE 3 2 PRINT STRING 36 143 160 PEN 1 FOR r 5 TO 6 LOCATE 3 r PRINT STRING 36 143 NEXT r 170 bx 9 180 lives 5 score 0 190 PEN 1 GOSUB 680 CLEAR INPUT 200 IF INKEY CHR 32 AND JOY 0 16 THEN 200 210 LOCATE 11 23 PRINT SPACE 20 LOCATE 1 24 PRINT SPA CE 40 220 GOSUB 690 GOSUB 660 GOTO 280 230 240 250 LOCATE bx 24 PRINT STR...

Page 475: ...F y 1 OR x 3 OR x 38 THEN SOUND 129 78 8 7 1 1 470 GOTO 340 480 I 490 I 500 lives lives 1 S0UND 132 19 46 12 2 2 IF lives 0 THE N GOTO 620 510 GOSUB 660 GOTO 280 520 I 530 I 540 IF INKEY 8 0 OR INKEY 74 0 AND bx 2 THEN bx bx 2 RETURN 550 IF INKEY 1 0 OR INKEY 75 0 AND bx 32 THEN bx bx 2 RETURN 560 RETURN 570 I 580 I 590 LOCATE xz yz PRINT RETURN 600 I 610 I 620 IF score hiscore THEN hiscore score ...

Page 476: ...kilL 0 ACE to 5 NOVICE skilL 100 IF ski LL 0 OR ski Ll 5 GOTO 90 110 skiLL skiLL 10 120 LOCATE 1 15 PRINT CHR 18 LOCATE 1 15 INPUT Enter speed 0 FAST to 100 SLOW rate 130 IF rate 100 OR rate 0 GOTO 120 140 150 BuiLdings 160 170 MODE 0 FOR base 5 TO 15 FOR height 21 TO INT RND 1 8 skilL STEP 1 LOCATE base height PEN base 2 PRI NT CHR 143 CHR 8 CHR 11 CHR 244 NEXT NEXT 180 PLOT 0 20 4 DRAW 640 20 4 ...

Page 477: ...70 440 GOTO 230 450 460 Instructions 470 480 LOCATE 1 2 PEN 1 PRINT You are piloting an aircraft over a des erted city and must clear the bui ldings in order to land and refuel Your air craft move s across the screen from left to right PRINT 490 PRINT PRINT On reaching the right the aircraft returns to the l ft A LINE FURTHER DOWN You have a n unLimited supply of bombs and you can drop them on the...

Page 478: ...E 1 8 PRIN T TOP SCORE 610 score 0 LOCATE 1 12 PRINT Press R to restart 620 a INKEY IF a r OR a R GOTO 630 ELSE GOTO 62 o 630 PEN 1 MODE 1 x 2 y 2 a 2 b 2 GOTO 90 640 I 650 I Bombed bui Ldi ng 660 I 670 LOCATE a b 1 PRINT CHR 8 PEN 4 FOR tr 1 TO IN T RND 1 3 1 score score 5 S0UND 3 4000 10 12 0 0 10 LOCATE a b FOR t 0 TO 4 PRINT CHR 253 CHR 8 CHR 32 CHR 8 NEXT b b 1 680 IF b 24 THEN b b 1 690 NEXT...

Page 479: ...O 100 150 PEN 2 160 x 1 3 y 1 5 170 x 2 37 y 2 22 180 edge CHR 233 edge2 STRING 2 207 190 LOCATE 1 3 PRINT STRING 39 edge PRINT STRING 39 edge 200 FOR i 1 TO 19 210 PRINT edge2 TAB 38 edge2 220 NEXT 230 PRINT STRING 39 edge PRINT STRING 39 edge 240 WINDOW 1 3 37 5 23 250 CLS 1 260 SYMBOL 240 0 60 126 126 126 126 60 0 270 bat I CHR 8 CHR HD I 280 clr CHR 8 CHR 10 290 ball CHR 240 300 PEN 3 310 LOCA...

Page 480: ...ETURN 570 IF dx 0 THEN score1 score1 1 ELSE score2 score2 1 580 scored 1 note 2000 590 RETURN 600 p 1 INKEY 69 0 INKEY 72 0 ABS INKEY 71 0 INKEY 73 0 2 610 IF comp 1 THEN p 2 ABS y 2 yb 2 y 2 yb GOTO 6 30 620 p 2 INKEY 4 0 INKEY 48 0 ABS INKEY 5 0 INKEY 49 0 2 630 PEN 3 640 FOR i 1 TO 2 650 LOCATE x i y i p i ch COPYCHR 0 660 IF ch THEN LOCATE x i y i PRINT clr y i y i ROUND p 2 670 LOCATE x i y i...

Page 481: ...NT 77 PEN 3 PRINT PRINT TAB 14 Or joysticks 78 PRINT PRINT PRINT PRINT 79 PEN 2 8 PRINT TAB 6 SeLect 1 or 2 pLayers 81 i INKEY IF i 1 AND i 2 THEN 81 82 IF i 1 THEN comp 1 ELSE comp 83 MODE 1 RETURN Appendix 3 Page 8 Some Programs for you ...

Page 482: ... THEN GOSUB 620 ELSE FRAME FRAME 190 IF p1sa 1 THEN GOSUB 670 200 IF p2sa 1 THEN GOSUB 720 210 GOTO 140 220 230 240 IF THEN 380 ELSE 480 250 260 270 CLS PEN 6 280 PRINT PRINT CHOOSE CONTROL 290 PRINT PRINT PRINT PRINT press J K then ENTER 300 LOCATE 4 10 PRINT JOYSTICK TAB 5 OR KEYS 310 LOCATE 12 10 IF j THEN PRINT ELSE PRINT 320 LOCATE 12 11 IF j THEN PRINT ELSE PRINT 330 IF NOT INKEY 45 THEN j 1...

Page 483: ...HEN AFT ER 15 GOSUB 770 520 IF p1sa THEN p1dir 0 530 IF p2sa THEN p2dir 0 540 RETURN 550 560 570 pt p1wp p1dir IF pt 25 OR pt 6 THEN RETURN ELSE p1w p pt 580 p1dir 0 590 PEN 1 LOCATE 3 p1wp CLS 3 PRINT CHR 209 RETURN 600 610 620 pt p2wp p2dir IF pt 25 OR pt 6 THEN RETURN ELSE p2w p pt 630 p2dir 0 640 PEN 2 LOCATE 18 p2wp CLS 5 PRINT CHR 211 RETURN 650 I 660 670 PAPER 4 4 WINDOW 4 4 17 p1wp p1wp CL...

Page 484: ...7 1 NK 1 0 890 SOUND 129 1000 0 12 3 S0UND 130 900 0 12 3 900 W HIL E INK EY WEN D 910 t TIME WHILE t 2000 TIME WEND 920 WHILE INKEY WEND 930 CLS 940 finished 1 950 RETURN 960 970 980 a 0 111101101101111 990 a 1 001001001001001 1000 a 2 111001111100111 1010 a 3 111001111001111 1020 a 4 100100101111001 1030 a 5 111100111001111 1040 a 6 111100111101111 1050 a 7 111001001010010 1060 a 8 1111011111011...

Page 485: ... 18 1 5 WINDOW 7 1 20 1 5 PAPER 7 3 1300 CLS CLS 7 PRINT 1 a 0 PRINT 2 a 0 p1sc 0 p2s c 0 p1wp 5 p2wp 24 p1dir 1 p2dir 1 1310 GOSUB 570 GOSUB 620 1320 SOUND 1 1000 0 12 2 S0UND 2 900 0 12 2 1330 p1sa 0 p2sa 0 finished 0 1340 RETURN FROM GAME SHEET RESTORE 1350 1360 1370 CLS 1380 PEN 7 1390 FOR n 1 TO LEN b 1400 LOCATE 2 n 10 1410 FOR n2 LEN b TO n STEP 1 1420 PRINT MID b n2 1 1430 LOCATE 2 n 10 14...

Page 486: ... 1570 1580 1590 1600 1610 1620 1630 LOCATE 7 5 PRINT CONTROLS PRINT PRINT PLAYER1 PLAYER2 PRINT PRINT A PRINT Z PRINT X t TIME WHILE RETURN up 6 down 3 fire 7 t 1000 TIME WEND Some Programs for you AppendiX 3 Page 13 ...

Page 487: ... WINDOW 1 2 39 22 25 PAPER 1 1 PEN 1 0 CLS 1 110 PEN 0 120 LOCATE 1 8 1 PRINT 1 BLACK ALWAYS PLAYS FIRST 130 LOCATE 1 1 3 PRINT 1 PRESS B OR W TO CHOOSE BLAC K OR WHITE 140 B INKEY IF B THEN 140 150 IF B W OR B w THEN Q 3 N 0 GOTO 210 160 IF B B OR B b THEN Q 0 N 3 GOTO 210 170 CLS 1 LOCATE 1 4 3 180 PRINT 1 BLACK OR WHITE ONLY 190 FOR T 0 TO 1000 NEXT T 200 GOTO 140 210 DIM C 10 10 P 9 9 C1 8 C2 ...

Page 488: ...30 E Q 500 GOTO 540 510 FOR M 0 TO 19 STEP 2 PLOT 270 30 D 70 M 30 E 520 DRAW 290 30 D 70 M 30 E 6 NEXT M 530 GOTO 400 540 VRX 0 550 FOR K 1 TO 8 560 VR 0 C3 D C4 E 570 C3 C3 C1 K C4 C4 C2 K 580 IF C C3 C4 N GOTO 590 ELSE 600 590 VR VR 1 GOTO 570 600 IF C C3 C4 6 GOTO 610 ELSE 620 610 NEXT K GOTO 670 620 IF VR 0 GOTO 610 ELSE 630 630 VRX VRX VR 640 C3 C3 C1 K C4 C4 C2 K 650 IF C C3 C4 6 GOTO 610 E...

Page 489: ...20 CLS 1 PRINT 1 DEADLOCK I MUST PASS ALSO GAME OVER 930 FOR T 1 TO 1000 NEXT T GOTO 1550 940 CLS 1 LOCATE 1 18 2 PRINT 1 1 MUST PASS 950 GOSUB 2720 960 IF PAS 1 GOTO 970 ELSE 990 970 CLS 1 PRINT 1 DEADLOCK YOU MUST PASS ALSO GAME OVER 980 FOR T 1 TO 1000 NEXT T GOTO 1550 990 GOTO 400 1000 IF LC 0 THEN LC 1 RANDOMIZE LC RL RND LC 1010 CX1 CX RL CX2 CY RL 1020 GOTO 1220 1030 VRX 0 1040 FOR K 1 TO 8...

Page 490: ... DRAW 270 30 CX1 89 30 CX2 N 1280 FOR T 1 TO 1000 NEXT T 1290 FOR K 1 TO 8 1300 VR 0 C3 CX1 C4 CX2 1310 C3 C3 C1 K C4 C4 C2 K 1320 IF C C3 C4 Q GOTO 1330 ELSE 1340 1330 VR VR 1 GOTO 1310 1340 IF C C3 C4 6 GOTO 1350 ELSE 1360 1350 NEXT K GOTO 1400 1360 IF VR 0 GOTO 1350 1370 C3 C3 C1 K C4 C4 C2 K 1380 IF C C3 C4 6 GOTO 1350 1390 C C3 C4 N GOTO 1370 1400 C CX1 CX2 N 1410 GOSUB 2720 1420 GOSUB 1460 1...

Page 491: ... HAVE WON I I 1700 END 1710 IF C 2 2 Q AND C 3 1 N OR C 1 3 N GOTO 1720 ELSE 1730 1720 P 3 1 1 P 1 3 1 1730 IF C 7 7 Q AND C 8 6 N OR C 6 8 N GOTO 1740 ELSE 1750 1740 P 8 6 1 P 6 8 1 1750 IF C 2 7 Q AND C 1 6 N OR C 3 8 N GOTO 1760 ELSE 1770 1760 P 1 6 1 P 3 8 1 1770 IF C 7 2 Q AND C 6 1 N OR C 8 3 N GOTO 1780 ELSE 1790 1780 P 6 1 1 P 8 3 1 1790 IF D 1 OR D 8 OR E 1 OR E 8 GOTO 1820 1800 IF CX1 1 ...

Page 492: ...0 IF C J I N GOTO 2140 2060 IC I 1 IF C J IC 6 GOrO 2140 2070 IF C J IC Q GOTO 2080 ELSE 2090 2080 IC IC 1 GOTO 2070 2090 IF C J IC 6 OTO 2110 2100 GOTO 2140 2110 IF IC 0 GOTO 2140 2120 IF C J I 1 Q AND C J IC 1 6 GOTO 2140 2130 P J IC 26 2140 IF C I J N GOiO 2230 2150 IC I 1 IF C IC J 6 GOTO 2230 2160 IF C IC J Q GOTO 2170 ELSE 2180 2170 IC IC 1 GOTO 2160 2180 IF C IC J 6 GOTO 2200 2190 GOTO 2230...

Page 493: ...9 I 1 20 P 8 I 20 NEXT 1 2500 IF C 8 8 N GOTO 2510 ELSE 2520 2510 FOR 1 3 TO 7 P I 8 20 P 8 I 20 NEXT 1 2520 IF C 1 1 6 THEN P 2 2 5 2530 IF C 1 8 6 THEN P 2 7 5 2540 IF C 8 1 6 THEN P 7 2 5 2550 IF C 8 8 6 THEN P 7 7 5 2560 P 1 1 30 P 1 8 30 P 8 1 30 P 8 8 30 2570 FOR 1 3 TO 6 2580 IF C 1 I N THEN P 2 I 4 2590 IF C 8 I N THEN P 7 I 4 2600 IF C I 1 N THEN P I 2 4 2610 IF C I 8 N THEN P I 7 4 2620 ...

Page 494: ... DATA 1 0 30 1 20 10 10 20 1 30 1 1 1 1 3 2900 DATA 3 3 3 1 1 0 1 20 3 5 5 5 5 3 20 1 1 10 3 5 2910 DATA 0 0 5 3 10 1 0 10 3 5 0 0 5 3 10 1 2920 DATA 1 20 3 5 5 5 5 3 20 0 1 1 1 3 3 3 3 1 1 1 1 30 1 20 10 10 20 1 30 2930 DATA 263 100 263 120 270 130 255 130 255 130 255 1 40 255 140 270 140 2940 DATA 270 140 270 150 270 150 255 150 255 160 270 1 60 270 160 270 180 2950 DATA 270 180 255 180 270 170 ...

Page 495: ... 355 410 3 75 410 365 395 365 3040 DATA 395 365 395 375 425 355 440 355 440 355 440 3 65 440 365 425 365 3050 DATA 425 365 425 375 425 375 440 375 455 375 455 3 55 455 355 470 355 3060 DATA 470 355 470 365 470 365 455 365 485 375 500 3 75 500 375 500 355 3070 DATA 515 375 515 355 515 355 530 355 530 355 530 3 75 530 375 515 375 3080 DATA 515 365 530 365 Appendix 3 Page 22 Some Programs for you ...

Page 496: ...200 GOSUB 340 110 IF gems 0 THEN GOSUB 970 120 PEN 4 130 FOR i 10 TO 12 140 LOCATE 15 i PRINT SWAG 150 NEXT 160 PAPER 0 CLS 2 PAPER 8 170 GOSUB 1170 180 GOSUB 1230 190 GOSUB 1370 200 GOSUB 1510 210 IF rm 0 THEN GOSUB 1900 220 IF dead 0 THEN 160 230 pause 100 GOSUB 340 240 PAPER 0 CLS PEN 1 250 LOCATE 4 3 PRINT Do you want 260 LOCATE 4 5 PRINT Another game 270 PEN 5 LOCATE 9 7 PRINT Y N 280 i UPPER...

Page 497: ...1000 60 3000 40 560 ENV 1 10 1 5 2 4 1 2 1 20 570 windw 1 STRING 2 250 windw 2 CHR 251 CHR 8 CHR 10 CHR 251 CHR 8 CHR 10 CHR 251 580 door 1 STRING 2 252 door 2 CHR 253 CHR 8 CHR 10 CHR 253 CHR 8 CHR 10 CHR 253 590 switch 1 0 CHR 246 switch 1 1 CHR 247 600 switch 2 0 CHR 248 switch 2 1 CHR 249 610 gem CHR 144 obj CHR 233 dog CHR 255 620 hit CHR 246 CHR 248 CHR 247 CHR 249 CHR 2 52 CHR 253 CHR 250 C...

Page 498: ...INT dog The Dog 910 PEN 5 PRINT PRINT PRINT 920 PRINT Use Joystick PRINT Or Cursor keys 930 dummy REMAIN 1 940 AFTER deLay 4 1 GOSUB 340 950 RETURN 960 970 Generate Gems obstacLes 980 990 FOR room 1 TO 5 1000 gemr INT RND 8 2 objr INT RND 10 5 1010 minx minx room miny miny room maxx maxx room ma xy maxy room 1020 FOR i 1 TO gemr 1030 x INT RND maxx minx 1 minx 1040 y INT RND maxy miny 1 miny 1050 ...

Page 499: ...HICS PEN 1 GOTO 2340 1320 IF a S THEN 2420 1330 IF a F THEN GRAPHICS PEN 6 GOTO 2340 1340 PRINT ERROR 1350 STOP 1360 1370 DispLay gems objects 1380 1390 PEN 6 1400 FOR i 1 TO obj rm 1410 LOCATE objx rm i objy rm 1420 PRINT obj 1430 NEXT 1440 PEN 5 1450 FOR 1 TO gems rm 1460 LOCATE gemx rm i gemy rm 1470 PRINT gem 1480 NEXT 1490 PEN 1 LOCATE xp yp PRINT man 1500 RETURN 1510 xf 0 yf 0 PEN 1 1520 IF ...

Page 500: ... AND yf 0 THEN 1630 1760 IF xf 0 THEN dir 4 ELSE IF xf 0 THEN dir 3 1770 IF yf 0 THEN dir 1 ELSE IF yf 0 THEN dir 2 1780 IF dir rm dir 1 THEN 1630 ELSE rm dir rm dir 1790 IF dog 0 THEN GOSUB 310 1800 IF dir 1 THEN xp 6 yp maxy rm 1810 IF dir 2 THEN xp 6 yp miny rm 1820 IF dir 3 THEN xp minx rm yp 13 1830 IF dir 4 THEN xp maxx rm yp 13 1840 RETURN 1850 IF xp 5 AND xp 8 THEN 1880 1860 IF xp 6 THEN d...

Page 501: ... PAPER 8 2120 IF no se 10 OR delay 50 THEN 1630 2130 delay delay 50 2140 dummy REMAIN 1 2150 AFTER delay 4 1 GOSUB 310 2160 GOTO 1630 2170 2180 Draw doors 2190 2200 READ no dr 2210 IF dr IV THEN dr 2 ELSE dr 1 2220 PEN 2 2230 p c door dr GOSUB 2500 2240 GOTO 1280 2250 2260 Draw windows 2270 2280 READ no w 2290 IF W V THEN w 2 ELSE w 1 2300 PEN 4 2310 p c w ndw w GOSUB 2500 2320 GOTO 1280 2330 2340...

Page 502: ... dogx 1 2600 IF dogy yp THEN dogy dogy 1 2610 IF dogy yp THEN dogy dogy 1 2620 LOCATE dogx dogy PRINT dog 2630 SOUND 1 0 RND 40 10 1 2 31 2640 GOTO 1510 2650 PRINT SNAP 2660 dead 1 RETURN 2670 DATA HaLLway 2680 DATA L 64 308 226 4 2690 DATA D 2 H 6 3 6 22 2700 DATA D 2 V 4 12 9 11 2710 DATA S 1 L 4 11 2720 DATA S 1 R 9 14 2730 DATA END 2740 DATA Lounge 2750 DATA L 2 308 258 4 2760 DATA D 1 V 10 12...

Page 503: ... 9 21 1 1 4 1 3060 DATA L 64 308 480 100 3070 DATA F 250 98 294 102 3080 DATA F 250 306 294 310 3090 DATA F 390 94 430 106 3100 DATA F 390 302 430 314 3110 DATA F 474 240 488 270 3120 DATA F 474 124 488 154 3130 DATA F 58 240 72 270 3140 DATA L 226 308 322 180 3150 DATA L 160 180 480 100 3160 DATA L 64 180 160 100 3170 DATA END Ifyou ve enjoyed these games you may like to join the AMSTRAD COMPUTER...

Page 504: ...sages 5 15 7 31 7 32 AND 3 4 9 18 AND LOGO 6 16 Animation 9 53 APV 6 43 ARCTAN 6 13 Arithmetic operations 1 33 7 27 7 28 Arithmetic operations LOGO 6 13 Arrays 2 3 3 18 3 25 7 28 ASC 3 5 ASCII 7 8 7 21 ASCII characters 7 8 7 9 9 15 ASCII files 1 45 3 71 5 4 5 11 5 13 5 14 7 29 ASCII LOGO 6 8 ASM 5 37 ASSIGN SYS 4 9 ATN 3 5 AUTO 2 10 3 5 AUX 5 28 B IB 1 44 1 75 5 8 Backup discs 4 2 IBANKFIND 1 87 8...

Page 505: ... 4 BUTTONP 6 35 BYE 6 7 6 38 Byte 9 9 c CALL 3 7 CAPSLOCKkey 1 17 Cassette operation 1 7 1 76 4 11 5 12 5 13 5 14 5 35 CAT 1 43 3 7 CAT cassette 4 11 CATCH 6 40 CHAIN 3 7 CHAIN cassette 4 12 CHAIN MERGE 3 8 CHAINMERGE cassette 4 12 CHANGEF 6 33 CHAR 6 8 Characters 1 55 7 9 7 43 7 52 7 54 9 14 Checksum 9 32 CHR 1 55 3 8 9 16 CINT 3 8 Circles 1 60 CLEAN 6 22 CLEAR 3 9 CLEAR INPUT 3 9 CLG 3 9 CLOAD 5...

Page 506: ... 38 7 39 7 40 7 41 CONT 3 10 7 29 CONTENTS 6 42 CONTRAST control 1 4 Control characters 7 3 9 51 Control codes 5 19 7 1 7 3 7 49 9 51 Copy cursor editing 1 28 COPYCHR 3 11 Copying discs 1 77 Copying files 1 45 1 77 5 11 5 13 5 14 COpy key 1 28 COPYON 6 20 COPYOFF 6 20 COS 3 11 COS LOGO 6 13 COUNT 6 9 CP M 5 17 CP M2 2 1 82 4 10 5 31 5 33 6 2 ICPM 1 39 5 9 CREAL 3 11 CRT 5 28 CS 6 22 CSAVE 5 13 5 1...

Page 507: ...ICE 5 27 5 28 DI 3 17 9 30 DIM 2 3 3 18 7 28 IDIR 5 9 DIR CPIM 1 40 5 21 5 29 DIR LOGO 6 33 DIRPIC 6 34 DIRS 5 21 DIRSYS 5 21 I DISC 1 76 5 9 Discdrive additional 1 8 1 14 1 40 1 42 1 80 5 4 7 40 DISC DRIVE 2 socket 1 9 7 40 IDISC IN 1 76 5 9 DISCKIT2 1 82 5 35 DISCKIT3 1 40 1 77 5 23 Disc organisation 7 44 I DISC OUT 1 76 5 9 Discs 1 11 1 38 4 1 DOT 6 22 DOTC 6 22 Dottedlines 3 43 9 49 DRAW 1 58 ...

Page 508: ...Envelope planner 7 37 EOF 3 25 4 14 5 8 7 29 EOF CP M 5 28 ER 6 30 ERA 5 21 IERA 5 10 ERALL 6 30 ERASE 3 25 ERASE CP M 5 21 5 29 ERL 3 25 ERN 6 30 ERR 3 26 7 32 ERRACT 6 42 ERROR 3 26 ERROR LOGO 6 40 Error messages 7 27 Errormessages AMSDOS 5 15 7 31 7 32 Errornumbers 7 27 ESC key 1 18 3 49 EVERY 3 27 9 29 EXAMINE 6 42 EXP 3 27 Expansion characters 3 37 7 22 EXPANSION socket 1 10 7 40 Exponentiati...

Page 509: ...rint 3 61 9 22 Format disc 1 38 1 40 1 79 5 33 7 44 FPUT 6 9 FRAME 1 57 3 29 FRE 3 29 FS 6 24 G GENGRAF 4 9 GLIST 6 32 GO 6 39 GOSUB 1 31 3 30 7 27 GOTO 1 24 3 30 Graphics 1 47 1 55 9 47 9 56 GRAPHICS PAPER 3 30 9 50 GRAPHICS PEN 1 64 3 31 9 48 GPROP 6 32 GSX 4 9 B Hardware 7 46 8 1 Headphones 1 9 1 68 HELP 4 3 HEX 3 31 Hexadecimalnumbers 9 11 HIMEM 3 32 7 46 Holdsoundchannels 3 73 9 38 HOME 6 26 ...

Page 510: ...erting discs 1 11 INSTR 2 5 3 36 INT 3 36 INT LOGO 6 13 Interrupts 7 7 9 29 I O 7 38 7 47 ITEM 6 10 J JOY 3 37 7 43 Joystick commands LOGO 6 35 Joysticks 1 7 7 21 7 23 7 43 JOYSTICK socket 1 7 7 38 K KEY 3 37 7 22 KEY DEF 3 38 7 22 7 43 Keyboard 1 15 5 25 7 21 7 22 7 23 7 43 KEYP 6 36 KEYS CCP 4 3 5 25 KEYS DRL 5 25 KEYS WP 5 25 Keywords 1 22 3 1 7 32 L LABEL 6 39 LANGUAGE 4 3 5 24 7 53 Index Appe...

Page 511: ...the Welcome program 1 21 LOADPIC 6 34 LOCAL 6 17 LOCATE 1 55 3 41 7 6 LOG 3 42 LOG10 3 42 Logic 3 4 3 48 3 54 3 91 9 18 Logical operations LOGO 6 16 LOGO 6 1 LPT 5 28 LPUT 6 11 LST 5 28 LT 6 27 LOWER 3 42 M Machine code 7 7 Mains plug connections 1 1 MAKE 6 17 MASK 3 43 9 49 MAX 3 43 MEMBERP 6 11 MEMORy 3 44 7 27 7 46 Memory machine 1 84 7 46 8 1 8 2 9 56 Menu 2 5 3 51 3 52 MERGE 3 44 MERGE casset...

Page 512: ...XT 1 30 1 61 3 48 7 27 7 30 9 16 NODES 6 6 6 30 NOFORMAT 6 31 NOT 3 48 9 20 NOT LOGO 6 16 NOTRACE 6 41 NOWATCH 6 41 NUMBERP 6 11 o ONBREAKCONT 3 49 ONBREAKGOSUB 3 49 ONBREAKSTOP 3 50 ONERRORGOTO 3 50 7 29 7 32 ON GOSUB 2 6 3 51 ON GOTO 3 52 ON indicator 1 4 1 5 ONSQGOSUB 3 52 7 7 9 44 OP 6 39 OPENIN 2 10 3 53 7 29 7 30 OPENIN cassette 4 14 OPENOUT 2 9 3 53 7 30 OPENOUT cassette 4 15 Operators 1 33...

Page 513: ...PIECE 6 11 PIP 4 4 5 28 Planners 7 34 7 35 7 36 7 37 PLIST 6 32 PLOT 1 58 3 57 PLOTR 3 58 PO 6 18 POALL 6 31 POKE 3 58 PONS 6 31 POPS 6 31 POS 3 59 4 14 POTS 6 19 POWERswitch 1 4 1 5 PPROP 6 32 PPS 6 32 PR 6 21 PRINT 1 22 3 59 9 22 Print formatting 3 61 9 22 PRINTSPC 3 60 9 23 PRINTTAB 3 60 9 23 PRINT USING 3 61 9 23 PRINTER socket 1 8 7 41 Printers 1 8 5 26 7 41 7 42 7 43 PRM 6 43 Appendix 4 Page...

Page 514: ...31 Read errors cassette 4 12 Read Onlyfiles 5 12 5 30 5 34 7 31 RECYCLE 6 7 6 31 REDEFP 6 43 RELEASE 3 65 9 43 RELEASE LOGO 6 38 REM 1 30 2 2 3 65 REM 6 43 REMAIN 3 66 9 30 REMAINDER 6 14 REMPROP 6 33 REN 5 22 IREN 5 10 RENAME 5 22 5 30 Rendezvous sound channels 3 73 9 37 RENUM 2 7 3 66 REPEAT 6 39 RERANDOM 6 14 Resettingthecomputer 1 20 1 21 RESTORE 3 67 9 33 RESUME 3 67 7 29 RESUME NEXT 3 68 RET...

Page 515: ...3 71 SAVE cassette 4 16 SAVE LOGO 6 34 Savingtocassette 4 16 Saving variables 2 9 3 90 5 6 SAVEPIC 6 35 ScreenDesigner program 9 56 Screendump 1 46 3 71 5 6 ISCREENCOPY 1 85 8 3 9 63 ISCREENSWAP 1 85 8 3 9 63 SE 6 12 Serial interface 5 27 9 3 SET 5 30 SET24X80 5 26 5 27 SETBG 6 24 SETCURSOR 6 21 SETD 6 35 SETDEF 5 32 SETH 6 28 SETLST 5 26 SETKEYS 4 3 5 25 SETPAL 6 24 SETPC 6 28 SETPOS 6 28 SETSCRU...

Page 516: ...LOGO 6 37 Sound envelope planner 7 37 SPACES 3 75 SPC 3 75 9 23 Speakers external 1 9 1 68 Speechsynthesiser 1 10 9 3 SPEED INK 3 75 SPEEDKEY 3 76 SPEEDWRITE 3 76 4 17 Sprites 9 54 SQ 3 77 9 45 SQR 1 34 3 77 Square root 1 34 3 77 SS 6 25 ST 6 29 STAT 5 34 STEP 1 30 3 78 Stereo 1 9 1 68 STEREO socket 1 9 1 68 7 39 STOP 3 78 STOP LOGO 6 40 Storage space disc 1 38 1 39 1 44 STR 3 78 STRING 3 79 Strin...

Page 517: ...socket 1 7 7 39 Terminalemulator 4 5 7 48 TEST 3 84 TESTR 3 84 TEXT 6 19 Text window planners 7 34 7 35 7 36 TF 6 29 THEN 1 28 3 84 THING 6 18 THROW 6 41 TIME 3 85 TO 3 85 TO LOGO 6 19 Tone envelope 1 72 8 21 9 41 TOPLEVEL 6 43 TOWARDS 6 30 TRACE 6 41 Transparent writing 7 5 9 51 TROFF 3 86 TRON 3 86 TRUE 6 43 TS 6 21 Turnkey discs packages 4 5 4 8 TV receiver 1 3 1 5 1 68 TYP 5 22 TYPE CP M 5 22 ...

Page 518: ...U emulator 4 5 7 48 Vendor format 1 41 5 33 7 44 Verifying discs 1 81 Vertical hold control 1 4 Vibrato 9 42 VOLUME control 1 9 1 68 Volume envelope 1 70 3 23 9 38 VPOS 3 87 w WAIT 3 88 WAIT LOGO 6 40 Wake up message 1 4 1 5 WATCH 6 41 Welcome program 1 21 WEND 3 88 7 30 WHERE 6 12 WHILE 3 88 7 27 7 30 WIDTH 3 89 Wild cards 5 5 WINDOW 2 11 3 89 7 5 9 26 WINDOW LOGO 6 25 Window planners 7 34 7 35 7...

Page 519: ...WORD 6 12 WORDP 6 13 WRAP 6 26 WRITE 2 9 3 90 9 23 WRITE cassette 4 15 Write protection 1 12 1 80 x XOR 3 91 9 20 XPOS 3 92 XSUB 5 37 y YPOS 3 92 z ZONE 3 92 9 22 Appendix 4 Page 16 Index ...

Page 520: ...t I i I I I I I I L 0 0 JAABPCA01D 0 0 0 C 0 o o o l o o ...

Reviews: