Home
March 1980 - Nascom / Gemini / 80 Bus
Contents
1. WAY 282 34 WIJ BET BET aas 887 WIJ T NOISNJA 52 WIH z Liverpool Software Gazette March 1980 I 2 niu CEL deta OIM N31 OL T I 3HDU3 89202 T W SIIH 808202 8 SIM 314140 88882 GFT X 4I B 98 9T 4 8334 X CILI 3M23H3 01 GNHOSASX 380415 WOM 90202 2 J dI 008092 wt 2 JI lt lt 1437 2 JOD LSIN WIH Basaz Td AWOH Tag TS D WB 4 8 JSITHILINI d d dIM TET 1 7 06002 lt gt lt 1337 JI Td OL T d 79 73997 135 H32 u 1154 2d d I d 5 fd B2T2T 25 NAT 10403849 0IM lt gt Z T M31 49 54 N31 OL T I STP 525 gt tCd
2. I 1 3 OMY CH31NIOd 40 O1 3NIIDON anc Ing Waa Be Tas 00262 1551 44 JI TI OL 303 BOTHZ ck 18134 DOTOS 00062 8 500 Liverpool Software Gazette March 1980 41 22 1222 easy solution 4 Isaac Newton s gn A48K Diskbased vu M March or ril May and only une only 16K byte Apple Nett VAT Total Computer 69500 10425 79925 Disk System 34900 5235 40135 Total with 32K freeextra memory 104400 15600 120060 OFFICIAL ORDERS We Welcome official orders from bona fide commercial and government organisations We require payment 14 days after invoice date Apple Business Systems ring GrahamJones 051 227 2535 SoftwarePackages Word Processor Letter Stock Control 22500 Writer 13000 General Ledger 29500 Book keeper Package 295 OO Purchase Ledger 295 00 Credit Control Sales Ledger 29500 Package 15000 Payroll 385 00 1579 Second Disk Drive 29900 4485 34385 iier Pascal Language System 29900 4485 343 85 s NE Graphics Tablet 46200 6930 553130 is Appletel System 595 00 8925 68425 Please send systems as above at 1200 60 in
3. 37 Liverpoo Software Gazette March 1980 N HL 3 dI 81509 B LAdNI Waa d Td lt 440 gt d dI AOSHI 3023233 F Waa THA d 4015 01 15 TINN Waa AO ansod tT Wed ansoo H DL S3NI3 Td I LX3N 1354 1239 OL T I 3043 DL SANIT 313739 Waa I 311041M023 23345 JO Waa 194 552 01 T 403 BESZT 2 gt 194 135 23345 Waa 304 29345 1511 H SI SIHL Waa Cu I N OL 17404 01 SANIT 1511 Waa NSHL 2 2 dI 2 2 dI 359 00 3219359935 H Td lt dI T gt M NO T gt M dI NAHL M lt M dI NI SajO M3 23 2 17540 81431 gt THA M cel NBT 05 1HDIA gt TWA azzzr 0109 M lt 2 M M I 2 CT I 0 QIM N31 01 T I 304 01090 MICAT 81331
4. 0109 JPT T d 4 f Sheet 3 4354 3 JI 2 64384 GAZET 8 508 9007 NH ANANI BARET B d SZITHILIINI HJH NAHL CT 35 41431 dI OTOT 3 5N0 INANI MHMOCMd SONA F MIN IDnJNI see WIJ BAHT I LX3N 1044 CIO d OZG T T 4315 401 T Td I 13 8 LI 3 O0W 605fT 0109 Td S6T T JI BETET 3 45584 9 509 d 3138 30845 WIJ 39 Liverpool Software Gazette March 1980 4 134 d PAISA TA I 1834 lt 15 OL T I X03 ATTEST 28 202 aa gt 0 M31 5 dI 2 0 0 H snson LE3M OL H NOISSH Waa 434 39 59 32 H ASTEZ Z 2 80509 143028 cH H M Z ZH f
5. CD UNE 36 Liverpool Software Gazette March 1980 A E a The Variable Table gives variables used The tions first by 22120 then amp 22400 22490 dimensioning on lines 110 to 140 arbitrarily set a max matches When a minimum section is reached Ag 15 imum of 100 PILOT lines with 20 labels 20 numeric searched for a match 22600 22690 23000 23320 and 20 string variables and a stack size of 10 Lines accepts and assigns to a string variable if required 210 320 format the menu The reply is returned bya 23150 23320 24000 24210 jumps to line 25000 get causing an immediate jam via lines 410 450 An 25130 jumps to subroutine after saving the current line invalid input will cause the menu to blink and reprompt on the stack S 26000 27420 computes by finding the The Editor gives all commands available in variable 27110 27260 then setting or incrementing 10110 which is displayed whenever an invalid input the variable 27300 27420 29000 29230 is a routine calls through to line 10350 As List Change and Delete that removes spaces from the end of a string and directions have the same operand they are processed reduces interior spaces to one space 30000 save PI together Lines 12102 12330 sort out the lines given to PS P1 onto magnetic media 40000 M to and validate them 12510 12590 list the given reverses this 50000 50040
6. INPUT Ck LEFTf cO 15 THEN 168 1280 REM USERS 148 FOR I 1 TO X INPUT ACID NEXT GOTO 1808 150 REM RAN NO S 160 FOR I 1 TO CS VO PRINT 128010 178 REM ADDRESS MO Z TO SORTING ARRAS 1808 FOR I 1 INT V IF 2 gt THEN 208 pico NEXT 286 REM RETURN TO FIRST ARRAY 610 0 0 220 FOR I TO X 2 THEN 248 230 C C 1 8 09 BI 240 256 LIST SORTED ARRAY 260 FOR 1 TO M PRINT I NEXT 278 END see C C 1 298 IF THEN IF 2 THEN 280 310 F 220 F F IF lt 2 8 THEN 320 230 BXF 45 F 1 gt THEN 2460 GOTO 194 Liverpool Software Gazette March 1980 SOFTWARE INTERFACE AND ACORN SYSTEMS COMPUTER programs do not only have to interface with the outside world in many cases they have to inter face with other programs This article describes interface methods and ways in which parts of programs may com municate with each other Although particular reference is made to the 6502 processor and the interface specifi cation of Acorn operating systems the ideas should be of general interest to anyone writing programs whether for fun or for work FLAGS Processor flags provide information about recently executed
7. H31 53233 HINN ECA EJ THa x S OSHISHA 018 4 4 H ILHA3 ET 3 ONILSIX3 eezz2 DtZ2Z 8 TO JI 9 OZTST 0109 I LX3N 09722 OIM 41 545 N31 OL I QNIAd WAY OTT2Z N HL Z gt N31 JI 2 WEY 00022 we ee BETIZ Way 8 gt TS 41 OR TS TS 8 57525 d BATIZ CM3INIOd JNIIDONSOS 3 WIJ 00092 9023425 Td d gHO1 33H Lod BETEZ 111834 2 81500 2752 114144 d 7535 T TS TS eese e e e ee o Was 5 01 OD 00052 Waa 1951 d aer 8STST 0109
8. NCC D YN I ECC GER SEIPUNUD S 222 The Sinclair computer has powerful edit facilities and every statement line is syntax checked as it is entered at the bottom of the screen so that only syntactically cor rect lines can be added to the program list at the top A marker identifies a syntax error and this unique feature will speed the production of an error free program and is seen as of particular value for beginners The 7 80 display black on white for clarity consists of 24 lines of 32 characters each Featuring high resolution graphics with 24 standard graphic symbols available the computer also allows any alpha numeric or graphic symbol to be reversed The Sinclair ZX80 can be purchased in kit form at 77 95 from Science of Cambridge Ltd a Sinclair com pany and built versions will be available during early March for 99 95 inc VAT The prices include the man ual but exclude mains adaptors at 8 95 SINCLAIR PERSONAL COMPUTER TECHNICAL INFORMATION 1 The Sinclair personal computer employs the Z80A microprocessor chip supplied by the Nippon Electric Company NEC 2 The Sinclair BASIC interpreter provides important advantages Examples include some Single stroke key word entry In most computers it is necessary to type out any key word in full ie P RIN T when print is required Only that key with the word PRINT above it need be hit with the ZX80 and no shift is required s
9. ZTE 3 gt 9 0100 0 1451 7 0171 C n 1 Sorat 3 GOTT 2 SETET 3131359 HH DTT 104421 HIM ANANI BETES GTa DEBET 0108 ANSON 184 X JI 500 MAHL 671 3I BERAZ 97509 AI 09 5 dI 01 x 139 gHl INISd 15Hd Su Je 1 2881 INISd CAT 14144 Ste ZT Gic 102314 2881 5 INISd 4 lNISd SWOH 0103195
10. 43 REM STEP 4 1848 RETURH READY LISTIHG 18 FOKE 5946 14 SIGH EVERSE OLISH ERIHT PRIHT 5888 IH GOSUE FEM FIND FIRST 40 P ZEf TE z PRINT THEN 28 1456 1818 ms 1929 REM SIMPLE EXPREZZIOH 2818 GOSUE see 2020 IF 2030 1988 5 1 LEM SE 32 12 2040 GOTO RETURN REM LISED AS STACK FOR DPERHTOR 2 TERMS THIS LEVEL REM TERM EH 13 2848 GOTO 32 2858 REM FACTOR 4010 IF CH z C THEN GOSUE 18 4020 OP OPET CH REM HOT z 40280 GOSUE 1888 REM COULD E 5 IHPLIT IF te 2810 COHCRTEHRTIHG HITH t Iz NEEDED READ Liverpool Software Gazette March 1980 Reach the people who matter with the LIVERPOOL SOFTWARE GAZETTE The microcomputer magazine that 18 An informal poll of our readership 3 samples showed that they were well educated normal responsible people who buy things It therefore obviously pays to ad
11. is indeed built around new and revolutionary circuitry The description of the circuit and a discussion on the computer s software capabilities will undoubtedly convince even the greatest unbelievers The new microcomputer uses the ever so popular Motorola MC6809 CPU as its main brain Actually computerists who are not up to par with the 6809 as yet have a choice of CPU s The main board provides sock ets for either the 6809 or the 6808 the latter being an offspring of the MC6802 The microcomputer offers full color graphics 8 col ors both at low resolution 32 x 64 and at high resolu tion 250 x 190 The MC 6847 is used for this purpose and a PAL conversion circuit has been designed to fulfill the needs of European enthusiasts Color graphics are generated via a very powerful BASIC language which is described in the software discussion of this article The COMPUMAX is equipped as standard with a super fast cassette system speeds selectable from 1200 baud to 9600 baud The cassette system is capable of driving two recorders and has motor control capability A full description of its software capabilities is again given in the software discussion Additional features of this revolutionary microcom puter which came as standard are the following 16 Dynamic RAM expandable on board to 48 K sockets and decoding are already provided Floppy disk controller circuit capability up to four mini drives Parallel i
12. 8292 Z N HL T EM lt 2 EW C T ZH 393 OIM 31 ZM D H3 OL T M 403 4 MI 1 X03 A007 agszz anson B dI f egezz ansoo N HL lt gt T SI T 101 T WW f 304 TM ZH B H HI 5 303 34001 WAA 81509 134 T M 509 5 9 M04 3001 09 nin gt CEI 395 SOIN dI Ol T xod 5 1 MOJ 3001 Wad 81509 ZWO eek LIS 39 NBT 2 dI LAN t TrZ 0109 2 N31 I I 0109 143 9 3 I 513431 813 BOTTZ 0105 3 1754 51421 Fd 2 212555 57554 02452 2 57222 2 2 92752 90072 96922 2 2 09922 05922 8 92 02922 ar zz 86v22 2 esrzz Spree 2 asrzz azrzz BATEZ
13. Disk Payroll 50 for up to 200 employees Disk Stock Control 50 handling 2 500 stock items Petsoft CompuThink Disk or 400 stock items Commodore Disk AND Please Mynameis rush me your latest catalogue Ilive at of over 170 PET programs Postcode lhaveanew old ROM PET I have NO PET 10 Liverpool Software Gazette March 1980 k II I w OU M IS TRU ET CES LE 510222 move numberofdisks 1 via onto from end End What the procedure says is that to move 5 disks from pole 1 to pole 3 we firstly move 4 disks to pole 2 via move the remaining disk on 1 from to 3 onto then move the 4 disks on 2 via to 3 onto using 1 from as the intermediary Thus the procedure reduces a problem to a slightly easier version of itself Eventually the task will be to move 1 disk in which case the procedure can handle that itself without calling on itself with a slightly easier problem recursion must exhibit these two main features a call to a simpler version of itself and a section which does not include a call to itself If the second part is missing the recursive process will never end In our example the number of disks being moved is 1 less each time a recur sive call is made so that eventually assuming num berofdisks to be positive a call will be made to move which does not result in a recursive call There is nothing magical about recursion and i
14. azezz BETTZ BET TZ esate Peete Zante pSOTZ I lt gt NJI Gl 0109 1893 JIH 3 f Z lt gt I Al azrr2 0109 3 0 lt N31 dI 3 CDSA 15371 dI TA B ND 4 lt gt CEST JIW 15 32H7d34 HJ Z 175453 lt gt TETS Naga Z M37 BEATE gt 1431 I BETTE N31 dI Adal Cd 3 LAJMI week 10114 a I dI 220 snsun gt 0 AI ninn ANSON 08202 34 lt gt 2 dI 0100 1509 gt I dI eezaz 0109 emarz 508 lt 2 2 dI 01090 5 52 04 DS2DZ lt I 4I 0109 agate gason NAHL lt 2 2 ST 0109 ATZ 8901509 NAHL slu lt gt 2 dI T ICCd d O SAIN 5
15. March 1980 Third Edition 50 ao LIVERPOOL 2 Liverpool Software Gazette March 1980 During the Autumn of 1979 a small group consisting of successful publishers and acclaimed computer experts sat down to plan a new publication Their brief To produce the best all round computer magazine on the market Three months later the publication was born It s name ComputerAge Computer Age is still only four issues old but already it is acknowledged by thousands to have achieved its original aim Each new issue is enjoying increased sales and advertising revenue but that s only part of the success story More and more respected professionals are adding their names to the list of contributors and one supposes to an ongoing success story Whatever your interest in computers the Publishers of Computer Age are confident you will be satisfied with the publication Why not put them to the test and see a sample copy Just send 60p to include postage and packing the issue you would like to see listed below and full details to COMPUTER AGE 4 VALENTINE PLACE LONDON S E 1 A small price to pay for keeping in touch with the computer age ISSUE 2 The government s views on comput ers Cultural energy and the personal computer Tribute to Christopher Evans Microcomputers in the legal professions Accountants guide to microcomputers peripheral connection Topics in artificial intelli gence Why not a comput
16. Wad eazaz 0109 D N53 dI 0109 MIHL D gt N30 JI N3Hl lt gt 9 AI 01095 lt N20 dI lt gt Q dI CCT 4 I T QIM gt Wa ATTST 0109 1 3 SbS0Z MO CT AT Cd d5 dI OL ADA O JI 0109 peace lt 0 30 0 41 CBA deed SOIN I 0 3904 0109 I 01 0109 N HL az ange Gr Sz AZAZ Bz zz Liverpool Software Gazette March 194 M33 NAITLLSM 1431 0 FLHOIA JI CT eggi M30133 MIHL 9 BTZ Z lt 2 14937 T Td BETEZ N31 lt 3S dI CT IC OS SOIM 19 arTez OLOS f BST Z NAHL T lt 1 T BST Z 4 ou gt AT SASH 4000 T3
17. Liverpool Software Gazette March 1980 I CNN ON DENIM MU SUM MN EMI 2 2 2 2 222272202222 TED tional guidance is needed Either Nat Wadworths Z 80 Cookbook Scelbi Rodney Zaks Programming the Z 80 Sybex or William Bardens Z80 Microcomputer Handbook Sams or all three would offer a good introduction The one Assembly listing included as a training prog ram which is well presented with flow charts etc is a start but brings back memories of trying to figure out how the Write the character set on the screen introduc tion to Z80 code program supplied with Nascom 1 kits actually managed to work Mind you at least Nascom gave you an assembly listing of the monitor R O M and a technical manual on the PIO In conclusion the program offers some very powerful commands in assisting with the writing of machine code but I do think a little more could have been included in the manual at least a list of useful books to help first time hex key pad punchers Well seasoned Z 80 freaks should have no trouble using the facilities provided and we can expect to see some fine programs sent in to the Gazette if you get your fingers out Finally most of the commands are prevented from being used anywhere except in the free area This makes saving a backup copy of the Machine Code Program or taking a peek at it impossible However the short prog ram at the end of this article moves the main program into the free area so that i
18. DUI EU AI IA rnTP YY V 0400 SINCE THE PROG NULLS ALL 0410 FREE SPACE 0420 kk k k KKK KK KK ck ck KKK KK KKK KKK KKK ck 0430 0440 THIS PROGRAM MUST ONLY BE USED 0450 FOR MAKING A BACK UP COPY OF 0460 v AN ALREADY PURCHASED 2000 0470 2000 2000 210022 0480 STARTI LD HL 2200 2003 110012 0490 DEST1 LD HL 1200 2006 010000 LD 0000 2009 EDBO 0510 LDIR 200B C30012 0520 1200 0530 M C PROG COLD START Errata to January 1980 edition REVAS AND ZEAP APPLEPIPS PAGE 20 PAGE 48 Line 6 of the listing should read Third paragraph listing lines 9 and 10 should read 8EOO 0060 ORG 8EOO normal start for 40 DATA 230 7 202 16 244 200 192 196 144 234 PAGE 21 50 DATA 96 63 You our readers should notice that there were few Line 4 of listing should read errors in our second edition in comparison to our first We can only hope that the saying practice makes per 8F3D20 0330 DEFM ORGE fect applies to our magazine and that with more experi ence in each issue you will find fewer mistakes PAGE 23 Again our apologies for these errors Line 28 of second listing should read OFA2 2AOCOC 0085 LDHL ARGI first line requested MY first attempt at writing a numerical sort programme was typically awful It seems thateveryones first attempt at serious programming after giving up trying to write
19. INTRODUCTION IN the first article in this series Allan 1980 I showed that microcomputers based on the 6502 processor using BASIC language interpreters could produce fairly accu rate numerical results In my conclusions to the article I noted that there seemed a possibility that the SQR function in APPLESOFT and PETSOFT BASIC might not be as efficient as it should I felt that this could be the case because the Cholesky inversion routine also called the square root method is sensitive to the effi ciency of the implemented square root routine and the APPLESOFT results were slightly worse than those of an IBM 7090 which had less bits for its fixed point part I have checked this point and find the in APPLESOFT BASIC is fairly inaccurate In the next section I give a user defined function FNS X for find ing a square root accurate to machine limits I then give some specimen examples ofthe relative accuracy of and FNS X Following this I discuss nature of the Cholesky routine and reapply the Cholesky routine with FNS X replacing SQR X to the Hilbert Matrix examples of Allan 1980 A coding for the Cholesky routine and the Hilbert test pro gram 18 given in Appendix FNS AN IMPROVED SQR NOBLE 1964 68 notes that it worthwhile devoting a considerable amount of effort to developing an efficient square root program by program he means a machine cooled function un
20. i Raymond Anderson alga E Liverpool Software Gazette March 1980 53 The translator does not at present allow the use of REAL or COMPLEX numbers mainly in order to simp lify the runtime system and also because most of the work carried out on Z8O s at Cambridge does not involve real numbers It is possible to write routines to simulate floating point arithmetic to arbitrary precision in Algol68 of course The basic modes types available are INT 16 bit integer CHAR 8 bit character BOOL 8 bit boolean TRUE OR FALSE BUTS 16 bit value machine word STRING 0 255 characters These can be built up into structures and arrays or united values without any extra work being done by the translator For example a mode can be declared MODE PERSON STRUCT STRING first name second name INT age BOOL sex Then a PERSON can be declared and initialised thus PERSON subject z Anne Stafford 21 female Assuming female is a boolean value such as TRUE male being FALSE Second name OF subject 2 Smith would be a valid operation in this instance The Translator program itself is about 5000 lines of well commented ALGOL68C which runs quite quickly To apply optimisation it reads the Z CODE in Basic Blocks sections of code in which there is no flow of control to or from other places Each basic block is scanned to determ
21. ENS Statements 660 to 760 calculate the inverse Hilbert matrix of order N 2 to 10 which is then converted to estimate the Hilbert matrix Q in statement 870 calcu lates the exact value of the I th J th element of the Hilbert matrix which is then compared to the estimate B LJ with the relative error being found in 880 holds the largest relative error This coding suitably adapted with multi statement input per line has worked successfully on 6502 proces sors Z80 processors as well as the ICL 1902T Descrip tions of the Cholesky method are referred in Allan 1980 a good advanced discussion is Ralston and Rabinowitz 1978 410 437 THE IMPACT OF ENS HILBERT PROGRAM 3 ON THE CHOLESKY TABLE II shows results for the Cholesky Hilbert prog ram which are given for both the SQR and the ENS functions partly taken from Allan 1980 TABLE D The improvements in accuracy due to the use of ENS are remarkable the ratio between the relative sizes of errors is of the order of 1 100 and the ENS program is very accurate up to the 7 x 7 matrix and reasonably close for the 8 x 8 matrix which could not be inverted by SQR program In the eariler paper it was noted that for an IBM 7090 the largest error was about 1 9E 4 for the 6 x 6 matrix to be compared with the error of 5 6 for the 6 x 6 matrix given by the FNS program This shows I hope that present day microcomputers are as accurate as
22. might appear throughout the articles WHILE DO BEGIN ARRAY CASE An example of syntax is WHILE expression DO statement In syntax when items are to be replaced with values supplied by the user these items are lower case and the name suggests the type of value to be supplied In the example above expression and statement are supplied as appropriate by the programmer actual program example might look like this WHILE N 5 DO Begin SUM SUM N N 1 END Dr Andrew Veronis President AGFA Inc P O Box 1070 Glen Burnie E Maryland21061 USA H AN INTRODUCTION In syntax optional items appear enclosed in vertical bars For example REPEAT statement statement UNTIL booleanexpression One or more repetitions of a single syntactical item is indicated by a succession of three periods as in the example above CONSTANTS A constant is a literal representation of fixed unvary ing value associated with some data type A Pascal constant can be a decimal integer with no decimal point For example 652 25 A constant can be a character enclosed in apos trophes For example A constant be a character string enclosed in apos trophes For example CHARACTER STRING ANOTHER STRING Note that the range of values for decimal constants is 32768 lt decinteger lt 32768 Also character strings must be 255 or fewer in length IDENTIFIERS Identi
23. ofproteins the amino acids Consider the nature of this code clearly it cannot be on the level of one base one amino acid because then the 4 bases could only code for 4 amino acids Similarly a pair of bases such as AU AG CC etc could only code for 47 amino acids 16 and would not be sufficient for the twenty acids In fact triplets or codons of bases are used giving 4 64 possible codes for 20 amino acids Since there are now more codes than amino acids the code becomes degenerate with more than one codon specifying one type of amino acid There are also two start of message codons AUG and and three end of message codons UAA UAG and UGA Inci dentally each human cell contains approximately 800 million codons equivalent to 600 megabytes of infor mation packed into a volume of 65 cubic microns puts 64K RAM into shame doesn t it The process of taking a sequence of bases looking for start codons and deciphering the subsequent code until an end codon is apparent is called translation Nor mally this biochemical process is taught statically but here is an area where a microcomputer would be of considerable value We are preparing a program that allows the student to input a sequence of bases or use a computer generated random sequence and then trans late it The program could then alter one of the bases in thesequence andretranslate it 1n biologicaltermsthisis a mutation for example mutatio
24. the best computer game yet is to have a go at writing a programme of one sort or another I went straight to it without any researching into sort algorithms and my first attempt took about three hours to put 250 randomly generated numbers into correct ascending order seen worse first attempts since As I was using an old R O M Pet at the time I was unable to get any sensible results for more than 250 numbers although I would have had to sit up all night to take them anyway due to the value replicating error in the old Pet R O M However it wasn t until I had made a few attempts that I found out about this fault If your not familiar with this problem and can get your hands on an old ROM Pet then try opening an array of 500 variables and filling every other one with the num bers 1 to 250 in ascending order i e 10 DIMA 500 20 FOR Iz 1 TO 250 152 1 NEXT 30 FOR I 1 TO 500 9 0 NEXT Then on listing them in line 30 you will find that some weird and wonderful things have happened to the array After overcoming that little problem I gave up my sort programme since it was 60 times slower than the only other sort programme I had seen running Liverpool Software Gazette March 1980 Roy Stringer Sales Manager Microdigital Ltd Then while I was on holiday over Christmas 1 gradu ally realised Ithought how this other programme must have been doing it and resolved to write one of equal effici
25. 0 2 F40 10 6 4202 10 1255 6 0 P327 7 176 101 F40 10 6 172 10 F20 10 6 172 F40 10 6 202 K10 1255 6 0 P327 7 176 RI 10 1 F40 10 6 174 K10 F20 10 6 174 F40 10 6 204 K10 1255 6 0 P277 7 200 F500 10 0 O K10 H711 0 P332 RO FO 10 0 1 H1 16 0 P333 L332 RO F20 10 7 4 F2 10 0 1 F40 10 7 14 K10 1255 6 0 P327 7 10 RI 10 1 F24 10 7 4 L333 RI 10 1 L334 RI 10 1 T247 327 331 0 U330 334 Z References 1 S R Bourne et al ALGOL68C reference manual Cambridge University 1975 2 van Wijngaarden et al Revised Report on the Algorithmic Language Algol 68 Springer Verlag 1976 3 C H Lindsey and S G van der Meulen Informal Introduction Algol 68 Revised North Holland 1977 4 Bourne Cheyney et al Z CODE a simple machine Cambridge University 1979 57 58 Liverpool Software Gazette March 1980 MICROCOMPUTERS amp BIOCHESTRY Dr R J Beynon Lecturerin Veterinary Biochemistry University of Liverpool P O Box 147 Liverpool L693BX Introduction AS a highly specialised subject Biochemistry has been restricted in general to the Universities and Polytechn ics research institutes and large industrial laboratories At all of these locations large mainframe computers are well established and access to high quality computing facilities has been available to most biochemists for many years The number of biochemists who have made us
26. 0480 RST 28 0 1 2A 0490 DEFM OD1F 00 0500 DEFB 00 0020 18 0510 JR OUTER O520 0530 ERROR PRINTOUT 0540 THE FORMAT IS 0550 ADDRESS EXPECTED FOUND Liverpool Software Gazette March 1980 20 0560 0022 5 0570 ERROR 0023 D5 0580 0024 5 0590 0025 7C 0600 0026 CD1903 0610 OD29 7D 0620 OD2A CD 1903 0630 0020 0640 OD30 79 0650 0031 CD 1903 0660 OD34 0670 0037 78 0680 0038 1903 0690 OD3B 1103 0700 OD3E 010000 0710 0D41 0720 WAIT 0042 78 0730 Bl 0740 0044 20FB 0750 ODA6 Cl 0760 0047 Dl 0770 0048 El 0780 0049 C9 0790 CRYSTAL ELECTRONICS CC ELECTRONICS The newest Z8O Basic XTAL Basic 2 2 HAS to be the best yet for your Nascom 1 2 All the usual features of other 8K floating point BASICs Plus Extra commands functions INCH CMD ON ERR GOTO ERR PI CLOAD tape verify And Add up to 64 reserved words of your choosing Now put your own disc tape control raphics commands etc for the ULTIMATE in BASIC exibility Fully upward compatible with version_2 1 see earlier Ads Can be to most 280 Systems Works with T2 B 4 and NAS SYS monitors EX Ung version ru Reith your original tape less manual with 50p P amp P and we will update it FREE of charge Price still only 35 VAT CREED PRINTER INTERFACE For NASCOM or APPLE lowest cost hard Complete kit of parts with software 18 V 16 CH
27. 57 31 ODD TESTS 100 numbers from 0 to 1000 5 3 1000 numbers from 0 to 1E6 to 1 6 57 30 1000 numbers from 0 to 5E35 56 30 100 number from 1 to 1 1E 8 8 6 500 number from 1 to 1 1E 8 104 98 1000 numbers from 1 to 1E 8 423 400 100 numbers from 1 to 1 1E 7 5 3 500 numbers from 1 to 1 1E 7 35 24 1000 numbers from 1 to 1 1E 7 85 63 68 Liverpool Software Gazette March m 1 1 4 SUPER SORT START INPUT NO OF 15 VARIABLES X B c lt 1 NOTE ADDRESS F C MOVE UP TO NEXT ADDRESS INPUT RANGE OF VALUES YtoZ MOVE UP TO NEXT ADDRESS DDRESS OCCUPIED DIM ARRAYS A X B Xx2 IS SET MOD VALUE Pz39xX 20x Z Y TAKE FIRST VALUE MOVE DOWN TO NEXT ADDRESS 1 6 lt A 1 LIST SORTED Nos Ms S queue iw Liverpool Software Gazette March 1960 e SL HANE Kausayta TII 10 CALL PRINT DO HANT SORT 28 INPUT X IF 1 THEN YTAE 1 GOTO 26 40 PRINT PRINT RANGE FROM INPUT 4 PRINT TABS FOTO INPUT 2 70 IF gt THEM 2 GOTO SA IF Z THEN 60 DIM Hx DIM Bch 29 MO S C20 420 PRINT DO SOU HANT INPUT YOUR
28. A single side ofthe disk will thus hold the equivalent of 7 5 million bytes of storage The December issue of Interface Age has an excellent article on this new technology which eventually will revolutionize education if read write capability can be economically produced 24 Liverpool Software Gazette March 1980 THE AIM 65 has been around for some time now It was originally designed by Rockwell as a system design kit to allow engineers who were interested in using the 6502 which they were second sourcing from MOS Technology to gain some experience in programming the microprocessor before designing their own systems Although it is approximately twice the cost of similar design kits it provides many additional facilities which make it suitable for use by the sophisticated amateur as a home computer For a basic price of 265 VAT you obtain a main printed circuit board containing the microprocessor 1K of RAM a 4K monitor in ROM a twenty character display various 1 0 controllers from the 6502 range and a little thermal printer Input can be from a full ASCII keyboard supplied with the AIM 65 or from a 20 ma current loop teletype connected to the peripheral port As can be expected from a component manufacturer a full set of 6502 manuals together with a complete circuit diagram a very comprehensive User Manual and an Assembler Listing of the Monitor are also included Sockets are provided to expand the RAM to 4K a
29. GOSUB 20 reveals that when the out of memory error occurs N 26 Ifthe out of memory error occurs when a PRINT FRE 0 reveals many bytes free then this is usually the problem GOSUBs using up the entire stack space avail able FOR loops also use up stack space so in certain programs less than 26 levels of subroutines can cause the error For a particular application the only real way to find out whether an application can work is to try it The Tiny Pascal compiler mentioned in the first issue runs Liverpool Software Gazette March 1980 THE PET USERS MAGAZINE hits the streets 10 times a year bringing you the very latest news reviews and pictures of PET products and software plus programming tips and listings in a glossy professionally produced format Already PRINTOUT S worldwide network of correspondents have broken exclusive Stories on the next generation of PET com puters and peripherals currently under development In the past four issues PRINTOUT Consumer tested and reported on over one hundred games programs Looked at a low cost speech synthesis System and reported on Commodore s upcoming voice synthesiser Evaluated the pros and cons of both Commodore and CompuThink disk Systems Carried an exclusive report Com modore s new colour PET Printed detailed stories on PET applica tions in Education Model Railways and Public Relations Test rated programming aid
30. I ON 0060 NOTES BUT WITH SUBROUTINES 0070 CHANGED TO WORK WITH NAS SYS 1 0080 0090 PROGRAM WRITTEN USING ZEAP AND 0100 PRINTED USING NASCOM IMP PRINTER 0110 42 0120 5 ZEAP IS 30 00 PLUS VAT 0130 IMP IS 325 00 PLUS VAT 0140 LiverpoolSoftware Gazette March 1980 19 2 2 LA apa w o asa 0150 MICRODIGITAL LTD 0160 25 BRUNSWICK STREET 0170 LIVERPOOL L2 0180 0190 MIKE SHANAHAN 28 2 80 O200 z ee 0210 0220 5 TEST PROGRAM 0230 TESTS IF EACH BIT CAN BE SET 0240 5 AND RESET 0250 0319 0260 B2HEX EQU 0319 0261 0262 B2HEX PRINTS CONTENTS OF ACC 0263 5 TWO HEX DIGITS 0264 0306 0270 SPACE EQU 0306 0271 x 0272 SPACE PRINTS A SPACE 0273 0311 0280 CRLF EQU 0311 0281 0282 CRLF PRINTS A CARR RETURN 0283 LINE FEED 0284 ODOO 0290 ORG 0DOO ODOO OEOO 0300 MTEST LD C 00 ODO2 2 0310 OUTER LD HL 0005 ED5B100C 0320 LD DE 0C10 ODO9 13 0330 INC DE ODOA 79 0340 INNER LD A C ODOB 77 0350 LD HL A ODOC 46 0360 0370 ODOE C4220D 0380 CALL NZ ERROR 0011 23 0390 INC HL OD12 B7 0400 OR A OD13 ED52 0410 SBC HL DE 0015 19 0420 ADD HL DE 0016 20F2 0430 JR NZ INNER OD18 0440 INC OD19 79 0450 LD A C OD1AB7 0460 OR A OD1B 20 5 0470 JR NZ OUTER OD1D EF
31. MN AT Liverpool Software Gazette March 1980 83 CPT 2 42422222222 222722272 6402 will provide serial communication through RS 232 interface The baud rate is selectable between 110 and 9600 The UART pack includes a 1 8432 Mhz crystal and an MC 14411 baud rate generator The PIO CTC and UART may be located any where in the Z80 port address space The required I O decode is fed back for either Nascom 1 or Nascom 2 NASCOM DYNAMIC RAM CARD THIS product is on an 8 x 8 P C B which is NAS BUS compatible It fits either Nascom frame or a Systems 80 microcomputer housing The user has a choice of three options 16K bytes 32K or 48K or 4116 dynamic RAM The 4116 is a x 16K bits and will run at 4Mhz with a WAIT state The board has full decoding buffering and dynamic memory support for all packages There are three banks of 16K bytes Each 16K bank is relocatable to 4K boundaries There is an up grade kit for this product with the following features Write protect Each 16K block of memory may be protected from CPU write by using a toggle switch with LED indication Page Mode It is possible to use up to four 48 RAM boards in a system As the CPU will only access 64K at one time the RAM board in use is software selectable with se
32. STRING context dependent 46 Liverpool Software Gazette March 1980 E o A gt E E A Le tar EXPRESSION sion to be specified FILEID part or all of an expres afileidentifier must be VAR filed FILE OF type TEXT or INTERACTIVE FILE an index into a STRING or PACKED ARRAY of CHARACTERS context dependent or as specified a literal or identifier whose type is either INTEGER or REAL INDEX NUMBER a relative disk block address relative to the start ofthe file in context the first block being block zero any declared Pascal variable which is BOOLEAN CHAR REAL STRING or PACKED ARRAY OF CHAR SIZE an INTEGER number of bytes characters any integer value a STRING or PACKED ARRAY OF CHARacters to be used as a read only array context dependent or as specified any STRING call by value unless otherwise specified 1 can be a string variable or a function which evaluates to a string a STRING consisting of a filename physical device number used to determine device handler used by the interpreter PROGRAMSTRUCTURE Every Pascal program has two required parts a prog ram heading and a block The first word of all Pascal programs is PROGRAM The block contains two main sections RELBLOCK SIMPLEVARIABLE SOURCE STRING TITLE UNITNUMBER Declaration definition Section specifies all objects
33. This enables the error routine to print the names of the routines which have invoked the routine which cased the error In addition the paramet ers of the routines are the first few items on the stack so the diagnostic message can print them out An example of a runtime error message is as follows ALGOL68C run time error non digit detected in read int stack C832 heap D6FO dyn stack D220 top D800 routine segment args sysreadint ZLIB 26 72 12 FF ED AD AA AA AA readint BASE 2672 29 64 AA 26 72 12 FF nexnum MAIN 67546789 00 AA FD AA 21 mainline no name This runtime error dump shows that nexnum routine in the MAIN segment ofthe program called the readint routine in the system BASE library which in turn called the system machine code routine systreadint which detected a character which was not a digit while reading an integer from the input file The hexadecimal numbers give the first 9 parameters on the local stack which may be useful of debugging In this case they are not very helpful but the error message is explicit Typical Uses Many useful programs are available in 68 at 2 222 52 2 TE 2 2222205 222 7277 Liverpool Software Gazette March 1980 55 Cambridge The disassembler used in this article will run out on 280 although it needs quite a lot of store sequential logic simulator a symbolic differentiator a turing machine simulator several
34. a valid one In the next issue a relocator using both of these routines will be listed and details given for linking it into the Commodore provided machine code monitors either in ROM or from tape VALID 48 PHA save op code 2907 AND 07 smask for low order bits A now equiv alent to j above giving bit number within byte i AA TAX E8 INX X j 1 68 PLA get op code again 4A LSR A 4 LSR A 4 LSR A 7 5 now zero last 3 instructions divide op code by 8 8 XY now equivalent to j above B9 4 03 LDA TABLE Y only instruction in the routine which 15 NOT relocatable Liverpool Software Gazette March 1980 J Stout Department of Architecture Liverpool Polytechnic 53 Victoria Street Liverpool L1 6EY SHIFT 4A LSR A valid invalid bit was in bit 0 it is now carry which is where we want it CA DEX DO FC BNE SHIFT if X non zero then needto shift again 60 RTS 40 so return TABLE 63 67 63 637377 63 63 63 77 63 63 63 77 63 637275 73 27 77 777377 73 77 63 637377 63 63 The routine above is assembled to occupy first 50 bytes of the second cassette buffer 033A 03F9 which gives a value of 034C for the address TABLE If the routine is to be moved elsewhere the instruction LDA TABLE Y will of course need altering since we have not at the moment written a relocator program to do it for us Searching IN the last issue the topics of search
35. a byte from the PROCESS DATA input channel into A The state of N Z and C is unknown all other registers are unchanged OSLOAD This subroutine loads all of a file into a specified area of memory entry X must point to IMP LOOP the following data in zero page INTERRUPTS The following action is taken on interrupts NMI PHA IMP NMIVEC IRQ BRK STA PLA PHA AND 10 which interupt was it BNE BRK LDA FF PHA JMP IRQVEC it was an IRQ BRK LDA FF PLP PHP RESET JMP BRKVEC it was a BRK On reset the operating system is executed starting with the transfer of the vectors into page two The COS uses locations CO upwards in zero page for scratch pad memory and these locations should be altered by user programs Ti I I UN UE I EE EN Liverpool Software Gazette March 1980 73 string of characters terminated by OD which is the file name address in memory of the first byte of the destination bit 7 0 ignore above use files address The data 15 copied the operating system and is not harmed processor registers used by the status is saved A break will occur if the file cannot be found Ininterruptor dma driven systems a wait until comple tion should be performed if the carry flag was set on entry OSSAVE This subroutine saves all of an area of memory to a specified file On entry X must point to the following data in zero p
36. addition Black amp White please send Modulator 1400 210 16 10 Eurocolour Card 7900 1185 9085 Total Remittance Joystick 2500 375 2875 Prices include courier delivery within U 20 AMICRODIGITAL 25 Brunswick Street Liverpool L2 OBJ Mail orders to MICRODIGITAL LIMITED Access and Barclaycard welcome 1 Tel 051 236 0707 24 hour Order FREEPOST No Stamp Required j Address 051 227 2535 All other Depts Liverpool L2 42 Liverpool Software Gazette March 1980 etter from America WM Smit Editor THE APPLE SHOPPE THE JOURNAL OF APPLE APPLICATIONS SUBSCRIPTIONS 24 00 A YEAR THE APPLE SHOPPE P O BOX 701 PLACENTIA CA 92670 USA HELLO to all my friends in England This month we present a new column that will let you know what is happening here in America so you can keep up with the latest US trends in small systems computing We wel come your response and hope you will drop us a line and let us know how developments here are affecting you in England Just send your comments to the above address and we will try to answer as many as we can through this column Personal replies only with a self addressed stamped envelope please Postage rates from the US to England do add up NEW COMPUTERS ARRIVE Several new computers have arrived on the scene here and are being received with mixed react
37. another value to it can be used to replace some IF THEN ELSE statements encountered when moving programs from one implementation of BASIC to another Thus IF X 0 THEN ELSE be written as IF X 0 THEN and for true compatibility every state ment before the IF must have a corresponding one in the THEN section Note a we could remove the I NE statement from line 1020 but this has two effects i if KEY occurs more than once in FILE IN returns the highest value of I such that FILE KEY i the loop is not terminated once the value KEY is found so that the routine takes longer to execute when KEY is found b itis unlikely that we have speeded the routine up by much since the alterations have only been to statements that are only executed once If the subroutine were repeatedly called it might be worthwhile but all we have done so far is to perhaps reduce the size of the routine and perhaps make it slightly more efficient Third effort Listing 3 If one is unable to use a FOR loop to control the number of iterations ofthe main part of the subroutine but must implement one using IFs and GOTOs perhaps when searching through a linked list another source for at least one article then a straight translation of the second effort might be Listing 31 However notice that two IF statements will be executed each time round the loop One way to reduce this is to make use of the zero th elem
38. as pointers and may be used to hold data in the same way MEMORY When index registers are used as pointers they can point to a region of memory which contains data for a section of program or subroutine An example of this is the routine to display messages on the Acorn display used in the mastermind program see Issue 1 which is shown in Listing 2 The messages are held in a table of display segment patterns to be sent to the display buffer by the routine shown The X register is loaded with the lower byte of the address of the required message before the routine is called Once the message is in the output buffer the scan display routine in the Acorn monitor can be used to show the message The use of the display buffer in the Acorn monitor is an example of data transfer by means of an agreed section of memory In this case both the sending and receiving programs must know exactly what information will be stored in which memory locations PROGRAM MEMORY Itis possible to store fixed data for use by a subroutine in sections of program memory This technique is par ticularly useful in the SC MP program shown in listing 3 The datais stored in memory immediately following thesubroutinecallinstruction XPPC3 Thesubroutine LISTING 1 ASCHEX ACORN 6502 Assembler Page 01 0010 0000 ASCHEX ORG 0000 0020 0030 2 contains ASCII on entry 0040 contains binary on exit 0050 5 on exit CC conversion done
39. batch mode or in peripherals such as teletypes which supported sequential input output With the coming of interactive computer systems and visual display units which allowed the computer to dis play characters at any position on the screen it was possible to display a section of the file on the screen and allow the user to identify the characters to be altered by moving a special character called a cursor to the desired position Commands are required to move the text win dow up and down the file manipulate the cursor and to perform the editing operation required Editors were being used to manipulate program and date files on line in an ad hoc manner Most editors available for use on microcomputers are of this type They are intended for use under immediate control from the keyboard Commands are few and are designed to allow the user to define the changes he requires with the minimum number of keystrokes Usually the user issues one com mand and waits for the computer to inform him of the result before issuing the next He can then carry on or re edit to correct the text 1f his last command did not do what he wished One useful facility which has been introduced into this type of editor is the ability to scan the whole or part of the text for a particular character string and to edit every occurrence of it This allows you for instance to change the name of a variable identifier everywhere it occurs very easily Systemati
40. be available with one or two drives The second drive can be easily added at a later date if the user s initial resources are limited CPU The new system is based on the now well established Nascom 2 Microcomputer Housing Within the System 80 housing is a frame racking that holds a NAS BUS motherboard a power supply 3 amp or 5 amp depending on the choice of boards to be fitted the CPU board and up to four 8 in x 8 in expansion boards Provision is made for external connection direct to the boards concerned The Nascom 2 keyboard fits snugly in the cutout provided The housing is moulded from glass reinforced plastic which combines lightness with high strength and is available in a choice of colours A TV or monitor can be placed on top of the housing however this surface has been designed with recesses to accept the feet of an expansion housing which is being designed to hold five more boards Using 78 way cable the two motherboards may be connected Floppy Discs Another totally new product the System 80 floppy disc system will be supplied with built and tested parts which can be bought individually or as a complete sys tem These include an assembled controller card con trols 4 drives power supply unit 5 41 doubled sized double density drives enclosure and accessories for mounting two drives and the PSU The industry stan dard CP M disc operating system will also be available Each drive provides 280K by
41. be required for the manipulation of programs and data before they can be processed by the microcomputer Indeed some interac tive computer languages such as BASIC include a very simple line editor as part of their specification This is sufficient for most program editing needs but is useless for handling data and other text files If a compiler or assembler is to be useda stand alone assembler will also be required The copy for this article was produced on a popular microcomputer using a very sophisticated text editor and formatting system which provides many of the facilities available on commercial word processing sys tems costing many thousands of pounds Although it is eminently suitable for generating letters and articles it cannot be used to generate program and data files which are to be input into assemblers compilers and user prog rams since it automatically formats the text to fill the desired page size Commands are included to centre lines for headings etc split the text into paragraphs and to assist in the laying out of tables Blocks of text can be moved around as desired so that the writer can re organise his work should this be necessary All this makes the writer s task a lot easier Text editors are now far more sophisticated than in the earliest versions The price to be paid is that unlike in the early days many programs designed to perform the same basic function that is manipulating textual inform
42. by the system The first holds the address that the procedure was called from and the second is used to chain back to the stack frame of the next enclosing textual level in order to access variables which are neither local to the current procedure or global Procedure Calls Algol 68 procedures always return a result although sometimes the result is known as VOID which means no value is really passed back In this implementation the parameters for the procedure are copied up the stack into locations where they will be accessible when the stack pointer moves forward on entering the routine The result from the procedure call is returned in the HL register pair In some cases the HL register will contain the address of a result if it cannot be held in 16 bits Entry to a normal procedure is as follows The space used by the current stack frame is added to the IX register and the return address is saved at offset 0 If a chain value is provided in the DE register it is stored at offset 2 on IX The code of the procedure is now executed At the end of the procedure the return address 15 taken from offset 0 and the stack is retracted to its original state In practice these actions are done by a routine call to ENTERS and a jump to LEAVE The procedure word giving the increase in stacksize required This wordis accessible indirectly viathe return address for use in retracting the stack so the old Value of the IX register need not be save
43. facilitate translation to your particular version Table 1 give equivalents to several other BASICS also remarks in the program Apple specific sections The program is deliberately written as an understand able modifiable extendable unit Commenting is fairly thorough within the program In animplementation tion this may be extracted to shorten and speed the system Structuring has been used with major sections starting at a new number group thus new routines may be added and existing ones changed or removed In operation the base level is menu driven ie a selection is made from a displayed menu and a branch made to the relevant subroutine These are a Editor allows PILOT programs to be input and modified b Runner runs the PILOT program interpretively c Loader loads a PILOT program from magnetic backing storage d Saver saves a PILOT program onto magnetic backing storage e Ender returns the user to BASIC Liverpool Software Gazette March 1980 numbering PILOT lines are not numbered as in BASIC but the editor still needs to be able to refer to individual lines so it numbers the lines by itself the first being 1 the second 2 Note the used as a separator hence 12 T HELLO 16 the 12th line which is T HELLO The line number is also used as a prompt so the request for line 13 is 13 NOTE
44. hoc ery FOOTNOTES 1 Proof Let T be the square root and A be the approxi mate square root Define the relative errorin by T thus 1 as is true square 7 and so FNS Z 0 222 0 5 2 zy 802717 T 1 e 05 T 1 1 and thus ife is very small 1 e 1 1 e and so FNS Z 0 5 Td 0 5 1 1 055 2 T QED 2 Technical can be safely ignored 3 Non technical do not ignore 4 0 5 49 999993 2500 49 999993 0 5 49 999993 50 000007 0 5 100 50 REFERENCES Allan G J B 1980 The numerical accuracy of microcomputers 1 Macrocomputer BASIC compared to mircrocom puter BASIC Liverpool Software Gazette 2 Lusty T 1980 Problem page Computing Today 1 11 Noble B 1964 Numerical Methods 1 Iteration Programming and Equations Edinburgh Oliver and oyd Ratton A and Rabinowitz P 1978 A First Course in Numerical Analysis New York McGraw Hill APPENDIX 20 OUR E RETE 30 REM 40 REM HILBERT MATRIX TEST PROGRAM 50 REM 60 E AUTHOR G J BORIS ALLAN D SEM 90 100LETH 0 5 110 DEF FNS X H SQR X X SQR X 120 DIM A 20 20 B 20 20 X 20 130 PRINT ORDER 7 140 INPUT NI 150 FOR 1 0 TO NI 160 LET 0 170FORJ OTONI 180LETA 1 J 0 190 NEXT J I 200LETE1 0 1E 6 210 GOTO 650 ta Definiti
45. instructions and are usually tested to find the results of compare load bit test or mathematical instructions However the flags may also be used to provide information on what has happened in larger sections of code for example at the end of a subroutine This is done in a subroutine available in the Acorn System One monitor which fetches a key code from the keyboard This routine returns with the carry flag set ifa control key has pressed or clear for the key of a hex character the code forthe pressed key is also returned in the accumulator Another example is given in Listing 1 which converts the ASCII code for a hexadecimal digit into its binary code and clears the carry flag or if a non hexadecimal digit is given to it the carry flag is set The accumulator contains the ASCII code on entry and the binary code on exit from the routine Having called a subroutine which returns a result in the status register it is easy to branch dependant on the condition of the flags to take the appropriate action However other operations may be called for before the conditional branch is made in which case the state ofthe flag must be preserved If the intermediate instructions do not affect the relevant flags all is well otherwise the status must be saved by pushing it onto the stack or by other suitable means and restored before the branch instruction When setting or clearing a flag which is to be tested Laurence Hardwick later it is worth
46. sheep not humans and the purpose of the experiments is to find out more about the role of the endocin system in the birth process The computer setup which goes under the unwieldy name of Biophysical Variable Signal Processing System assists in the monitoring of various processes in both the foetus and the mother according to Dr Kitch Wilson a faculty member in the Department of Paediatrics and the father of the computer system Transducers he said are implanted in the foetus and in the mother s uterus and blood veins to monitor every thing from blood and inter utherine pressure to oxygen and blood flow The sensors are attached to a black box that converts pressure readings into electrical signals and finally into digital numbers which are analysed by the computer and then stored on a disk and used later in correlatum analyses Various experiments are performed before and during labour while the sensors continue their monitoring function The final correlation analyses will be done by a larger minicomputer butthe Apple does all the signal pro cessing and the real time acquisition and data analysis It does it especially well Wilson said because it s inter ruptable It s like having two computers First it does monitor ing and housekeeping chores then every 10 mil liseconds it s interrupted and goes down into the assem bly language program where the input is processed When that s finished it goes back to the
47. sorting routines simple compiler for language and several games programs in ALGOL68C are also usable on 780 Although programs written in ALGOL68C tend to take up more space than hand coded programs the ease of programming in ALgol68 more than makes up for this in most cases The system described would be very useful for writing large commercial packages There would be no source code to pirate and no overhead of BASIC interpreter ALGOLOSC allows the user to write CODE sections in most places a BEGIN END block would be accept able These allow the user to write sections of machine code or Z CODE in a program when special features are required System programmers use such features extensively indeed some the STRING operations are written in ALGOL68C but with CODE sections where the 780 block move instruction is appropriate operating system for the Cambridge CAP computer is IITLE Output code for program ORG 00100H written in ALGOL68C and the language has proved suitable for the job Appendix I Sample Programs THEfollowing programs are simple programs to show the type of code produced by the translator The code produced by the translator has been disassembled by another program and comments have been added Some of the calls to external routines will be to strange loca tions as these are usually assigned by the link editor Example 1 The program in the text above PROC add two number
48. stock NASCOM 1 z twah ELF TRS80 as previously advertised HENRUS M 404 Edgware Road London W2 England 01 4026822 Liverpool Software Gazette March 1980 21 Re locate your editor 22 Liverpool Software Gazette March 1880 IN last issues Apple Pips we omitted to give the address of Owl Computers who are responsible for LISP on the Apple II For those who are interested in this package here is the address Owl Computers 41 Stortford Hall Park Bishops Stortford Hertfordshire CM23 5AJ gt SYNTAX ERROR LIST 20 REM DATE VET PROGRAM 25 REM 20 REM BY G JONES 40 REM ke ee ede eee 50 DIM A 12 REM MONTHS AS NUMBERS 60 DATA 31 28 31 30 31 30 31 31 70 FOR 1 12 READ A I NEXT I REM 100 HOME 10 110 REM INPUT DATE AS 8 CHARACTER STRING 115 2 28 120 DD VAL LEFT X 2 REM DAY VALUE 120 MM VaL MID X 4 REM MONTH VALUE 140 YY VAL RIGHTS X 2 REM YEAR VALUE 150 IF lt 80 THEN 100 REM CHECK YEAR gt 80 160 IF MM 1 OR MM 12 THEN 100 170 FOR 0 TO 99 STEP 4 172 IF I THEN A 2 29 174 NEXT I 176 REM ALLOW FOR LEAP YEAR 180 DD lt 1 OR DD gt A MM THEN 180 200 VTAB 20 PRINT DATE OK END FROM APPLE MAGAZINE NUMBER 3 The Apple II will have the responsibility for one of many experimen
49. that if a line 15 inserted between lines 12 and 13 then this will now be line 13 the old line 13 will be 14 the old line 14 will be 15 etc To overcome the loss of lines due to confusion editing from the bottom up is recommended Editor commands are prompted with E and are INPUT NEW PROGRAMME typing I will elicit the response NEW PROGRAM OK this allows for accidentally hitting the wrong key as this command erases any existing programs NO N etc will return control to Editor command level YES Y or simply return gt will start input with the first line prompt D Lines are now input as prompted A line may be 80 characters long lines with detected errors are repromp ted Liverpool Software Gazette March 1980 33 To indicate the end of the program and return to Editor command level type LIST LINES L m n This is similar to the BASIC list instruction e g L will list all lines L 12 will list lines 1 to 12 L5 will list from line 5 to the end If a line beyond the given line is used then the actual line limit of the PILOT program is used There is an extra bonus for APPLE users paddle 0 is used as a list speed controller At zero setting the listing will halt and rotating it clockwise will increase the speed at which lines are displayed DELETE LINES Dm n This deletes lines specified in the same manner as list above and renumbers lines to maintain the incre mental or
50. to a numeric variable or increments or decrements a vari able by a given amount thus the formats allowed are a C lt numeric variable gt l lt number gt e g C X 7 b C numeric variable gt same variable number c C numeric variable gt same variable number eg C X X 5 note that 1 will increment not JUMP J This causes a jump conditional if modifiers are used to the named label line e g 3 NEXT NEXT causes a jump to NEXT is the numeric variable P is equal to 3 SUBROUTINE JUMP U This is used like jump J only a return to the next instruction line may be made with an E instruction SUBROUTINE RETURN E There is no operand for this instruction Execution continues on the line following the last U instruction encountered e g T THIS U NEXTONE T FUN NEXTONE T IS E this prints THIS IS FUN REMARK R This is 1gnored by the interpreter and is for the prog rammer to comment his listing e g R THIS SECTION DEALS WITH HORSE PLAY QUIT Q The pilot interpreter will halt at the last line of the program This instruction allows termination at any point within the program e g Q C 0 a PROGRAM OPERATION The program is divided thus O dimensioning and menu selector 10000 Editor 20000 interpreter 30000 Saves Routines 40000 Load Routines 50000 End OTT I
51. two memory test prog rams in the back of the memory board construction notes were written to run under Nasbug T2 or T4 They call three monitor subroutines as part of the error routine The addresses of these must be changed to run under Nas Sys 1 Re assembled versions of the two 0010 gt 0020 0030 0040 0050 0060 0070 0080 0090 0100 0110 0120 0130 0140 x lt 2 ty eye te ee programs are shown below N B If you have a perfect RAM Board some chance and have run these programs you probably won thave had any problems since the wrong addresses only occur in the error routine which is never called if there are no RAM faults Incidentally the programs were listed on one of the New Nascome Imp Printers our specimen was a bit drunk at the time Talking of which ifyou try to run an IMP off a Nascom 1 you will run into problems by just following the steps in the manual good Nascom It s all very well feeding the external UART clock from the printer into the Nascom 15 external clock pin but it wont go anywhere unless the on board UART clock select link is changed to external Since it needs to be changed back to internal for reading cassettes it might be as well to fita SPOT switch instead ofa link Try writing to Nascom for one under Warranty XK MEMORY TEST PROGRAM FOR NASCOM THIS IS THE SAME PROGRAM AS IN
52. 0060 0070 EEE E E 0080 0000 C9 30 ENTRY 0 0090 0002 90 OF BCC NONUM ASCI 1 code lower than 0 0100 0004 C9 3A 0110 000690 NUMOUT digit 0 9 0120 0008 E9 07 SBCIM 507 0130 000A 90 07 BCC NONUM ASCI 1 code lower than 0140 000 C9 40 CMPIM 40 0150 OOOE BO 03 BCS NONUM ASCI 1 code higher thanF 0160 001029 OF NUMOUT ANDIM F 0170 001260 RTS 0180 0013 38 NONUM SEC 0190 001460 RTS ID scans through the data and it uses it as appropriate until some escape data entry is encountered at which time the pointer P3 is pointing at the next instruction in the main program A second XPPC3 then returns command to the main program DOCUMENTATION Whatever data transfer techniques are adopted bet ween program modules the format used should always be well documented Not only will other people pick up your program and ask How do I give it data and where do the answers come out you will do the very same thing if you pick up an undocumented program two months after you write it Only a small number of idea have been mentioned in this article and different processors have different capabilities so some methods are more suitable for some machines than for others It is useful to look at other peoples programs and see what sort of formats the use of software interface and to maintain a degree of flexibility in the input and output requirements of your progra
53. 10 DEF ENS X H SQR X X SQR X 20 INPUT NUMBER Z 30 260 40 FOR 30 50 1 te Gl 60 70 G2 SQR Z SN EEE SIE ET 2 AE RAE SE TT a SEE C EEUU e TEE Liverpool Software Gazette March 1980 75 80 G3 FNS Z 90 PRINT TRUE ROOT 15 01 100 PRINT SQR 15 02 110 PRINT TAB 5 RELATIVE ERROR IS G2 G1 G1 120 PRINT ENS IS G3 130 PRINT TAB 5 RELATIVE ERROR IS G3 G1 G1 and not that the relative error in FNS is always zero It is instructive to note that in SOBS BASIC on the ICL 1902T the relative error in SQR is zero TABLE 1 shows relative errors in SQR for APPLESOFT BASIC over a wide range of values of Z it can be seen that the errors which vary from 7 20 10 to 3 37E 10 indicate constant inaccuracy in the SQR function apart from the four smallest calues of Z The implications of these inaccuracies will now be consi dered for the case of the matrix inversion routine used in the first article Allan 1980 to see how errors in estimating elements are affected by the use of the improved square root function TABLE RELATIVE ERRORS IN SQR FUNCTION FOR APPLESOFT BASIC 2 RELATIVE ERROR Z 0 5 0 16 0 65 0 326 4 13 10 1957 3 37E 10 13700 5 09E 10 109601 7 20E 10 986410 4 80E 10 9864101 6 07E 10 THE CHOLESKY DECOMPOSITION ROUTINES 2 IF A is a symmetric positive semi definite matrix i e t
54. 2 d N31 JI Td OL T Zd d B 9 2 N3Hl d kkk HOSHJS ONIMIS HIH d u 3NIT 30383 T3981 ON ANI3d N30133 3NIT730333 3 11108815 ek INING 133 11 9 547 INIT 40333 1 3NIT 30333 XHINAS 3NIT M0333 MO03N3 1388 1 3 XHINAS LNIQd 40 100 sek 320980104 INIA 8331230433 3023233 HIJ 0109 tSZ C N33 JI 3 3 0109 86 TWI lt ASH JI Se6rT 0109 GATAZ acra BEEBE BATEZ arc Bau asap staeoc BETATT SETAT 96575 OTTST sb T 2 BT6t T 986t1
55. 477285 Subscriptions Within Great Britain 6 00 for 12 issues Individual copies by post 60p Please tell us issue you would like to start a subscription with REPRINTS Articles that are explicitly marked as having restricted reproduction rights may not be copied or reprinted withoutwritten permissionfrom Microdigital Allotherarticles may be reprinted for any non commercial purpose provided a credit line is included stating that said material was reprinted from the Liverpool Software Gazette 14 Castle Street Liver pool L2 OTA Please send copies of any reprints to Liverpool Software Gazette attention of Bruce Everiss d Corner _ IN the last issue a routine was given which when passed the first byte of 6502 machine code instruction in the accumulator returned the number of bytes in that instruction 1 3 It did not check the instruction for being a valid instruction 103 out of the 256 possible instructions are invalid instructions and so could not be used for an application such as a single step program The short routine below using 50 bytes returns with the carry bit set if the byte passed to it in the accumulator represents a valid machine code instruction otherwise it returns with the carry bit clear It uses 32 bytes of data where the i th byte of data 0 lt lt 31 has a 1 in bitj 0 lt 2j lt 7 bit 0 being the least significant bit if the machine code instruction represented by 8 i j is
56. 5 DEC LD 4 LD IX OODH H CALL FACT DW LB PUSH HL LD 1 21 4004 LD H IX4005H PUSH HL CALL MULI6 POP HL L384 JP LEAVE ELSE i factorial i l FL b factorial 21 02 00 22 82 00 store parameter for fac CD 2C 01 00 increase in stack size 22 7A 00 put result at a 22 82 00 and pass it to fac CD 2C 01 7 00 22 7 00 put result at b 22 84 00 parameter for next call CD 00 00 0000 filled by link editor 80 00 C3 00 00 0000 filled by link editor name of routine CD 02 FF DD 6E 04 DD 66 05 get i into HL 7D B4 see 0 20 05 21 01 00 set HL to result 18 1E and jump to end DD6E 04 DD66 05 get 1 back 2B subtract 1 DD75 0C DD74 parameter for next call CD 2C 01 08 00 ES result of call EE 6E 04 DD66 05 ES pushi CD OF FF and multiply them E1 into HL xcd Ru RAS E Liverpool Software Gazette March 1980 PN GAIN MY PE NTC 201 Appendix 2 Examples of Z CODE T237 146 0 0 5331 factorial Z IN case the reader is interested to see what Z CODE T246 327 331 0 looks like here is the Z CODE for the second example F20 10 7 4 above B330 326 1 145 0 7 172 Z BASE Z FO 10
57. ANNEL RELAY BOARD Now in stock for NASCOM 1 2 For 49 95 Sixteen switched isolated channels for many control Rape i will greatly increase the flexibility of your NASCO Members of Computer Retailers Association amp Apple Dealers Association Shop open 0930 1730 except Wed amp Sun 40 Magdalene Road Torquay Devon England Tel 080322699 PUSH PUSH PUSH HL DE BC A H B2HEX 2 SPACE 2 2 CRLF C NZ WAIT BC DE HL You ve heard about it Read about it HERE IT IS AVAILABLE EX STOCK 4k A eX CONPLETE KIT AS PER AAAY lt CU MANUFACTURER S SPECIFICATION A OV With provision for 8K on board expansion Excludes 41 18 8 INCLUDES FREE 16K EXPANSION VALUE 140 includes ALL parts with every kit gt NASCOM 2 ON DEMONSTRATION NOW AVAILABLE ONLY FROM US ON THE COUPON BELOW RS232 COMPATIBLE 80 COLUMN PRINTER brand new List price 550 If sent by carrier 5 extra Please send me my NASCOM 2 KIT with the FREE 16K EXPANSION 2205 FREE 16K EXPANSION WORTH 140 OPTIONAL EXTRAS 3 AMP POWER SUPPLY 1596 29 50 Post 1 50 For NASCOM 2 8 OFF 4118 For NASCOM 2 PLR Chaser Early ERP Delivery Our PRICE 395 1 5 MANUFACTURER S WARRANTY DONT DELAY ORDER TODAY for 295 VAT l enclose remittance to cover Name amp Address Also in
58. BASIC program of monitoring General Telephone of Pennsylvania has come up with a solution to the problem of testing lines frequently enough at a reasonable cost It uses an Apple II in a system developed by one of its employees Ed Didion Didion has programmed the Apple to test each of the company s 2000 trunks and produce a printout telling what the expected volume was on each what the actual level was the percentage of trunks that passed and failed the standard volume and what the projected failure time is This enables them to better plan their mainte nance schedules from The Apple Shoppe No 4 APPLEKEYPAD Advanced Business Technology has announced the Keypad a 13 key keypad for the Apple computer The keypad is in a molded plastic case matching the Apple case and includes and return keys in addition to the 10 key numerics The pad interfaces with the normal Apple keypad in piggy back fashion and costs 125 00 It is being distributed to Apple dealers in Southern California by the Apple distributor OB 1 and should be available at your local Apple dealer APPLE AND THE VIDEO DISK Utah State University has combined the Apple com puter with the new video disk to create the ultimate teaching machine Each side of the disk stores 54 000 screens of information The information is retrieved using laser technology and any frame may be randomly accessed in 2 5 seconds A full search of the disk takes only 5 seconds
59. BRE rT T 3 393 81431 3 0109 3 S88tT T lt 3 N31 JI d d N3Hl I N31 JI NAHL C gt TI 25H 4 4 nu ANIMd tZ lt gt ASH fan ZT lt gt TI 25H JI BEST 139 on 3 23 INI 53087439 see WEA 0100 ANSON asset f T f H 2 JI H N31 01 T HDJ MOSHI MOIIOIT4LSNI 0109 509 1 2 JI 2 05 0102 ON c 32 N31 dI nin CTC SS JI 32 N31 01 T 8 Td OSitT 5 gt 0 89zer 3 1431 2 DSEFT 3 41 Ansan sSr tI 5 5309 M38 PETET 3 SLNdNI 9 1
60. GSOON Memory after loading asic 14K B 10K 18k 22K 34K Allpricesincludecourierdelivery withinUK Accessand Barclaycard Welcome AMICRODIGITAL 25 Brunswick Street Liverpool L2 OBJ Tel 051 236 0707 24 hour Mail Order 051 227 2535 Allother Depts Mail orders MICRODIGITAL LIMITED FREEPOST No Stamp Required Liverpool L2 Liverpool Software Gazette March 1980 Figure 1 Aim 65 MEMORY MAP RAM 3FFF A000 AFFF 0000 Assembler ROM Monitor ROM FFFF FIGURE 2 A suggested Use of RAM on the AIM 65 when string the 2 Pass Assemblers Normally used for variable storage 65 system space and 6502 stack space Space for Program under Text Editor Text Assembler Symbol Table Liverpool Software Gazette March 1980 PROGRAM ENTRY EDITOR SOURCE TEXT ASSEMBLER ASSEMBLER LISTING BINARY CODE BINARY DATA PROGRAM RESULTS FIGURE 3 ENTERING AND ASSEMBLING A PROGRAM Liverpool Software Gazette March 19 Enter Program using EDITOR Assembly Errors find errors and correct using EDITOR Ran Correctly FIGURE 4 DEVELOPING AN ASSEMBLER PROGRAM Liverpool Software Gazette March 1980 31 IN computer graphics separate shapes are often used such as for drawing spaceships in star games It is desire able to be able to make the shape reduce or expand to
61. H From the syntax diagrams the first component ofan expression is a term so we call subroutine 3000 Since a term consists of a factor the first job of 3000 is to call 4000 which then checks for the presence of a If there is one then factor knows that it is being called upon to evaluate an expression which it does by calling the expression subroutine 4000 after first finding the first character of the expression by calling 1000 The structure ofthe routines models very closely that ofthe syntax diagrams and it will be noticed that the only places where a stack is needed to hold the value of a variable is where there are two or more possible entry points to a recursive call e g in the expression sub routine where if the first term has been dealt with and either or has been met in which case whichever it was must be remembered so that on return the relevant operator may be added to the end of the R P expres sion Since every element to be dealt with is a single character we are stacking them by concatenating the character on to the end of a string and on return remov ing the character from the string One possible problem with recursion especially with the PET and all 6502 based machines is that BASIC uses the stack internal to the 6502 to store return addresses and since the 6502 stack is limited to 256 bytes this places a limit on the number ofrecursive calls that can be made A simple program 10 0 20N N 1
62. IF lt gt THEN 50130 50122 TI TS gt TC THEN TT I RETURN REM 1 INDICATES TIMEOUT 50124 GOTO 50120 REMTCISTHE LENGTH OF TIME ALLOWED FOR RESPONSE IN JIFFIES Ifon return TT 1 then a timeout has occurred note that this can be tested by simply IFTT THEN Ifthe timeoutis to be ignored ifthe user has typed anything at all then the condition in 50122 should become TI TS gt TOAND 15 77 I can be reached at the following address 6 College Ave Formby Merseyside L37 3JJ Fortelephoning during working hours please try 051 236 0598 SIMPLE EXPRESSION Liverpool Software Gazette March 1980 13 LISTING 1 1000 REM search FOR KEY FILE lt NE gt 1010 FOR I 1 TO NE 1020 IF FILE I KEY THEN IN I I NE NEXT 1040 REM FOUND 1030 NEXT I IN 0 REM NOT FOUND 1040 RETURN READY LISTING 3 1000 REM search FOR KEY IN lt gt 1010 IN 0 FOR 1 1 TO NE 1020 IF FILE I KEY THEN 1 11 1030 NEXT I RETURN REM 0 gt FOUND READY LIS TINGS 1000 REM search FOR KEY IN FILE NE 1010 IN 0 I 1 1020 IF FILE I KEY THEN 1 1 0 1940 1930 1 1 IF THEN 1920 1040 RETURN READY Lis TIN 5 3 11 1900 REM SEARCH FOR KEY IN FILE lt NE gt 1010 IN NE FILE 0 1920 IF FILE IN lt gt KEY THEN IN IN 1 GOTO 1020 1030 RETURN READY LISTI
63. NG 4 19 NC 14 FCS FOR 1 TO NC READ 5 5 5 05 29 DATA BP BR CE FI FO HE IN LS NF PL RM SP TI UL REM SET UP COMMAND STRING 39 INPUT OMMAND 1 1 r KEY 49 GOSUB 1000 IF IN 0 THEN PRINT RROR COMMAND NOT RECOGNISED PRINT GOTO 30 59 PRINT OMMAND NUMBER PRINT GOTO 30 1000 REM SEARCH FOR 2 LETTER COMMAND KEYS IN FCS SINCE COMMANDS ORDERED COULD COULD 1919 REM USE BINARY SEARCH SEE LISTING 5 1020 0 1030 1 1040 IF MIDS FCS CN 2 1 2 KEYS THEN IN CN CN NC 1050 NEXT CN RETURN READY LISTING 5 1000 REM BINARY SEARCH FOR KEY IN FILE NE ASSUMES SORTED 1010 INZO LEFT 1 RIGHT NE REM FIRST SECTION TO SEARCH IS ENTIRE ARRAY 1020 IF LEFT gt RIGHT gt THEN 1979 REM NOT FOUND 1030 MIDDLE INT LEFT RIGHT 2 TRY FILE MIDDLE 1040 IF lt KEY TRY gt THEN IN MIDDLE GOTO 1070 1050 IF lt KEY lt TRY gt THEN RIGHT MIDDLE 1 GOTO 1020 1060 LEFT MIDDLE 1 GOTO 1020 1070 RETURN READY 7 14 Liverpool Software Gazette March 1980 B DDEOXOMSO 7 7 707 9 7 LIZ ZTIFHCOG RzS5 M 3 REM SET SEED AND RANGE OF HUMBERS 20 FOR TO 21 3 1 38 GOSUE 1888 40 NEXT I PRIHT FRIHT GOTO 28 1000 REM GENERATE HEST RANDOM HUMBER IM 1616 lt FEM STEF 2 1020 RzOROBRHDOZTOMeZO 12 REM STEP 3 18308
64. PUTIN 0450 LD HL OCOE 0460 RDBACK LD 0470 XOR 0480 XOR 0490 LD CA 0500 LD A HL 0510 CP 0520 CALL NZ ERROR 0530 INC HL 0540 OR A 0550 SBC HL DE 0560 ADD HL DE 0570 JR NZ 18 Liverpool Software Gazette March 1980 CUNEO M C A 2 OD2D 0580 LD 0030 4 0590 XOR 40 0032 32 00 0600 LD 0BEO A 0035 1000 0610 DJNZ LOOP OD37 EF 0620 RST 28 0038 2A 0630 DEFM OD39 00 0640 DEFB 00 0 18 4 0650 JR TEST 0660 0670 PRINTOUT 0680 THE FORMAT 15 0690 ADDRESS EXPECTED FOUND 0700 OD3C E5 0710 ERROR PUSH HL OD3D D5 0720 PUSH DE C5 0730 PUSH BC OD3F F5 0740 PUSH AF 0040 7C 0750 LD OD41CD1903 0760 CALL B2HEX 0044 7D 0770 LD AL 0045 CD1903 078 3 CALL B2HEX 0048 00603 0790 CALL SPACE 79 0800 LD OD4C CD1903 0810 CALL B2HEX OD4F 00603 0820 CALL SPACE 0052 F1 0830 POP 0053 CD1903 0840 CALL B2HEX 0056 CD1103 0850 CALL CRLF 0059 010000 0860 00 OD5C 0870 WAIT DEC BC 0050 78 0880 LD OD5E 0890 OR OD5F 20FB 0900 JR NZ WAIT 0061 C1 0910 POP BC OD62 1 0920 POP DE OD63 0930 POP HL OD64 C9 0940 RET 0010 0020 0030 7 MEMORY TEST PROGRAM FOR 0040 THIS IS THE SAME PROGRAM AS 0050 THE BACK OF THE CONSTRUCTION7
65. THE BACK OF THE CONSTRUCTION NOTES CHANGED TO WORK WITH NAS SYS 1 BUT WITH SUBROUTINES PROGRAM WRITTEN USING ZEAP AND PRINTED USING NASCOM IMP PRINTER ZEAP IS 30 06 PLUS VAT IMP IS 325 00 PLUS VAT 0319 0306 0311 0600 0002 4 0004 32E00B 0007 2 ODOA ED5B100C ODOE 13 ODOF 7D 0010 OD11 A8 OD12 77 OD13 23 OD14 B7 0015 ED52 OD17 19 OD18 20F5 OD1A 2AOEOC 0010 7D OD1E AC OD1F OD20 4F 0021 7E OD22 B9 0023 C43COD OD26 23 0027 B7 OD28 ED52 OD2A 19 0028 270 ed 17 0150 MICRODIGITAL LTD 0160 25 BRUNSWICK STREET 0170 LIVERPOOL L2 OPJ 0180 0190 MIKE SHANAHAN 28 2 80 0200 SR Mr Meo MEUM O210 0220 TEST PROGRAM ONE 0230 TESTS IF EACH BYTE IS UNIQUELY 0240 ADDRESSABLE 0250 0260 B2HEX EQU 0319 0261 0262 2 PRINTS CONTENTS OF 0263 ASTWOHEXDIGITS 0264 0270 SPACE EQU 0306 O271 0272 SPACE PRINTS A SPACE 0273 0280 CRLF EQU 0311 0281 0282 CRLF PRINTS A CARR RETURN 0283 LINE FEED 0284 0290 ORG 0D00 0300 TEST LD 00 0310 LD A AF 0320 LD 0330 LOOP LD HL OCOE 0340 LD DE 0C10 0350 INC DE 0360 PUTIN A L 0370 XOR 0380 XOR B 0390 LD HL A 0400 0410 OR A 0420 HL DE 0430 ADD HL DE 0440 JR NZ
66. addresses in the original array were Further criticism was aimed at the fact that these pointers were packed quite loosely in an array three times the size of the AA Liverpool Software Gazette March 1980 67 original array See line 40 For this reason it was necessary to vet out the zeroes scattered about in the pointer array when listing the sorted numbers I think that the importance of these features is purely matter of opinion since just as many people seem to think that it is the end result that matters and not the way in which it is obtained Anyway this month I have re written the programme so that it can handle user values within any range that the machine can handle In this case an Apple I have also removed the original position feature and instead relo cated the list of variables in ascending order in the origi nal array but I have also provided a list of modifications for putting the old features back However 57 seconds for sorting 1 000 numbers in a range of 0 1 000 is still pretty fast and the programme is still linear for a well distributed set of variables i e 6 seconds for 100 num bers and 60 seconds for 1 000 numbers To run the programme you will firstly have to answer the question many numbers do you want to sort with a value greater than zero Next you have to enter the lowest and highest allow able value If those are entered as the same val
67. age string of characters terminated by OD which is the files name Where to put data when reloaded address of machine code to go to if data is to be executed start address in memory of data end address 1 of the data ud d d The data is copied by the operating system and is not harmed processor registers are used but the status us saved In interrupt or dma driven operating systems a wait until completion should be performed if the carry flag was set on entry A break should occur if no storage space large enough can be found OSBPUT This subroutine outputs the byte in the accumulator to a sequential write file X and Y are saved N Z and C are unknown In the COS inter rupts are disabled during BPUT but the interrupt status is restored on exit In other systems the files sequential byte pointer will be incremented after the byte has been saved OSBGET This subroutine returns the next byte from a sequential read file in A X and Y are retained N Z and C areunknown In the COS interrupts are disabled during BGET but the interrupt status is restored on exit In other systems the files sequential byte pointer will be incremented after the byte has been read On reset a set of vectors are moved into RAM in block zero which point to these routines These vectors are in RAM so that they may be changed by a users program to point to other routines ie serial interface etc th
68. am ple for designing a bar graph would be 10 PLOT clears the screen 20 low resolution graphics 30 DRAW 4 0 0 0 30 this will give you a perpendicular bar from top to bottom red in colour By setting various draws with the appropriate colours you can easily come with a bar graph The color graphics in the COMPUMAX are truly excellent THE DISK OPERATING SYSTEM The COMPUMAX uses the TSC FLEX DOS which is fully equipped with disk BASIC assembler dissassem bler relocator math package etc The disk controller circuit standard on the main board accesses the disk drives quite easily has to do while in the operat ing system monitor hit key P and he or she is on the DOS Then of course you will have to wait a few seconds until FLEX DOS is loaded into memory One inter sting feature of the computer is that while you are under DOS you can actually deactivate the memory space taken up by the PROM BASIC and use that space for your needs However the interesting software arsenal of the does not stop here It will be equipped with PASCAL FORTRAN and COBOL in the 3rd quarter of 1980 A truly magnificent system NEW SINCLAIR COMPUTER FOR UNDER 100 EXTREMEL Y portable measuring 9x7x2 inches max 218 x 170 x 50mm and weighing 12 ounces 340g the 7 80 15 intended for use at home work college or school As well as providing a personal insight into com puter prog
69. ams The software comes in the form of a cassette tape which is loaded into the machine and an instruction manual which explains both the commands ofthe prog ram and the instruction set of the Z80 microprocessor which is the CPU in the Sharp MZ 80K The programs availability on tape rather than in R O M follows Sharp s policy with their BASIC Lan guage tape They claim it has the advantage of easier and cheaper updating of the software in the future Certainly the disadvantage of waiting for the tape to load in is not great It takes just under 30 seconds for the tape to be read in and the amount of free R A M on board to be checked The program lies from 1200 H through 2000 H and like the BASIC program the cold start is at 1200 H On start up the program announces itself on screen and then proceeds to check the amount of R A M present in the machine In so doing it sets all this area to zero thus destroying any data present Therefore if the Machine Code Program is to be re executed after jumping back to the monitor say then the warm start at 1260 H can be used This does not perform R A M check and consequently any data in the free area from 2000 H upwards is safe Incidentally since the Machine Language Program lies in the same area in memory as the BASIC program the BASIC load command cannot be used to load this tape loading must be done via the monitor or an overlay error will be detected Once the tape is loaded w
70. applications Noble thoughts of teaching the principles of say enzyme kinetics through the use of a microcomputer are best forgotten unless the department is willing to sit OEE aS PS EET Liverpool Software Gazette March 1980 59 down for a few months and write first class software to run on the machines Whilst I enjoy writing programs in BASIC I am primarily a biochemist and make no aspira tions to being a programmer Even the expensive Chelsea Science Simulation program on enzyme kinetics is easily crashed and I wouldn t like to present it to a naive user The potential for the use of microcomputers in biochemistry lies in the illustration of biochemical con cepts Demonstrations in tutorials particularly with a decent size monitor and graphics but under the control of the tutor can make a valuable demonstration of an important principle One fascinating area in which such a demonstration would be of considerable value lies in the illustration of the genetic code Forgive the brief tutorial that follows basis of modern molecular biology resides in what is called the central dogma This states that the genetic material that is passed from one generation to the next nucleic acid codes for the major determinants of biochemical function the proteins Simply the code is as follows nucleic acid contains 4 bases represented by the letters A U G and C These 4 bases code for the 20 different building blocks
71. are is needed to take the 12 bit signal stored in two consecutive locations in the scratchpad RAM for the converter to a form represented in 8 bits but in machine code this is appar ently very rapid The application that we are planning is the interfacing of the Apple II to a spectrophotometer an instrument that measures the absorption of light by different molecules The spectrophotometer would normally be controlled by TTL level signals which are available on one of the ports of the Apple The analogue signal from the spectrophotometer would be passed through the 12 bit A D converter to the Apple which would initially do little more than store the data Subsequent analysis with trial output onto the monitor at a resolution of 0 696 or eventual output onto the plotter could then be per formed at leisure Fig 3 The software to drive the set up would permit repeated timed scans subtraction of one scan from another averaging of data and would allow dumping of data to disc output to the screen or to the plotter All of this could be performed within the experimental limits defined at the outset or brought in from disc by the person currently using the machine One a more sophisticated level differentiation of changing analogue signals or integration of areas under curves would be feasible The major disadvantage of this application is that the microcomputer 15 committed to instrument precluding its use for other applicatio
72. as being powerful in more serious applications A timer is available under program control and POKE enable the entry of machine code instructions and USR causes a jump to a users machine language sub routine 3 The computer has a complete alpha numeric keyboard using the standard typewriter configura tion 4 t has high resolution graphics with 24 standard graphic symbols being available Any alpha numeric or graphic symbol may be reversed The display con sists of 24 lines of 32 characters each 5 An expansion bus available at the back by edge con nectors brings out all lines including address and data lines so that there is no restriction on the extension of the machine Plug in boards are available to increase the memory capacity Memory expansion boards which take up to 3K bytes are 12 00 each and RAM memory chips of standard 1K bytes capacity are 16 00 NEW APPOINTMENT FOR COMPUTER RETAILERS ASSOCIATION THE Computer Retailers Association has appointed Mrs Helen M W Gibbons as Assistant Secretary reporting to the Secretary Mr T Moore of Newbear This appointment is one of vital importance to the Association as it will provide it with a full equipped permanent Secretariat which will give it a sound and well organised base from which to grow Mrs Gibbons who has many years experience as an Association Secretary sees the newly formed Computer Retailers Association as one of the most dyna
73. ask ourselves whether these mic rocomputers offer anything new that mainframes couldn t deliver What I hope to achieve in this article is to describe using personal experiences to illustrate cases the potential value that these machines possess in an experimental science I doubt if I am particularly well qualified to provide much enlightenment and I shall not include any programs take full responsibility for my opinions and will be pleased to communicate with any one who wishes to raise any points from this article Anoverview There are three major areas where microcomputers could be used effectively in biochemistry 1 Teaching 2 Analysis of input data 3 On line analysis of output from analytical instru ments Trying to decide on a configuration that is suit able for all three areas is difficult but a typical specifica tion might include Hardware Software Disk drives Accurate floating point Hard copy ideally graphic routines Easy interfacing to instru ments High resolution graphics Graphic routines High level language Machine code environm ent This specification is demanding and is probably met by few systems currently available The configuration that we are using at present is shown in Fig 1 is based on an Apple II plus and cost in the region of 3 500 Fig 1 Table 1 In addition the biochemistry department at Liverpool has an 8k shortly to become 32k PET and printer Teaching
74. ation are required each to be used in a different context Most microcomputer owners will have several text editors each designed to be used in a different context Care must be taken to choose programs which are similar in use otherwise you will become confused when using the different editors Each text editor should be selected to provide a different facility and not to duplicate functions which are already adequately covered by other programs Typically an editor will be 50 Liverpool Software Gazette March 1980 required to generate files to be read by any assemblers and compilers that you use and a text editor formatter SUPPORT MEMBERS OF THE to be used as a simple world processing system 1 COMPUTER RETAILERS The followingarticle describesthe developmentofthe ASSOCIATION various editors used at one major site over a period of fourteen years and will be of interest to anyone interested in seeing how a major item of software develops over such an extended period P Hazel The Development of Text Editing at Cam bridge IUCC Bulletin 1 pp155 118 1979 THEY WILL SUPPORT YOU For further details on the associations aims membership code of conduct etc Please contact Mrs Gibbons Owles Hall Butingford Hertfordshire CE9 9PL Tel 0763 71209 UNIVERSITY OF LIVERPOOL MICROPROCESSOR LABORATORY MICROCOMPUTER ASSEMBLER PROGRAMMING 5 AFTERNOONS STARTING TUESDAY 20TH MAY 1980 This course give
75. c spelling corrections can be dealt with in the same way More recently with the rapid increase in the power of modern computers very sophisticated editors have been used to search text files in a systematic way This is almost always done in batch mode operation with the programmer using the editor commands as in effect a special text handling language The editor can be used to find error messages in a compilation listing or to isolate the results of a large program which are of immediate interest leaving the rest to be analysed at leisure It is possible using an editor to locate and printoutthe final results ofa calculation to set up a data file for analysis by another program and to obtain the intermediate results on microfiche for storage To do this the editor must have powerful macro looping and conditional prog ramming in a traditional computer language These facilities would be for too complicated for all but the most experienced programmer to use from the Keyboard On large mainframes however it is more economical to implement all the required facilities in one large package since those parts which are not used will remain on disk and will not be loaded into the computer s main memory This is not possible with most microcomputers which do not have enough memory or backing store to do this It is therefore necessary to mount several different editors each intended for use in a different area The main editor will
76. cal and electronic components from dust dirt probing fingers etc it makes the computer much more manageable Although the cost ofthe complete package is compar able with that of a minimum configuration PET or TRS 80 different facilities are offered It would cost several hundred pounds for instance to connect even the cheapest printer to on of the other machines Also it is possible to connect a wide range of peripheral devices directly to the AIM 65 through either the peripheral or the expansion connectors The AIM 65 can also be used in conjunction with a cheap controller type single board computer such as the ACORN to develop a number of useful projects around the home TABLE 1 AIM 65 MONITOR COMMANDS MAJOR FUNCTION ENTRY COMMANDS RESET Enter and Initialize Monitor E Enter and Initialize Editor T Re enter Text Editor at Top of Text N Enter Assembler 5 Enter and Initialize BASIC Interpreter 6 Re enter BASIC Interpreter INSTRUCTION ENTRY AND DISASSEMBLY COM MANDS I Enter Mnemonic Instruction Entry Mode K Disassemble Memory DISPLAY ALTER REGISTER COMMANDS i Alter Program Counter A Alter Accumulator X Alter X Register Y Alter Y Register P Alter Processor Status S Alter Stack Pointer R Display Register Values DISPLAY ALTER MEMORY CONTENTS M Display Specified Memory Locations SPACE Display Next 4 Memory Locations Alter Curre
77. clears and end the BASIC lines with 12540 12560 providing Apple specific program trol 12710 12770 delete the lines by shifting up lines below and reassigning PI 12810 12830 changes VARIABLE TABLE line by deleting then inputting 13030 13550 appends from the given line by inputting a line using the input A accepted string routines of 14300 then shifting lower lines down one to C general purpose left half of string make space for the new line 14020 14940 inputs lines D general purpose right half of string using 3 routines 14110 14260 is the control loop D crunch routine flag 14330 14560 inputs line into E and does simple E inputted string syntax checks 14810 14940 replaces INPUT EIS got string allow colons and commas which otherwise are taken H string of allowed instructions data separators Control characters are checked far I J general purpose string variable 14830 return 14850 ctl X delete line and 14880 LO label table line number lift arrow delete last character no others are sup L n label table string number ported but extra routines maybe added 15010 15150 Ll label table end pointer are all the error messages used by the editor and the Editor line number and general pur interpreter 17100 17200 is the string search routine pose The actual Interpreter starts by scanning the program current program line for labels and recording their name and l
78. considering the ways in which flag s contents may be destroyed The overflow flag in the 6502 15 affected by only a very few instructions PLP CLV RTI ADC SBC and hence once it has been cleared it is usually fairly easy to ensure that its status 15 not inadvertently altered When various tests are being performed it is possible to store the results in a byte in memory by using the rotate ROR instruction of the 6502 This instruction shifts the contents of the carry flag into the top bit ofa memory location and all bitin that location right by one bit A sequence of instructions something like JSR TESTI result in carry flag ROR MEM JSR TEST2 result C in carry flag ROR MEM etc will build up a byte in memory which contains the results in a sort of minature stack C bit 7 stack gets pushed C bit 6 down as each new C bit 5 result is added bit4 The results can subsequently be rotated out ofthe mem ory location using the reverse instruction ROL and acted upon in order The use of flags is important in good programming it is always useful to know which processor instruction affected what flags REGISTERS The example program in Listing 1 demonstrates the transfer of data in the accumulator and the applications i oir Ed Liverpool Software Gazette March 1980 71 of this method are fairly obvious The other processor registers may be used index registers are not only useful
79. continues his excellent regular series applicable to 2096 of all micros in use in the U K Page 16 NASCOM NOTES Michael Shanahan airs his views and helps Nas sys users to test their memory Page 21 CARTOON Page 22 APPLE PIPS Our regular series on Apple is a little smaller this month but articles elsewhere more than make up for this Page 24 AIM 65 ASSEMBLER Find out more about this vastly under rated piece of kit and 6502 programming in general Page31 GRAPHICS SHAPE SCALING Our contributing Editor will have more to say on this next month Page 32 PILOT TAKES OFF A full listing of a Pilot Assembler in BASIC Page 42 LETTER FROM AMERICA The first of Dave Smith s regular features on the latest West Coast computer gossip Page 44 PASCAL AN INTRODUCTION Dr Andrew Veronis starts his lucid explanation on this structured high level lan guage Page 48 PROGRAMMING PRACTICES AND TECHNIQUES This regular series continues this month with a look at editors Page 51 CARTOON Page 52 ALGO 68C ON THE Z80 In this article Raymond Anderson seeks to point out that Pascal is not the only structured high level language that will run on a micro Page 5 8 MICROCOMPUTERS AND BIO CHEMISTRY This application article helps to show that microcomputers are tools for a wide wp variety of possible useages Page 62 SHARP MACHINE LANGUAGE An introduction to using the Z80 within your Sharp Page 65 ERRATA Page 66 SUPER SORT Roy Stringer thoroughly
80. d on routine call Example Consider the program PROC add two numbers INT a b INT a b INT 2 Declare three integers x 3 y 4 z add two numbers x y After assignment of x and the stack will look like Where each box represents two bytes Just before the call x and y are copied up as parameters Now the procedure is called setting IX to point to the base of the procedure local workspace The return address is placed in offsets 2 amp 3 as described above The routine now accesses its parameters as offsets from IX The sum ofthe parameters is calculated and held in HL over the procedure return The actual code pro duced is given in Appendix 1 The stack after completing the routine call and assign ment of z will be Runtime Errors EVEN the best programs occasionally encounter run time situations that they either do not expect or cannot handle A clear indication of what has gone wrong is useful and if the place in the code where the error occurred can be indicated the message is even more useful Obviously the code has to be fairly compact so the amount of data available when an error happens is limited In the Z80 implementation it is possible to follow back the routines which are currently using the stack and determine the start address of each one When the code for a routine is output the first seven characters of the routine name are generated before the body of the routine
81. d within the requirements of a limited research group or which provide frequently referenced information could remain in the machine or on the disk in the drive all day and be accessed as needed The software for this type of laboratory utility program has to be elegant however as it will be used by many people from the original author to students Boot ing procedures and commands impede the user if he knows little about the machine or BASIC and are best circumvented Many microcomputers with disk drives allow automatic loading and running of an application program immediately after power up with no interven ing steps I consider that this is an essential element in building up sets of utility programs Use ofthe computer then becomes very secondary to use ofthe programs all the user needs to know is how to insert the disk and switch on the machine If the software is of sufficiently high quality it should be impossible for the user to escape from the environment of the program and should never see the interpreter or command level the program should be crashproof The design of crashproof programs often seems to consume far more memory than the central mathemati cal routines All input should be entered as strings many tests are possible on string data including scans for end of data markers or requests More difficult are overflow errors but with the BASIC interpreter available on the Apple and several oth
82. decimal formats Rockwell have very sensibly included the Text Editor and Assembler documentation in the AIM 65 User Manual Not only is reference material included in this comprehensive manual but there is also consider able tutorial material both on the use of the facilities provided on the AIM 65 and on 6502 programming in general There is also an advanced tutorial on the use of the 6522 Versatile Interface Adaptor a very useful peripheral controller which also includes two timer cir cuits Both the hardware and software are described in detail in the reference sections I have used the AIM 65 both for the development of 6502 programs and for the teaching of Assembler Prog 26 Liverpool Software Gazette March 1980 ramming for some time now Students appreciate the two pass Assembler in ROM where it is always avail able without the time consuming necessity of loading it in from cassette tape They are introduced to the Assembler in the first practical and use it for all their programs There is little temptation to use either the Mnemonic Instruction Entry facility orto enter to prog ram as hexadecimal Object Code The Disassembler can be used to check that programs have not been overwritten without resorting to the interpretation of hexadecimal dumps The printer is also much appreciated since it allows the student to take a listing of his program away with him to study before the next practical session For most studen
83. delete as applicable Name u School College University Address E E Type of card l Send to EDUCATIONAL COMPUTING ECC Publications Ltd 30 31 Islington Green London N1 8BJ Title Signature F M s Liverpool Software Gazette March 1980 35 eg FRED INSTRUCTIONS TYPE T Prints include a accepted string variables of the form single character gt This allows such as Christian names to be used to deformalise programs e g the operand text Extra formatting may T HELLO WHAT S YOUR NAME 8 T HELLO X b Screen clear If the first two characters are e g CHAPTER 2 MATCH M Searches the last Accepted string see below for a match with the operand and sets the match flag if successful Special characters are amp and logical operators AND and OR respectively e g M NIT amp IDE NITRO This will successfully match with NITRIDE NITRIC OXIDE NITROGEN etc It will fail to match with NITRATE NITRE NIT RITE etc ACCEPT A Halts the program and prompts the user for an input with 77 ie A will give and wait for a string input which may then be checked with a match statement A string variable may be used see Type above and the reply is assigned to that variable e g A P COMPUTE C Note that this is not a full compute statement it is only for loop and modifier control It assigns a number
84. der within the editor hence 1 T HOW ARE YOU 2 T OK 3 A with the command D2 become 1 T HOW ARE YOU 2 A APPEND FROM LINE Am This allows insertion of any number of new lines after line m Each new line will be asked for with a prompt Existing lines will be renumbered to accommodate the new lines To return to Editor command level just type return Note iftis typed this makes this the final line in the program deletes all lines after it and returns to Editor command level To insert before line 1 append from 0 0 CHANGE LINES Cm n This performs a delete plus append Specified lines as in list above are replaced with new lines See rules for append for inputting new lines SEARCH FOR STRING 5 string To facilitate locating lines you may search using any given sequence of characters within that line so SHELL will give with the first line with HELL somewhere in it e g 35 M HELL PURGATORY if the end of the program is reached without finding a match END OF PROGRAM is displayed The search is cyclic so if S is again typed the search will start again from line 1 QUIT Q This returns control to the menu mode THE RUNNER Torunacurrent program type R whilstin menu mode When the program finishes the line n it stopped at is displayed in the message PILOT LANDED AT LINE n To return to menu mode afterwards simply hit return To stop at program whils
85. dissects the workings of his sort programme published in issue 2 of this magazine Page 70 SOFTWARE AND ACORN The only regular feature for Acorn owners continues this month with a look at interfacing Page 74 NUMERICAL ACCURACY Dr Allan continues from last month on this essential topic Page 78 ETC It looks like hardware is infiltrating into the Gazette n n IW 24 272 1 nn MU ihe UNE AWA HANNS wy NN NUS NS SW SQ TG NS uN M S 2 ww 3 A pi A d 14 5 ZZ Liverpool Software Gazette March 1980 15422 p Jt jj 1 Il t D wid um 2 7 2 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII IIIIIIIIIIIOI IOI IIOIIIIIZIIHIIZIIAIIIIIIAIIIIAIIIZIIIIIIIIII IIII II IIIIIIAIII I IIIIIIIIIIIIIZIII I Editor 0 0 WHAT amazing industry this 15 few short years ago computers were the preserve of professionals looked upon by outsiders in awe and deference The advent of the micro has liberated the computer almost overnight computer time has gone from being a precious commod ity to being freely and cheaply available to anyone who wants The result has been a broad base of computer literacy and nothing demonstrates this better than the fact that the authors of articles in this magazine include an architect a b
86. does not allow their contents to be modified The breakpoint or B command allows you to set up to 9 breakpoints in your program with each being executed an individual number of times up to a max imum of 14 This is very useful for analysing conditional jumps out of loops On typing B all the current break point addresses and execution counters are displayed They may be modified or added to using the cursor controls Certain limits are put on where a breakpoint can be placed in a program For instance you cannot set a breakpoint at a DJNZ an RST7 or a CALL type of instruction i e one s that save the Program Counter on the stack Applicable error messages are displayed if this is attempted or if more than 9 breakpoints are set On executing your program by way of the G command as soon as a breakpoint is encountered the R command is automatically executed and all the CPU registers are displayed Also program execution is halted Execution may be advanced to the next breakpoint by typing G if all proves OK in the first section of the program By this powerful method bugs can usually be erradicated if breakpoints are setat relevant points in a program Once a program is freed of bugs all breakpoints may be cleared by executing the clear breakpoint or amp command One command missing from the package is a single step facility This could have proved a valuable addition but since it is usually implemented using the NMI and some ha
87. e also a number of other more unusual facilities Breakpoint can be set at desired instructions within the program The breakpoint facility can be turned on and off without clearing the breakpoint settings This is a very useful facility since it is often necessary to run the program through to check for correct opera tion before finally clearing them Separate instructions are included to trace instruction codes the register con tents or the contents of the program counter This is very useful since usually trace output is routed to the printer and the generation of unnecessary trace informa tion would waste a lot of paper As an additional debugging aid a single step facility is provided through a slide switch on the main computer board Software is included to read and write to cassette tapes in both KIM 1 format as used by the other single board computers and the AIM 65 s own format which gives a better transfer rate and is more reliable Also within the monitor are a mnemonic instruction input mode and a disassembler These two instructions allow the user to input his programs directly as assembler codes and avoid the necessity of hand assembling programs The disassem bler can be used to check the contents of program mem ory and output is in the same form as the instructions were entered Once developed user programs can be called if desired by pressing one of three extra keys on the keyboard provided jump addresses a
88. e and so on One convention used in Kernighan and Plaugher s Software Tools Addison Wesley is that a formatting directive begins with a and is the first thing on a line They are two letter commands e g bp br ul and so on The first task 15 to determine that a formatting command is to be obeyed and then to get the two letter string which then compared with the possible range of values for the formatting command these pos sibilities having been loaded into an array earlier on in the program One of the search algorithms above is then 8 Liverpool Software Gazette March 1980 used to see if the command obtained is one of the legal commands If it is then we return IN a value in the range 1 NC where NC is the number of commands This value of IN can then be used in an ON IN GOTO GOSUB command There are a number of slight variations on this techni que When using strings the target strings may be con catenated into one long string and the command string compared against substrings ofthis string This normally needs some sentinel string at the end e g XX or the idea of tacking the command string onto the end as in the routine in Listing What we are doing is to create a form of CASE state ment equivalent to an ON GOTO GOSUB where the argument is not numerical The search is being used to map the possible range of values of the command string onto the integers 1 NC Listing 4 demonstrates the technique f
89. e are ready to do some machine code programming All the commands in this program use single character codes followed by hexadecimal arguments as appropriate A printer command implemented by typing a character enables anything printed on screen to be duplicated on an external printer not available as yet A second character will disable the printer drive Note that trying to use this command without a printer Mike Shannon Engineering Dept Microdigital Ltd attached will give an error message and terminate the command Typing as a command will return control to the monitor When using this command take note of what was said earlier if a jump back to the Machine Code Program is to be performed The first command to use for actually placing your own program in memory is the Memory Write Com mand or W for short After pressing W the program inserts its own space and waits for a four digit hexadeci mal address to start the writing operation Any invalid characters non hexadecimal typed in for the address are not accepted and the bell is sounded If the format of the arguments is not correct Le riage return is pressed before typing the full argument then several bells are sounded and the command is ter minated with the message INVALID being displayed If any of the arguments fall outside the free memory area some question marks are printed and the command is again terminated These features along with the a
90. e array The important thing to note is that at each iteration we halve the range under consideration so that the number of comparisons will be ofthe order of log NE Thus double the number of elements and we add a constant number of compari sons the number necessary to determine whether we have found the element must search the lower half of the range or the upper half As we have said this technique depends on the array being sorted but for large arrays its performance is so much better than the linear search that it will often repay the extra effort made It shows that to speed a process up gains will not be made from removing spaces comments etc which can even approximate those made by altering the algorithm If a program is not fast enough one s first question should be 15 there a better algorithm There exists an even faster method of searching though it is not useful in every situation which depends not on the data being sorted but on it exhibiting a pecul iar form of randomness The technique of hashing will be covered in the next issue along with the problem of sorting the Supersort presented in the last issue uses a form of hashing to achieve its spectacular performance along with a large amount of memory A USEFUL RANDOM NUMBER GENERATOR Sometimes it can be useful to generate random num bers in such a way that one 15 sure of getting all the possible values e g in a game For real numbers this is impossible b
91. e hard disk with many vendors offering an assortment of hard disk capability for their systems Corvus is marketing a 10 megabyte 8 inch Winchester hard disk for the Apple TRS 80 and 5 100 bus computers The company claims to have solved the back up problem with a tape drive unit for around 1500 that will back up the hard disk in just a few minutes The Apple version is very impressive running Apple Pascal The Pascal driver is supplied with the drive and allows the entire 10 megabytes to be addressed as a single block or broken up into smaller blocks Com plete compatibility is maintained with both DOS 3 2 and with the 280 block Apple Pascal disk format An Apple pascal system with 10 megabytes on line is a very power ful system indeed and would rival many mini s in proces sing power for a fraction of the cost The corvus unit is 5350 Look for a lot of activity in this area since Shugart has announced a 2 megabyte hard disk that fits into an 8 inch floppies why not It won t take long for the Shugart unit and others from Japan to open up the 1 to 2 megabyte market which if the cost is down around 2500 will be extensive NEW APPLE USERS GROUP A new Apple users group is being organized as the club to end all clubs Called the International Apple Core the club will actually be a user group for Apple user groups Val Golding of Call A P P L E fame will be editing the club magazine called the Apple Orchard which promises to b
92. e of these facilities has been limited in my opinion for several reasons Firstly biochemistry is closer to being a descriptive than a mathematical science we understand so little of the ways in which a vast array of complex molecules are assembled into a structure as complicated as a living human cell As a life scientist I take exception to Lauries recent editorial in Practical Computing 1 when his idol the wonder chip produces self replicating adaptive cognitive and independent machine in 70 kg c f the human body then he can make derisive references to butcher s shop materials until then due respect to nature and her 3 0 billion years of research and development Conse quently models tend to be simple and are analysed readily without recourse to the application of mainframe facilities Secondly the centralised mainframe with its aggres sive operating system and slow turnround is a real deter rent to its use for small jobs sometimes it s just not worth the walk to the nearest data centre Finally biochemistry is an experimental science and the biochemist must be aware of the partition between acquisition and analysis of data there is a danger of computers leading a gloss of sophistication to a descrip tive science And now biochemists note the arrival of the mic rocomputer replete with its entourage of attendant adjectives approachable affordable local sonal We have to
93. e process was completed until a satisfactory text was obtained It was realised at an early stage that the programmer was not really interested in the line numbers of the text which he wished to modify He was of course interested in the text which the line contained Also by requiring that the complete line was retyped the editor commands included a lot of information which was not strictly necessary Experiments were conducted into the use of context editors using the text itself to identify the posi tions of the information to be altered during the mid 60 s It was now possible to change single characters or groups of characters within a line without retyping the whole line Two different types of editor were now developing one contextual and the other based on whole line operations Users were unhappy and con fused by the availability of two different editors intended to perform exactly the same function It was therefore decided to combine the functions of both editors and so obtain the full benefit of both Lines could be defined by absolute line number or by its position relative to the current line or by the characters which it contained Character strings could be inserted deleted or exchanged within the current line By intro ducing the concept of a character pointer it was possible to handle lines containing repetitions of the same string more easily the editors discussed so far were intended to be used either in
94. e sent to every Apple owner world wide Apple has already supplied the new user group with mountains of technical material which has been sent to member user groups for distribution Check with your local user group for details on how you can join Only user groups can actually become members of the International Apple Core NETWORKING TAKES OFF The latest craze here is networking with micros Two national networks have really caught on with nearly every micro vendor These are The Source and Mic ronet With these systems you can call a friend on your computer from L A to N Y for just 2 90 an hour This will really open up personal computing In fact rumor has it that GTE and the other big telephone companies are aiming to do just that by getting in on the band wagon and offering the personal computer telephone that will serve both communication and computing needs in the home In light of this some people are projecting a serious manpower shortage in the telecom munications industry for skilled technical people One of the really neat things about systems like The Source is that your micro can tie into the huge news gathering services of AP and not to mention the DOW JONES stock information Maybe a London New York link can be established MICRO NEWS In the personal computing news look for Programm International to release a new version of Lisa and Apple Pi The new Apple Pi text editor is supposed to be better t
95. e unit in favor for anew lower cost unit without the color monitor now that T I has received FCC clearance on their units Still both the Atari units and T I unit suffer from a bad price performance ratio when compared with the Apple or radio shack because of the relatively high cost of the peripherals and memory expansion HITS THE MARK One new unit that is receiving enthusiastic response is the new H P 85 personal computer This new unit is everything the T I unit is not It features a built in video screen H P digital tape unit thermal printer all in one small desk top unit While the price of 3200 is a bit high by micro computer standards this unit carries all the quality and backing of the H P line Included is an impressive graphics capability and scientific oriented BASIC compiler The built in printer prints anything on the screen including graphics and the unit accepts a wide variety of peripherals including LE E E 488 or Liverpool Software Gazette March 1980 43 I o MAI ATA E Sau S n mI W RS 232 peripherals It no doubt will become the lowest cost bus controller available and will probably show up in every engineering department in the country very quickly Perhaps it will become pawn in the up coming press for manpower with companies offering H P 85 s to attract top engineering talent during the projected manpower shortage in the next few years Deal
96. e vectors are as follows 0200 NMIVEC NMI routine entry 0202 BRKVEC routine entry 0204IRQVEC IRQ routine entry 0206 COMVEC operatingsystemcommandline interpreter 0208 write character to output subroutine 020A RDCVEC read characterinputsubroutine 020C LODVEC load program subroutine 020F SAWEC save program subroutine 0210 RDRVEC ERROR 0212 STRVEC ERROR 0214 BGTVEC get byte from tape 0216BPTVEC put byte to tape 0218 FNDVEC ERROR 021ASHTVEC ERROR The vectors which point to error are there to allow for software expansion to sequential file handling A call to error causes the COS to output Com a break is then executed CALLS As there is no jump to subroutine indirect to use these vectors the COS has the following calls in it FFCB OSSHUT JMP SHTVEC unused FFCE OSFIND JMP FNDVEC unused FFD1 OSBPUT 4 OSBGET JMP BGTVEC FFD7 OSSTAR JMP STRVEC unused FFDA OSRDAR JMP RDRVEC unused FFDD OSSAVE JMP SAWEC FFED OSLOAD JMP LODVEC FFE3 OSRDCH JMP RDCVEC 6 OSECHO JSR OSRDCH FFE9 OSASCI FFEB BNE OSWRCH FFED OSCRLF LDA OA FFEF JSR OSWRCH FFF2 LDA 0D FFF4 oswrcH JMP WRCVEC COMVEC 74 2 n O O n D 6 Liverpool Software Gazette March 1980 by Dr B Allan NUMERICAL ACCURACY OP MICROCOMPUTERS
97. ed in such a way that they will be LDH FREDH compatible with future acorn operating systems and XPAH3 higher level software and are defined as follows LDAFREDL XPAL 3 OSCLI subroutine interprets a string of charac ters held at 0100 terminated by a carriage return as an operating system command Detected errors are met with a brk All processor registers are used the XPPC3 CALL FRED EXCHANGE P3 decimal mode flag will be set to binary on exit DATA TABLE NOP PROGRAM CONTINUES SUBROUTINE FRED LDA P3 1 LOAD A AND INCREMENT EOROS8 08 IS CODE FOR NOP JNZNORETURN XPPC3 EXCHANGE PC P3 TO RETURN NORETURN EOR 08 RESTORE DATA OSWRCH This subroutine sends the byte in A down the output channel This channel is usually treated as ASCII data and special action may be taken on ASCII control characters In the COS the recognised control characters are the cursor movement and printer control characters No processor registers are destroyed OSCRLF This subroutine generated a line feed and then a carriage return using OSWRCH A will con tain OD N will be 0 Z will be 0 all other register will be as before OSECHO This subroutine fetches a byte from OSRDCH and then writes itout using OSWRCH Ifa carriage return occurs in OSRDCH both a line feed and a carriage return are sent to as OSWRCH A will contain the byte N Zand C are unknown all other registers are unchanged OSRDCH This subroutine fetches
98. ency Thanks to my not having read about sort algorithms before I had founda very obvious but seem ingly unusual algorithm Of course I thought He s using the random num ber itself as an address for it s new position in the array And that of course meant that it had only to make one pass through the Jumbled Array This approach produced a very fast but very simple programme the first version of which somehow found its way into last month s issue of this magazine This original version used a neat method of maintain ing a record of each number s original position without havingto use an extra array which would waste valuable memory The usual method to my knowledge is to move each number s position record in a separate array in parallel with the movements of the number itself Then when the completed array is listed its sister posi array is listed as a record of where number came rom A dead give away as to how to get around this waste of memory is in line 100 of last months version Firstly it prints the number in the original jumbled array pointed to by the current variable in the sorted array A B I This is the next value in the ascending list It then prints the current pointer in the sorted array which is of course the original position of the value B I Finally it prints the new position D This system received some criticism as it meant that the numbers themselves were not sorted although their
99. ent in FILE as follows in Listing 3ii At some time the condition in line 1020 must be false since if the element KEY was not in FILE NE FILE 1 it is definitely in FILE O by reason of the second statement in line 1010 If KEY was in FILE NE FILE 1 then the loop will exit with IN equal to the relevant value which is what we want This technique of using a particular element to act as a sentinel for the loop is equivalent to using a variable with an abnormal value to signal the end ofa list of data It s basic use is to simplify the terminating condition of the routine or as we have seen to remove one or more of the terminating conditions altogether It has a certain elegance in that we generate the value of IN 0 auto matically without having to assign it especially Often a long sequence of IF statements occurs in a program where a variable is being tested against a large number of possibilities and the one which is truly being used to either GOTO different portion of the program or to assign different values to other variables The linear search algorithms introduced above can be used to simplify this type of programming quite easily Perhaps the best way to demonstrate it is to consider the action of a combined text editor and formatter program which enables the user to input text to the program inters persed with formatting commands e g to set the left margin centre a line set the number of characters per lin
100. er in your School Brand news and much more apa Computer ISSUE 4 The microcomputer and the teacher Computer retailing Using a digital ring Desert island floppy discs Computers for the smaller firm Systems for small businesses Keeping your computer busy New technolog les for education More on FORTH ISSUE 1 Clive Jenkins and the unions views Are games playing programs intelli ent Artificial intelligence and the ayman Micro computers in educat ion Algorithmic designs How mighty micros can aid super sales Why not a computer in your busi ness Some microcomputer uses in psychology Learning FORTH Office of the future and much more ISSUE 3 Faceless bureaucrats an invasion of privacy Buying a personal com puter Statistical analysis on a micro Doing it in binary The small systems market hots up Book reviews When we re all ten years older Database The modular approach Optimising employment periodical can be highly recommended on the evidence ofits first two issues It contains for the businessman professional firm teacher and individual a reliable guide almost equivalent to a computer Which on theins and outs ofbuying and using computers The Times Monday February 18 Liverpool Software Gazette March 1980 CONTENTS Page 4 EDITOR AND PUBLISHERS LETTER The Editor airs his views not too contentious this month we hope Page 6 PETS CORNER John Stout
101. er machines the ONERR function allows control of such errors All that is needed is a jump to some routine that tells the user that an overflow problem is apparent before RESUMEing execution We generally find that the mathematical routines are the simplest part of the prog ram to write embedding those routines into an error proof program can take much longer The following criteria are those that we try to apply when producing utility software for general use 1 The program should resist attempts to crash if by the entry of mismatched or ridiculous data 2 The program should resist control C type attempts to half execution I don t have a method for resisting Fu I WW s r OT m sssi Liverpool Software Gazette March 1980 EEUU I NEN IK I I I LIU LM C MEN V CRM CNET RESET on the Apple any suggestions 3 The program should respond to a specified key e g and should give appropriate assistance according to the position in the program 4 f program goes away to perform long calcula tions it should inform the user Have you ever been asked to hold on during a telephone call and ended up replacing the handset because you don t know whether the silence at the other end means that you have been disconnected Iknow that these all obvious but by writing them in a 4k set of marks routines quickly becomes a 16k program Some readers may be interested i
102. erest in 1975 On line analysis of data Many manufacturers are now releasing sophisticated microprocessor controlled analytical instruments which boast an impressive repertoire of capabilities that may be user defined One spectrophotometer has a locking key that disabled the control panel and prevents casual button pushers from altering instrument settings These machines are expensive especially in the face of dimin ishing research funding and are limited to the flexibility designed into the instrument The alternative approach to interface a microprocessor to an existing instrument is attracitve This is especially so with a microcomputer as the availability of a high level lan guage will allow the user to write his own analytical routines The majority of analytical instruments output infor mation as an analogue signal posing the first problem of interfacing to a microcomputer The majority of mic rocomputers that are currently available use 8 bit micro processors and so can handle data best in 8 bit chunks The use of an analogue digital converter that produces 8 bit digital data has limited application in analytical research as the range of numbers represent ing the whole of the analogue signal can only be from 0 to 255 an effective resolution of about 0 596 Again one of the reasons that promoted us to acquire an Apple was the availability of 12 bit A D converters giving a resolution of 0 25 Obviously softw
103. ers report a very health demand for this unit with H P already on allocation until June IBM MAKES ITS MOVE IBM is making its long expected move into the mini and micro field with their new distributed processing system the 5120 This unit is actually the same as their 5110 unit which has been on the market for some time but features a lower price with a large video screen The cpu is rumored to emulate a 360 which accounts for the slow speed of the 5110 It is not known if this has been changed in the new unit With the desk top processor display unit are built in dual floppies for 1 2 megabytes on line with hard disk capability optional Best of all a full range of small business accounting software is avail able Now check the price 13 000 to 23 000 depend ing on model and options This compares very favorably with many small business micro s which are now inching up into the 10 to 20 thousand dollar range with hard disk capability Now I ask you ifit came to a choice between a North Star 8080 and an IBM computer which would you choose My guess is that IBM will take a lot of suffering out of the sails of budding micro business sys tems which seem to be proliferating at an unbelievable rate IBM will market the unit at IBM retail outlets some 200 which are planned for this year The unit will be offthe shelf although its weight of over 100 pounds may make that a bit impractical HARD DISKS ARE IN This is the year of th
104. every advertiser even page 50 free copies of the issue they advertise in selling these will help recoup part of the advertising cost 1 1 IF you are at an academic institution or a member of a computer club or any other group that can get together a regular bulk order for the Gazette you will be able to buy at trade price from Computer Bookshop 43 45 Temple Street Birmingham 1 2 First Edition 52 pages Second Edition 68 pages This Edition 84 pages Next Edition 100 pages This magazine has more pages of articles than any other microcomputer magazine published in the U K f 2273 EVERISS SHARP Computer Apersonal computer that opens the world of programming to your own fresh ideas CRT Display MZ90K This unit is equipped with a 25cm 10 monochrome CRT for up to 1 000 letters 40 letters 25 lines Processing results can be displayed on the CRT and it is possible to program and edit addition deletion etc while watching the operation tor confirmation A Technical Masterpiece A personal computer that makes full use of the multi functions of an 8 bit microcomputer Z 80 this model is certainly one of the most advanced anywhere It employs BASIC language a feature which 78 Keys ASCII standard Alphabet capital and small letters Graphic symbols Built in Clock provides easy programming even to those Clock circuit time is displayed according to totally unfamil
105. fiers are names chosen by the programmer to iaia si 1 denote constants types files variables procedures and Liverpool Software Gazette March 1980 45 functions The first character of an identifier must be a letter Any number of letters and digits can follow However identifiers must differ in the first 8 characters to be distinct Most of Pascal compilers in use today recognise the set of standard identifiers specified below These identifiers can be redefined locally or globally Standard constants are FALSE MAXINT TRUE Standard types are BOOLEAN CHAR INTEGER REAL TEXT Standard files are INPUT OUTPUT Standard Functions are ABS ARCTAN CHR COS EOF EOLN EXP LN ODD ORD PRED ROUND SIN SOR SORT SUCC TRUNC Standard procedures are GET NEW PAGE PUT READ READLN RESET REWRITE WRITE WRITELN Punctuation symbols Almost half of the Pascal punctuation symbols includ ing mathematical operators are the same as in any order programming language However quite a few more have a different meaning and are described briefly below AND Boolean conjunction OR Boolean inclusive disjunction NOT Boolean complement becomes replacement separates items in list separates statements separates variable name and its type delimits character string literals Decimal point record selector program ter minator 1 subrange specifier A indicates file or pointer va
106. for putting in a screw so different languages are suitable for different jobs and a programmer needs a tool box of different languages to apply to the different tasks In this issue are articles about two of the tools that are available Algol as well as our regular series on Pascal In future issues there will be further articles on these and other languages whilst obviously continuing to support BASIC as this is the microcomputer language in the most widespread use Further up and coming goodies are an application article about microcomputers in architecture a look at Crystals superb Z80 BASIC an analysis of the Social Effects of Microcomputers and articles on the various Sorcerer Pacs among many others To maintain and even enhance the quality of this journal we need reader feedback even if just to complain so don t hesitate in taking pen to paper Publisher 1 0 LIVERPOOL Software Gazette is a company in its own right separate from Microdigital though it 1s neces sary for us to continue using Microdigital s resources for a while This should make no difference our editorial content has not favoured Microdigital in any way as we have always regarded the Gazette being a separate entity We hope this change will encourage more adver tising in the Gazette because advertising revenue is the Liverpool Software Gazette March 1980 a lifeblood of a magazine As a further inducement to advertise we are giving
107. fortunately the square root function in APPLESOFT BASIC seems to be sadly lacking in efficiency in efficiency and accuracy The last statement can easily be justified by recourse to Newton s method Noble 1964 26 30 esp Ex 2 2 and this method is the basis for the new function ENS To get a feel for Newton s method try this program 10 INPUT NUMBER Z 20 GUESS Z 2 30 FOR I 1 TO 30 40 GUESS 0 5 GUESS Z GUESS 50 PRINT GUESS IS GUESS 60 NEXT I 70 END note that this program is in a basic a BASIC as poss ible On running this program you can see just how quickly the successive guesses converge to the same number the square root of the number you input The key line is statement 40 Normally we guess the value of the square root in BASIC by use of the SQR provided function That is GUESS SQR Z and 5 denotes an improved estimate of the square root of Z statement 40 would suggest S 0 5 GUESS Z UESS or S 0 5 SQR Z Z SQR Z Itis possible to continue by using S in a further step in the iteration but if statement 20 is altered to 20 GUESS SQR Z and the program is then run you will see how quickly successive guesses converge This can be utilized as 5 0 5 10 DEF ENS X H SQR X X SQR X where FNS X gives the exact value ofthe square root If FNS X does not give the exact value ofthe square root then SQR X must be very inaccurate Try 5 0 5
108. give the impression of travelling away from or towards the V D U Screen Fig 1 This article describes the theory of how to do just this It assumes shapes are drawn as successions of points upon the display device In order to scale a shape all points on that shape must be moved towards or away from a given origin in an equal ratio Hence shape ABCD in Fig 2 reduces towards origin O and becomes A B CD such that OX OX K where X is any point on ABCD and is the corres ponding point on A B CD K is the constant scaling factor such that if K 15 less than 1 then reduction occurs if K is equal to 1 then no size change occurs if K is greater than 1 then expansion Occurs Each point may be described as a cartesian x y value from the origin and co ordinates of the corresponding position are divided in the same ratio Thus considering one point P in Fig 3 X X OP y gives the new co ordinates as Kx Ky To avoid propagated errors all scaling should be done from the original shape Thus the Nth position of P 15 given by KI x K2 x K3 x xKn x KIxK2xK3x xKn y where 2 Kn are suc cessive scaling factors With constant scaling factor K this position will be End stops must be catered for when shape expands off the screen or reduces to a point With expansion the points will separate and a line will become a series of dots This may be c
109. gt 164 M PITZT Z gt JI 0100 002954 FOIW gt H MAHL umn gt CEO 81431 0109 Td M lt gt 0 di 5 13815 TINN M OL 6 313734 151 be Nani3s D lt gt I 0105 aeezt 81509 NSHL 5 lt gt 2 dI 00297 0109 801509 BPEZBT gt 2 Al 223281 11 52 42 SZT T 2 Start eootrt 02827 82227 89227 05227 2 822271 87227 BBAT BESET asset 89527 asset 92627 21 08527 2 gt BOTT 42451 14 23 12 0109 anson gt 2 JI 0109 8101509 1 2 gt 24 ainda 6 35 eret
110. han anything on the market including Easywriter Speaking of Easywriter from Information Unlimited they have announced a new plug in board for the Apple that gives upper and lower case from the Apple keyboard and 80 columns display on the screen It is rumored to be Apple Pascal compatible but that has not been verified yet Ifit is it means the excellent Pascal editor will be available fortext editing without having to buy an external terminal More on this development next time Please feel free to write and let me know how things are in England And I hope you Apple owners will take advantage of my APPLE SHOPPE publication as am sure you will find it a great help to you That s all from America 7 3 Liverpool Software Gazette March 1980 PASCAL is fast becoming one of the most popular programming languages for microcomputers It is for this reason I developed the urge to write a long series of articles and to describe this fascinating language ELEMENTS OF PASCAL Pascal like any other programming language has its own syntax that determines the way Pascal identifiers and symbols are put together to form statements oriented to Pascal Computational processes NOTIONS The basic Pascal vocabulary consists of keywords plus special symbols used as operators and delimiters In this series of articles Pascal keywords are always capitalized For example the following are Pascal keywords as they
111. he determinant of A is greater than or equal to zero then itis possible to findareallowertriangualr matrix L such that A LLT where 1 is the transpose of L L can be thought of as the matrix square of root of and in fact one needs to calculate square roots to obtain L In the test program of the Appendix statements 470 to 640 calculate the lower triangular matric and stores it in the lower triangular portion of the matrix A 20 20 including the diagonal Ifthe matrix A is singular determinant of zero or near to zero then a pivot A J J in line 510 will be less than a small amount set in line 200 to be equal to 1E 7 and so there is a jump around line 520 to lines 540 and 550 line 550 outputs a warning After the lower triangular matrix is placed in the lower triangular portion subroutine 360 uses L to calcu late the inverse matrix successive columns of the iden tity matrix are placed in X and subroutine 220 is called the routine extends from 220 to 350 The correspond ing column of the inverse matrix is returned in the same vector X and stored in the appropriate column of B If one 15 performing a solution for a set of linear equations without needing the inverse matrix X would contain the constant in the equation e g in the example in the first paper the constants were 1 199 and X 2 197 and one would use 1000 GOSUB 470 1010 GOSUB 220 Note that in lines 520 we use the function
112. her change it or simply make that line the current line The string change command has an interesting facility in that when the Editor finds the next line containing the search string it displays it and waits for confirmation If the line is the one which requires changing the programmer replies by pressing the return key and the line is changed Ifit is not the line which requires changing any other key is pressed and the Editor continues the search stopping at the next line in which the string occurs This means that the whole text can be scanned for a particular string with no fear of changing the wrong line The Symbolic Assembler is of conventional two pass operation During the first pass a Symbol Table is built up in which all the symbols used are stored together with their values The Object Code and program listing are produced during the second pass The Assembler uses the usual 6502 mnemonics and formatting conven tions and is initiated by using a special Monitor com mand The Source Code can be taken directly from the Text Editor buffer in memory or from cassette tape having been saved there by the Editor The Object Code can be stored in memory at the desired address or may be stored on cassette tape for later use Ifboth the source of the program and the Object Code are to be stored on cassette tape two recorders are required This is necessary for programs of any consid erable length since there is not enough room
113. iar with computer operation program SHARPMZ80KSOFTWARE BREAKOUT 5 00 SUPER SIMON 5 00 MASTERMIND 5 00 MIZ MAZE 8 00 SHAPE MATCH 5 00 GRAPHICS MUSIC 5 00 LUNAR LANDER 5 00 BOMBER 5 00 SNAKES amp FIREBALLS 5 00 LADDERS 5 00 DONKEY DERBY 5 00 HB COMPUTERS LTD 22 NEWLAND STREET KETTERING NORTHANTS Tel 0536 83922 amp 520910 Telex 341297 LIVERPOOL SOFTWARE GAZETTE Editor Publisher Bruce Everiss Editorial Assistant Nikki Devereux Contributing Editors John Shout Dr Martin Beer Dave Straker Advertising Subscriptions Nikki Devereux Artwork Peter Croft John Burrows ADVERTISING Full page 17 5 cm x 24 cm 180 00 Half page Upright 8 5 cm x 24 cm 95 00 Half page Landscape 17 5 cm x 11 75 cm 95 00 Quarter page 8 5 cm x 11 75 cm 52 00 Agency discount 10 Please contact Nikki Devereux on 051 227 2535 if you would like further details DISCLAIMER the information in the magazine has been throughly debugged and tested However no guarantees are made as to its truth or validity TRADE DISTRIBUTION Computer Bookshop 43 45 Temple Street Birmingham 021 643 4577 U S DISTRIBUTION Bits Inc Box 428 25 Route 101 West Peterborough NH 03458 c LIVERPOOL SOFTWARE GAZETTE 1980 THE LIVERPOOL SOFTWARE GAZETTE is published bi monthly by Liverpool Software Gazette Limited 14 Castle Street Liverpool L2 OTA Registered in England No 1
114. inal VERIFY Reads a file from the cassette and compares each byte ofthe file with the corresponding byte in Liverpool Software Gazette March 1980 79 memory MOVE Copies the absolute binary contents of a block of memory specified by FROM BEGIN through FROM END into a memory block starting at TO BEGIN COMPARISON Performs a byte by byte comparison of the absolute binary contents of a block of mem ory with the contents of a memory block FIND Searches memory in the range of BEGIN through END for all occurrences of BYTE or WORD and prints the corresponding addresses on the system terminal EXIT Returns control to the Operating System Monitor ON Turns on the cassette drive motor to allow manual operations rewind etc DRIVE The prefix Drive is an integer 1 or 2 which specifies the cassette drive on which the command 15 to be executed THE BASIC INTERPRETER One of the fastest BASIC interpreters in existence today if not the fastest is the one written by Technical Systems Consultants TSC of Indiana and the COM PUMAX uses it It is located in 6 EPROMs and is indeed superfast The TSC BASIC incorporates two main color graphics commands the PLOT and the DRAW The screen is divided into two axes the X and Y axes addressable in low resolution into 32 by 64 segments and in high resolution into 250 by 190 segments The designation of the various colours is given by number typical ex
115. ince the machine anticipates a key word knowing that it follows a line number This feature eliminates much tiresome typ ing Powerful edit facilities Every statement line is syntax checked as it is entered and only syntactically correct lines can be added to the program list The line being typed in appears at the bottom of the screen and only joins those lines at the top if it is free of syntax errors If there is a syntax error then a marker identifies it so that it may be eliminated This unique feature helps ensure the production of an error free program and is of particular value for beginners The BASIC has good string handling capability There can be up to a maximum of 26 string variables and the strings can be of any length All rational tests may be used on the strings so that for example strings may be compared The machine has string input so that the computer canrequesta line of text string when necessary Strings do not need to be dimensioned which is an unusual benefit and upto a maximum of twenty six single dimension arrays are possible Nesting for loops is also permitted up to a maximum of twenty six Integer variables may be of any length The BASIC is capable of handling full Boolean arithmetic conditional expressions etc Built in functions are CHR STR TL PEEK CODE RND USR ABS The randomise function is of particular value for games and secret codes etc as well
116. ine position P n PILOT line table lines 200300 20090 20100 20130 initialises vari end of PILOT program pointer ables Each interpreted line starts at 20230 20230 numeric variable value table 20270 check for non interpreted lines remarks label numeric variable name table and end and break 20300 20620 checks the modifier end of numeric variable table pointer and if false jumps to the next line 20700 20820 routes S n stack to the appropriate instruction routine 21000 21130 SI stack pointer types are checking for screen clear 21012 21018 and V n string variable name and value table replacing string variables with the actual text 21040 VI end of string variable table pointer 21110 22000 22690 matched This divides into sec X X 25 general purpose variables CONVERSION TABLE APPLESOFT DESCRIPTION ALTERNATIVE LEFT X Y The Y leftmost characters of X X 1 Y X Y The Y rightmost characters of X X LEN X Y LEN X3 X Y The rightmost characters of X from Y X Y LEN X X Y Z Z characters of X from Y X Y Z PEEK 16384 strobe keyboard return value of 127 key value if key is pressed 16386 4 resets keyboard strobe PDL X returns value 0 255 depending upon analogue paddle X HOME clears Screen FOR 1 1 TO24 PRINT NEXT I C
117. ine the ideal register usage and then translated into machine code Extensive error checking during translation means that faulty Z CODE is detected and this means users can safely write directly in Z CODE if the fancy takes them Runtime System Algol 68 allows recursion in procedures and dynamic declaration of array bounds This complicates the run time system compared with simpler languages Consider the program BEGIN print much newline INT space read space newline O space INT array declaring a vector if integers etc END The amount of space required for the array is not known until runtime so it has to be allocated dynami cally In addition to the above there is a form of storage known as the HEAP This allows objects to be generated inside a procedure for example and to remain in exis tence as long as some reference to them exists This type of storage is useful in list processing and is also used by STRINGS which may change in length during their lifetime There are seven areas of store in Z80 implementation Program code allocated before running constant Read only data combined with program code The Z80 stack allocated about 40 bytes before the program starts Global variables Allocated places in store during translation Local variables local to procedures which may be recursive They are accessed relative to IX the local stack which is adva
118. ing and sorting were brought up and an expansion promised for this issue Rather than try and deal with both topics at once we will deal with the searching problem first and start with a description of the problem we are attempting to solve A variable KEY is given together with an array FILE which contains NE number of elements The task is to find that index IN such that FILE IN KEY The Liverpool Software Gazette March 1980 7 definition of FILE will have occurred in a statement such as DIM FILE NE at the start of the problem where NE may either have been assigned a value as the result of an INPUT statement or of an assignment statement Wherever the routines presented refer to the size of the array they will use NE so that the problem does not depend on a particular value of NE not that users of PETs with old ROMs must have NE less than or equal to 255 A typical application might be to find the location in the array which contains the number KEY then use that position to retrieve other information linked to that number e g a description of a part with that given part number where that extra information may be stored in another array e g DESS NE In the special case where the range of possible values for KEY is 1 then of course our task is much simplified since all we would need to do is to look straightaway at DESS KEY The problem of searching simple squashes KEY to fit into the range of possible
119. iochemist and even a salesman We welcome this democratisation of computing as it is resulting in an almost infinite variety of ideas and appli cations that can only be good for the industry and thus for society as a whole Certainly we look forward to pou many more articles from non computer pro ssionals 0 1 THIS issue ofthe magazine sees the introduction of two more regular features both by American authors Letter from America is written by Dave Smith who has been in micro computers from the beginning in Southern California and who has his finger on the pulse of the Orange County computer scene His monthly contribu tion will do much to keep out readers aware of the way the industry is going Andrew Vernois is a computer professional who has worked for several of the Ameri can microelectronic giants and who has written quite a few books on computing microelectronics We hope that bringing his professionalism to spreading the Pascal gospel will help more people realise that BASIC is not the ultimate way to use their machine With successive issues we hope to carry more regular features The next issue should see a 6800 section and a regular home for news and information on the Sharp MZ we hope too to find sufficient material for a regu lar 1802 feature as we feel this excellent processor has not received the coverage it deserves 0 2 A high level language is a tool for doing a job and just as a hammer is unsuitable
120. ions Many com puter dealers now have the new Atari 4005 and 800 s but so far the Apple look alikes have not burned up the marketplace Indications are that the Atari 800 will become a moderately good seller with the 400 much less so But the Atari s poor showing in the display window reportedly has helped Apple sales where the two units have been displayed side by side The Atari is well known for having good shielding having passed the government FCC regulations for radiation interference The trouble is while it may not radiate anything it picks up everything So when the Atari is placed next to an Apple the Apple screen is sharp and clear while the Atari suffers from worms and waves in its display and really shows the unit off in a bad light The reported cause of this is the poor quality rf modulator that is built in to the Atari The Apple on the other hand uses an external modulator so some freedom of choice is available to choose a good modulator Still the Atari is bringing in new customers into the marketplace and that is good for everyone TI UNIT SALES DISMAL Another new unit the home computer is having a dismal time and dealers are reporting very few takers for the unit It appears that has guessed wrong about the strength of the home computer market and that most people simply are not willing to spend over 1000 for what amounts to a sophisticated video game Rumor has it that T I will phase out th
121. ious computer time for the preparation of either programs or data this was done offline and prog rammers queued up to feed their punched cards or paper tapes into the computer and obtain their results The programs were written directly in machine code so program changes were difficult and time consuming to introduce Only once computers were introduced into the commercial world was any real consideration given to how the computer could help make the programmer s task easier With the introduction of first assemblers and later compilers it became necessary to create and maintain large amounts of machine readabletextual information in the form of program sources At first these were held either on paper tape or on punched cards in the same way as machine code programs and data had been before The program text was ammended by removing the relevent punched cards and replacing them with new ones holding the required text or by repunching the whole paper tape making the necessary corrections as you went It was possible if your computer had a forgiv ing paper tape reader to cut out the sections of tape to be corrected and splice in new sections suitably cor rected Although papertape was more difficult to handle than punched cards it had the advantages that it was lighter and more compact and could not be mixed up when dropped Because punched card equipment such as mechanical sorters required the data to be held i
122. lised that the information required could be held permanently on the mass storage medium and manipulated using special utility prog rams These were the first true text editors Early editors were able to insert replace and delete complete lines which the programmer identified by their line numbers stored within the text As computers became yet more powerful and users amassed considerable quantities of data the primitive facilities then available became woe fully inadequate Editors were developed which not only allowed the programmer to manipulate individual lines of text but also allowed him to insert whole blocks of information into the centre of his text To do this the line numbers could no longer be stored as part of the text but had to be computed by the editor when reading the source This is a principle which has been followed almost all text editors since These early editors weree developed as parts of primitive filing systems and weree used in batch mode operation The ammendments still had to be entered into the computer either on punched cards or on paper tape It was common practice to Liverpool Software Gazette March 1980 49 ST MN I u e c cc I the initial source of a large program on tape and to ammend the card deck or paper tape containing the editor commands manually until it too became unwieldy A copy of the corrected source was then stored on tape and th
123. local to the program Consists of five specific parts which are described as the discussion proceeds Label declaration part Constant definition part Variable declaration part Procedure function declaration part The State Section specifies all actions to be performed upon the above declared objects PROGRAM HEADING PART The program heading gives the program a name For example PROGRAM ADD PROGRAM INVENTORY LABEL DECLARATION PART The label declaration part sets up statement labels for reference by GOTO statements Each label must be an unsigned integer of four digits or less For example LABEL 214 56 5 CONSTANT DEFINITION The constant definition part gives program constants a name identifier to be used within the program as a synonym Constants can be numbers a string or another constant For example CONST ROW LENGTH 17 MAXVAL 145 QUESTMARK If the particular Pascal compiler you to use loys values that are known before program execution you can write each value two different ways as a con stant or a literal Actually a constant is a literal with a name Constants are given names in the CONST decla ration section The following are program segments using literals WHILE X 15 DO FOR INDEX 1 25 DO Following are some examples using constants set by CONST CONST MAX 20 HIGH 25 PI 23 141593 WHILE X MAX DO FOR INDEX 1 TO HIGH In the
124. many earlier macrocomputers but one needs to be extremely careful in the coding of numerical procedures TABLE II LARGEST RELATIVE ERRORS IN HILBERT MATRICES APPLESOFT BASIC Order Using SQR 1 Using FNS 2x2 0 0 3x3 0 0 4 4 0 0 5x5 2 5E 5 0 6x6 5 8E 4 5 0E 6 7 7 1 6 2 4 6 4 8 8 2 1 7 2 9x9 5 2 3 1 10 10 3 2 1 Notes 1 Taken from TABLE of Allan 1980 2 Matrix is singular at this point according to this routine 76 Liverpool Software Gazette March 1980 CONCLUSIONS Worries about square roots do not only have an impact on multivariate procedures in Lusty 1980 we are presented with an example of inaccurate square roots for the RM 380Z Lusty shows how the square root of 50 000000 50 000000 1s calculated by the 380Z to be 49 999993 a relative error of 1 4 7 However Lusty does not try to improve the accuracy of the square root sq root but notes that if the true square root is integral INT SOR Z 0 0001 will equal the true square root He uses this information in a computer game Square Triangles Solution Obviously if one does not understand the numerical basis of errors in functions such as SQR then one will tend to use adhoc solutions to eradicate the errors This is poor programming and with complicated programs is also probably wrong The final article in this series will discuss how functions can be improved on the basis of numerical analysis and not of ad
125. mic in the industry At its formation a few months ago twenty two com panies formed the nucleus of its membership and now with the appointment of a Secretariat the CRA which is the only body representing the micro computer industry 15 soon to embark on a full programme ofactivities which is likely to bring it to the attention of Computer Retailers I IISN IAIAIAIA WIAIaIAIIT H Fc sasa Liverpool Software Gazette March 1980 81 a all over country and thereby attract much larger membership Membership is open to companies in the computer field who have a significant interest in supplying mic rocomputers or related products and services to end users and who have a permanent display area where their products and services can be effectively demons trated Mrs Gibbons would be delighted to answer enquiries from potential members and she may be reached at Computer Retailers Association Owles Hall Bunting ford Hertfordshire 509 9PL Telephone Royston 0763 71209 NASCOM SYSTEM 80 NASCOM Microcomputers launched a desk top mic rocomputer system called System 80 which combines many of the company s widely acknowledged products with a number of new boards and peripherals With the exception of the IMP impact matrix printer which is only supplied built all the products can be supplied in builtor kit form The new floppy disc system will
126. ms ACORN SYSTEMS To demonstrate some of the methods used on a 6502 system and perhaps as some small step towards a stan dard we can look at the following specification for the Acorn operating systems These will support higher level languages in such a way that changes from a tape cassette to a floppy disk based system etc will not cause too large an upheaval and provide a useful set of input output facilities whatever the system hardware config uration LISTING 2 MESOUT ACORN 6502 Assembler Page 01 0010 0000 MESOUT ORG 18000 0020 0000 TABLE 3000 0030 0000 POINT 0040 0050 MESSAGE OUTPUT TO DISPLAY 0060 ENTRY X LOWER BYTE OF MESSAGE 0070 4 ADDRESS 0080 EXIT Y FF gt 0090 PE 0100 0000 AO 07 0110 0002 B6 20 0120 0004 A9 30 0130 0006 B5 21 ENTRY LDYIM 07 8 digits to send SIX POINT X points to message on entry LDAIM TABLE load upper half of pointer STA POINT 01 0140 OOOB 20 LOOP LDAIY POINT load bit pattern 0150 99 1000 STAAY 0010 store in output buffer 0160 000 88 DEY 0170 OOOEIOFB BPL LOOP and loop 8 times 0180 001060 RTS ID 72 Liverpool Software Gazette March 1980 ET LISTING 3 O S SOFTWARE SPECIFICATION PROGRAM THE OS contains several routines which can be called to interface between user programs and the system hard ware The routines are defin
127. n fixed fields assemblers and high level languages designed to be used on computers with primarily card based input output required that the programmer used ELLER ENDESA TEEST EEE LIE Programming Practices MICROCOMPUTER PROGRAMMING TECHNIQUES Martin D Beer Computer Laboratory University of Liverpool P O Box 147 Liverpool Software Gazette March 1980 4 particular columns for different purposes The computer was very unforgiving and would reject any card which did not precisely fit the predefined conventions It was also usual to follow the convention of numbering each card in a special field so that if a card deck was dropped it could be put back together again in the correct order with the help of an automatic sorter The strict field conventions of most assemblers and some high level 4 languages notably FORTRAN are a throw back to these days As computers became cheaper and more common consideration was given to the connection of mass stor 4 age devices such as magnetic tape units and later magnetic drums and disks At first these storage units were used to store the operating system and programs which were run frequently such as the assemblers and compilers They were then used to store the programs and data temporarily so that throughput could be improved It was then rea
128. n of UCA to UGA would cause premature termination of the process UGA is an end codon Other work using computer generated sequences of bases have been described 2 We hope to have our program running for student use by October 1980 Programs for the PET which simulate the experiments for sequencing of a chain of amino acids have been described and the Chelsea Science Simulation pro jecton enzyme kinetics is published by Edward Arnold 4l For an introduction to the use of computers in biological education the reader is referred to the recent papers by Smythe and Lovatt 5 and Morgan 7 On a more mundane level we shall provide statistical routines on the PET for use by students of Veterinary Biochemistry during their practical work there are few better ways of teaching statistics than by the application of tests to the students own data From an administrative aspect we are using the Apple II to maintain marks of veterinary science students throughout their two years of biochemistry The use ofa minicomputer to maintain a bank of multiple choice examination questions has been described 6 but I sus pect that storage limitations might impede such developments on microcomputers Analysis of hand input data and personal computing There are a number of advantages associated with the acquisition of a microcomputer as part of the research equipment available to the biochemist A series of prog rams that are designe
129. n the routine in Fig 2 this does some of what I feel is necessary but does not include the ONERR overflow and control C checks The subroutine would return with RF set to a value dictated by the keys pressed and with valid answers in TS and TV if RF 1 A routine in the main program including an ON RF GOTO could then deal appropri ately with the response of the user The types of programs that we are using or developing include routines for the design of buffer solutions which maintain hydrogen ion concentrations at defined levels in experiments statistical routines for group analysis or regression and routines for driving the plotter to pro duce fully annotated and drawn graphs fortheses and for publication Incidentally I am against the common type of regression program that allows the user to fit a curve to data according to each of six relationships you should decide which relationship your data conform to before performing any curve fitting Finally within this context we use a database system on the Apple II to allow limited access to the scientific literature appropriate to our research The program allows limited subject guided searching and gives a brief citation a reference to a card index containing more information and a brief summary of the subject of the work This is helpful in providing reading lists for new students or for running a rapid search through say the file containing the set of the 600 references of int
130. nced when a procedure is entered Arrays Global or Local A description of the array is kept on the Local or global stack but elements are held on the Dynamic stack so they may be released when needed no longer Heap Storage is allocated by a routine heapgen when required It is in a separate area of store called the HEAP area Store TOP I P m E I I Dynamic I Stack Normal A Stack IX 21 Globals o ss Q q a s m 1 280 Stack en a ee D 1 Program 1 Code 1 gt RR 4 54 Liverpool Software Gazette March 1980 The of the dynamic stack is pointed to by word on the local stack When space for an array is required the routine dyngen is called to give the space required This adjusts the pointer to the top of the dynamic stack and returns the address at which the array may be allo cated If there is insufficient space then a runtime error routine is called When a procedure is entered a new set of variables is required and also a record of the return address must be kept To accomplish this all variables local to a proce dure are accessed as offsets from the IX register which is used as a stack pointer The first two words on the local stack are used
131. nd that the VAR section does not assign actual values to the variables The actual value of a variable is determined by the execution ofan assignment statement of the form variable expression For example X 26 AZIMUTH 75 92 MAX COUNT FLAG TRUE SIGNAL M COUNT 2 4 To review then data items are either CONSTants or VARiables and their type can be of one or ofthe follow INTEGER REAL BOOLEAN CHAR These are standard Pascal data types others are possible by explicit definition with the TYPE Statement Nextmonth we will continue with more description of the interesting world of Pascal SUPPORT MEMBERS OF THE COMPUTER RETAILERS ASSOCIATION THEY WILL SUPPORT YOU For further details on the associations aims membership code of conduct etc Please contact Mrs Gibbons Owles Hall Butingford Hertfordshire SE99PL Tel 0763 71209 48 Technics TEXT EDITORS Part Ill Liverpool L69 3BX FROM the earliest days of electronic computers it was realised that they could be used for the manipulation of textual information Although the earliest machines were used primarily for numerical work they were also required to read and generate textual information in the form of program data and results The earliest comput ers were very expensive and computer time was strictly rationed No one would therefore consider the use of prec
132. nd to install another three 4K x 8 ROMs which can be used either for additional software provided by Rockwell or by the user s own PROMs Facilities are available for connecting up to two tape recorders for the storage of programs and data through the peripheral connector at the rear of the main board Software is included in the monitor to load and store programs and data on the cassette tapes and to turn the recorders on and off if the remote control leads are connected correctly Should further memory or 1 0 be required it can be connected to the expansion connec tor also at the rear ofthe computer Rockwell have very sensibly made the peripheral and expansion connectors compatible with two other 6502 based single board mic rocomputer systems This means that there are already a wide range of expansion cards available which are at least hardware compatible with the AIM 65 In addi tion Rockwell have added a few interesting ones oftheir ING Dr Martin D Beer ComputerLaboratory University of Liverpool P O Box147 LiverpoolL693BX own notably a Bubble Memory board As can be expected with a 4K monitor a full ASCII keyboard a built in character display and a printer the programming facilities available on the basic AIM 65 are very extensive Not only are the standard features of displaying and changing the contents of both registers and memory locations and the execution of user prog rams fully supported but there ar
133. ns Conclusions Withoutintroducing toomuchbiochemistry hopeto have indicated the ways in which microcomputers can find application in teaching and research in this science The ideas presented here are not new but indicate what we are doing currently to make use of the new machines Progress is invariably slow anda few ofthe applications have progressed little beyond the paper stage Perhaps in a couple of years time we will be able to claim to have integrated the microcomputer into our laboratory demoting it from its somewhat exalted position to an important tool in teaching and research REFERENCES 1 Laurie P 1980 Practical Computing 3 editorial para 2 J Bryce C F A 1977 J Biol Ed II 140 142 3 Cunningham P 1979 Biochem Ed 7 83 4 ENZKIN Edward Arnold Publishers Ltd 25 Hill Street London WIXSLL 5 1 Smythe R and Lovatt K F 1979 J Biol Ed 13 207 220 6 Bryce C F A 1979 Biochem Ed 7 17 16 7 Morgan M R J 1979 Biochem Ed 7 84 85 WEILE a CEU 2 ra Liverpool Software Gazette March 1980 61 Table 1 FIG 1 An Apple microcomputer system Monitor b w APPLE II 48K Plotter Computer Apple IL 48k RAM BASIC 9 digit Line printer floating point routines graphics Disk storage Single drive controller 110 k Disk DOS 32 Hard co
134. ns High or low resolution with PAL SECAM NTSC or RGB output High resolution uses 6K Static RAM 4118 and gives a choice of 16 colours The foreground and background colours are definable on a 96 x 48 Matrix giving 4608 definable points In conjunction with the Programmable Character Generator board and using the foreground and back ground capability it is possible to use colour to an even higher apparent resolution Low resolution reduces the matrix to 48 x 48 and uses only 3K of Static RAM MK 4118 One of the Z80 ports is allocated to control the opera tional functions These include colour on off write pro tect high low resolution NASCOM INPUT OUTPUT BOARD THIS product is one an 8 x 8 P C B which is NAS BUS compatible It fits either a Nascom frame or a System 80 microcomputer housing It is through plated and has all the necessary support chips When it is fully populated it will support 3 x MK 3881 PIO 1 x MK 3882 Counter Timer 1x 6402 UART PIO The MK 3881 provides 2 x 8 bit wide bi directional ports Each has two handshake lines It may be fully interrupt driven and implements the 780 interrupt priority daisy chain The PIO pack includes a 26 way board connector and cable Counter Timer The MK 3882 contains four counter timer channels It may by fully interrupt driven and implements the Z80 interrupt priority daisy chain MD MOINS ILG RU Ar ERR
135. ns the value of an operand containing no forward references to either symbol or the location counter Assigns multiple ASCII strings or expres sions to consecutive single byte memory loca tions in high byte low byte order WORD Assigns multiple expression operands to consecutive memory locations in low byte high byte order DBYTE Assigns multiple expression operands to consecutive double byte 16 bits memory loca tions PAGE Generates a title under a dashed line SKIP Generates one blank line Controls assembly listings are optional and can be specified in any order or in separate statements FILE Last record in a multiple file source program except the last file which points to the con tinuation file Last record in a single or multiple source file SharpMZ80K NOT A KIT Works the day you buy it JAPANESE The same quality they have put into cars and Hi Fi SINGLE UNIT No trailing leads and wires Z80 More registers and instructions than other processors TAPEBASIC You don t get left with obsolete ROMs TAPE COUNTER Know where you are on the tape SOUND Built in music synthesiser with 3 octaves FASTLOADING Cassette interface runs at 1200 bps Other features 79 keyboard up to 48K RAM on screen editing real time clock 256 different characters 10 inch video display 80 x 50 bit mapped graphics DISKDRIVEANDPRINTERCOMIN
136. nt Memory Locations LOAD DUMP MEMORY COMMANDS L Load Object Code into Memory D Dump Memory BREAKPOINT MANIPULATION COMMANDS Clear Breakpoints Toggle Breakpoint Enable Set Clear Breakpoint Address Display Breakpoint Addresses gt p MDC s r A m Ym Hurin Liverpool Software Gazette March 1980 EXECUTION TRACE CONTROL COMMANDS G Start Execution of User s Program Z Toggle Instruction Trace Mode V Toggle Register Trace Mode H Program Counter History CONTROL PERIPHERAL DEVICES CTRL PRINT Toggle Printer On Off PRINT Print Display Contents LF Advance Printer Paper 1 _ Toggle Tape 1 Control On Off 2 Toggle Tape 2 Control On Off 3 Tape Verify Block Checksum TABLE 2 AIM 65 TEXT EDITOR COMMAND SUMMARY ENTER AND EXIT EDITOR COMMANDS E Enter and Initialize Editor Q Exit the Text Editor and Return to Monitor LINE ORIENTED COMMANDS R Read Lines into Text Buffer from Input Device I Insert One Line of Text Ahead of Active Line K Delete Current Line of Text U Move the Text Pointer Up One Line T Move the Text Pointer to the Top of the Text B Move the Text Pointer to the Bottom of the Text L List Lines of Text to Output Device SPACE Display the Active Line STRING ORIENTED COMMANDS F Find a Character String Change a Character String Table 3 Assembler Pseudo Operations Assig
137. nt than with most languages This is of course a useful feature if reliable software is to be produced The Algol68C compiler is written in ALGOL68C and produces an intermediate code called Z CODE 4 see appendix 2 The Z CODE must be interpreted or com piled into machine code for a particular machine In this implementation the Z CODE is compiled into machine code by Translator written in ALGOL68C ALGOLOSC allows hashes s as comment sym bols Remarks enclosed by hashes are ignored by the compiler in the examples that follow The normal way of transferring ALGOL68C to a new type of machine is as follows 1 Write a translator in ALGOL68C 2 Translate the Compiler and Translator 3 Write runtime library code for the target machine in machine code Z CODE or ALGOL68C and translate it 4 You now have a working compiler and translator on the new machine Unfortunately the standard ALGOL68C compiler is Liverpool Software Gazette March 1980 avery large program which requires a minimum of about 120K bytes of store on an IBM370 This means that until a smaller version of the compiler 15 written the compiler must be run on a larger host machine usually the Cambridge CAP research computer Initially therefore the translator 18 run on the same machine and the size is not a critical factor in its design The code generated by the cross compilation is linked with a small library of routines for transput I C s
138. nterface Serial Interface RS 232 20 ma interface 2 user PIAs user ACIA 10 Extended BASIC ROM 4K operating system monitor in ROM including cassette and disk monitors However enough said not hardly about the hard ware This is a software oriented publication So let us march onto the software THE CASSETTE SYSTEM The Compumax cassette system is truly unlike any others It provides high performance storage for the computer The major design goals for the system were speed and data reliability In addition to reading and writingin high speed binary the systemis also capable of reading cassettes in Kansas City Standard 51 59 format without any modifications Here are some of its software capabilities SAVE Preserves a named file on cassette from memory locations DIRECTORY Lists the identification segment ofa file on cassette to the system terminal Ifthe optional argument FILENAM is used tape head is positioned precisely at the End Of File position LINK Preserves a named file on cassette in the same manneras the SAVE command exceptthat a link age is created to the next file on the cassette LOAD Reads and loads a file from cassette RUN Reads and stores a file from the cassette and transfers to the address specified by TRANS FER in the save command GO Executes a memory resident program either a previously loaded file or a program which was entered into memory through the term
139. o be looked at The block is displayed in the same format as the W command the start address and then a block of 8 bytes to a line The dump may be broken at any time using the break key On screen editing may be performed using the cursor control keys The command is terminated with the CR key A useful related command is the transfer X com mand which can be used for moving a block of data around in memory It requires 3 arguments before it is executed the start address of the originating block the end address ofthe originating block and the start address of the destination block The next usual step in writing a machine code program is to save it on tape This is a safety step For unlike programmes written in high level languages like BASIC if there is one incorrect byte in a M C program the processor can go tearing off up memory destroying everything in its path never to be seen again I speak from bitter experience At least with a copy on tape albeit with a bug in it there is a fighting chance of spotting the error by reloading the tape and examining a dump of the program on screen The tape save command S asks for a filename for the program to be saved under This may be any combina tion of characters up to a maximum of 16 It s a pity other manufacturer s monitor programs don t have more than single characterfile names Are youreceiving me NASCOM The start and finish address of the block to be saved are then asked f
140. o get your LIVERPOOL SOFTWARE GAZETTE regularly Imagine the disastrous effect on your life style if you missed a single issue The possibility of trauma 15 easily eliminated by the simple expedient of acquiring a regular subscription at the all time bargain price of 6 00 for the next twelve scintillating issues Don t miss the chance ofa lifetime in the form below Commercial and educational organisations requiring a large number of copies can buy in bulk at advantageous rates from Computer Bookshop 43 45 Temple Street Birmingham Please send me twelve issues of the A Software Gazette starting with the first second third fourth issue Cheques and PO s should be made Liverpool Software Gazette and sent to us at 14 Castle Street iverpoo Printed by MERSEY MIRROR LTD Media House 34 Stafford Street Liverpool L3 8LX Tel 051 207 7113
141. o trouble NOTES There is no error checking but this could be added e g testing that CH in line 4010 after GOSUB 2000 If the input routine 1000 were replaced by calls to the scanner of the last issue then multiple character variables could be coped with together with lt gt gt etc The basic idea for these routines comes from the Pascal User Manual and Report page 73 75 Timeout in INPUT One possible use of the line input routine listed in last issue lines 50100 to 50220 is to return to the calling routine with a variable set if the user does not reply within a certain time This could be especially useful for computer aided instruction packages where ifthe user of the package does not reply to an answer within a certain time the program is able to recognise this and perhaps provide a prompt or hint Should all the hints have been provided the program could then give the answer and an explanation of how this was arrived at The length of time allowed could be made a function ofthe hardness of the problem Even on simple business programs the timing out could be considered to indicate that the user VARIABLE does not know how to respond to the question and results in an explanation of what input is required The changes are only small and are summarised below 50110 1 TS TI TT 0 REM LINE IS INITIALLY NULL TS IS TIME ON ENTRY TT 0 INDICATES NO 50120 POKE 167 0 GET KY
142. o write and is rather difficult to follow Consider instead the recursive procedure written in Pascal procedure move numberofdisks from on to via integer begin if numberofdisks 1 then writeln Move disk from from to onto else begin move numberofdisks l from via onto writeln Move disk from from to onto Liverpool Software Gazette March 1980 The Petsoft Gold Cassette presented to Oliver Bulmer author of Mailing List Developed by ACT Britain s leading computing group to run on a 32K PET with Anadex or Datac BD80 printers Commodore Disk versions available price 115 These systems provide full facilities for ledger maintenance preparation of lists of outstanding balances printing of statements and remittance advices Full audit trail Send for details Q We celebrated by slashing Ledger systems prices by over 60 SALES one Mailing List 15 VAT Pack 17 50 Microchess 14 LEDGER two Word Processor 25 Invoicing 20 Super Startrek 8 PET BASIC Tutorial 15 Forth 30 Eliza Doctor 8 ix dm 905 Assembler Editor 25 Statistics 7 Backgammon 8 Prices exclude VAT Credit card orders accepted by All prices correct at the time of going to Press telephone All programs available through your PET is the trademark Of Gommediore local PET dealer or direct from fe i Se ets O Radclyffe House 66 68 Hagley Road Edgbaston Birmingham B16 8 Telephone 021 455 8585 Telex 339396
143. olleges and universities Computer services have an obvious part to play in the educational process itself Aswellasprovidingimportantopportunities for your students to learn many skills which could be vital to theirfutures you will benefit personally by greater familiarity with the one subject that s undeniably changing everyone s life This unique magazine will offer pen etrating investigations into the educational applications and implications of data pro cessing systems full details of available Liverpool Software Gazette March 1980 courses examin ations and career options and an authoritative range of reviews of equip ment software programs and books currently on the market Beginners Guide really does start right atthe beginning with advice on raising the finance for your hardware and how to be sure you re choosing the right system for your needs Teachers and students alike will want to use EDUCATIONAL COMPUTING to keep them abreast of the latest technological developments As one ofthe ECC family of top computer publications you d be rightto expect a knowledgeable and entirely un partisan editorial approach This is a com plex and challenging new field where there Is always something newto learn So don t risk being left behind Sendthe coupon today Please enter my subscription for ten issues at the annual rate of 5 1 enclose a cheque PO Please charge my credit card
144. on Section 220 FOR 1 1 TON 230 FOR J 0 TOM 240 LET 0 5 0 1 250 NEXT J 260 LET X D X D A 1 270 NEXT I 280 LET X N X N A N N 290 FOR I N 1 TO 1 STEP 1 300FORJ 1 1TON 310 LET X X 1 A J X J 320 NEXT J 330 LET X X D A 1 340 NEXT I 350 RETURN Back Subtitution for array X 360 FOR 1121 TON 370FORJ1 1 TON x is If Col Las 380LETX J1 20 15 olumn of Indentity 390 NEXT Jl Mans 400LETX I1 21 410GOSUB220 Back Subtitution 420FORJ1 1 TON 430LETB I1 J1 2X J1 440 NEXT B IL is th Column of 450 NEXT II Inverse Matrix 460 RETURN 78 Liverpool Software Gazette March 1980 EIC EIC ETC ETC ETC ETC ETC ETC ETC ETC EIC ETCETERA EIC EIC EIC EIC EIC EIC EIC EIC EIC EIC EIC EIC EIC ETC ETC EIC ETC EIC ETC EIC EIC EIC ETC EIC ETC ETC ETC ETC ETC ETC ETC EIC THE COMPUMAX By Dr Andrew M Veronis MICROCOMPUTERS have become as abundant as digital wrist watches and calculators When a new mic rocomputer is introduced into the market the people now say and rightly Oh another one of those What the latter statement really means is that unless this new microcomputer has much more to offer we don t want it A statement which makes it tougher for the designer to dream up new revolutionary circuits The COMPUMAX is indeed a new microcomputer Furthermore the
145. or After saving a program it may be verified using the V command A file name may be specified to be searched for or CR may be pressed and the verification done on the first program found on the tape If any mismatches are found an error message is displayed A similar action is taken to the above when yanking a program from tape at a later date using the V com mand filename may or may not be specified and any checksum errors are flagged on screen otherwise the program is loaded intothe same section of R A M it was saved from originally Once the program has been safely saved on tape the program may be executed This is done using the G command This is the same as the GOTO command of the monitor and requires a four digit hexadecimal address at the start of the program If there are no bugs in the program every thing will work correctly but if something is wrong results will be very unpredictable This is where the remaining com mands come leaping to the rescue Four commands are available to display the contents of the Z 80 s on board registers The command displays the Main register set AF BC DE and HL and allows modification by cursorcontrol The C command displays the complimentary register set AFBCDE and in the same format The command displays the Special Purpose registers PC SP IX IY and I and also allows modification Finally the R command displays all the above three sets of registers but
146. or Kernighan and Plaugher s 14 formatting commands using the one long string technique So far we have concentrated on altering the routines in ways which are unlikely to confer much benefit on the timing of the routines On average assuming the values to be evenly distributed in FILE we will do NE 2 com parisons before finding KEY fit is in the array other wise we will do NE 1 in the sentinel version Thus the effort ofthe routine is proportional to the number of elements in the file double the number of elements and you double the number of comparisons Given that the array is sorted we can do much better than this with a technique known as the binary search Binary Search Listing 5 This method works by approximately halving the range of the array to be looked at for each comparison and looking at the middle element or the element nearest the middle Since we assume the array is ordered such that 1 less than implies FILE 1 less than or equal to FILE j there are three possibilities for the result of the comparison Firstly the comparison could yield true in which case we have found the element we were look ing for Secondly the middle element is less than KEY In this case we know that if KEY is in the array it must be in the top half of the array and we can repeat the technique on the top half ofthe array Thirdly the middle element is greater than KEY in which case we repeat the technique on the lower half of th
147. ountered either by drawing lines between adjacent points or by ensuring that the scaling factor does not exceed 1 Motion on the screen of the shape is very simple to implement as the shape is being redefined it can easily beredefinedin any position by moving the origin to that position i e move the origin and the rest of the shape will follow Various methods of moving shapes will be described in a following article publishers willing Fig 1 scaling of a triangle to give apparent motion in the z direction Fig 2 scaling of shape ABCD gt Fig 3 co ordinate scaling 4 lt 32 25 28 e 45 DaveStraker akes ort INTRODUCTION THE EDITOR IN my last article on PILOT I outlined the language as a simple to use method of writing text orientated edu cational programs Now teachers and would be teachers can write programs in PILOT using the BASIC program that I have written below DESIGN PHILOSOPHY Why BASIC Why not Assembler After all an Assembler implementation would be both smaller and faster The obvious question must be answered BASIC is a language that is commonly available both on micros and in schools often on time sharing terminals linked to a county mainframe Hence in order to prop agate the language further it must be in the most useable form The original was written in Applesoft and thus has BASIC instructions unique to that particular dialect In order to
148. parate read and write enables NASCOM FLOPPY DISC CONTROLLER BOARD THIS product is on an 8 x 8 P C B which is NAS BUS compatible It fits either a Nascom Frame or a System 80 microcomputer housing The board is capable of driving up to four Siemens double density double sided 54 Mini FLOPPY drives It uses the industry standard 1791 controller chip Data Transfer does not rely on CPU interrupts wait states or D M A The system uses real time loop trans fer To maximise reliability a phase lock loop technique is used to synchronise data transfer from the drive to the 1791 The board has simple test links which make the set up operation extremely simple The board has various link optional available The user may decide on single or double sided discs and single or double density He may also run his CPU at 2 Mhz or 4 Mhz 1 Systems 80 85 00 3 Amp PSU 30 00 Nascom 2 Board 225 00 32K RAM Board 165 00 505 00 2 System 80 Box 85 00 3 amp PSU 30 00 Nascom 2 Board 225 00 48K RAM Board 225 00 P C G 90 00 Colour Card Highest Res 165 00 820 00 3 System 80 Box 85 00 5 amp PSU 40 00 Nascom 2 Board 225 00 48K RAM 225 00 P C G 90 00 Complete Twin Disc Set 690 00 1355 00 4 System 80 Box 85 00 5 amp PSU 40 00 Nascom 2 Board 225 00 3 x 48K RAM Boards 675 00 Complete Twin Disc Set 690 00 1715 00 5 System 80 Box 85 00 5 amp PSU 40 00 Nascom 2 Board 225 00 4 x 48K RAM Board 900 00 1250 00 How t
149. py Centronics 779 matrix printer parallel Disk 100K interface Houston Instruments plotter serial interface AN Apple based microcomputer system in use at the Department of Biochemistry at Liverpool FIG 2 10 REM SUBROUTINE FOR NUMERIC INPUT 10 Tv 0 FEM RESET HFIH3LES 1020 GETP IFfi THEN1020 1036 Pj gt 1 0 1140 FEM FEIUF N e IFflf gpfi rriEfJll50 FEM i ELF 1040 IFri N ORP 4 amp FPf THENIlrO 1050 FOP L OTC FEM NUMERIC HSC lt PI 487 1 1 160 1090 1020 1140 1 1190 1150 2 1200 1160 1165 117 1020 1190 TV VAL TS 1200 RETURN REM RETURNS WITH FF 7 READY AN inescapable numeric input routine The subroutine returns with 1 numeric value in TV and RF 1 or alternatively ifthe help key was pressed RF 2 Note that negative or real numbers could have been excluded by altering line 1050 FIG 3 Spectrophotometer Control signals 12bit A D converter Plotter V Use of a microcomputer for on line analysis 62 Liverpool Software Gazette March 1980 The Machine Language Program SP 1002 is the latest software from the Sharp stable for their MZ 80K Per sonal Computer It allows the user to write debug and save on tape machine code programs to be used either by themselves or in time critical parts of high level language progr
150. r is provided sepa rately a fairly extensive Text Editor is included in the Monitor ROM This is primarily a Line Editor with commands added to search for the nextoccurrenceof a particular string and replace it if desired The Editor forms an integral part ofthe Assembler package as it is required to enter and maintain the source program before it is assembled On entering the Text Editor for the first time the memory area in which the source text is to be stored must be defined The program text can then be input from the keyboard cassette tape the teletype paper tape reader or a user defined device Once entered the text can be manipulated using the Editor Commands Line numbers need not be stored within the text The pointer can be set to the top or the bottom line and it can then be moved up ordown one line ata time Lines can be added before the current line or it can be deleted Files can be merged if necessary by reading file in with the pointer set to the right point in the text Thecurrently active linecan be displayed orany desired number of lines can be listed from the current pointer position Should the Editor be left for any reason it can be re entered without clearing the text buffer by using the warm entry command In this way assembler programs can be developed completely within the computer s main memory The two string orientated commands allow the user to searchforthenextoccurrenceofagivenstring andeit
151. ramming and applications for the business executive and a vitalinitiation to computers for students and school children the ZX80 is a powerful tool for the experienced user A 130 page instruction manual is provided to simplify learning by direct response The manual includes a course in BASIC programming the established stan dard high level language for personal computers used by the ZX80 To ensure maximum flexibility of use the ZX80 has been built without a dedicated VDU visual display unit but with the facility to be plugged directly into the aerial socket of any domestic colour or black and white television This also enables screens of a variety of sizes to be used A conventional home cassette player is used to store programs For business or industrial use the Sinclair ZX80 can be coupled to any type of computer peripheral such as a printer It is envisaged that the unit will also be incorpo rated in a variety of industrial systems as a machine tool control for example A key advance is the design of a single super ROM containing the BASIC interpreter character set operat ing system and monitor The ZX8O s byte RAM is equivalent to 4K bytes in a conventional computer Program entry is atouch sensitive typewriter con figuration alpha numeric keyboard which features single stroke key word entry eliminating much tiresome typing 80 Liverpool Software Gazette March 1980 LS a
152. rdware and the NMI on a MZ 80K is perma nently pulled high this could not be used This command is not missed so much since the breakpoint facility is very comprehensive The manual that comes with the cassette tape has detailed descriptions of all the commands along with otherusefultables ofinformation Amongst the data 1 A Memory Map of the MZ 80K although details of the individual input output addresses of the ports used are missing An explanation of how to link your machine code routines into a BASIC program A list of the monitor and user callable monitor sub routines The Z 80 flags are described in detail and the rear half of the book includes all the Z 80 instructions listed three times One list is by mnemonics in alphabetical order one by hex code in numerical order The first list will prove invaluable when hand assembl ing a program and the second is a great boon when hand dissassembling someone else s program All the instruc tions are also listed grouped by instruction type with such details as numbers of clock cycles no of bytes and the way in which each flag is affected This list is similar to that in the Mostek or Zilog Z80 CPU Technical Manuals The book is fine after running through a Japanese English cross compiler for anyone like myself who is used to Z 80 machine code programming but is not conversant with the MZ 80K but for anyone starting out on low level programming I feel that addi 64
153. re provided in certain memory locations Not only have Rockwell provided this extensive monitor but they also make certain software available as extra ROM sets which plug into the additional sock Liverpool Software Gazette March 1980 25 ets on the main computer board At present two sets are available one of two ROMs containing an 8K BASIC interpreter and the other consisting of one ROM con tains a two pass Symbolic Assembler Either one or both of these ROM sets can be installed since the Assembler and the BASIC interpreter occupy different memory areas The version of BASIC supported is that supplied by MICROSOFT and gives full floating point calculation capability It is similar in its essentials to the BASICs available on such machines as the APPLE TANDY TRS 80 and PET The small on board random access capability is a little limiting but 4K bytes should be sufficient for the types of application that the AIM 65 would usually be used It certainly cannot be recom mended that you try to run BASIC on a machine with only 1K byte of RAM A useful feature is that when BASIC is entered the interpreter asks the user what memory area is available forits use for program and data storage The rest of memory is then available to the program mer to use for assembler subroutines etc A comprehen sive BASIC manual is provided when the ROMs are purchased which describes the facilities available Although the Symbolic Assemble
154. riable starts parameter list or nested expression end parameter list or nested expression starts subscript list or set expression ends subscript list or set expression starts a comment ends a comment lt starts a comment p ends a comment RESERVED KEYWORDS The following are standard Pascal keywords which are reserved and each keyword is considered a distinct spe cial symbol that cannot be used in any context other than in the explicit definition of Pascal AND ARRAY BEGIN CASE CONST DIV DO DOWNTO END ELSE FILE FOR FUNCTION IF IN LABEL MOD NIL NOT OF OR PACKED PROCEDURE PROGRAM RECORD REPEAT SET THEN TO TYPE UNTIL VAR WHILE WITH COMMENTS Comments can be added to a Pascal program and can be inserted between any too identifiers numbers or special symbols The general format is Examples THIS IS A COMMENT lt gt When the compiler encounters a left hand comment symbol it scans the text for the matching right hand comment symbol Do not intermix the two types of commentdesignators TERMS AND DEFINITIONS The following terms are often used in place of formal parameters in dummy declaration headers ARRAY A PACKED ARRAY OF CHARACTERS BLOCK one disk block 512 bytes BLOCKS an INTEGER number of blocks BOOLEAN any BOOLEAN value CHARACTER any expression which evaluates to character DESTINATION a PACKED ARRAY OF CHARACTERS to write into or
155. s INT a b INT b INT x y z X 53 y 4 z add two numbers x y START LD HL 3 0100 21 03 00 0103 22 7A 00 store 3 at x via HL 0106 11 04 00 LD 0109 ED 53 7C 00 store 4 at y via DE ID 010022 84 00 store x at parameter 1 LD DE 0110 ED 53 86 00 store at parameter 2 LD L132 HL 0114CD 27 01 LD L134 DE 0117 80 00 increase in stack size CALL ADDT 011922 7E 00 store result in z DW L128 011CC3 00 00 LD z HL 07 name of next routine JP STOP 0127 CD 02 FF advance IX and save DB 7 addtwon 012ADD 6E 04 return addr ADDT CALL ENTERS 012 66 05 HL parameter 1 ID L IX 004H 0130 DD 4 06 LD H IX 005H 0133 DD 46 07 BC parameter 2 006 0136 09 add them into HL LD 1 007 0137 return to caller ADD JP LEAVE 56 Liverpool Software Gazette March 1980 222 V SC Example 2 recursive factorial program PROC factorial INT i INT IFi 0 INTa b factorial 2 code produced by this program is START LD HL 2 LD parl HL CALL FACT DW L126 LD HL LD parl HL CALL FACT DW L126 LD b HL LD par2 HL CALL PRINTINT DW L128 JP STOP DB 07 factori FACT CALL ENTERS LD L IX 004H LD H IX 005H LD A L OR H JRNZ L318 LD HL LI JR 1348 1318 LD L IX 004H LD 1 00
156. s practical introduction to assembler level programming of microcomputer systems particularly those based on the extremely popular 6502 processor Practicals are arranged around the AIM 65 single board computer but the principles discussed can be applied with equal ease to the APPLE and PET which are also based on the 6502 For prices and further information Please contact DR M D Beer Computer Laboratory University of Liverpool P O Box 147 LIVERPOOL L69 3BX Liverpool Software Gazette March 1980 51 Disassemble your monitor EN murem 52 THIS article outlines implementation of ALGOL68C on 780 microcomputer The project is being carried out by the author during his degree course at Cambridge University to allow users of Z80 systems at Cambridge to write large programs quickly and also to write large programs for his Nascom 1 ALGOLO6SC 1 is a sublanguage of Algol 68 2 3 with some extensions Algol68 is a powerful general purpose language based on the principles of Algol 60 but with greater power and flexibility Readers unfamiliar with the language are urged to read a primer on the language but most programs included here are quite readable and can be understood by reading the com ments and the text The language is well checked at compile time and this combined with the ease of accu rate expression in the language means that run time errors are less freque
157. s and utilities Evaluated Word Processors for the PET Published a full length article on Modular Programming and complete listing of the MPAK program Examined the workings of PET s key board and video logic Printed excerpts from two authoritative new books The Hitchhikers Guide to the PETand PETRevealed2nd edition Published complete program listing and documentation for high density plotting on the PET Surveyed Business software packages Reported on input routines for the PET COMING SOON Which Printer Consumer report String Handling The Ultimate Assembler Hard disk systems The Pros and Cons Micro Networking The Good News Are you for Stringy Floppy Human Engineering for your programs PRINTOUT a single source for what you need to know about PET computing Because we are independent we can bring you the news first honestly and without bias Already PRINTOUT is quoted and reprinted in the other magazines as the authority on PET matters J PET 9 of Commodore SUBSCRIBETO PRINTOUT PRINTOUT Greenacre House North Street Theale Berkshire RG7 SEX Please enter my subscription for one year 10 issues enclose 9 50 U 10 50 Eire 14 50 Overseas 95p Sample Issue My name is My address is Postcode PET Configuration 12 Liverpool Software Gazette March 1980 without encountering this problem so most applications should have n
158. second example literals are given names in the CONST declaration section which defines the entity to have a name and a value Well written programs rarely use literals outside the CONST declaration section This makes program changes easier Each data item in a Pascal program is either a constant or a variable constants remain the same during program execution but variables can vary Constants are declared in the CONST section Variables are declared in the VAR section Each data item is of a specified type QUEEN Liverpool Software Gazette March 1980 47 and its type determines the kind of operations that can be performed on it In Pascal the four standard types of data are INTEGER REAL BOOLEAN and CHAR Examples of the four standard data types are INTEGER REAL BOOLEAN CHAR 20 20 5 TRUE 15 15 274 FALSE 27 When you declare constants in the CONST section their type is implicit in the declaration and you need not specify the type When you declare variables in the VAR section you must specify the type by using INTEGER REAL BOOLEAN or CHAR For example VAR X INTEGER MAX COUNT AZIMUTH REAL FLAG ENDFILE BOOLEAN SIGNAL CHAR Nascoms Programs amp Information a book by Merseyside Nascom Users Group 2 262 25 Including P amp Yours Microdigital Limited 25 Brunswick Street Liverpool L20PJ Note that numerous variables can be typed at the same time a
159. sociated with it into the array RE at element SP and increment SP by 1 4 ifitis an operator perform that operation on the top operands in array RE ie RE SP 2 operatorRE SP 1 put the result RE SP 2 decrement SP by 1 5 move to the next character in the expression and goto step 2 upon exit the result ofthe expression will be in RE 0 If SP doesn t equal 1 then there was an error in the original expression Compilers and probably interpreters convert the algebraic form of an expression into R P interpreters implicitly generate the result at the same time as convert ing it and the routines are presented as an aid to writing a calculator package or perhaps adding calculator facilities to a PILOT interpreter We describe the syntax ofthe expressions the routines will convert by using syntax diagrams which are mostly commonly used to describe the syntax of Pascal but which will display very neatly the relationship between the syntax of the expressions and the routines which convert to R P Atthe moment we will only make the routines convert simple expressions that 15 only expressions involving single letter variables Z and the 4 operators and together with and for altering precedence into R P The general principle is that on entry to one of the routines we have in CH the first character of the string which itis to translate Thus is the input is A B on calling the routine at 2000 C
160. t can be performed in BASIC but we need to explicitly write some ofthe housekeeping routines which are performed automatically in systems supporting recursion The main task is to make sure that the recursive call does not destroy any values which will be needed upon return from the call and the natural mechanism for doing this is a stack which we simulate in BASIC with an array of reals integers and or strings depending on what type of variables we need to save and a pointer to that array This pointer is incremented by 1 or as many spaces as we need upon entry to the routine and the save vari ables put into the space allocated Upon exit from the subroutine the pointer is decremented and the saved variables or rather their values restored The selection of subroutines listing 7 exhibitindirect recursion where routine A calls B which calls A Their purpose is to convert an expression written in standard algebraic notation into Reverse Polish notation familiar to users of HP Novus and the early Scientific cal culators In P notation A B becomes A B C D becomes AB CD and becomes assuming normal precedence The main use for R P is that the evaluation of an expression is very easy and is performed in the following way 1 start at the left most character of the expression set 5 0 2 get next character Ifitis end of line marker exit 3 ifitis a variable put the value as
161. t it is running type lt CTRL L gt THE LANGUAGE STATEMENT LAYOUT This is of the form lt instruction gt lt modifier gt lt operand gt instruction a single letter indicating instruction type e g Type is T modifier an optional signified by the square brack ets boolean condition which iffalse causes this instruc tion to be ignored There are two types of modifiers a Once a numeric variable has been defined in a com pute statement it may be tested against any number in round brackets the modifier 1 T X lt 6 WELL DONE Types WELL DONE only if X is less than 6 Other conditions that may be tested are equal less than or greater than b When a match statement M is performed is set ifa match 15 found and reset if no match is found This flag may be tested with Y true if flag is set or N true if flag is reset 1 e TN WRONG AGAIN types WRONG AGAIN only if the last match was unsuccessful lt operand gt described under each instruction heading LABELS These have as the first character They are refer enced without the in Jump and routine U instruc tions EDUCATIONAL COMPUTING isthe new magazine for everybody who has ever wondered what the microcomputer revolution has meant to educa tion Here s your chance to find chancetofindouteverything about the use and study of computers and their peri pherals in schools c
162. t may be interrogated by you at your leisure Happy hand dissassembling 0010 9 0020 ZEAP ASSEMBLER RUN 0030 NASCOM 1 29 2 86 0040 LETS LEAP INTO ACTION 0050 0060 SHANAHAN lt 0070 MICRODIGITAL DEPT 0080 0090 SHARP MACHINE LANGUAGE 0100 gt PACKAGE BACK UP PROGRAM 0120 0130 THIS PROGRAM IS TYPED IN 0140 7 USING THEM MACHINE LANGUAGE 0150 PROGRAM AFTER EXECUTING FROM 0160 2000 THE PROGRAM IS 0170 MOVED UP IN MEMORY FROM 0180 2200 TO 52 2000 0190 ORG 2000 2000 210012 0200 FART LD 1200 2003 110022 0210 2200 2006 010000 0220 LENGTH LD 2009 EDBO 0230 LDIR 200B C36012 0240 JP 1260 0250 0260 THE SECOND PROGRAM CAN TYPED IN 0270 NEXT AT THE SAME LOCATIONS THIS 0280 IS SAVED ALONG WITH THE MOVED MAIN 0290 PROGRAM FROH 2003 TO 3000 BY 0300 USING THE S COMMAND WHEN THIS O310 BLOCK IS RELOADED AT A LATER DATE 0320 USING THE MONITOR LOAD COMMAND 0330 AND EXECUTED USING GOTO 2000 v 0340 0350 BACK TO 0360 0370 0380 THE MAIN PROGRAM WILL BE MOVED 51200 1F00 AND A COLD START WILL BE DONE AT 51200 ree m 0390 NB DO NOT 2000 Liverpool Software Gazette March 1980 65 Hx I I
163. t practical tape recorders are unnecessary since the programs written are in general very short Itis betterto avoid the complexity ofextra equipment at what is usually an early stage in their microcomputer programming career They are of course essential for advanced practicals and programming projects when more complex programs are developed over an extended period The AIM 65 can be used successfully to develop programs not only for itself but also for other ASSEMBLER eo 5 LISTM LIST OUT N OBJ N ASSEMBLEP 600 6 IN M LIST Y LIST OUT LISTING 1 An Example of an AIM 65 Assembler Listing BI N PASS 1 D PASS 2 0088 t fif C 610c 4C0002 JMP i 010F 010F CLP fEB44 010F 700 0200 Fl 2044 JSP CLP R2FF ID FF 0205 LOOP ES NX BD1402 Lbfi MSGi I C9ZB CMP 4 006 207RE3 JSP OUTPUT 4 0502 JMP LOOP 0213 60 PTS 0214 MSGI 554C BVTE ULCL M ICRO 204C BYTE LflB END EP RQRS 6000 6502 based microcomputers such as the PET APPLE or ACORN The resulting Object Code must usually be retyped into the target microcomputer or PROM prog rammer unless a suitable teletype interface is available To be used as a personal or home computer the AIM 65 really needs to be fitted into a box with a suitable power supply Apart from protecting the mechani
164. tes of formatted storage NASCOM PROGRAMMABLE CHARACTER GENERATOR BOARD THIS product is on an 8 x 8 P C B which is NAS BUS compatible It fits either a Nascom Frame or a Systems 80 microcomputer housing There are 2K bytes of 2114 static RAM which is used as a programmable character generator The Nascom Graphics ROM may be relocated on this board This gives the user the chance of software selec tion between the block graphics ROM and his own high resolution graphics at any time The high resolution graphics operate on a cell struc ture Each Character cell is made up of Nascom 1 128 dots Nascom 2 112 dots The user can produce 128 different cells to this dot level in the 2k RAM Each cell once defined may be displayed anywhere and any number of times on the screen at the same moment up to a maximum screen capacity of 768 cells 82 Liverpool Software Gazette March 1980 SE a ND NENNEN UNE C M KU EM TY EUN NM NUNC PO 48 x 16 Dot resolution on the Nascom 1 384 x 256 98304 Nascom 2 384 x 224 86016 780 port is allocated to control the operational functions These include RAM ROM select write pro tect etc Standard Alpha Numeric characters and block and high resolution graphics may be intermixed on the screen This board is designed to be compatible with the colour board NASCOM COLOUR BOARD THIS board has various optio
165. to store both the source and object codes in the 4K bytes of memory available The Assembler uses an area of Ran dom Access Memory as workspace to hold the Symbol Table and again this must be allocated by the prog rammer before assembly begins It must not conflict with the source and object code buffers if these are held in memory It is advisable therefore to organise the mem ory allocation of all the workspaces required before coding commences so that the most efficient use of memory is achieved No Macro or Conditional Assembly facilities are pro vided but these can hardly be expected on a machine of this size The arithmetic operations allowed on data items in the Address Field of the instruction codes are also very limited Of the normal arithmetic and logical operations only addition and subtraction are supported together with special operators to select either the high or low byte of a sixteen bit address have not in fact found this a real limitation since in practice the usual reason for using the other arithmetic operators is to split addresses up into individual bytes for storage so that they can be used later for indirect jumps etc It would have been useful to have the logical operators AND OR and NOT but these can be simu lated with those provided After all the Assembler Source is not the place to engage in complicated arith metic computation Numerical data can be entered in Binary Octal Decimal and Hexa
166. torage allocation and com mon utilities e g multiply This means that it will run on machines with as little as 4K bytes of store The Translator Z CODB is a simple assembly language for an abstract machine The compiler is told details of the instructions available on the target machine and it produces Z CODE which is easily translated into machine instructions The translator reads the Z CODE from a file and produces output in INTEL hex format in whatis essentially a one pass process Program segments may be compiled separately allow ing a user to prepare a library of useful procedures for use with his programs The main aim of the translator is to produce compact code without too much sacrifice of runtime speed This is achieved by the following techniques 1 Relative jumps are used wherever possible 2 Standard subroutines taking parameters on the hard ware stack are used where inline code would be bulky 3 Some Z CODE instructions are optimised to simpler ones For example HL HL 4 becomes ADD HL HL ADD HL HL etc 4 The translator tries to keep track of what is in each register and does not perform redundant or useless operations if avoid doing so 5 The general Z CODE registers are not firmly associ ated with real machine registers allowing some opera tions to be done with the most suitable register without continually swapping registers es aG m iu s miss sms
167. ts aboard the 15 x 60 foot NASA Space Lab It will monitor a plant growing experiment from which NASA hopes to piece together a scientific puzzle determining what effect gravity has on the mysterious Helical spiraling patch followed by plant seedlings as REM CHECK MONTH For those of you who have been victims of the reset key there is the heartening news that all new Apples now being imported into the U K have a sepa rate Encoder board directly underneath the keyboard This Encoder Board has a 2 position switch in on position the reset functions normally and in the other position control reset is required to get any action 20 21 20 21 REM NO DAYS PER MONTH SET UP MONTH ARRAY INPUT WHAT IS TODAY S DATE DD MM YY X IF LEN x lt gt gt 8 THEN 100 REM CHECK DAY FOR MONTH they grow Plant growth will be recorded with a vid eotape camera and other pertinent information such as temperature and illumination will be transmitted bac to scientists on earth Each phase of the experiment will be controlled and monitored by the Apple II The over riding goal is to sharpen up on our experimental techni ques in space Liverpool Software Gazette March 1980 23 UCLA Counts Sheep For Mom s Sake Researchers are hooking up expectant mothers to an Apple and keeping them there for 30 days at the UCLA University of California Los Angeles Medical School Sounds inhuman It is The mothers are
168. ue then the highest value will be re prompted If they are the wrong way round then both values will be re prompted These values may be anything between 1E37 and 1E37 provided that the included range does not exceed 5E35 It uses these two values to determine the modifying constant needed to obtain an address from each value Having successfully got through that lot you will be asked Do you want to input your own numbers I suggest that if your response to the first question was a number greater than 50 and you are simply running the programme to test it you should answer NO to this question N will suffice and let the programme gener ate its own random numbers If you reply YES then you will be prompted with a standard for each value Once you have entered the required number of values the sort will automatically begin The programme can be converted as mentioned above by changing the following lines 190 B C I NEXT 230 C C 1 PRINT 240 NEXT END 300 IF A B C lt A THEN 280 To conclude I have compiled a list for both of the above version LINEARITY TEST VERSION VERSION 1 0 100 numbers from 0 to 100 6 3 200 numbers from 0 to 200 12 6 300 numbers from 0 to 300 17 9 400 numbers from 0 to 400 22 13 500 numbers from 0 to 500 29 16 600 numbers from 0 to 600 34 19 700 numbers from 0 to 700 40 22 800 numbers from 0 to 800 46 25 900 numbers from 0 to 900 51 28 1000 numbers from 0 to 1000
169. ut in the situation where the numbers in the range 0 2 1 are to be generated the random number generator in listing 6 can be useful and we will return to it in next issue s discussion of hashing The generator works as follows 1 start with initial R 5 2 multiply R by 5 and place the result in R 3 mask out all but the lowest 2 bits of R equival ent to taking the remainder when dividing by 2 4 the next random number is INT R A 5 repeat from step 2 The routine listing generates 6 7 4 5 2 3 0 and 1 and then repeats Recursion Recursion is the process of defining something in terms of itself The usual and overworked example is that of the factorial function which can be defined as factorial n n factorial n 1 and factorial 0 1 Since we can calculate factorial n using iteration F 1 FOR I 2 TO N F F N NEXT D we could do with a better example of the power of recursion Con sider the game THE TOWER or The Trilogic Game to old Doctor Who fans Given 3 poles with no disks of ascending size biggest at the bottom slipped over pole 1 move them to pole 3 moving only 1 at a time and at no time having a larger disk on top ofa smaller pole 2 can be used as an intermediate one A formula for the number of moves is not hard to find 2 disks 3 moves 3 disks 7 moves 4 disks 15 moves but a BASIC program not using recursion is rather dif ficult t
170. uto spacing applies to most of the commands and takes a bit of getting used to compared to dumb executive programs on other machines Once the start address has been specified hexadecimal data may be typed in with the display show ing 8 bytes to a line The start address of each block of 8 bytes is shown at the left of the line The command may be terminated by pressing Carriage Return One annoying feature is that the Delete Key is ignored Thus if the wrong address is typed by mistake the command must be terminated and re given This problem does not occur with incorrectly typed data entries This is because the cursor left key can be used to step back up memory and make corrections Another useful feature of this command is that if relative jumps are being used in a program there is no need to work out the offsets yourself When the point has been reached where the offset must be typed a full stop followed by the four digit actual address may be typed instead The program will automatically calculate the relative offset in 2 s compli ment and insert it at the relevant point in the program MRNA ITIN VIRI 22222 21 Liverpool Software Gazette March 1980 63 Once your program has been typed in it may be checked before executing or saving to tape by using the memory dump or M command This requires two four digit arguments the start and finish addresses of the block t
171. values for an array At the end of this article we shall present an application which takes a command letter or group of letters and generates an index IN which can be used as the subject of an ON TO GOSUB In the case when KEY is not an element of FILE then we return a value of IN 0 This means that we cannot use the zero th element of FILE but should it be necessary the algorithms presented can be adapted to return 1 or some other distinguishable value First effort Listing 1 The slightly unusual construct in line 1020 makes sure that the FOR loop is properly terminated In some cases it may not be needed and may well not work for other implementations of BASIC or in other languages is always better to be safe than sorry If the program terminates in line 1040 we know that FILE lt gt KEY 1 1 NE and so IN 0 or 1 or what ever value is chosen to represent failure If FILE D KEY then IN is set to that value of I the FOR loop terminated and the routine ended Second effort Listing 2 To cut down on the size ofthe routine we might notice that we have two occurrences of NEXTI RETURN We cannot simply delete the first occurrence from line 1020 since the routine would then always return IN 0 How ever if we move the IN 0 to before the start of the FOR loop then the algorithm works and is slightly shorter This method of assigning a value to a variable before a test which if true assigns
172. vertise Ridiculously reasonable rates high quality editorial and production standards make us unbeatable media in which to advertise your product however mythical it may be Advertise that Z 8000 board here the 325 1200 CPS impact Printer or Hard Disk sub system for SC MP Notes Full page 17 5 24 180 00 Half Page Upright 8 5 x 24 95 00 Landscape 17 5 cm x 11 75 cm 95 00 Quarter Page 8 5 cm x 11 75 52 00 Agency discount 10 Copy Date for the May issue is April 18 Copy Date for the July issue is June 20 14 Castle Street ALL ADVERTISERS RECEIVE 50 COPIES OF THE ISSUE THEY Liverpool L2 OTA ADVERTISE TN OF CHARGE Tel 051 227 2535 6 7 8 16 Liverpool Software Gazette March 1980 NASCOM NOIES AT the present moment Nascom are still supplying Nas com 25 with free 16K R A M Kits This has caused some problems Firstly as mentioned in Nascom Notes last time the recommended position for the four 5 in the Memory Map was FOO0 to FFFF This was to fit in with Tiny Basic and Super Tiny Basic But on a Nascom 2 the 8K Basic lies from to FFFFH There is a one line note somewhere in the Nascom 2 documentation telling you to relocate the EPROMS at DOOOH to DFFF but I m still getting Nas com s back because due to this error they won t run 8K Basic obviously from fools who don t buy the Gazette The second problem is that the
Download Pdf Manuals
Related Search
Related Contents
URZ4024 - LED TV 24” URZ4032 - LED TV 32” Robert Bosch Corporation Husky HDA70403AV Instructions / Assembly ダウンロード - 双葉電子工業株式会社 ASSMANN Electronic DN-82022 network media converter (Discontinued) Single Wire Version Manual important safety instructions warning: danger Philips Oven lamp Incandescent lamp 871150015754625 Comment Remplir sa déclaration Française NewAir AB-1200 Instructions / Assembly Copyright © All rights reserved.
Failed to retrieve file