background image

Summary of Contents for MZ-80A

Page 1: ......

Page 2: ...MACHINES SUPPLIED IN THE U K AND REPUBLIC OF IRELAND HAVE 48K BYTE RAM FITTED AS STANDARD ...

Page 3: ...Personal Computer MZ 80A Owner s Manual 080311 250182 C SHARP CORPORATION ...

Page 4: ...ect to revision without prior notice therefore you are requested to pay special attention to file version numbers This manual has been carefully prepared and checked for completeness accuracy and clarity However in the event that you should notice any errors or ambiguities please feel free to contact your local Sharp representative for clarification All system software packs provided for the MZ 80...

Page 5: ...erpreter SA 5510 BASIC an abbreviation for Beginner s All purpose Symbolic Instruction Code was devel oped as an all purpose language to provide beginners with a means of easily programming computers to solve a diverse range of problems Its simplicity and versatility make it well suited to personal pro gramming applications BASIC SA 5510 is an extended BASIC interpreter which enables the MZ 80A co...

Page 6: ...rst then pull the plug do not pull the cable If the power switch is turned off then immediately turned on again initialization may not be per formed correctly Allow a few moments after turning the power off before turning it on The personal computer MZ 80A contains 32K byte RAM as standard equipment When you use system software that requires the disk drive access DISK BASIC FDOS etc it is necessar...

Page 7: ...he PRINT S 1st and 2nd Approaches 15 Let the Computer Run 16 LIST for Quick Understanding 17 Error Puts the Computer in Confusion 18 Collect the Statewentÿi 19 Correct the Statement 20 Further Study of Comma and Semicolon 21 Colon and it s Use 22 Does A B Equal B A 23 Variables the Computer is Very Fond of 24 Computing the Earth 25 Archimedes and the Mysterious Soldier 26 The Function Family Membe...

Page 8: ... for 5 years 51 Subroutine is the Ace of Programs 52 Stop Check and Continue 53 Jump in masse Using the ON GOTO statement 54 ON GOSUB is the Use of a Subroutine Group 55 Primary Array has the Strength of 100 Men 56 Array is also Available for String Variables 57 Array is the Master of File Generation 58 Challenge of French Study 59 Secondary Array is More Powerful 60 What about the Multiplication ...

Page 9: ...also be Stored on Cassette Tape 86 Technique to Memorize a Music History 87 List of School Work Results 88 Music Library Kept on Tapes 89 Data Bank is a Computer s Speciality 90 Telephone Number List is also a Data Bank 91 SOS in Morse Code 92 Signals in Dots and Dashes 93 Unending Time 94 Miniature Space Dictionary 95 A Solution of Simultaneous equations 96 Find 1000 Prime Numbers 100 701 260 Hou...

Page 10: ... 1 6 How to obtain copied BASIC tapes 122 Chapter 2 Monitor Program of the MZ 80A 123 2 1 MONITOR SA 1510 Commands and Subroutines 124 2 1 1 Using monitor commands 124 2 1 2 Monitor subroutines 124 2 2 MONITOR SA 1510 Assembly Listing 130 Chapter 3 Hardware Configuration of the MZ 80A 161 3 1 The MZ 80A system configuration 162 3 1 1 Memory configurations 164 3 1 2 Key scanning system 167 3 2 The ...

Page 11: ...Your MZ 80A and BASIC Programming Chapter 1 ...

Page 12: ...future hardware and software applications in mind Its greatest features are its high speed and ease of operation When it was introduced the MZ 80A was widely acclaimed as a system which would open a new dimension in computer programming Figure 1 1 is a simplified illustration of the hardware configuration of the MZ 80A It consists of a storage unit which stores programs and data a central processi...

Page 13: ... different numbers The MZ 80A employs a Z80 a so called 8 bit microprocessor which process one byte of data at a time as its central processing unit Accordingly programs which give instructions and data to be processed are all stored and trans ferred in byte units Byte locations in the storage unit are designated by a 2 byte pointer in the central processing unit With this 2 byte pointer the Z80 c...

Page 14: ...of the MZ 80A and their functions Top view of the MZ 80A CRT display Main keyboard Tape counter Cassette tape deck Cassette tape deck control buttons Numeric pad Figure 1 2 Rear view of the MZ 80A Volume control Brightness control I O module access window No 1 4 Figure 1 3 ...

Page 15: ...key L Load The Monitor s program loader starts and message 4 PLAY is displayed Press the PLAY 1 button of the cas sette tape deck The program loader loads the BASIC interpreter photo at left of Figure 1 4 and upon completion of loading the MZ 80A displays the message illustrated in the photo at right and the BASIC interpreter begins to operate The message Ready indicates that system control is at ...

Page 16: ... is similar to that of an ordinary electronic calculator The main keyboard has two operating modes 1 Normal mode 2 Graphic mode Keys provided on the main keyboard produce different characters according to operating mode as shown in Figure 1 6 normal mode A a hold down SHIFT graphic mode V 4 hold down SHIFTS Figure 1 6 Different characters of the X key Note that the letter key normally produce capi...

Page 17: ...l following characters of the string to the left one space INST inserts a space where the cursor is located by shifting all following characters of the string to the right one space HOME returns the cursor to the upper left hand comer of the display screen CLR clears the display screen and also returns the cursor to the screen s upper left hand comer In the graphic mode HOME produces the reverse c...

Page 18: ...own Pressing these keys again or pressing the CR key releases the shift lock This rolls down the listing of the CRT display This rolls up the listing of the CRT display This generates the character This character is used as a delimiter PASCAL FDOS etc This sets the character display mode to reverse mode Pressing these keys again sets the character display mode to normal mode This sets the V RAM co...

Page 19: ...lay the result These instructions are written in BASIC as follows 10 INPUT A 20 INPUT B two numeric data items from the keyboard 30 LET C A B Compute their sum 40 PRINT C Display the result SO END End On the first two lines variables A and B are assigned two numeric values through the INPUT statement which has the function of receiving data from the keyboard On the next line the sum of A and B is ...

Page 20: ...l then appear on the next line and the cursor will flash This means that the program execution has started and that the first INPUT statement is being executed Key in for example the number 19 as the value of variable A Entry of data during execution of the INPUT statement must also be terminated by pressing CR 1 9 CR It is convenient to use the ENT1key instead of the_CR key when entering numeric ...

Page 21: ...ing at the beginning of the tape rewind it by pressing the REW button before proceeding to the next step Enter a SAVE command together with an appropriate program name The SAVE command causes the program in the computer to be saved on the cassette tape Now let s record the above program changed to a subtraction program through screen editing on cassette tape Name the program Subtraction After moun...

Page 22: ... means delete copy calculate or write the calculation results There s no way to do them unless they are specified Teacher For I can do many things PRINT To use the computer in the same manner as the electronic calculator the computation of 5 8 is required to be displayed on the CRT screen For this there is the PRINT command available as an instruction Using this command let s press the keys in the...

Page 23: ...y calculator This is a calculation with parenthesis In case of ordinary mathematical operation different signs of groupings are used to write as follows 3x6 6 3 9 2 4 2 1 Whereas the parenthesis alone is used at all times with the computer 3 6 6 3 9 2 4 2 1 Even with the above the computer never forgets the rule that computation in the inner signs of groupings be done first and never makes any mis...

Page 24: ...ls between the quotation marks is called a string PRINT 3 5 fL_ This is a string put between quotation marks PRINT 3 5 _ft_ This is an expression not a string It is necessary for you to know more about the strings The free use of strings will double the pleasure in operating the computer PRINT is the command which you will have to get along with quite often If you think it troublesome to key in PR...

Page 25: ...space away This one character space is the position for the sign of plus Or minus of the 8 PRINT 3 5 3 5 Cÿ 3 5 2 k ffleitracte ÿce In case of a plus sign the sign omitted according to mathematical practice PRINT 3 S 3 5fCP 3 5 2 Use of this separator results in display of output lists on successive lines This separator causes output lists to be displayed in a tabulated format When a separation is...

Page 26: ...in the sequence of the line numbers and therefore the line numbers are made in steps ot 10 as illustrated in the above example so that new statements can be inserted later whenever required The line numbers can be selected at liberty from 1 to 65 535 Line No Statement Displaying the charactei on the CRT screen alone is not sufficient for the keying in of the statement After the display of each sta...

Page 27: ...the program extends over tens and hundreds of lines beyond dispaly at a time part of the stored programs can be displayed LIST 30 or Displays a program up to line number 30 LIST 30 CR Displays a program after line number 30 LIST 30 50 CR Displays a program between line numbers 30 and 50 LIST 30 CR Displays a program of line number 30 The result of NEW To store a new program clear the previous prog...

Page 28: ...t was keyed in later With this is your program complete If so try to make a mistake in line number 20 for example 20 5 B With this the statement in line number 20 must be re vised Sure Use the LIST command to check the re vision 10 A 3 20 B 5 30 C A B 40 PRINT A B C 50 END 205 B Oh something funny occurs Line number 20 is not revised On top of that a strange statement with line number 205 lists ou...

Page 29: ...ure With this the program displayed on the CRT screen has been modified In fact however this has not yet modi fied the program stored in the computer To modify the stored contents the CR key must be pressed What Did you key in 6 instead of 7 To modify the character to the left of the cursor there are two methods available Method 1 Pressing the INST DEL key With the INST DEL key held down the curso...

Page 30: ... in 100 to this space No more description is required for the revision of C to D Since the statement has been modified so far why not modify the line number from 30 to 35 and press the CR key Modify line number 40 as shown below 40 PRINT A B C D Then type RUN CR RUN 3 108 Character Deletion 35 D 100 A B 35 D A B C times This shifts the cursor until A B portion conies right next to mark RUN 3 5 8 1...

Page 31: ...s space before the number is for the plus or minus sign 30 C A B 40 PRINT A B C 50 END 3 5 8 K O 10 character space 8 or minus 32 D B t A Eÿ 34 E B A 36 F B A 45 PRINT D E F RUN 3 5 8 125 15 1 6666667 With the comma revised to semicolon for line numbers 40 and 45 run the program once more To modify the program type in LIST and use the cursor in as smart a manner as possible RUN 3 5 125 15 1 666666...

Page 32: ... 100 Colon is a symbol to be used when more than 2 statements are inserted in one line number This kind of state ment is called a multi statement A statement with 2 lines can be described in one line number 1 line consists of 40 characters making it possible to use 76 characters including a line number How Much Left SIZE It is natural for you to desire to know how much storage capacity is left at ...

Page 33: ...the result of the right expression is sub stituted by symbol A prepared on the left expression In line number 10 value 1 is substituted by symbol A and at the right expression of line number 30 the value in symbol A and 2 are added and substituted by symbol A using symbol At this time value 1 previously put in A does not exist any more The following 2 programs produce different results which prove...

Page 34: ...iction however the computer will understand Let me see 3 is out in A before it is added to 5 in B making 8 that s made a new value for A This is easy Characters subject to Variables 1 A variable should be a combination of two or less characters Any variable over 2 characters can be stored but the charac ters after the second are neglected in computer processing For example ABC and ABD can be displ...

Page 35: ...h s volume for variable VE 50 ZE WE VE IE 2 This substitutes the mean density for variable ZE 60 PRINT EARTH DIAMETER DE KILOMETERS 70 PRINT EARTH SURFACE AREA SE SQUARE KILOMETER 80 PRINT EARTH VOLUME VE CUBIC KILOMETER 90 PRINT EARTH MASS WE THOUSAND TONS 100 PRINT EARTH MEAN DENSITY ZE KILOGRAM CUBIC METER 110 END The prince of a star understands slightly the size of the earth Pay much attentio...

Page 36: ...le C 60 If side CA length is known side AB and BC lengths or even the area of the triangle can be easily determined Archimedes Don t be silly Soldier All that needed is to generate a BASIC program Let me see Oh Yes it s good with CA 12 10 A 30 B 90 CA 12 20 AB CA COS A w I80 30 BC CA SIN A tr 180 40 S AB BC 2 50 C 180 A B 60 PRINT AB AB BC BC CA CA 70 PRINT AREA S S 80 PRINT A A B B C C 90 END Usi...

Page 37: ... 1 2 7182818 EXP 0 1 Common logarithm LOG X logio X Provided X is greater than 0 LOG 3 0 47712125 Natural logarithm LN X logeX Provided X is greater than 0 LN 3 1 0986123 Square root SQR X Vx Provided X is greater than or equal to 0 SQR 9 3 SQR 0 0 This Is PRINT 2 2 Identical to PRINT 2 t 2 Well 934 t 2 results in fractions of 872355 99 but 934 934 results 872356 This is correct as an arithmetic e...

Page 38: ...with velocity doubled or tripled are displayed DEF FN command is very convenient particulary when the same functions are often used in a long program Fall from an altitude of 10 000 meters How do you think the velocity and altitude of a fall from an altitude of 10 000 meters changes per second Fuction FNV T in the program is the fall velocity after a lapse of time T and FNH T is the altitude at th...

Page 39: ... 13CUCH egj r BUHIHCR _0 lEI cE The sequence of values the computer will ask about is in the order of how the variables are arranged Fr If you make a mistake in response to the question just prese the INST OEk_ key The answer is O K and then press the CR key to confirm to that effect Look The same display is there This is the inquiry about the value of the second variable B If there are 3 vari abl...

Page 40: ... HIS AGE 20 INPUT A 30 PRINT WHAT IS HER AGE 40 INPUT B 50 X A 2 B 60 PRINT WAIT X YEARS 70 END RUN WHAT IS HIS AGE 43 WHAT IS HER AGE 22 R WAIT 1 YEARS It is impossible to wait for 1 year In other words they could have been married a year ago Asked suddenly about a question the computer may be confused at what variable you are talking about In this program a string indicating inquiry contents is ...

Page 41: ...nged DATA 10 11 12 13 Number of values identical to that of variables that follow READ Similar to the INPUT command the arrangements of variables and values must be matched It is unexpectedly easy to generate programs to determine rectangular circle and triangle areas using the READ and DATA commands 10 READ A B 20 SI A sk B 30 PRINT RECTANGLE S1 40 READC 50 S2 7T 5k C t 2 60 PRINT CIRCLE S2 70 RE...

Page 42: ... prize you care to ask for Sir Lancelot replied Thank you my Lord I would like to have 1 Ginea today 2 Gineas tommorrow 4 Gineas on the 3rd day 8 Gineas on the 4th day and so on until the 30th day King Arthur was so surprised by such a small request that he agreed immediatly Let us make the program below to find out how much King Arthur must pay 10 D 1 F 1 S 1 20 PRINT DAYS GINEAS TOTAL 30 PRINT D...

Page 43: ...er of the numberal 10 READ A 20 IF A 0 THEN PRINT A A 30 GOTO 10 40 DATA 10 20 5 9 8 6 5 SO END RUN A 20 A 5 A 8 A 5 Positive numbers alone are displayed The general form of IF THEN statements is as follows IF conditions THEN statement or line number The conditions herein referred to are greater than or less than expressions using equal sign and unequal sign Sign Conditions How to Use ii os A B C ...

Page 44: ...A 0 THEN 90 60 IF A 3 THEN L L 1 GOTO 40 70 IF A 6 THEN M M 1 GOTO 40 80 N N 1 GOTO 40 90 PRINT YOU INSERTED FIGURES FROM I TO 3 L TIMES 100 PRINT FROM 4 TO 6 M TIMES 1 10 PRINT AND FROM 7 TO 9 N TIMES 120 END A new symbol H k used in line number of 10 Dkplay of S is possible when the SHIFT key depressed in the graphic mode This command will clear all the character on the CRT screen and shift the ...

Page 45: ...w can you decide the multiple of 3 or 4 You ve got it haven t you The answer is this Modification for the multiple of three 20 IF X 3 INT X 3 GOTO 10 Modification for the multiple of four 20 IF X 4 INT X 4 GOTO 10 IF can select Maximum and Min 10 S 999 L 999 20 READ X IF X 9999 THEN 80 30 IF X L THEN L X 40 IF X S THEN S X 50 GOTO 20 60 DATA 2 5 91 256 43 70 DATA 87 321 76 9999 80 PRINT MAXIMUM VA...

Page 46: ...0 Now let s generate a program 10 PRINT X Y PASSWORD 20 READ X Y 30 PRINT X Y C Comma following Y is very convenient for continuous display on the 40 Q INT X Y CRT screen 50 R X Q Y 60 X Y Y R 70 IF R 0 THEN 40 80 PRINT X GOTO 20 90 DATA 63 99 1221 121 64 658 100 DATA 12345678 987654321 110 END RUN Exposure of a Trick for this Program Long ago a Greek mathematician Euclid developed this method of ...

Page 47: ...increased for example by 0 5 or decreased by 2 The variation at this time is assigned by the word of STEP To increase in 0 5 increments 10 FOR N 1 TO 5 STEP 0 5 To decrease in 2 decrements 10 FOR N 5 TO 1 STEP 2 The general form of FOR NEXT statement is as follows FOR variable Initial Value TO Last Value STEP Variation The initial value final Repeated Program value and variation mav NEXT Variable ...

Page 48: ...e variable Y loop In other words with variable X remaining at 1 variable Y varies 1 2 3 to 9 and each time the multiplication product with variable X is displayed at line number 30 When varialbe Y reaches 9 a line feed is executed at line number 50 and at line number 60 variable X is then 2 The FOR NEXT loop can be used double triple etc up to 15 What must be observed however is that loops are nev...

Page 49: ... IF B C THEN K B B C C K 60 IF C D THEN K C C D D K 70 IF A B GOTO 40 80 IF B C GOTO 40 90 IF A C GOTO 40 100 PRINT A B C D 110 PRINT PRINT ONCE MORE PLEASE PRINT 120 GOTO 30 Give attention to line number 40 Using another variable K after the THEN statement the job is being done by changing the values of A and B If A 3 and B 5 in the initial state By the above job A 5 and B 3 are obtained Similar ...

Page 50: ...0 150 IFA A B B C C 0 THEN PRINT A B C 160 NEXT C B A 180 END You already know the meaning of line number 10 Try to draw carefully so that a fine triangle is formed between line numbers 20 through 80 At line numbers 120 through 160 the FOR NEXT loop is triple The equation shown at line number 150 is repeated 8000 times 20 x 20 x 20 with C from 1 to 20 at A 1 and B 1 and with C from 1 to 20 at A 1 ...

Page 51: ... example of a simple program combined with the FOR NEXT statements 10 FOR X 1 TO 20 10 FORY lTO20 20 PRINT TAB X 20 PRINT TÿB 20 Y 30 NEXT X 30 NEXTY Now let s try a little more complex program 10 PRINT S PRINT SPACES 8 20 FOR X 1 TO 22 PRINT NEXT X PRINT 30 FOR Y 1 TO 20 40 PRINT TAB 8 TAB 29 Y TAB 29 NEXT Y PRINT SPACES 8 50 FOR Z 1 TO 22 PRINT NEXT Z A new statement is there at line numbers 10 ...

Page 52: ... at line number 70 and at line numbers 80 through 100 automobiles are controlled so that they do not collide By the way RESTORE at line number 110 is not a familiar command is it RESTORE Returns to the Start of Data No matter where it may be or no matter how it may be scattered DATA statement is read by READ statement OX NO 10 DATA 21 10 READ A 20 READ A B C 20 READ C 30 DATA f t 107 30 DATA 27 10...

Page 53: ...s Processing very similar to that of ordinary variables is possible Let s look at some examples to see their characteristics 70 PRINT BS 80 PRINT AS RUN PAUL MIKE Using connects string variables 100 PRINT BS CS AS ES LS DS KS RUN 100 PAULTONYMIKEDENISDAVIDPETEBILL What will happen if is used in place of 120 PRINT BS AS IS RUN 120 PAUL MIKE K 7ÿ K 10 character space i JACK To combine string variabl...

Page 54: ...ATER Using INPUT statement the input of a string can be keyed in requiring no quota tion marks Another example of this is shown below 10 PRINT TYPE IN ANYTHING AT ALL 20 INPUT AAS 30 PRINT YOU HAVE JUST TYPED AAS 40 GOTO 10 String variables when combined with READ and DATA statements can be generated into a program 10 READ XIS X2S 20 PRINT XIS LIKE CREAM X2S Note that quotation marks are not requi...

Page 55: ...to generate a new string The string variables BS has been defined for the new string To select some characters when counted from the right hand side of a string RIGHT S is used 40 CS RIGHT S AS 9 HZÿSelects the last 9 characters from A 50 PRINT CS RUN ARIES LEO To select characters in the center of a string MIDS is used 60 DS M1D AS 10 12 70 PRINT DS RUN PISCES ARIES Selects 12 characters starting...

Page 56: ...B 2 AS GOTO 20 Vary the values of input The computer performs square drawing by using LEN Then drawing is made possible by characters or symbols other than Using LEFT S line numbers 20 and 40 of the previous program are modified 20 INPUT AS AAS LEFT S AS 1 40 PRINT TAB 2 AAS SPACE S LEN AS 2 AAS The use of LEN makes a string parade possible 10 SS SHARP BASIC 20 FOR M 1 TO LEN SS 30 PRINT LEFTS SS ...

Page 57: ... a clear clue to the reason why the same result is obtained although the strings in the parentheses differ between line numbers 10 and 20 The ASCII code is for characters up to 255 CHR If characters can be converted to the ASCII code it is natural that there is a statement to reverse the conversion That s right CHRS state ment does that job PRINT CHRS 65 CHRS ASC K A K Ready A cipher is generated ...

Page 58: ... 2 34 5 6 50 NEXT END 1 2 3 45 6 60 DATA 1 2345 6 12 3456 12 34 5 6 70 DATA 123 45 6 123 4 56 1 2 345 6 80 DATA 12345 6 READY VAL statement has a function opposite to STR S statement In other words it converts a string of characters to a numeral 10 AS 1 2 3 4 5 6 20 B VAL AS rufiT 30 C 654321 B j f M lfVj 40 PRINT AS V_ t 50 PRINT B fe w v 60 PRINT C to a numeral 80 END RUN 123456 Not a numeralbut...

Page 59: ...ition counted from the right is a multiple of 3 If so a comma is placed at line number 100 For example presuming that the input integer is a number of 9 figures the follow ing is obtained INPUT integer Y variable Z variable Character count of INPUT integer LEN X 123456789 876543210 Z LEN X Y Take a number consisting of figures 1 to 4 and another number of the same figures but with a reverse arrang...

Page 60: ...g is the equation for determining interest included for the n year in each calculation method Interest included by simple calculation n year with rate R B X principal n X R Interest included by compound calculation n year with rate R C X 1 R n Based on the above equations the following program is generated to calculate interest included both in simple and compound interests 10 PRINT PRINCIPAL 20 I...

Page 61: ...r M X 1 R 2 X 1 R Interest included 3 years after Mj X 1 R 3 X 1 R 2 X 1 4 R Based on the above the interest included is calculated in the following eouation for n years Mn X 1 R n X 1 R 1 X 1 R This is simplified as follows Mn X 1 R n 1 1 R R Here s the program generated to indicate what is the interest included for any desired year with the same amount of money deposited each year Even though th...

Page 62: ...wt just GUSUB for a minute 10 PRINT a 20 PRINT TAB 10 TOTAL SALES PRINT 30 PRINT 5 1 0 1 5 20 40 PRINT 1 r r r r 50 PRINT 1 FOUR GOSUB 200 60 PRINT 1 SUGER GOSUB 200 70 PRINT 1 WINE GOSUB 200 80 PRINT 1 SAUCE GOSUB 200 110 PRINT 1 120 PRINT END 200 PRINT 1 READ A 210 FOR N 1 TO A PRINT S NEXT N 220 PRINT A 230 RETURN 240 DATA 20 15 21 24 In the above program subroutines are line numbers 200 throug...

Page 63: ... marks indefinitely 10 A 0 B 38 C 1 20 FOR X ATOB STEP C 30 FOR Y 0 TO X 40 PRINT 50 NEXT Y PRINT NEXT X 60 K A A B B K 70 C C GOTO 20 With the BREAK key pressed while holding down the SHIFT key program execution stops Then insert the following in the program and give the CONT command 100 END This is followed by the display below Error 17 CONT command cannot be executed The CONT command cannot be ...

Page 64: ...GOTO 10 GOTO 10 RUN NUMBER I 3 1 Given 122 for example integer XXX NUMBER 1 3 2 Y Y Y NUMBER 1 3 7 fif 1 is processed cutting off any place of decimals Let s play a joker pick game using the ON GOTO state ment A joker is included in 5 cards The place of the joker is un known of course Guess where the joker is to compete with the computer for a win When asked Do you pass in the program key in 1 for...

Page 65: ...a convenient multiple manner 10 AS FRENCH BS MATHEMATICS CS ENGLISH 20 DS SCIENCE E MUSIC FS ATHLETICS 30 GS SOCIAL STUDIES HS ART IS TECHNOLOGY 40 JS RELIGION KS ECONOMICS 50 PRINT WHAT DAY OF THE WEEK 55 PRINT 1 MON 2 TUE 3 WED 4 THU 5 FRI 0 ALL 60 INPUT XS X ASC X 47 70 FOR Y 0 TO 3 PRINT TAB 3 8 Y Y 1 80 NEXT Y PRINT 90 ON X GOSUB 170 110 120 130 140 150 100 PRINT GOTO 50 110 PRINT MON AS CS D...

Page 66: ... Now let s look at what the primary array is all about A o 2 3 This means that the computation of expression 2 3 should be put into the prepared A 50 A o z A io 8 Now you have understood what the primary array is haven t you Using the primary array the program has been generated as follows 10 DIM A 100 20 FOR J 1 TO 100 30 READ A J 40 NEXT J 50 DATA 5 30 12 See the program is very short As is clea...

Page 67: ...ing variables is all about Let s generate a simple program Just a look at this Keeping variable strings in the form of arrays eliminates the labour of writing whenever they are used The program itself is neat and simple 10 DIM AS 2 BS 2 CS 2 20 FOR J 1 TO 2 READ AS J BS J 30 CS J AS J BS J 40 PRINT AS J BS J CS J 50 NEXT J 60 END 70 DATA YOUNG GIRL WHITE ROSE RUN YOUNG GIRL YOUNG GIRL WHITE ROSE W...

Page 68: ...ks 75 51 28 56 100 81 60 43 66 1 48 Generate a file program arranged in the order of merit 10 DIM A 10 B 10 20 FOR J 1 TO 10 30 READ A JT B J NEXT 40 FOR K 1 TO 9 M 0 50 FOR J KTO 10 60 IF B J M THEN 80 70 M B J L J 80 NEXT J 90 B L B K B K M 100 A 1 A L A L A K A K A1 120 NEXT K 130 PRINT S 140 PRINT ORDER OF MERIT MATHEMATICS 150 PRINT 160 PRINT STUDENT NO TAB 14 170 PRINT MARKS 180 FOR J 1 TO 1...

Page 69: ...D 80 PRINT AS K 90 INPUT XS 100 AX AS K XS 110 IF CS K AXS THEN PRINT OX 120 PRINT WRONG FOR M 1 TO 1000 130 PRINT B SPACES 10 PRINT 140 PRINT Q GOTO 80 150 K INT 10 RND 1 1 160 PRINT TRANSLATE TO FRENCH 170 PRINT BS K 180 INPUT YS 190 YBS YS BS K 200 IF CS X YBS THEN PRINT O K 210 PRINT WRONG FOR M 1 TO 1000 220 PRINT SPACES 10 PRINT 230 PRINT GOTO 170 240 END 250 DATA CHAT CAT PORTE DOOR MAISON ...

Page 70: ...clear description of the English mark of Paul M and N in the A M N represent separate items Writing A M N using two items is called the secondary array Two items used mean second ary array The primary array previously described has one item Now look at how this secondary array can be used in the program for the computer Plus integer constant variable expression Variable boxes in the number of 5 1 ...

Page 71: ... multiples of 2 namely even number larger than 2 are not prime numbers To use variables with subscripts effectively even numbers are excluded from the start 10 DIM P 255 20 FOR J 0 TO 255 30 P J J 2 3 NEXT J_ 40 FOR K 0 TO SQR 255f 50 IF P K 0 THEN 90 60 KK K P K 70 FOR L KK TO 255 STEP P K 80 P L 0 NEXT L 90 NEXT K _ 100 PRINT 2 110 FOR M 0 TO 255 120 IF P M 0 THEN 140 130 PRINT P M 140 NEXT M 15...

Page 72: ...NS A Name is keyed inJ 90 IF NS A 0 THEN 110 100 NEXT A 110 A A 1 120 FOR B 1 TO A 1 130 FORC 1 TO A B 140 D LEN NS C E LEN NS C 1 F 1 IF D E THEN E D 142 X ASC M1DS NS C F 1 143 Y ASC MIDS N C 1 F 1 IF X Y THEN 150 144 IF X Y THEN 180 145 IF E F D E THEN 180 146 IF E F D E THEN 150 148 F F 1 GOTO 142 150 KS NS C 160 NS C NS C 1 The order is substituted 170 NS C 1 KS 180 NEXT C B 190 PRINT 200 FOR...

Page 73: ...CE 150 IF N 10 THEN PRINT N TAB 5 160 IF N 10 THEN PRINT N TAB 5 170 ON N 10 GOTO 200 210 220 180 ON M GOTO 300 310 320 330 200 PRINT JACK GOTO 180 210 PRINT QUEEN GOTO 180 220 PRINT KING GOTO 180 300 AS GOTO 340 310 AS GOTO 340 320 AS GOTO 340 330 AS GOTO 340 340 FOR B 1 TO N 350 PRINT AS 360 NEXT B 370 RETURN 400 PRINT 410 PRINT THENIRESHUFFLE 420 FOR M 1 TO 4 FOR N 1 TO 13 430 X fM N 0 440 NEXT...

Page 74: ... for recording are O K V Cassette tape recorder operation r s Press the RECORD and PLAY buttons _ _J Recording start CRT screen display Writing NAME Recording in progress No name is displayed with no file name given to a program CRT screen display Ready Recording completed ...

Page 75: ...e displayed as o 61 Found NAME Display indicating that the program to be verified was found j o Load D LOAD NAME gg u7 f PLAY 3 Press the PLAY button 4 Found 151 Found NAME 6 Loading NAME 7i Ready Display and operation are same as the steps 3 to 6 of the VERIFY command Transfer to the computer in progress loading Loading completed ...

Page 76: ...en to a group of data to be written A maximum of 16 characters can be used to name a group of data Of course it is unnecessary to have a name if so desired 10 WOPEN T DATA 20 FOR X 1 TO 99 30 PRINT T X 40 NEXT X 50 CLOSE T 60 END Now it is time to read the data which has just been written First rewind the cassette tape then execute the following 10 WOPEN T DATA 20 FOR X 1 TO 99 30 INPUT T A 40 PRI...

Page 77: ...e as data it has nothing to do with the name of the substituted variable This makes it possible to change the variable name in the program as long as the string data is read by the string variable and the numeral data by the numeral variable Now from what you have learnt so far let s generate a data file with mixed numeric and string data To also write the years when the previous composers died fo...

Page 78: ...tten data of results and calculate the mean of individual students points and the mean of each subject 10 ROPEN T RESULT 20 INPUT T N 30 DIM N N K N E N 40 DIM R N 50 FOR X 1 TO N 60 INPUT T NS X K X 70 INPUT T E X R X 80 NEXT X 90 CLOSE T 100 PRINT TAB 12 FRENCH 110 PRINT TAB 19 ENGLISH 120 PRINT TAB 27 SCIENCE 130 PRINT TAB 34 MEAN 140 FOR X 1 TON 150 PRINT NS X TAB 11 K X 160 PRINT TAB 18 E X 1...

Page 79: ...hanges must be made 300 WOPEN T ETUDE 310 PRINT T J1S J2S J3S N1S N2S N3S 320 CLOSE T Attention is required to the fact that the character count for data writing should be within 255 characters If written as follow 305 MAS J1S J2S J3S MBS N1S N2 N3S 310 PRINT T MAS MBS the contents of string variables MAS and MBS exceed 255 characters which make data writing incomplete Molto Vivace F Chopin Puppy ...

Page 80: ...ata bank This data bank makes it simple to retrieve and sort out items depending on the type of program Retrieving is made for all the data related to any required items assigned For example a blood type is assigned to retrieve all people of the same blood type and this is called retrieving by blood type In addition with an eye to a certain item names are arranged in ABC order for example or ages ...

Page 81: ...ing by use of the surname 190 NEXT K 200 IF X 0 THEN 240 210 PRINT NO RELEVANT PERSON FOUND 1 220 PRINT PLEASE RE ENTER 230 GOTO 140 240 PRINT PRINT 250 FOR K 1 TO X 260 L F K For display of persons with the same surname 270 PRINT NAME TAB 11 N L MS L 280 PRINT HOME NUMBER 290 PRINT AS L BS L 300 PRINT WORK NUMBER 310 PRINT CS L DS L PRINT 320 NEXT K 330 GOTO 140 340 DATA JONES JOHN 01 364 9617 01...

Page 82: ...o which try to strike SOS Very dif ficult The Morse code requires practice until your fingers move naturally and quickly without thinking of where to press To make this easy the program for the Morse code is generated in the following section Line numbers 20 to 270 are strings to gen erate signals from A to Z and line numbers 290 to 380 for those from 0 to 9 Brief description is given of the progr...

Page 83: ...2R2 A5 260 MS 89 A5R2 A2R2 A5R2 A5 270 MS 90 A5R2 A5R2 A2R2 A2 280 REM NO 290 M4 48 A5R2 A5R2 A5R2 A5R2 AS 300 MS 49 A2R2 A5R2 A5R2 A5R2 A5 310 MS 50 A2R2 A2R2 A5R2 A5R2 A5 320 MS 51 A2R2 A2R2 A2R2 A5R2 AS 330 MS 52 A2R2 A2R2 A2R2 A2R2 A5 340 MS 53 A2R2 A2R2 A2R2 A2R2 A2 350 MS 54 A5R2 A2R2 A2R2 A2R2 A2 360 MS 55 A5R2 A5R2 A2R2 A2R2 A2 370 MS 56 A5R2 A5R2 A5R2 A2R2 A2 380 MS 57 A5R2 A5R2 A5R2 A5R2...

Page 84: ...T 100 T 0 IF K2 0 THEN 120 110 FOR N 1 TO K2 PRINT TAB T T T 4 NEXT N T T 4 120 FOR N 1 TO L NS STRS N J LEN NS 130 PRINT TAB T 5 J N T T 4 140 IF T 28 THEN T 0 PRINT 150 NEXT N 160 IF TOO THEN PRINT 170 GOSUB 190 180 PRINT a GOTO 30 190 FOR Z I TO 31 PRINT NEXT Z PRINT RETURN 200 DATA JAN FEB MAR APR MAY JUN 210 DATA JUL AUG SEP OCT NOV DEC 220 DATA SUN MON TUE WED THU FRI SAT 230 END 400 X Y 410...

Page 85: ...ther heavenly bodies Motion velocity of a satellite in Motion velocity of a satellite in oval orbit Period Long radius Short radius Eccentricity G M r m s T 2 f3 1 n J G M s G 6 67 x 10 _11 N m kg Universal gravitation constant M Mass of the earth kg r Distance from the earth s center to satellite m v JG M 1 I m s T WGÿ M s h h 2R a 2 m b V a e m e OF OP Ja2 b2 a rp a 1 e m ra a 1 e m Mass I for t...

Page 86: ...n we obtain a set of simultaneous Unear equations in which JC is not included that is one unknown is eliminated Rewriting the coefficients of all equations as 022 a2n and so on we obtain a 11x1 a 12x2 OlnX Ai 022X2 02 Xn bl a 2X2 t a x b 3 The process of creating the set of equations in 3 from the set of equations in 1 is called elimination using the first row and column as a pivot Performing the ...

Page 87: ...f variable N as the number of unknowns and the contents of 2 dimensional array A N N 1 as the coefficients of the equations in 1 finds values of the unknowns and assign them to array X N from X N to X l First let s consider step 3 whkh is the most important elimination step As seen from the equations in 2 the kth k 1 to N 1 elimination process is carried out basically by repetitions of assignment ...

Page 88: ...ign the unknowns and the coefficients of the simultaneous linear equations in question to variable N and 2 dimensional array A N N l Many methods are possible such as using the READ and DATA statements however we have decided here to enter them one at a time from the keyboard In step 3 we decided to display the values of the unknowns on the CRT display unit in the format XI X2 These steps can be c...

Page 89: ... will find that the program can solve systems of simultaneous linear equations with more than 80 unknowns when it is used on the MZ 80A Try solving various systems of simultane ous linear equations in which there are a large number of unknowns 2 After running program several times you may encounter the error message Error 2 in 1030 which indicates that an overflow error occurred during execution o...

Page 90: ...itude Approach to the problem Many different programs could be used to solve this problem The first major proposition however is that the program constructed must be a practical one An extreme approach might be as follows Find and print prime numbers starting at the smallest one 2 is the smallest prime number so let s print 2 first Next is 3 next is 5 next is 7 All we have to do is to print them u...

Page 91: ...se a 2 dimensional numeric array This is because since the maximum subscript value for 1 dimensional arrays is 255 it is not possible to identify all array elements with a 1 dimensional array Since all array elements must be identified within the subscript range of 255 we use an array structure such that the 1000 elements are grouped into 10 subarrays of 100 elements each The DIM statement for the...

Page 92: ...it by four prime numbers 2 3 5 and 7 if it is not indivisible by these numbers we can regard 101 as a prime number This fact affects programming efficiency greatly In fact to determine whether 10100 which is 100 times greater than 101 is a prime number or not we only need to divide it by 25 prime numbers from 2 to 97 Otherwise as you will see later you would have to divide it by far more than 1000...

Page 93: ...1030 GOSUB 2000 1040 PRIM M N I 1050 NEXT N M 1060 RETURN 2000 REM Find the next prime number 2010 1 1 1 X 0 Y 0 2020 IF PRIM X Y PRLM X Y I THEN RETURN 2030 L I PRIM X Y 2040 IF L INT L 0 THEN 2000 2050 Y Y 1 2060 IF Y 100 THEN 2020 2070 X X 1 Y 0 GOTO 2020 3000 REM Print 1000 prime numbers 3010 FOR M 0 TO 9 FOR N 0 TO 99 3020 PRINT P PRIM M N 3030 NEXT N M 3040 RETURN ...

Page 94: ...1 1187 1193 1201 1213 1217 1223 omitted 6143 6151 6163 6173 6197 6199 6203 6211 6217 6221 6229 6247 6257 6263 6269 6271 6277 6287 6299 6301 6311 6317 6323 6329 6337 6343 6353 6359 6361 6367 6373 6379 6389 6397 6421 6427 6449 6451 6469 6473 6481 6491 6521 6529 6547 6551 6553 6563 6569 6571 6577 6581 6599 6607 6619 6637 6653 6659 6661 6673 6679 6689 6691 6701 6703 6709 6719 6733 6737 6761 6763 6779 ...

Page 95: ...ol and university or college 245 days a year are for going to school and 5 hours a day for lessons After school 1 5 hours are for home work every day throughout the year After graduation from university 8 hours a day for 245 days a years a year are for work as a salaried man with 8 hours a day for sleep 365 24 days a year are assumed Based on the above calculations are made with results as follows...

Page 96: ...BS E INT RETURN ASC LEFTS RIGHTS ATN LEN RND E AUTO LET ROPEN T CHARACTERS LIMIT RUN CHRS LIST Sj SAVE CLOSE T LIST P SET CLR LN SGN CONT LOAD SIN COPY P LOG SIZE COS 0 MIDS SPACES CSRH MON SQR CSRV MUSIC STEP 0 CURSOR 0 NEW STOP DATA NEXT STRS DEF FN 0 ON LL STRINGS m DIM OUT TAB END 0 PAGE P TAN E EXP PEEK TEMPO FOR POKE THEN E GET PRINT TIS GOSUB PRINT P TO m GOTO PRINT T u USR IF E READ 0 VAL ...

Page 97: ...mand clears all variables fills them with 0 or null string before running text RUN 1000 Executes the BASIC text starting at line number 1000 VERIFY VERIFY C This command compares the program contained in the BASIC text area with its equivalent text assigned the file name C in the cas sette tape file AUTO AUTO Automatically generates and assigns line numbers 10 20 30 during creation AUTO 200 20 Aut...

Page 98: ...colon is used variable data to the right of the colon is displayed from the next tab set position A tab is set every 10 character positions 110 PRINT COST CS Displays the string between double quotation marks as is and CS 120 PRINT Performs a new line operation i e advances the cursor one line INPUT 10 INPUT A Obtains numeric data for variable A from the keyboard 20 INPUT AS Obtains string data fo...

Page 99: ...ctively 1 5 4 Loop statement FOR TO 10 FOR A 1 TO 10 The statement on line number 10 specifies that the value of varia NEXT 20 PRINT A ble A is varied from 1 to 10 in increments of one The initial value 30 NEXT A of A is 1 The statement on line number 20 displays the value of A The statement on line number 30 increments the value of A by one and returns program execution to the statement on line n...

Page 100: ...ther statements follow a conditional statement on the same line and the conditions are not satisfied those following an ON statement are executed sequentially but those following an IF statement are ignored and the statement on the next line is exe cuted ON GOTO 50 ON A GOTO 70 80 90 Jumps to the statement on line number 70 when the value of varia ble A is 1 to the statement on line number 80 when...

Page 101: ...execution is continued END 1999 END Declares the end of a program Although the program is stopped the following program is executed if a CONT command is entered CLR 300 CLR Clears all variables and arrays that is fills all numeric variables and arrays with zeros and all string variables and arrays with nulls CURSOR 50 CURSOR 25 15 60 PRINT ABC The CURSOR command moves the cursor to any position on...

Page 102: ...0 79 and the second operand specifies the Y coordinates 0 49 300 SET 40 25 Displays a dot in the center of the screen RESET Resets a dot in the specified position on the CRT screen 310 RESET 40 25 Resets a dot from the center of the screen 1 5 10 Cassette data file input output statements WOPEN T 10 WOPEN T DATA 1 Defines the file name of a cassette data file to be created as DATA 1 and opens PRIN...

Page 103: ...50 175 Stores 175 SAF in hexadecimal in address 49450 130 POKE AD DA Stores data between 0 and 255 specified by variable DA into the address indicated by variable AD PEEK 150 A PEEK 49450 Substitutes data stored in address 49450 into variable A 160 B PEEK C Substitutes the contents of the address indicated by variable C into variable B USR 500 USR 49152 Transfers program control to address 49152 T...

Page 104: ...INP Reads data on the specified I O port 10 INP 12 A The statement on line number 10 reads data on I O port 12 20 PRINT A OUT Outputs data to the specified I O port 30 B ASC A The statement on line 40 outputs the ASCII code of the character 40 OUT 13 B A to I O port 13 1 5 14 Arithmetic functions ABS 100 A ABS X Substitutes the absolute value of variable X into variable A X may be either a constan...

Page 105: ...onstant or an expression The statement on line number 310 is used to substitute the tangent of numeric variable Y in degrees into variable A ATN 400 X ATN A 410 Y 180 JT ATN A Substitutes the arctangent of variable A into variable X in radians A may be either a numeric constant or an expression Only the result between tr 2 and rr 2 is obtained The statement on line number 410 is used to substitute...

Page 106: ...into string variable CS SPACE S 40 DS SPACE S N Substitutes the N spaces into string variable DS STRING S 50 ES STRINGS 10 Substitutes the ten repetitions of f into string varialble ES CHRS 60 FS CHR S A Substitutes the character corresponding to the ASCII code in numeric variable A into string variable FS A may be either a con stant a variable or an expression ASC 70 A ASC XS Substitutes the ASCI...

Page 107: ...statement following THEN is executed 20 IF AS XYZ THEN If the content of variable AS is XYZ the statement following THEN is executed 10 IF A X THEN If the value of variable A is greater than X the statement following THEN is executed 10 IF A X THEN If the value of variable A is less than X the statement following THEN is executed or 10 IF A OX THEN If the value of variable A is not equal to X the ...

Page 108: ... and awaits entry of data for XS from the keyboard 250 PRINT AB CD E Displays character strings in a tabulated format i e AB First ap pears then CD appears in the position corresponding to the start ing position of A plus 10 spaces and E appears in the position cor responding to the starting position of C plus 10 spaces 300 DIM A 20 BS 3 6 A comma is used to separate two variables 320 AS SHARP BAS...

Page 109: ......

Page 110: ...ded 16 11 The number of levels of FOR NEXT nests exceeded 16 12 The number of levels of functions exceeded 6 13 NEXT was used without a corresponding FOR 14 RETURN was used without a corresponding GOSUB 15 Undefined function was used 16 Unused reference line number was specified in a statement 17 C ONT command cannot be executed 18 A writing statement was issued to the BASIC control area 19 Direct...

Page 111: ... OPEN statement ROPEN or WOPEN was issued to a file which is already open 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Out of file 64 65 The printer is not ready 66 Printer hardware error 67 Out of paper 68 69 70 Check sum error _ ...

Page 112: ... Be sure to keep the original BASIC tape in a safe place Activate BASIC interpreter by the original BASIC tape Execute the following command USR SllFD the message ÿRECORD PLAY is displayed Set the new cassette tape into the deck and press the RECORD 1 and PLAY buttons Upon completion of writing a copied BASIC tape will be obtained Any number of copied BASIC tapes can be made using this procedure H...

Page 113: ...Monitor Program of the MZ 80A Chapter 2 ...

Page 114: ...ws the message when the power switch of the MZ 80A is turned on MONITOR SA 1510 S The cursor flickers to inform the operator that system control is in Monitor command level Monitor commands are as follows L 1 CR 1 Loads the cassette tape file into memory J xxxx JTR Transfers system control to the specified address that is loads the specified address in the program counter of the CPU xxxx 4 digit h...

Page 115: ...s CALL MSGX 0018 Almost the same as MSG except that cursor control codes are for reverse character display All registers CALL BELL S003E Sounds a tone approximately 880 Hz momentarily All registers except AF CALL MELDY S0030 Plays music according to music data The starting address of the music data must be specified in advance in the DE register As with BASIC the musical interval and the duration ...

Page 116: ...to be stored must be specified in advance in the DE register CR functions as the end mark 80 is the maximum number of characters which can be input including the end mark 0DH Key input is displayed on the screen and cursor control is also accepted The BREAK code 1 BH followed by a carriage return code ODH is set at the beginning of the address specified in the DE register when SHIFT BREAK are pres...

Page 117: ...assured All registers except AF and HL CALL 2HEX S041F Handles 2 consecutive ASCII strings as hexadecimal strings and returns after setting the data in A register The call and return conditions are as follows DE starting address of the ASCII string e g 3 A CALL 2HEX DE Cflag 0 A register hexadecimal number e g A register 3AH C flag l A register is not assured All registers except AF and DE CALL KE...

Page 118: ...ALL WRDAT S0024 Writes the contents of the specified memory area onto the tape as a CMT data block in accordance with the contents of a certain part of the header buffer Return conditions C flag 0 No error occurred C flag 1 The BREAK key was pressed All registers except AF CALL RDINF S0027 Reads the first CMT header found starting at the current tape position into a certain part of the header buff...

Page 119: ...e size of the data block which is to follow IBU20 SI 104 S1105 These two bytes indicate the data address of the data block which is to follow The loading address of the data block which is to follow is indicated by CALL RDDAT The starting address of the memory area which is to be output as the data block is indicated by CALL WRDAT IBU22 SI 106 SI 107 These two bytes indicate the execution address ...

Page 120: ...009 JP LTNL 14 0009 NL ENT 15 0009 C37B09 JP NL 16 OOOC PRNTS ENT 17 OOOC C39309 JP PRTS 18 000F PRNTT ENT 19 000F C38409 JP PRTT 20 0012 PRNT ENT 21 0012 C39509 JP PRNT 22 0015 MSC ENT 23 0015 C39308 JP MSG 24 0018 MSGX ENT 25 0018 C3A10S JP MSGX RST 26 001 B GETKY ENT 27 001B C3B308 JP GET 28 001E BRKEY ENT 29 001E C3110D JP BRK Figure 2 1 Since the first address of MONITOR SA 1510 is 0000 relat...

Page 121: ... 0000000000 iNcxfinÿNaio N n ooooooooo r ÿrs 0 O Nm Tin i NaioO fi rir 0N0i O Nn NNlNlMNNNNNN n r n nrtr V f IT 4 K a C N n c a o O HA HA ir HA HA o ae a oc a u a n cr E cc o O P flD I n o o J 1 0 M X a CL a a a o UJ cr z z o o V o o u c 00 QC 1 E CO ts v CL CO X UJ J r a X v V UJ X cr a C o cc 1 E n E Ul UJ Cl a z 1 o J Z a a a E E o ac n 3 OC X E o a i ft o ac V A A c r r A C c r A r r C A 0 f r...

Page 122: ...lj o o NritirKNOOO 0 0ÿ rtn 4jrx MNNrjNOjNfjr Non ÿÿ ÿ v y m y m a cc cc uJ X o _J u x if x z o o a x a J JOTO o o cc o a cc UJ if r X if CJ UJ S O X X X E rt V V if E E E z V J _J J G o J _J J UI X O O O 1 o x 1 if a o X o z UJ o E X E x v X UJ X XXX X UJ x x a UJ rÿoo CM r oc xx _j a ÿCDr ar juj UJ X _J N X_J rÿG oozoroo c ox o o X CM X X X X X x u o r o D N O O fJ NO OCiX N MU G u D O GO O x _J...

Page 123: ... Nn iri4KC frO Nn rÿN OiO Nn pÿMJjffO oo o o NNNNNNNNNnn in nnnrin r ÿ ÿ iftrÿinirHfHf rrir 0 l c o UJ G o UJ a ut o O G X G A z r N 04 A mm r A N mm N X a Q G a G G o m G r G X G X f4 4 G J J G G G X C 3 G X G OJ X G A Z u o X X X X X X X X X X X X X X r a _ o G G G o O o A G o o G G A o G 4 G Z G G O G A G G o O X G G G o A G X A G s u N 4 04 4 G rx 04 X z X G O G X G X A X G X X X X X mm p A A ...

Page 124: ...NT POINTER 55 0283 1 56 0283 F5 MOP I1 PUSH AF 57 0284 E5 PUSH HL 58 0285 217C11 LD HL MCPNT 59 0288 7E LP A ML 60 0289 3C INC A 780 ASSEMBLER SB 7201 MZ 80A MONI T OR PACE 08 09 04 81 01 028A FE 33 CP 51 l COLUMN 51 THEN 0 02 028C 2001 JR NZtMOPO 03 028E AF XOR A 04 028F E5 MGPOl PUSH HL 05 0290 6F LD L A 06 02 1 3A9I 1 1 LD A SPACE 07 0294 B7 OR A 08 0295 7D LD A L 09 0296 El POP HL 10 0297 2001...

Page 125: ...E HL 59 030F 2107E0 LO ML CONTF 60 0312 3674 LO HU 7 4H I CALL MELDV 12H 280 ASSEMBLER SB 7201 M 2 80A MONI TOR PAGE 10 09 04 81 01 0314 36B0 LD HL BOH 02 0316 2B DEC ML 1 C0NT2 03 0317 73 LD HL E 04 0318 72 LO ML 0 05 0319 2B DEC ML 1 CONTI 06 031A 360A LO HL IOAM 07 031C 3600 LO HL 0 08 031E 23 INC HL 09 031F 23 INC ML 1 CONTF 10 0320 3680 LD HL 80H 1 1 0322 2B DEC ML t CON T 2 12 0323 4E 9 T MS...

Page 126: ...039A FI POP AF 54 08ft FB El SS 039C C9 RET 56 0390 1 57 0390 1 DSP03 PACE MOPEI 56 0 390 1 59 0390 EB 0SPO3I El PE HL 60 039 3601 LD HL t 1 CON T 2 280 ASSEMBLER SB 7201 M2 80A MONITOR PAGE 12 09 04 81 Os 01 03A0 23 INC HL 02 03A1 3600 LO HL 0 03 03A3 C37B0E JP CURSR 04 03A6 1 05 03A6 I 06 03A6 1 07 03A6 t MANAGMENT PAGE MODE 08 03A6 09 03A6 1 10 03A6 3A72I 1 MANG2 1 LP At DSPXY 1 1 1 03A9 85 AOD...

Page 127: ... LD L A 59 04 1 D 01 ML 1i POP DE to 04 1E C9 RET IHEX 23 lML ME X 15 ZBO ASSEMBLER SB 7201 M 80A MONI TOR F AC E I 09 04 81 01 04 1F 1 02 04 1F ORO 041FM 03 04 1F 1 04 04 F t 05 04 F 2 ASCII TO ACC 06 04 IF l 07 04 1F 1 OE DATA LOW ADR 08 04 1F t 09 04 1F 1 EXIT CF 0 I Ok 10 04 1F l 1 OUT I1 04 1F I 12 04 1F 2HEX ENT 13 04 1F C5 PUSH BC 14 0420 1A LD A DE 15 0421 1 3 INC DE 16 0422 CDF903 CALL HE...

Page 128: ... n K J Vi O vj n n i i 4 w 4 n n r I J 4 X X c j X w 4 n ix n K t n 4 V r i rri n ni era o o vl o o J T O c O O o O XIII W I M 30 m 0 0000000 O OC0 C JAwK CP ÿ wÿ OOffl Jl ÿ Wÿ O C0 JOyl wK CO l JÿJAwM O W Ji J wW OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOO O Ooco r 1 i i m Tii mr inmfnmmr iDaoaoaooooooonoooooonooon noor airw o vi K n m r O O O O K n n n noon nmoonnoooo CD ni iji j j...

Page 129: ...001 JR NZ O 56 0560 FB El 57 0561 FI POP AF 58 0562 C9 RET 59 0563 l 60 056 3 15 RTP5I DEC D t CALL PL Y2 3 Z80 ASSEMBLER SB 7201 MZ 80A MONITOR PAGE 1 01 056 4 2806 JR Z RTP7 02 0566 62 LD M P 03 0567 CDE20F CALL OAPCK 04 056A 1 89E JR RTP1 05 056C 3E01 RTP7I LD A 1 06 056E 1802 JR RTP9 07 0570 3E02 RTP6I LD A 2 08 0572 37 RTP9I SCF 09 0573 1 8D0 JR RTP4 10 0575 1 1 1 0575 I t 12 0575 1 VERIFY 13...

Page 130: ... Nft i ri rÿco fro IN o on aio o ooooocooo ÿf iNW NNNNN ftnftW n nnt f f ioÿÿrirr r ÿ ÿÿ a o V fr O m Ui o c Ui Ui o a Ci Ci O in Z X X n m r n hv in Ui X Ci in X L u n It a 00 X _i O Ui a Li Ui Ui u a 0 c 0 m 0 j X CL V X X 0 O CL cc a 3 U Z A X cr J a It 0 u _J C _i c _i G z _i l_i O J CD X _i D _i CD CD Ui _i x O U CL X U O 0 Qifflaia O z X Oi O Z X It X z cc J z Cl X 0 r X CL i r G r 0 0 0 X X...

Page 131: ...C 58 06A4 05 PUSH DE 39 06 A3 E5 PUSH HL 60 06 A6 060A LO B 10 I L I CALL 0LY2 3 I CALL 0LY2O 780 ASSEMBLER SB 7201 M7 80A MONl TOR RAGE 22 09 04 81 01 06A8 3A02E0 MOT 1i LD A CSTR 02 06AB E610 AND IOH 03 06 AD 280A JR 7 MOT 4 04 06AF 06A6 M0T2 LD 8 i A6H l 2 SEC OLAY 03 06BI CDA70D CALL DLY12 06 06B4 1OF B PJN7 3 07 06B6 AF XOR A 08 06B7 18E6 M0T7 JR RET 3 09 06B9 3E06 MOT 4 l LD A 06M 10 06BB 21...

Page 132: ... 0745 30FC JR NC 2 57 0747 7C LD A M 58 0748 81 ADD A C 59 0749 4F LD C A 60 0 7 4 A C 37 40A JP SWEPOI Z80 ASSEMBLER SB 7201 M Z 80A MON I TOR PAGE 24 01 0740 I 02 074P MODE SET OP KEYPORT 03 074D l 04 074D MOPE i ENT 05 074D 21O3E0 LO HL KEYPF 06 0750 368A LD HL 8AH 07 075 3607 LD ML 07M 08 0754 3605 LD HL 05H 09 0756 3601 VOOFF 1 LD HL 0 1 M 10 0758 C9 RET 1 I 0759 1 12 0759 1 1 3 0759 1 14 075...

Page 133: ... 07AA E5 PUSH HL 13 07AB 05 PUSH OE 14 07AC CD6302 GETLOi CALL SAVE 15 07AF CDCA08 CALL KEY 16 0782 FECB CP CBH 17 07B4 28F9 JR 7 5 18 07B6 CDCA08 GETL1 CALL EY 19 07B9 C OFF09 CALL FLAS 20 07BC 28F8 JR 7 6 21 07BE F5 PUSH AF 22 07BF AF XOR A 23 07C0 329311 LO STRGF A 24 07C 3 FI POP AF 25 07C4 47 AUTO3 LO B A 26 07C5 C0F505 CALL LOAD 27 07C 8 3A9011 LO A SWRK 1 BELL WORK 28 O7C0 87 OR A 29 07CC C...

Page 134: ...RE LINE 53 0863 0650 GETLBi LD 8 80 l 2 LINE 54 0865 2E00 GE TL6 LD L 0 55 0867 CDB40F CALL 9PNT1 56 086A 01 POP DE l STORE TOP ADR 57 0868 05 PUSH DE 58 086C 7E LD A HL 59 086D CDCEOB CALL 7DACN 60 0870 12 LD DE A 280 ASSEMBLER SB 7201 M2 80A MON 1 TOR PAGE 28 01 0871 23 INC HL 02 0872 CB9C RES 3 H 03 0874 13 INC DE 04 0875 1OF 5 DJN2 9 05 0877 EP EX DE HL 06 0878 360D LD HL rODH 07 087 A 28 DEC ...

Page 135: ... 124 RL GRAPH ROW t 12 M SEC OELAV HL BC TENkEY CHECk X TEN KEY THEN JUMP 780 ASSEMBLER SB 7201 M7 80A MONI TOR PAGE 30 09 04 81 01 0909 07 RLCA 02 090A 2023 JR N7 Y 4 03 090C 47 LD B A 04 0900 3A8F 1 1 LD A SFTLk 01 0910 B7 OR A 06 091l 78 LO A B 07 0912 2803 JR 7 1 08 0914 17 RL A 09 0915 3F CCF 10 0916 IF RRA 1 1 0917 17 RL A 12 0918 17 RL A 1 3 0919 3007 JR NC 7ICY3 14 09i B 1 1DA0C LO DE KT B...

Page 136: ...OLIWWWW oooooooooooooooooooo f j r n i Uj XM O Is r ii r O rJo fuÿÿifÿCC C u G r X O O CJ r m o r u ff v i 9 j N CC 9 O r ir v k ir v i m a X _i o o z o CL a cr u CL u L L ÿ z z z X X X z z X X X trv W X o X X X X Cl r Ci Ci o o CL X X u o O z w u z z o G ÿ c o CO oc x X X Ll Ui O Z W o Ul X u X X U 2 UJ z o M J J X 3 X u J L_l at L UJ k 1 I Oi J o m CCiUiO Cl UJ c Z X X Zf X z o X UJ z z Ci X z C...

Page 137: ... r i 0 X t 05 m m 0 O x st O 35 m r O r X 4 O X X X X O rnm 00 00000000000000000000 J JI _ J3 _ j A J Ji 1 ÿ W V OOOOOOOOOOOOOOO WWWWWUWWWWÿN ÿ JÿÿK JK O OC0ÿ Ji U Nÿ O tfCO WCÿiJIftgN 0000 0000000000000000 C WÿwWw Mÿ OX TP CO N4 _ I W J OXO XJX CO K ooooooooo o i J w w J J w oooooooooooooooooooo PI TO ni TJ TP CP CP U TP TP rp t_J3 W f_V I O w x o i l a x v x o jno O T O 4 0 jr c M OwK ownwv w 0 ...

Page 138: ...O 0 O 73 13 X 13 V O X CP w _ O CD __ PI c CP O PI p W J mm 7 DC Cft O ift CD PI 0 X 33 X 30 Ift PI mm PI Pi 3 U PI X X Pi J PI 0 J O P X z O PI PI 0 p Pi 0 3 DC 30 N Z P O z A X N O Z 00 3 O o 0 JI JIelI Ai A JI _ l AAAAAA AAAAWWWWWWWU WW N s V s N N K KlNJ 0 OOOOOOOOO O OCOMCÿÿAUW O Offl fl UAWN O OO ÿOvÿAWK o OC0 Jl UU WM O OCOÿJO JIAWÿJ O O Oft J o I A w J 00 0000000000000000 rfl PI PI PI P rn...

Page 139: ...56 0820 E8 DEFB E8H 57 0821 E9 DEFB 9H 58 0822 EA DEFB EAH 59 0823 EC DEFB ECM 60 0824 ED DEFB EDH Z80 ASSEMBLER SB 7201 M7 80A MONITOR PACE 38 01 0B25 1 70 7F 1 02 OP 25 DO DEFB DOH 03 OP26 Dl DEFB D1H 04 0827 D2 DEFP P2H OS 0828 D3 DEFB D3H 06 0829 D4 DEFB D4H 07 0B2A D5 DEFB D5H 08 0B2P D6 DEFP D6H 09 092C D7 DEFB 07H 10 0B2D D8 DEFB D8H 1 1 0B2E D9 DEFB D9M 1 2 0B2F DA DEFB DAH 1 3 OB 30 DB DE...

Page 140: ...25 0874 88 DEFB 88M 25 08AC 48 DEFB 48H 26 0875 1 CO CF l 26 OBAD 46 DEFB 46H 27 0875 80 DEFB 8OH I 1 27 OBAE 70 DEFB 7DM 28 0876 38 DEFB 38M 28 OBAF 44 DEFB 44H 29 0877 3A DEFB 3AM 2 0880 IB DEFB 1 BH 30 0878 70 DEFB 70H 30 OBBI 58 DEFB 5BM 31 0879 3C DEFB 3CH 31 0882 79 DEFB 79H 32 087A 71 DEFB 7 1H 32 088 42 DEFB 42H 33 087B 5A DEFB 5AM 33 0BB4 60 DEFB 60M 34 087C 3D DEFB 3DH 34 08P5 1 35 0870 ...

Page 141: ... DEFB I6H 1 V 60 ocoi 02 DEFB 02H 1 B 09 04 81 472 780 ASSEMBLER SB 7201 M7 80A MONITOR PAGE 42 0ÿ 04 81 01 0C02 1S3 18 IF l 02 OC02 28 DEFB 28H 1 8 03 0C03 27 DEFB 2 7H 1 7 04 OC 04 09 DEFB 09H 1 I 05 0C05 15 DEFB I5H 1 U 06 0C06 OA DEFB OAH t J 07 0C07 08 DEFB 08H 1 H 08 0C08 OE DEFB OEH 1 N 09 0C09 00 DEFB OOH l SPACE 10 OCOA IS4 20 27 1 1 1 OCOA 20 DEFB 20H 1 0 12 OCOB 29 DEFB 29M 1 9 13 ococ ...

Page 142: ... z z z Z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z 2 000 0 z r c c r r x x x T V S o o o o 1 wrt y c X n m to o x s nx ra a 2 fc a C 2 r i X CD r O m 2 ÿ to to to toWWWU WWWWWW 4 4 J jK K K K K K OOOOOOOOO C a w w o o o x to m awK O O jÿiJi OK O O0 jÿ0 auw ooooooooooooooooooooopooooooooooooooooooooooooooooooopoooooo ooor ooooooooooooooooooooooooooooooooooooonooooooooooooooooo H o O...

Page 143: ... IB DEFB 1BH i 58 OCD1 89 DEFB B9H i 9 59 0CD2 IS6 60 OCD2 C 6 DEFB C6H i CL R 280 ASSEMBLER SB 7201 HZ 80A MONITOR PAGE 46 09 04 01 OCD 3 D 3 PEFB D3H 1 9 02 OCD4 C 4 DEFB C 4H 1 CURSOL LEFT 03 0CD5 Cl DEFB CIH 1 CURSOL DOWN 04 0CD6 CP DEFB CDH 1 CR 05 OCD7 B7 DEFB B7M 1 06 0CD8 00 PEFB OOH I NULL 07 OCD9 BB PEFB BBH 1 9 08 OC PA 1 09 OCPA TBLC i 10 OC DA ISO CTRL ON 1 1 OCDA FO DEFB FOH 1 CODE 8...

Page 144: ...0D39 C8 RET 2 56 OD 3A 3E20 LD A 20H l AID5 I CTRL 57 0D3C 37 SCF 58 OD 3D C6 RET 59 0D3E 1 1 60 0D3E 1 1 BIT WRITE 1 BIT WRITE U 280 ASSEMBLER SB 7201 M2 80A MONI T OR PAGE 48 09 04 81 01 0D3E l 02 0D3E F5 SHORT i PUSH AF 03 0D3F 3E03 LD A 0 3H 04 0D41 3203E0 LD CSTPT i A 05 004 4 CD5907 CALL OLYI 06 OB47 CD5907 CALL DLY1 07 0D4A 3E02 LD A 02H 08 0D4C 3203E0 LD CSTPT A 09 0D4F CD5907 CALL DL Y 1 ...

Page 145: ... 780 ASSEMBLER SB 7201 M Z BOA MON1 TOR PAGE SO 09 04 81 01 ODDD C5 PUSH BC 02 OPDE D5 PUSH DE 03 OPPF E5 PUSH HL 04 OPEO 47 LD B A 05 ODEl E6F0 ANO F OH 06 ODE 3 FECO CP COH 07 ODE5 C2E50E JP NZ RSTR 08 PE8 A8 XQR B 09 0DE9 07 RLCA 10 PEA 4F LP C A 1 1 ODES 0600 LD B 0 12 ODED 21FF0D LD HL CTBL 13 ODFO 3A91 l LD A SPAOE 14 00 3 B7 OR A 15 0PF4 2803 JR z 5 16 0DF6 216801 LD HL CTBL i PAGE MODE 1 1...

Page 146: ...P D CURS3 HL DSPXY A L 39 NC CURS2 L CUR 3 L 0 H A H 27 C CURS1 H 24 DSPXY HL CURS6 HL DSPXYl A L A 7 5 L CURS 3 L 39 H P CUR5U1 H 0 DSPXY HL A SPAGE l Z80 ASSEMBLER SB 7201 M2 80A MONI T OR PA 01 OEAD B7 OR A 02 OEAE 2035 JR N 2 RSTR 03 OEBO C3590F JP ROLD 04 0EB3 1 07 0EB3 21731 1 CLRSi LD HL HANG 06 0EB6 061B LD B 27 07 0EB8 CDD80F CALL 9CLER 08 OE BB 210000 LD ML POOOH 09 0C9C E7 PUSH ML 10 OE...

Page 147: ...A I E 59 0F55 lOF 8 DJNZ INST I 60 0F57 188C JR 7RSTR 09 04 81 LEFT SIDE ACC 80 Z 80 ASSE HOLER SB 7201 M 7 80A MON I T OR PAGE 54 09 04 81 01 0F59 l 02 OF 59 2 1 7 A 1 1 ROL P LD HL PBI AS 03 0F5C 3A7P1 1 LD A ROL TOP 04 0F5F BE CP HL 05 OF60 2883 JR Z RSTR 06 OF 62 CD9D02 CALL MOP D 07 0F65 7E LD A HL 08 OF 66 D605 SUB 5 09 0F68 77 R0L2 J LD HL A 10 OF 6 6F LO L A 1 1 0F6A 26E 2 LP H E 2H 1 2 OF...

Page 148: ...08 1 28 OF 08 1 29 0FD3 I CLER 1 30 OF06 1 P SI7E 31 0F08 ML LOW ADR 32 0F08 1 33 0F08 CLER ENT 34 OF08 AF XOR A 35 OF 09 1802 JR 4 36 OF 08 CLRFFi ENT 37 OF08 3EFF LD A FFH 38 OF00 01NT i ENT 39 OFDD 77 LD ML A 40 OF OE 23 INC HL 4 1 OFDF 1 OFC 0JN7 2 42 OFE 1 C9 RET 43 0FE2 t 44 0FE2 1 45 OFE 2 1 GAP CHECK 4 6 0FE2 1 47 OFE 2 C5 OAPCK i PUSH BC 48 OFE 3 05 PUSH OE 49 0FE4 E5 PUSH HL 50 OFE5 OlOl...

Page 149: ...ENT 1 EXECUTION ADR 19 11A1 DEFS 2 20 1 106 DEFS 2 20 1 1A3 BUFERI ENT GET LINE BUFFER 21 1 108 COMNT s ENT 1 COMMENT 21 1 1A 3 DEFS 81 22 1 108 DEFS 92 22 1 1F4 END 23 1164 SUPUl ENT 1 SWEEP WORK 24 1 164 DEFS 10 25 1 16E KDATWI ENT 1 FEY WORK 26 1 16E DEFS 2 27 I170 FANAF 1 ENT l FANA FLAG 28 l 1 70 DEFS l 29 1 171 DSP XV 1 ENT l DISPLAY CO ORDINATES 30 1171 DEFS 2 31 11 73 MANO ENT 1 COLOUMN MA...

Page 150: ... 0865 OETLA 0886 GETLB 0863 OETLC 084E GETLD 05E 1 GETLL 03D5 GETLR 0880 GOTO OOBB HEX 03F9 ME XI 03F2 HEX 2 03F5 HE X J 03E5 HL1 04 1D HLHEX 04 10 HOMO 0409 HOHOO 0ED4 H0M1 0406 HOME 03FB IBUFE 10F0 INST 0F2D INST1 OF 4 F K ANA OEEE K ANAF 1 170 F ANS T 003 KDA T W II6C KEYPA EOOO KEYPB EOO1 KEYPC E002 KEYPF E003 KSLO 0270 KSL2 0989 KTBL OBEA KTBLC OCDA KTBLO OC 6A KTBLGS 0CA2 KTBLS OC32 LETNL 00...

Page 151: ...Hardware Configuration of the MZ 80A Chapter 3 ...

Page 152: ...162 3 1 The MZ 80A system configuration Figure 3 1 shows the standard system configuration of the MZ 80A personal computer Figure 3 1 MZ 80A System Diagram ...

Page 153: ...interval timer 8253 is input to the sound generator which outputs sound to the speaker The two counters other than this IC serve as internal clocks for the MZ 80A Table 3 1 shows the configuration of MZ 80A memory mapped I O Table 3 1 Assignment of memory mapped I O Address Memory Read Memory Write Device SEOOO D7 Resets cursor timer D3 D0 Key strobe 8255 SE001 D7 D0 Key data SE002 D7 V Blank D6 S...

Page 154: ...waps are performed under control of memory mapped I O by executing memory read instructions such as the follow ing To place the memory in the state shown on the right LD A EOOCH To place the memory in the state shown on the left LD A E010H The memory configuration shown on the right is especailly effective when the system programs used start at address 0000 and when the system programs utilized ma...

Page 155: ...the monitor ROM Also if it is necessary to alter part of the monitor program for use it can be modified by block transferring it from SCOOO SCFFF to SOOOO SOFFF and making the changes in RAM The 2 K byte area from SD000 SD7FF is assigned to video RAM This area is the standard package which is used for the MZ 80A mam unit CRT display Figure 3 3 MZ 80A video RAM area Although up to 1 000 characters ...

Page 156: ...area capable of displaying data on the CRT screen is the 2000 bytes starting at D1EO SDOOO SD1E0 SD7FF Actual display area SDOOO Lower right of the SD1AF SD1E0 Upper left of the screen SD7FF Actual display area Lower right of the screen Upper left of the screen Condition when the screen is rolled Intermediate state down all the way Condition when the screen is rolled up all the way Figure 3 4 Rela...

Page 157: ... delivered to 10 keyboard strobe input terminals Keys are discriminated by strobe signals and key data For instance when the strobe is 2H and the key data is FBH it indicates that the s key is being pressed 6 o 5 o 4 o 3 O 2 o 1 o 0 o BREAK CTRL GRPH SHFT 10 keyboard strobe input terminals 3 1 5 6 II 2 S 4 l i3 CLR HOME 8 3 5 7 9 I w R I 1 J f jcURSOR u CURSOR 4 6 D G CR ENT INST DEL H K v N B SPA...

Page 158: ... ...

Page 159: ... circuit diagrams for reference These diagrams are arranged as follows 1 CPU board block 1 CPU signal system 2 CPU board block 2 3 CPU board block 3 RAM signal system 4 CPU board block 4 8255 and 8253 signal system 5 CPU board block 5 Peripheral I O port and power terminal ...

Page 160: ...w O 1 gj Si 1 a 1 5 i 3 1 tl g a al iJ l 8 a n 1 ÿ o V _5 _ _g 4 4 4 4 8 ij S I I I t rr SU g q g 5 t f n O I i rr rn g t 16 n 4 I a P jjJiJJJJ TTTTTTTtTI ilh f 1 Figure 3 7 CPU board block 1 CPU signal system MZ 80A 1 5 ...

Page 161: ...171 Figure 3 8 CPU board block 2 MZ 80A 2 5 ...

Page 162: ...172 MZ 80 A 3 5 ...

Page 163: ...173 Figure 3 10 CPU board block 4 8255 and 8253 signal system MZ 80A 4 5 ...

Page 164: ...NO 4 DS 04 5 07 06 6 GND AO 7 RESET A 8 GNO A2 9 HALT A3 10 KT A4 ii GNO As 12 wR A6 13 ffb A7 14 GNO A8 15 TORES A9 16 MRES AIO 17 GNO All 18 EXTNT Al2 19 GNO AI3 20 NMl A 4 2 l EX WAIT AO 22 Ex RESET o A PARTS SIDE MZ 80A 5 5 Figure 3 11 CPUboard block 5 Peripheral I O port and power terminal ...

Page 165: ......

Page 166: ... resulting in a wider range of applications The MZ 80FB dual floppy disk drive uses a double density mini floppy diskette 286K bytes diskette with a diameter of 5 25 inches both sides of which are used for recording It enables use of the DISK BASIC interpreters which is suitable for practical business applications of the double precision DISK BASIC interpreter which performs 16 digit BCD operation...

Page 167: ...TIMER 7 EXP PORT No 1 No 4 CASSETTE TAPE DECK UNIVERSAL 1 1 INTERFACE PTR PTP etc IPRINTER 1 PRINTER INTERFACE1 1 l D FLOPPY INTERFACE 1 DISK DRIVE J Figure 3 13 MZ 80A system expansion WARNING AND CAUTION Warning Dangerous voltage is inside of the main cabinet Leave the installation of optional devices which can be connected in the main cabinet to your dealer Caution r If the power is turned on w...

Page 168: ...registers Special Purpose Registers 1 Program counter PC The program counter holds the 16 bit address of the current instruction being fetched from memory The PC is automatically incremented after its contents have been transferred to the address lines When a program jump occurs the new value is automatically placed in the PC overriding the incrementer 2 Stack Pointer SP The stack pointer holds th...

Page 169: ...mically located anywhere in memory with absolute minimal access time to the routine 5 Memory Refresh Register R The Z 80 CPU contains a memory refresh counter to enable dynamic memories to be used with the same ease as static memories Seven bits of this 8 bit register are automatically incremented after each instruction fetch The eighth bit will remain as programmed as the result of an LD R A inst...

Page 170: ...errupt or subroutine processing These general purpose registers are used for a wide range of applications by the programmer They also simplify programming especially in ROM based systems where little external read write memory is available 1 2 ARITHMETIC AND LOGIC UNIT ALU The 8 bit arithmetic and logical instructions of the CPU are executed in the ALU Internally the ALU communi cates with the reg...

Page 171: ...hanger and for I O device data exchanges I O addressing uses the 8 lower address bits to allow the user to directly select up to 256 input or 256 output ports A0 is the least significant address bit During refresh time the lower 7 bits contain a valid refresh address Tri state input output active high D0 D7 constitute an 8 bit bidirectional data bus The data bus is used for data exchanges with mem...

Page 172: ...operation can resume While halted the CPU executes NOP s to maintain memory refresh activity WAIT Wait Input active low WAIT indicates to the Z 80 CPU that the addressed memory or I O devices are not ready for a data transfer The CPU continues to enter wait states for as long as this signal is active This signal allows memory or I O devices of any speed to be synchron ised to the CPU TNT Interrupt...

Page 173: ...bus data bus and tri state output control signals to go to a high impedance state so that other devices can control these buses When BUSRQ is activated the CPU will set these buses to a high imped ance state as soon as the current CPU machine cycle is terminated BUSAK Bus Acknowledge Output active low Bus acknowledge is used to indicate to the requesting device that the CPU address bus data bus an...

Page 174: ...ck transfer and the block search instructions can be interrupted during their execution so as to not occupy the CPU for long periods of time The arithmetic and logical instructions operate on data stored in the accumulator and other general purpose CPU registers or external memory locations The results of the operations are placed in the accumulator and the appropriate Hags are set according to th...

Page 175: ... set is demonstrated by the fact that the Z 80 CPU can provide all required floppy disk formatting i e the CPU provides the preamble address data and enables the CRC codes on double density floppy disk drives on an interrupt driven basis Finally the basic CPU control instructions allow various options and modes This group includes instructions such as setting or resetting the interrupt enable flip...

Page 176: ... to 126 from the jump relative OP code address Another major advantage is that it allows for relocatable code Extended Addressing Extended Addressing provides for two bytes 16 bits of address to be included in the instruc tion This data can be an address to which a program can jump or it can be an address where an operand is located one or two bytes Extended addressing is required for a program to...

Page 177: ...his type of instruction would be to load the accumulator with the data in the memory location pointed to by the HL register contents Indexed addressing is actually a form of register indirect addressing except that a displacement is added with indexed addressing Register indirect addressing allows for very powerful but simple to implement memory accesses The block move and search commands in the Z...

Page 178: ...m ber of bytes required for each instruction as well as the number of memory cycles and the total number of T states external clock periods required for the fetching and execution of each instruction All instruction OP codes are listed in binary notation Single byte OP codes require two hex characters while double byte OP codes require four hex characters The conversion from binary to hex is repea...

Page 179: ... n IY ÿ d n 11 111 101 oo no no d 4 3 19 LD A BC A BC n 00 001 010 2 fl LD A DE A DE oo on oio 1 2 i LD A nn A nn 00 111 010 3 4 13 n n LD BC A BO A Hi 000 010 1 7 LI DP A DE A 00 010 010 1 2 7 LD n n A nn A oo no oio n n 3 4 13 LD A I A 1 l IFF2 ft 0 0 11 101 101 2 2 9 01 010 111 LD A R A R 1 IFF ft 4 0 0 11 101 101 2 2 9 01 Oil 111 LD I A 1 A 11 101 101 2 2 9 01 000 111 LI R A R A 11 101 101 2 2...

Page 180: ...190 ...

Page 181: ...q qqH SP 1 11 qqO 001 1 3 10 qq Sl POP IX IXM SPI I 11 Oil 101 2 4 14 IXL SP 11 100 001 POP 1Y IY SPM 11 111 101 2 4 14 IYl SP 11 100 001 Notes dd is any of the register pairs BC DE HL SP qq is any of the register pairs AF BC DE HL PA1R h PAIR L refer to high order and low order eight bits of the register pair respectively E g BCL C AFjj A Flag Notation flag not affected 0 flag reset I flag set X ...

Page 182: ...0O Oil EX SP IV IYH SPM 11 111 101 2 6 23 IY L MSP 11 100 Oil LDI DE IIL f 0 0 11 101 101 2 4 16 Load HL into DE DE DE 1 10 100 000 increment the pointers and HL HL4 1 decrement the byte counter BC BC 1 BC LDIR DE HL 0 0 0 11 101 101 2 5 21 If BC 0 DE DE1 l 10 110 000 4 16 If BC 0 HL HL4 1 BC BC 1 Repeat until BC 0 x LDI DE HL 4 0 0 11 101 101 2 4 16 DE DE l 10 101 000 HL HL 1 BC BC 1 LDDR DE HL 0...

Page 183: ...1 11 101 101 2 4 16 HL HL 1 BC BC I 2 10 101 001 CPDR A HL 1 X 1 11 101 101 2 5 21 If BC 0 and A HR HL HL I BC BC 1 Repeat until A HL or BC 0 10 111 001 2 1 16 If BC 0 or A HL Notes I P V flag is 0 if the result of BC 1 0 otherwise P V 1 Z flag is 1 if A HL otherwise Z 0 Rag Notation flag not affected 0 flag reset 1 flag set X flag is unknown flag is affected according to the result of the operati...

Page 184: ...arly the P symbol indicates parity V 1 means overflow V 0 means not overflow P 1 means parity of the result is even P 0 means panty of the result is odd Flag Notation flag not affected 0 flag reset 1 flag set X flag is unknown t flag is affected according to the result of the operation 8 BIT ARITHMETIC AND LOGICAL GROUP TABLE 3 3 4 ...

Page 185: ...111 1 1 4 Complement carry flag SCF CY 1 l 0 0 oo no in 1 I 4 Set carry flag NOP No operation PC PCM 00 000 000 1 1 4 HALT CPC halted oi no no 1 1 4 D1 IFF 0 n no on 1 1 4 Kl IFF 1 n in on 1 1 4 IM 0 Sst interrupt mode 0 11 101 101 01 060 no 2 S IM l Set interrupt mode 1 11 101 101 oi oio no 2 2 8 IM 2 Set interrupt mode 2 11 101 101 oi on no o 2 8 Notes IFF indicates the interrupt enable flip flo...

Page 186: ...I 0 X 11 111 101 2 15 rr Reg 00 rrl 001 00 BC 01 DE 10 1 Y 11 SP INC ss H 1 00 VJO Oil 1 I 6 INC IX IX IX 1 4 II Oil 101 2 2 10 00 100 011 INC IY IY IY I it in IOI 2 2 10 00 100 Oil DEC ss SS SR 1 00 ssl Oil 1 1 6 DEC IX IX IX 1 11 011 101 2 2 10 00 101 Oil DEC IY IY IY 1 11 111 101 2 2 10 00 101 Oil Notes ss is any of the register pairs BC DE HL SP pp is any of the register pairs BC DE IX SP rr i...

Page 187: ...197 Flag Notation flag not affected 0 Hag reset 1 flag set X flag is unknown J flag is affected according to the result of the operation ROTATE AND SHIFT GROUP TABLE 3 3 7 ...

Page 188: ...il 000 0 d _4 001 I 01 b 110 010 2 SET b r ffc 1 11 001 on 2 2 on 3 il b r 100 4 101 SET b HL llL h 1 11 001 Oil 2 4 15 no 6 11 b 110 in ft SET b lX d IX d k ft 11 Oil 101 4 6 23 11 001 Oil d m1 b 110 SET bv IY d IY d b I ll in 101 4 6 23 11 001 Oil LL no RES b a To form new OP code a r HL replace 11 of SET b m IX d with 2 Flags and time IY d states for SET instruction Notes The notation s indicat...

Page 189: ...C PC e JR Z e If Z 0 conti nur 00 101 000 2 2 i If condition not met e 2 If Z 1 PC PCÿe 2 3 12 If condition s met JR NZ c If Z 1 continue 00 100 000 2 7 If condition not met e 2 If z o PC PC e 2 3 12 If condition s met JP HL PC HL 11 101 001 1 1 1 JP IX PC IX 11 Oil 101 2 2 8 11 101 001 JP IY PC IY 11 111 101 11 101 001 2 2 s DJNZ C B B l 00 010 000 2 2 8 If B 0 If B O continue e 2 If B 0 IX PC e ...

Page 190: ...200 Rag Notation flag not affected 0 flag reset 1 flag set X flag is unknown t flag is affected according to the result of the operation CALL AND RETURN GROUP TABLE 3 3 10 ...

Page 191: ... 10 111 010 UB ft B to As Ai5 HL HL 1 2 4 16 Repeat until B 0 BBS OUT n A n A 11 010 Oil 2 3 11 n to Ao AT Acc to A AIL OUT C r C r 11 101 101 2 3 12 C to AO AT 01 r 001 B to AiÿAis OLTI C HR i X X 1 X 11 101 101 2 4 16 C to Ao A B B l HL HL 1 10 100 on B to A AIL OTIR C HL 1 X X 1 X 11 101 101 2 5 21 C to As At B B l 10 no on U B S B to AH AIL HL HL 1 4 16 Repeat until B 0 UK 0 OLTD C HL t X X 1 ...

Page 192: ...es that the two s complement num ber in the accumulator is in error since it has exceeded the maximum possible 127 or is less than the mini mum possible 128 number than can be represented in two s complement notation For example consider adding 120 0111 1000 105 QUO 1001 C 0 1110 0001 31 wrong Overflow has occurred Here the result is incorrect Overflow has occurred and yet there is no carry to ind...

Page 193: ... operation indicated a match between the source and the accumulator data Also the parity flag is set if the byte counter register pair BC is not equal to zero This same use of the parity flag is made with the block move instructions Another special case is during block input or output instructions here the Z flag is used to indicate the state of register B which is used as a byte counter Notice th...

Page 194: ... 1 if the result of the operation is zero S Sign flag S l if the MSB of the result is one P V Parity or overflow flag Parity P and overflow V share the same flag Logical operations affect this flag with the parity of the result while arithmetic operations affect this flag w ith the overflow of the result If P V holds parity P V 1 if the result of the operation is even P V 0 if result is odd If P V...

Page 195: ...tly explained A reset to the CPU will force both IFF and IFF to the reset state so that interrupts are disabled They can then be enabled by an El instruction at any time by the programmer When an El instruction is executed any pending inter rupt request will not be accepted until after the instruction following El has been executed This single instruction delay is necessary for cases when the foll...

Page 196: ...ction on the data bus and the CPU will execute it Thus the interrupting device provides the next instruction to be executed instead of the memory Often this will be a restart instruction since the interrupting device only need supply a single byte instruction Alternatively any other instruction such as a 3 byte call to any location in memory could be executed The number of clock cycles necessary t...

Page 197: ...e a zero This is required since the pointer is used to get two adjacent bytes to form a complete 16 bit service routine starting address and the addresses must always start in even locations Interrupt Service Routine Starting Address Table desired starting address pointed to by I REG CONTENTS 7 BITS FROM PERIPHERAL 0 The first byte in the table is the least significant low order portion of the add...

Page 198: ......

Page 199: ...Appendix ...

Page 200: ... 1 0 0 0 1 mm0 Q H 0 SB S a 72 1 B m 2 0 0 10 0aa R s 0 e 0 0 H a m 3 00 11 H na s a 0 w m m a 4 0 100 A a T K V H 0 0 H 5 0 10 1 0a u E 0 ul 0 E a 6 0 110 s 0 a V H E CD Q 0 B 0 7 0 111 0 Gj jW 9 E Jj g o n m 8 1000 ffi 000 a am H 9 100 1 masE TlU E a ffi E u A 10 10 amaa w a E 0 a B 10 11 ffl ma LL W E0s0a DB C 1100 sESK a d on a E D 110 1 CR Ba M K r a y a K m E 1110 0 N ffl lb B p Effl 0 3 F 1...

Page 201: ...0 m 000 a 0 0 HB 2 00 10 11 mED H E 0 0 0 II K h 3 0011 S 0 ffl m lm H 4 0100 m ss00 n B 0 0 V 3in 5 0 10 1 0m 0 m 0m M e 0 H Q SI 0 K B 6 0 110 0 V 0 n 0 E 0 0 0 V H Ha H 7 0 111 n jw 0 00 tu S 0 H W 13 8 1000 M 00 Q 0 rn B E 0 0 0 H S M 9 100 1 m0 0 a m m m mE 0 I B K 0 A 10 10 00 B H 0sH m00 0 K I B 10 11 IKJ S sa H C kj 00 K 0a a C 1100 0 BD H 0 00 f 4h a D 110 1 M H k 0 n El ffl T a E 1110 E ...

Page 202: ...A IX d FDS605 ADD A IY d 87 ADD A A 80 ADD A B 81 ADD A C 82 ADD A D S3 ADD A E Note 84 ADD A H nn n d and e in the operands of each mnemonic code represent constant data The example values set 85 ADD A I C620 ADD A n forth below are used for these constants in this table 09 ADD HU BC 19 ADD HLDE nn 584H n 20H 29 ADD HU HI 39 ADD HUSP d 5 e 30H DD09 ADD IX BC DD19 ADD IX DE Data codes represented ...

Page 203: ...B CB60 BIT 4 B CB41 BIT O C CB61 BIT 4 C CB42 BIT 0 D CB62 BIT 4 D CB43 BIT 0 E CB63 BIT 4 E CB44 BIT 0 H CB64 BIT 4 H CB45 BIT 0 L CB65 BIT 4 L CB4E BIT UHL CB6E BIT UHL DDCB054E BIT l IIX d DDCB056E BIT 5 IX d FDCB054E BIT l IY d FDCB056E BIT 5 IY d CB4F BIT 1 A CB6F BIT 5 A CB4S BIT l B CB68 BIT 5 B CB49 BIT I C CB69 BIT 5 C CB4A BIT 1 D CB6A BIT 5 D CB4B BIT 1 E CB6B BIT 5 E CB4C BIT 1 H CB6C ...

Page 204: ...8405 CALL PE nn VA8405 CALL PO nn CC8405 CALL Z nn EDB1 2F 27 35 1 1 3505 FD3505 31 05 OB 01 15 IB II 25 2B DD2B FD2B 2D 3B CPIK CPI DAA DEC HI DEC IX d DEC IY d DEC A DEC B DEC BC DEC C DEC D DEC I E DEC E DEC H DEC HI DEC IX DEC IY DEC L DEC SP 3F CCF F3 1 1 BE DDBE05 FDBE05 BF BS B9 BA BB BC BI FE20 F DA9 EDB9 EI A1 CP HI CP IX d CP IY d CP A CP B CP C CP D CP F CP H CP L CP n CPD CPDR CPI U 2E...

Page 205: ... HL C OC INC C 72 LD HL D 14 INC I 73 LD HL E 13 INC I E 74 LD HL H 1C INC E 75 LD HL L 24 INC H 36 20 LD HL n 23 INC HL I D7705 LD IX d A DD23 INC IX mmos LD IX d B FD23 INC IY I D7105 LD IX d C 2C INC L D1 7205 LI IX d D 33 INC SP DD7305 LI IX d E D1 7405 LD lX d H EDAA INI DD7505 LD IX 4 d L EDBA INDR DD360520 LD IX d n EDA2 INI 1 7705 LD IY d A EDB2 INIR FD70O5 LD IY d B FD7105 LD IY d C E9 JP...

Page 206: ...LD D n 7B LD A E ED5BS405 LD DE nn 7C LD A H U8405 LD DE nn ED57 LD A I 5E LD E HL 7D LD A L DD5E05 LD E IX d 3E20 LD A n FD5E05 LD E IY d 46 LD B HL 5F LD E A 1 1 4605 LD B IX d 58 LD E B FD4605 LD B IY d 59 LD E C 47 LD B A 5A LD E D 40 LD B B 5B LD E E 41 LD B C 5C LD E H 42 LD B D 5D LD E L 43 LD B E 1E20 LD E n 44 LD B H 66 LD H HL 45 LD B L DD6605 LD H IX d 0620 LD B n FD6605 LD H IY d ED 1B...

Page 207: ... OUT C L 6B LD L E D320 OUT n A 6C LD L H EDAB Ol TD 6D LD L L EDA3 OUTI 2E20 LD L n ED7B8405 LD SP nn FI POP AF F9 LD SP HL Cl POP BC DDF9 LD SP 1X D1 POP DE FDF9 LD SP IY El POP HL 318405 LD SP nn DDE1 POP IX FDE1 POP IY EDAS LDD EDB8 LDDK F5 PUSH AF EDAO LDI C5 PUSH BC EDBO LDIR D5 PUSH DE E PUSH HL ED44 NEG DDE5 PUSH IX FDE5 PUSH IY 00 NOP CB86 RES O HL B6 OR HL DDCB0586 RES O IXÿd DDB605 OR I...

Page 208: ...97 RES 2 A CBB7 RES 6 A CB90 RES 2 B CRBO RES 6 B CB91 RES 2 C CBB1 RES 6 C CB92 RES 2 D CBB2 RES 6 D CB93 RES 2 E CBB3 RES 6 E CB94 RES 2 H CBB4 RES 6 H CB95 RES 2 L CBB5 RES 6 L CB9E RES 3 HL CBBE RES 7 HL DDCB059E RES 3 IX d DDCB05BE RES 7 IX d FDCB059E RES 3 IY t d FDCB05BE RES 7 IY d CB9F RES 3 A CBBF RES 7 A CB98 RES 3 B CBB8 RES 7 B CB99 RES 3 C CBB9 RES 7 C CB9A RES 3 D CBBA RES 7 D CB9B R...

Page 209: ...B06 RLC HL CF RST OSH DDCBO506 RLC IX d D7 RST 10H FDCB0506 RLC lY d DF RST 18H CB07 RLC A E7 RST 20H CBOO RLC B EF RST 2SH CB01 RLC C F7 RST 30H CB02 RLC D FF RST 38H CB03 RLC E CB04 RLC H 9E SBC A HL CB05 RLC L D1 9E05 SBC A IX d 07 RLCA FD9E05 SBC A IY d 9F SBC A A ED6F RLD 9S SBC A B 99 SBC A C CB1E RR HL 9A SBC A D DDCB05IE RR IX d 9B SBC A E FDCB051E RR dY d 9C SBC A H CB1F RR A 9D SBC A L C...

Page 210: ... CBE9 SET 5 C CBCA SET l D CBEA SET 5 1 CBCB SET l E CBEB SET 5 E CBCC SET 1 11 CBF C SET 5 H CBCI SET l L CBED SET 5 L CBD6 SET 2 HI CBF6 SET 6 111 DDCB05D6 SET 2 lX d DDCB05F6 SET 6 IX d FDCB051 6 SET 2 IYfd FDCB05 re SET 6 IY t d CBD7 SET 2 A CB17 SET 6 A CBDO SET 2 B CBPO SET 6 B CBD1 SF T 2 C CBF1 SET 6 C CBD2 SET 2 1 CBF2 SET 6 D CBD3 SET 2 E CBE3 SET 6 E CBD4 SET 2 H CBF4 SET 6 H CBD5 SET 2...

Page 211: ...4 SLA H AF XOR A CB25 SLA L AS XOR B A9 XOR C CB2E SR A HL AA XOR D DDCB052E SR A IX d AB XOR E FDCB052E SRA lY d AC XOR H CB2F SR A A AD XOR L CB28 SRA B EE20 XOR n CB29 SRA C CB2A SRA I CB2B SRA E CB2C SRA H CB2D SRA L CB3E SRL HL DDCB053E SRL IX d FDCB053E SRL lY d CB3F SRL A CB38 SRL B CB39 SRL C CB3A SRL D CB3B SRL E CB3C SRL H CB3D SRL L 96 SI B HL DD9605 SUB IX d F119605 SUB IY d 97 SUB A 9...

Page 212: ...ing voltage Temperature Operating temp 0 to 35 C Storage temp 15 to 60 C Humidity Lower than 80 Weight Approx 10 kg Cassette Standard audio cassette tape Data transfer speed 1200 bits sec Data transfer system SHARP PWM Dimensions Width 440 mm Depth 480 mm Height 260 mm Sound output Max 400 mW 440 Hz 2 CPU BOARD SECTION SPECIFICATIONS CPU SHARP LHOOSO Z80 CPU 1 pc ROM Monitor ROM 4K bytes 1 pc Char...

Page 213: ... Focus Horizontal lock in range 300Hz 100Hz limit Working temperature 10 C to 50 C Vertical lock in range 12Hz 6Hz limit Video output 40Vp p standard 35Vp p limit Audio frequency characteristic 440Hz OdB lOdB 4dB at 100Hz 12dB 4dB at 10kHz 5 CASSETTE TAPE DECK SECTION SPECIFICATIONS System PWM recording ___j Erasing DC system Power source 5V 0 25V rated Playback sensitivity 1m sec to 500p sec stan...

Page 214: ...pull the power plug and contact your dealer Shock If the unit is subjected to shock the sensitive electronic parts may be damaged Trouble If any trouble occurs stop operating the unit immediately and contact your dealer Long periods of disuse When the unit is not operated for a long time be sure to pull the power plug from the AC outlet Connection of peripheral devices When connecting peripheral d...

Page 215: ...intenance Dirty cassette deck recording and reproducing heads may result in incorrect data recording or reproduction Be sure to clean the heads every month Commercially available cleaning tape is convenient Discoloration of CRT screen If a certain spot of the CRT screen is lit an external period of time the spot may become discolored If it is neces sary for certain spot to be lit for an extended t...

Page 216: ......

Reviews: