background image

Содержание AMSTRAD

Страница 1: ...THE AMSTRAD NOTEPAD ADVANCED s 7 USER GUIDE...

Страница 2: ......

Страница 3: ...THE AMSTRAD NOTEPAD ADVANCED USER GUIDE ROBIN NIXON Programs written and documented by Chris Nixon SIGMA PRESS Wilmslow United Kingdom Thi s One 5ZSR LLP 2C3T...

Страница 4: ...re SK9 6AR England British Library Cataloguing in Publication Data A CIP catalogue record for this book is available from the British Library ISBN 1 85058 515 6 Typesetting and design by Sigma Press W...

Страница 5: ...software By porting Protext across to it they have a top selling word processor also available on a number of platforms including the Amstrad CPC and PCW Archimedes Atari ST Amiga and PC compatibles I...

Страница 6: ...ely In fact this book is packed with undocumented information about the Notepad and even the Z80 microprocessor itself that you are unlikely to find anywhere else Along with the comprehensive index yo...

Страница 7: ...S 7 CALC BAS 12 USING THE PROGRAM 13 HOW IT WORKS 15 CHART BAS 22 USING THE PROGRAM 23 HOW IT WORKS 23 COOKIE BAS 26 USING THE PROGRAM 26 HOW IT WORKS 27 DEVIL BAS 33 USING THE PROGRAM 34 HOW IT WORKS...

Страница 8: ...6 2 UNDOCUMENTED FEATURES 129 TRANSFERRING BBC BASIC PROGRAMS 129 QUICK MACRO ASSIGNING 129 LINE DRAWING CHARACTERS 130 PAGE DISPLAY MODE 130 USING THE FILE SELECTOR 131 PEEKING ABOUT 131 UNDOCUMENTED...

Страница 9: ...CTIONS 219 SECTION 3 APPENDICES 225 APPENDIX 1 NC100 JUMPBLOCK ENTRY POINTS 226 APPENDIX 2 INPUT OUTPUT PORTS 0000 00FF 229 APPENDIX 3 KEYBOARD SCAN CODES 230 APPENDIX 4 THE COMPLETE SET OF Z80 INSTRU...

Страница 10: ......

Страница 11: ...ble to pick up on the various methods used and then incorporate any ideas you like into your own programs To this end the variety of programs has been kept as wide as possible and a broad range of pro...

Страница 12: ...code involved as you could lock up your Notepad Golden Rule number two Read the listing carefully A common error is to confuse any of the following for each other Lower case 1 lower L i lower I and 1...

Страница 13: ...just dropping into command mode USING THE PROGRAM Type in the listing and save it as AUTO before trying it out Note that you must NOT call it AUTO BAS although all the other programs should use the BA...

Страница 14: ...selector again 130 Load the selected program into memory replacing AUTO and run it 160 190 Prepare for a two pass assembly using a FOR NEXT loop and set the program point P to the machine code destina...

Страница 15: ...hine code loop to copy a file name to a known location useable from Basic The program 10 REM BBC Basic menu system 20 30 CLEAR 40 DIM A 22 50 PROCselect 60 CALL A 70 IF buffer 0 0 THEN CLS PRINT Press...

Страница 16: ...r a computer program to handle In fact there probably isn t a computer in existence that hasn t had a biorhythm calculator written for it as a demonstration of the machine s graphics capabilities as m...

Страница 17: ...ether with a one word summary of how good or bad each one is today If you can t wait for the full plot you can cut it short by pressing Q which jumps straight to the summary screen useful if you re no...

Страница 18: ...olved Adjust the days according to the birth month and current month Adjusts the days further according to the day of the month of birth and the current day of the month Adjust the days further accord...

Страница 19: ...followed by the length of the dot and dash for that line followed by the initial dot dash phase to start with 920 Holds the single word comments which are used at the end of each plot to summarise th...

Страница 20: ...xels flag Keeps count of each line s current dot or dash phase well Numbers representing how good or bad each cycle is today well Store of single word summaries yc Y centre of graphic window xc X cent...

Страница 21: ...l 13 290 REPEAT CLS INPUT Year 1900 yl UNTIL yl 100 OR yl 1900 300 IF yl 100 yl yl 1900 310 leg TRUE IF yl 1900 OR yl 2020 leg FALSE 320 IF dl m ml FNleap yl ml 2 leg FALSE 330 IF leg 0 CLS PRINT CHR...

Страница 22: ...itution Today Is CHR 20 840 PRINT TAB 5 1 Physically SPC 5 well well 1 850 PRINT TAB 5 2 Emotionally SPC 4 well well 2 860 PRINT TAB 5 3 Intellectually well well 3 870 REPEAT UNTIL INKEY 0 32 ENDPROC...

Страница 23: ...rent calculation and displays it in a separate stationary window so that you can scroll freely through several screens of work and not lose your position It clears this value when you next enter a lin...

Страница 24: ...lc will restore the old contents of the line You might think that Calc is limited by the seeming inability to pass on any results to the next calculation you enter For example if you were to enter 10...

Страница 25: ...d Result windows up and places the next expression on the editing line Del Delete character under cursor The rest of the line is shunted to the left while the cursor remains stationary Del Delete char...

Страница 26: ...update B and advances the array pointer ptr and max if ptr was already at the highest element used so far Checks that max hasn t exceeded the limits of the arrays A and B otherwise adjusts max Draws...

Страница 27: ...the accumulator tot Makes separate strings holding the decimal and hex versions of the new total Joins both strings together padding so that the hex number is on the left and the decimal is on the rig...

Страница 28: ...put from the keyboard and calls relevant routines for inserting and deleting characters or moving around Moves the cursor one character to the left Moves the cursor one character to the right Scrolls...

Страница 29: ...nt cursor position on the editing line o The mathematical operator at the start of the expression if any t Result of current expression in decimal h Result of current expression in hexadecimal The pro...

Страница 30: ...ght 470 IF x 1 1 ENDPROC 480 x x l PROChilite ENDPROC 490 500 DEF PROCup 510 IF ptr 0 ENDPROC 520 CLS ptr ptr l PROCnewline ENDPROC 530 540 DEF PROCdown 550 IF ptr max ENDPROC 5 60 CLS ptr ptr l PROCn...

Страница 31: ...060 1070 DEF PROCshowacc 1080 t STR tot tot STRING 14 LEN t CHR 32 t 1090 PROCwinacc CLS PRINT CHR 17 tot CHR 18 1100 ENDPROC 1110 1120 DEF FNcarry o e 1130 IF o 42 THEN tot EVAL e 1140 IF o 43 THEN t...

Страница 32: ...with a command such as PRINT CHR 12 will usually have a quite unexpected effect unless of course that was your intention in this case the screen would be cleared exactly as if you had typed a CLS comm...

Страница 33: ...er itself hexadecimal ASCII code To see another 64 codes press Down and the screen will be redrawn with the next page of characters Press Up to go back to the previous page and Stop to exit the progra...

Страница 34: ...conventional width for hex characters which is two characters for eight bit numbers three once the ampersand is added to the front 230 Prints dec at the correct column position which is x 10 as each...

Страница 35: ...x The current column 0 7 y The current row 0 7 The program 10 REM Programmers ASCII Chart 20 30 ON ERROR GOTO 290 40 PROCsetup REPEAT PROCkeys UNTIL FALSE 50 60 CLS 70 DEF PROCsetup 80 page 0 PROCpage...

Страница 36: ...ful string slicing functions demonstrated albeit to a very small degree but some of the basic rules of simulating natural language on a computer are presented in an approachable fashion Feel free to e...

Страница 37: ...190 Begins the picture drawing FOR NEXT loops y is controlled by the outer loop within which a single string s is read from the picture DATA x is controlled by the inner loop within which each charac...

Страница 38: ...p key If the error was caused by something else or if AUTO isn t on your Notepad a full error report is displayed After the error report the Notepad will be left in BBC Basic so this message is displa...

Страница 39: ...of data and store the data Functions and procedures in that location PROCsetup Dimensions the three word arrays reads in all the words calls PROCcard to draw the card the Chinese gentleman and the sta...

Страница 40: ...NT TAB 27 6 Press SPACE for further enlightenment 220 CALL scrn_to_disk ENDPROC 230 240 DEF PROCdot 250 PLOT 69 x 78 56 y ENDPROC 260 270 DEF PROCproverb 280 CLS adj adj RND max l obj obj RND max 1 su...

Страница 41: ...OOOO0OOOOOOOOIOOOOOOOOO viva IIIITTTTITITTIIITIIIIIIIITIIITIIIITIIIIIIIITIIII VIVO 0I00O00O00O0OOO0O00000000O0O000000000000000O0OIO viva 00IIIIIIIIIIIIIIIITITIIIIIITIIIIII00000000000I00 VIVO oootooooo...

Страница 42: ...H CTC OfrU OEM OIH I3H OOfrl 0 IH ai 06EI 6 15 IH TI 08ET Tiuoaj o 3T 0Z ET uiusdoj 09 EI eureuBXTj iH CTC OSEI _ OfrET sfp uioji ujos OEEI 03ET asoioj jt OIEI 3 ooiq noj TTVO 00 EI 00015 03 Q1 0631 0...

Страница 43: ...ee vertical poles to another one at a time but the stack is built from rings of different sizes and at no time during the game may any ring be placed on top of one that is smaller It s not hard to wor...

Страница 44: ...the end pole For example if you wanted to move a ring from pole 1 to pole 2 just push 1 followed by 2 There is no need to press Return to enter your choice the keys are read instantly as you push the...

Страница 45: ...from the main menu When you ve finished reading press Space to return to the menu HOW IT WORKS 30 Points the Basic error handler to Devil s own error handling routine at line 2510 Resets all windows...

Страница 46: ...heck poles 2 and 3 to see if a complete stack has been built by comparing stack pole with tiers If equal return TRUE If not return FALSE Print a Quit YIN prompt and return TRUE if Y is pressed or FALS...

Страница 47: ...he value of legal 1130 Returns FALSE if the end pole selected was in fact the start pole 1 140 Returns FALSE if the start ring is larger than the top most ring on the end pole 1150 Returns TRUE becaus...

Страница 48: ...1 1470 1480 End the inner and outer loop before returning 1510 1540 Display the automatic solution menu and prompt for a key press 1550 Reads the keyboard until A M or Q is pressed 1560 Returns if Q...

Страница 49: ...tepad a full error report is displayed 2550 After the error report the Notepad will be left in BBC Basic so this message is displayed to remind users of how to return to the Notepad main menu 2580 Sta...

Страница 50: ...PROCtiers PROCplay PROCdrawstack PROCrules PROCwinl PROCwin2 PROCwin3 PROCgetO PROCputO PROCscore procedures Sets up the main variables and draws the playing screen Calls PROCchinese four times to di...

Страница 51: ...turning FALSE if the latter or TRUE if any of the former Returns FALSE if the selected start pole is illegal for any reason Returns FALSE if the selected end pole is illegal for any reason Returns the...

Страница 52: ...290 PRINT TAB 8 3 VDU 40 17 67 18 41 PRINT hange the number of Tiers 300 PRINT TAB 8 4 VDU 40 17 80 18 41 PRINT lay the computer s solution 310 PRINT TAB 8 5 VDU 40 17 82 18 41 PRINT ead the Rules of...

Страница 53: ...830 840 DEF PROCwin2 850 VDU 28 64 5 78 1 ENDPROC 860 870 DEF PROCwin3 880 VDU 28 64 6 78 6 ENDPROC 890 900 DEF FNmove 910 PROCwin3 CLS VDU 17 PRINT TAB 1 0 From 920 REPEAT start FNkey IF start FALSE...

Страница 54: ...ia ooaaaNa I8 6 ai 0991 I8 6 HO LL HO S9 HIW EZZ ONV 133 IVadSH OSSI apow IPnuPW ut sbaoui aOVaS 5 OBq Pid s ttiB 9 0 HVI INIHa 0 SI c oBqABid IHnuH iNIHa ifr 8I Z Z Z I 0fr 2E O OA 0E9I oT o 11imHa i...

Страница 55: ...viva oooiiooooooiiooo viva oooiiiiiiiiiiooo viva oooiiooooooiiooo viva oooiiiiiiiiiiooo viva oooiiooiioooooii viva iiiiiiiiiiiiiiio viva oioooiiooooiiooo viva X snopqv JS OBJBqo eseuxqo W3H 0000000110...

Страница 56: ...j 009 Z SY8H5 nouedoj 06 SZ eiquiessPOOHd aaa 08SZ 0Z SZ QUIZ 09 SZ nuew ut W p da ON jloj x uoj ouna ssaaa IKIHa iNIHa 0SSZ THa BUTT IKIHa iHOdaa OfrSZ Oin V NI tfH3 N3HJi Z T HH3 l SrlD 9Z HOA 0ESZ...

Страница 57: ...A 3240 OUT 13 A 3250 RET 3260 3270 filename 3280 3290 DEFM DEVIL SCN DEFB 0 3300 3310 flag 3320 3330 DEFB 0 3340 3350 state 3360 3370 DEFB 0 3380 3390 NEXT 3400 ENDPROC FOOD BAS Food Additive Guide hl...

Страница 58: ...ps considered to be most sensitive to or even at risk from these effects But when using Food please bear in mind that the information and advice given is gleaned from the various consumer guides avail...

Страница 59: ...information about it will also know whether the additive is officially recognised by the EEC and if so will print an E before it When you have read the card press Space to return to the input screen w...

Страница 60: ...fectsS group and warn before searching the database Stores the additive number as a string in numS Sets afound flag f to FALSE and starts a FOR NEXT loop with a as the loop counter to search the datab...

Страница 61: ...uter loop before returning List the name and notes for each additive category recognised by the program to be read into cat List the special case database of additives to be read into enum Each entry...

Страница 62: ...in a currently established band Main variables and arrays max The number of additives in the special case database cat 0 Holds the category name and notes for each currently established band of additi...

Страница 63: ...0 240 e VAL RIGHT e LEN e i VDU 26 legal FNlegal e 250 IF NOT legal PRINT TAB 19 7 Sorry not a valid Number 260 IF NOT legal PRINT press SPACE REPEAT UNTIL GET 32 270 IF NOT legal PRINT TAB 19 7 SPC 4...

Страница 64: ...the handling properties of foods especially packet mixes 860 DATA Miscellaneous Additive 870 DATA Part of the firming gelling and anti caking agent group 880 DATA Flavour Enhancer 890 DATA Works by in...

Страница 65: ...a uT spooj ux peq puaad on VIVO OEM suon viva OZfrl OIH suox xpuoo ipxoeds W3H 00M 06ET s usx Bd a 9q ao puB Aeupxx VIVO 08ET saxBaaxiB q xM sxdoe viva 0Z ET axdoad eAx xsues uxjxdsp ox puiq sv VIVO 0...

Страница 66: ...II OIIOOOII OOIOOOIO 000III00 0SZ I O4Z 1 viva OOOIIIOO OOIOOOIO OIIOOOII OIIOOOII 00000011 06Z I viva OOOIIIII OOIOOOII OIIOOOII OIIOOOII 0TI000II OLLT viva OIIOOOII OIIOOOII OOIOOOIO 000III00 09Z I...

Страница 67: ...d prompt the user Dimensions A ready to store the machine code Assembles the machine code into A Calls the machine code Assigns F the value returned by extracting the two byte value that has been plac...

Страница 68: ...0 PRINT PRINT Press any key combinations or Stop to end 40 DIM A 100 50 PROCassemble 60 CALL inkey 70 F buffer 0 buffer l IF F 0 THEN GOTO 60 80 VDO 31 0 6 PRINT Th value is P 90 GOTO 60 100 DEF PROCa...

Страница 69: ...rest rates remain static throughout the enure period of the loan If interest rates are currently fairly high 15 or fairly low 5 it might be an idea to adjust the rate to take an educated guess for fut...

Страница 70: ...les amount The amount of the loan rate The interest rate payment The monthly repayment year The current year The program 10 REM Mortgage Loan Calculator 20 30 CLS 40 ON ERROR GOTO 220 50 PRINT Mortgag...

Страница 71: ...EC BAS is a program that allows you to do just this It s based on the more complex program CALC BAS and even borrows some of the same procedures but it s a lot shorter and simpler to use and understan...

Страница 72: ...is added on Now press Up a few times watching as your previous entries scroll back into view Note the lines turning bold one by one as they pass through the bottom line of the Input window Stop at an...

Страница 73: ...red Dimensions the calculation storage array calls PROCclear to print a 0 in the Total window and tells Basic to display all numbers to 10 significant figures the maximum Runs through A 0 setting all...

Страница 74: ...isn t already at maximum length 700 720 Remove character to left of current character from e unless at start of e 750 770 Remove current character from e unless at end of e 800 820 Truncate e at the...

Страница 75: ...ays a full error report After the error report the Notepad will be left in BBC Basic so this message is displayed to remind users of how to return to the Notepad main menu procedures Draws the screen...

Страница 76: ...DRAW 0 57 DRAW 0 6 90 MOVE 364 6 DRAW 452 6 DRAW 452 18 DRAW 364 18 DRAW 364 6 100 PRINT TAB 60 1 CHR 17 Ready Reconciler CHR 18 110 PRINT TAB 66 4 TOTAL PROCwinlist 120 PRINT TAB 21 0 CHR 17 CHR 19...

Страница 77: ...ROCwinin PROChilite ENDPROC 630 640 DEF PROCinsert 650 IF 1 54 ENDPROC 660 e LEFT e x l CHR key RIGHT e l l x 670 1 1 1 x x l PROChilite ENDPROC 680 690 DEF PROCdell 700 IF x l ENDPROC 710 e LEFT e x...

Страница 78: ...5 US Go 1 1 ons SCALES BAS stay conversant with conversions It s often useful to convert figures from one unit of measurement to another and by now most of us know the old trick of multiplying inches...

Страница 79: ...elow this is the result going the other way that is from unit B to unit A To take the example of converting from inches to centimetres which is at the top of the list when you first run the program a...

Страница 80: ...ad the keyboard until Return is pressed checking for the Up and Down keys and calling the relevant scroll routine if either is pressed and the pointer is able to move in that direction Un inverses the...

Страница 81: ...d 128 and chopped by one or two characters respectively If the number pointed to a real lexicon entry and was not zero denoting no word it is joined to p and a space is added unless it is the last of...

Страница 82: ...lex Holds the lexicon of words from which the units of measurement names are built table Holds the text of the conversion table scale Holds the conversion factors for all units of measurement pairs l...

Страница 83: ...utput ENDPROC 340 350 DEF PROCscroll_down 3 60 PROChighlight scale scale l row row l 370 IF row 4 row 3 PROCwin3 VDU 31 0 3 10 PRINT table scale 380 PROChighlight PROCoutput ENDPROC 390 400 DEF PROCsc...

Страница 84: ...0 0 I 03 YIYCI 0801 Z fr0 00 0 0 0 frl 61 0 0 0 9 VIVO OLOZ 989 0 0 0 0 0 S 0 0 0 9 VIVO 0901 98 9 0 0 0 6T 6T 0 0 0 9 Viva 0S0I 6668S 3 0 0 H 6I 0 0 fr 61 VIVO 0 01 9E8 0 0 0 ET 6T 0 0 E 6T YlVd OEO...

Страница 85: ...Basic as opposed to machine code and it gets there in the end As a fully working seriously written program Style serves as a good example of just what you can do with the much maligned Basic language...

Страница 86: ...bust of Shakespeare the Main Menu will appear Press A to analyse a new document and the Notepad File Selector window will appear Choose the document you want to analyse and press Return and it will b...

Страница 87: ...various thresholds used during analysis Dimension the comment arrays and read in all the style comments Dimension the passive and hidden verb arrays and read in the passive verb partners and hidden v...

Страница 88: ...SE 1020 1040 Calculate the Fog Index and the Flesch Kincaid Index for the document just analysed 1080 1110 Calculate the percentage of sentences in which each of the four style errors occurred 1150 12...

Страница 89: ...ame or a null string if Stop was pressed 2550 2780 Assemble machine code that will call the Notepad file selector 2800 Points the Basic error handler to a full error report in the event of a further e...

Страница 90: ...successful loading set the contents of flag to 1 then return Save the current status of the bank switcher for block 4 C000 FFFF Map the video RAM into main RAM then return Restore the state of the ba...

Страница 91: ...pressed Returns the next word from the file Returns TRUE if the passed character is a letter Returns TRUE if the passed character is an end of sentence marker Returns the number of syllables in the p...

Страница 92: ...50 senlimit 40 90A 160 DIM style 4 structures 4 clarity 4 impact 4 RESTORE 2190 170 FOR s 0 TO 4 READ style s NEXT FOR s 0 TO 4 READ structure s NEXT 180 FOR s 0 TO 4 READ clarity s NEXT FOR s 0 TO 4...

Страница 93: ...g 81 730 IF g 65 PROCanalyse ENDPROC 740 IF g 67 PROCcomment ENDPROC 750 IF g 84 PROCadvice ENDPROC 760 IF FNsure Quit Style Master quit TRUE 770 ENDPROC 780 790 DEF PROCanalyse 800 PROCwin2 IF doc T...

Страница 94: ...Ha A 08ET ooHdaNa ai olzt pio xoeqooona aaa 09 ex OSET DOHdONa OfrET 3S1Ya JAd o 8fuduoo 0 aadpaHq o uaiuaa as1Yd 90 OEEI ues 9UD0Hd aaa ozei OIET 3S1VJ OOET anni Nam E9 o ho 9 ho ee ai 06ZI o puasTNa...

Страница 95: ...8 0 CHR 17 1910 PRINT Golden Rules for Good Writing CHR 18 1920 PRINT Use simple words even in serious writing 1930 PRINT Avoid abstract words and clever jargon 1940 PRINT Keep your style alive avoid...

Страница 96: ...follow 2360 DATA Quite obscure 2370 DATA Incomprehensible 2380 2390 REM Impact 2400 DATA Very punchy 2410 DATA Fairly high 2420 DATA Quite low key 2430 DATA Barely measurable 2440 DATA Nonexistant 24...

Страница 97: ...2970 2980 scrn_to_disk 2990 3000 CALL map_scrn_in 3010 LD HL F000 3020 LD DE fi8000 3030 LD BC 1000 3040 LDIR 3050 CALL map_scrn_out 3060 LD HL filename 3070 CALL fopenout 3080 RET NC 3090 LD HL 8000...

Страница 98: ...ROC TIMEZONE BAS World Clock World Time Zones Use Cur 5o Keys London Thu 16 10 271 Home T i mezone GMT B Hrs TIMEZONE AS goodness is that the time World clocks of one kind or another are included with...

Страница 99: ...n the right of the screen is the status window showing the current time zone This is always London when you first run the program though it s easily changed Below this is the time in that zone and ini...

Страница 100: ...e loop Read the keyboard checking for fLeft Right and Returnl Call PROCprevzone PROCnextzone or PROChomezone respectively If at least one second has elapsed since the last time this line was visited r...

Страница 101: ...ments the day of the week wrapping to the first day of the week if necessary Converts the new day number to a name Constructs the string that holds the time for the current zone from the day of the we...

Страница 102: ...the first time and loads it in each time thereafter 2250 Start of procedure that assembles the screen saver loader which saves a copy of the screen after everything is drawn the first time and loads...

Страница 103: ...at location procedures Dimensions the arrays draws the screen boxes the globe and prints static text Displays data for the home time zone and calls PROCscankeys in an infinite loop Reads the keyboard...

Страница 104: ...gmt Time zone offset from Greenwich Mean Time day The current day of the week in the home time zone hour The current hour of the day in the home time zone mins The current minute secs The current seco...

Страница 105: ...Cprevzone 420 PROCcrosshair zone zone l IF zone 0 zone 24 430 PROCshowzone 440 ENDPROC 450 460 DEF PROCnextzone 470 PROCcrosshair zone zone l IF zone 25 zone l 480 PROCshowzone 490 ENDPROC 500 510 DEF...

Страница 106: ...x xm y ym 1030 NEXT ENDPROC 1040 1050 DEF PROCamerica 1060 RESTORE 1720 PROCisland 1070 PLOT 69 l xm 25 ym 1080 PLOT 69 2 xm 24 ym 1090 ENDPROC 1100 1110 DEF PROCafrica 1120 RESTORE 1780 PROCisland 1...

Страница 107: ...T 6Z VIVO 0frZ T EE IE SE 6Z Z E SZ SE 9Z EE frZ 9E OZ Ot EZ 6E SI Tfr 6 6E Z 0 S 6E 0 VIVO 0EZ T Efr VIVO 0ZZ T BOTjeuiY q nos pup q aoN W3H 0TZ T uns 5 S T nill p M eni uow VIVO 00Z T sApa s M W3H...

Страница 108: ...E 16 IE 26 OE Z6 82 68 6Z 68 OE 16 IE 16 YIYd OIIZ 9 YiYa ooiz und r waa 060Z V 96 I Z6 Z Z6 fr S6 Z 96 YIYd 080Z YIYd 0Z 0Z pu T ez N WZH 090Z Z 8 8 S8 6 98 6 Z 8 8 88 8 68 9 06 9 Z6 8 6 01 6 ZI Z6 H...

Страница 109: ...610 2620 froml 2630 2640 LD HL 8000 2650 LD BC 1000 2660 CALL finblock 2670 CALL fclose 2680 CALL map_scrn_in 2690 LD HL 8000 2700 LD DE F000 2710 LD BCfilOOO 2720 LDIR 2730 CALL map_scrn_out 2740 LD...

Страница 110: ...programs such as COOKIE BAS or TIMEZONE BAS to page a selected ROM in rather than the video RAM and save a copy to disk ready for disassembly Note that if you do disassemble parts of the ROMs you may...

Страница 111: ...Incidentally the reason Zap reads its input from a file is because the program is rather large and being in BBC Basic it would not be easy to allow it to disassemble from ANY RAM address in ANY RAM or...

Страница 112: ...sterisks in the original with the passed values which are the actual opcodes 1120 1320 Print the values of opcodes 1 2 3 and 4 in hexadecimal 1340 1440 Read the opcodes and mnemonic data into the arra...

Страница 113: ...l text data and converts to a number FNselect Prompts the user for a file using the File selector Main variables and arrays start The ORG address of the code being disassembled one Number of one byte...

Страница 114: ...yte is read in while oldstart retains the correct address of the start of the current opcode J Opcode one Also used as a temporary loop counter during initialisation K Opcode two if there is one L Opc...

Страница 115: ...rb d3 fourc dl foura d2 fourb d3 fourc 150 DIM dla oura d2a fourb d3a fourc d3b fourc 160 170 PROCassemble 180 PROCread_data 190 file FNselect IF file THEN END 200 I 0 PRINT Disassembling file PRINT I...

Страница 116: ...aea 700 FOR X 0 TO threea l 710 IF J cl X THEN PROCj PROCk PROCl PRINT SPC 3 PROCnuiemon clS X 1 K L fil00 0 4 VDU 27 J 27 K 27 L chk l 720 NEXT 730 chk 740 750 DEF FNchk_threeb 760 FOR X 0 TO threeb...

Страница 117: ...Z 1210 PRINT Z 1220 ENDPROC 1230 1240 DEF PROC1 1250 Z STR L IF L 16 THEN Z 0 Z 1260 PRINT Z 1270 ENDPROC 1280 1290 DEF PROCm 1300 Z STR M IF M 16 THEN Z 0 Z 1310 PRINT Z 1320 ENDPROC 1330 1340 DEF PR...

Страница 118: ...VIVO 0fr6I a oaa so viva 0E6i a oNi fro viva 0Z6I OH ONI EO VIVO 016 I v oa arr zo viva oo6i aoN oo viva 0681 0881 a Xq axBufs W3a 0Z 8I 0981 soxuouiauui pus sepoo uoponj sui W3H 0S8I 0fr8I OOHdONa 0E...

Страница 119: ...B A 2390 DATA 48 LD C B 2400 DATA 49 LD C C 2410 DATA 4A LD C D 2420 DATA 4B LD C E 2430 DATA 4C LD C H 2440 DATA 4D LD C L 2450 DATA 4E LD C HL 2460 DATA 4F LD C A 2470 DATA 50 LD D B 2480 DATA 51 L...

Страница 120: ...Y 099Z YIYd 48 aaY H Y OO30 YIYd S8 aaY TY OTOE YIYd 98 aaY TO Y OZOE YIYd LB aaY Y Y OEOE YIYd 88 DOY a Y O4OE YIYd 68 DOY D Y OSOE YIYd Y8 DQY a v 060E YIYd 38 DOY a Y OZ OE YIYd D8 DQY H Y 080E YIY...

Страница 121: ...DATA BF CP A 3590 DATA CO RET NZ 3600 DATA CI POP BC 3610 DATA C5 PUSH BC 3620 DATA C7 RST 00 3630 DATA C8 RET Z 3640 DATA C9 RET 3650 DATA CF RST 08 3660 DATA DO RET NC 3670 DATA Dl POP DE 3680 DATA...

Страница 122: ...0 DATA CB 22 4290 DATA CB 23 4300 DATA CB 24 4310 DATA CB 25 4320 DATA CB 26 4330 DATA CB 27 4340 DATA CB 28 4350 DATA CB 29 4360 DATA CB 2A 4370 DATA CB 2B 4380 DATA CB 2C 4390 DATA CB 2D 4400 DATA C...

Страница 123: ...CB 5D BIT 3 L 4800 DATA CB 5E BIT 3 HL 4810 DATA CB 5F BIT 3 A 4820 DATA CB 60 BIT 4 B 4830 DATA CB 61 BIT 4 C 4840 DATA CB 62 BIT 4 D 4850 DATA CB 63 BIT 4 B 4860 DATA CB 64 BIT 4 H 4870 DATA CB 65...

Страница 124: ...A CB 99 RES 3 C 5400 DATA CB 9A RES 3 D 5410 DATA CB 9B RES 3 1 5420 DATA CB 9C RES 3 H 5430 DATA CB 9D RES 3 L 5440 DATA CB 9E RES 3 HL 5450 DATA CB 9F RES 3 A 5460 DATA CB AO RES 4 B 5470 DATA CB Al...

Страница 125: ...A CB D5 SET 2 L 6000 DATA CB D6 SET 2 HL 6010 DATA CB D7 SET 2 A 6020 DATA CB D8 SET 3 B 6030 DATA CB D9 SET 3 C 6040 DATA CB DA SET 3 D 6050 DATA CB DB SET 3 E 6060 DATA CB DC SET 3 H 6070 DATA CB DD...

Страница 126: ...D 46 IM 0 6590 DATA ED 47 LD I A 6600 DATA ED 48 IN C C 6610 DATA ED 49 OUT C C 6620 DATA ED 4A ADC HL BC 6630 DATA ED 4D RETI 6640 DATA ED 4F LD R A 6650 DATA ED 50 IN D C 6660 DATA ED 51 OUT C D 667...

Страница 127: ...F9 LD SP IY 7140 7150 REM Two byte n 7160 7170 DATA 06 LD B 7180 DATA 0E LD C 7190 DATA 16 LD D 7200 DATA IE LD E 7210 DATA 26 LD H 7220 DATA 2E LD L 7230 DATA 36 LD HL 7240 DATA 3E LD A 7250 DATA C6...

Страница 128: ...E IX 7820 DATA DD 66 LD H IX 7830 DATA DD 6E LD L IX 7840 DATA DD 70 LD IX B 7850 DATA DD 71 LD IX C 7860 DATA DD 72 LD IX D 7870 DATA DD 73 LD IX E 7880 DATA DD 74 LD IX H 7890 DATA DD 75 LD IX L 79...

Страница 129: ...DATA FD 2A LD IY 8440 8450 REM Four byte IX IY n 8460 8470 DATA DD CB 06 RLC IX 8480 DATA DD CB 0E RRC IX 8490 DATA DD CB 16 RL IX 8500 DATA DD CB 1E RR IX 8510 DATA DD CB 26 SLA IX 8520 DATA DD CB 2E...

Страница 130: ...2 IY 8880 DATA FD CB 5E BIT 3 IY 8890 DATA FD CB 66 BIT 4 IY 8900 DATA FD CB 6E BIT 5 IY 8910 DATA FD CB 76 BIT 6 IY 8920 DATA FD CB 7E BIT 7 IY 8930 DATA FD CB 86 RES 0 IY 8940 DATA FD CB 8E RES 1 I...

Страница 131: ...SECTION 2 REFERENCE...

Страница 132: ...in your BBC Basic programs using the Notepad s built in wordprocessor So for example to enter a program called PROGRAM BAS press Function Word followed by Word then enter the file name PROGRAM TXT and...

Страница 133: ...ing off You can now re enter the wordprocessor by pressing Function Word followed by Calc and then selecting the file PROGRAM TXT for editing This technique may also be useful if you are using one of...

Страница 134: ...s are reported or not If the bit is set then yes otherwise no The OPT statement can only occur inside the square brackets which signify the use of assembler directives If labels are used in your assem...

Страница 135: ...K of a RAM card but actually only store the code in a safe area of ram at 6000 9FFF A procedure to do just that might look like this 1000 DEF PROC assemble 1010 FOR PASS 4 TO 7 STEP 3 1020 P C000 O 60...

Страница 136: ...ple you could print a single character to the screen with the call TXTOUTPUT B833 using the following two commands A ASC CALL SB833 In addition BBC Basic returns the contents of these registers to the...

Страница 137: ...cannot be fitted into a field it reverts to the G format The decimal points are aligned vertically making this format particularly useful for printing tables This controls the total number of digits p...

Страница 138: ...ears to be offering you the equivalent of EDIT 10 50 which means edit lines 10 to 50 inclusive placing them all in the edit buffer but with a slight change of syntax making the command mean EDIT short...

Страница 139: ...Menu followed by the down cursor key twice and the right cursor key once to set the display format of dd mm yy Now you re ready to transfer your files so press Function L to list the files select the...

Страница 140: ...rsor key for example to use an asterisk press Shift Control C and then press a key such as then when you next draw lines they will be made up of asterisks When you have finished as advised in the manu...

Страница 141: ...you have a diary entry set for the 1st of July 1994 you would see the file name oOl_07_1994 In fact a separate file is created for each and every day you enter in your diary To make the files invisibl...

Страница 142: ...3 81 F3 C3 CI F3 C3 33 F3 21 00 02 36 0fl 2C uSf M Ksi SBr 4030 36 09 2C OF 77 2C 20 FC 3E 37 32 FE A2 21 76 C0 60 u f 72i6 vL 4040 22 EE R2 CD CI F0 ED 53 E4 R2 22 DC R2 CD E7 C7 6 SZ6 9 r 4050 C2 D3...

Страница 143: ...r they are all functioning Next all the characters in the character set are displayed Next you see the value of the Memory Battery Status byte the Real Time Clock and then the 12 internal ROMs are che...

Страница 144: ...4 096 bytes of screen memory are saved to the file Knowing this you can write your own programs to dump these screens to a printer or even convert them to industry standard PCX or TIFF files But follo...

Страница 145: ...T handlein 250 NEXT 260 FOR N 1 TO 4 270 D BGET handlein 280 NEXT 290 NEXT 300 CLOSE handlein 310 CLOSE handleout 320 GOTO 80 330 340 REM PCX header block 350 360 DATA SA 5 1 1 0 0 0 0 DF 1 3F 0 0 0 0...

Страница 146: ...e SO FOR J 1 TO 128 60 READ B J 70 NEXT 80 PRINT GRAB2PCX BAS Press any key for the File Selector G GET 90 file FNselect IF file THEN CLS END 100 IF LEFT file 2 s THEN PRINT Not a screen grab GOTO 80...

Страница 147: ...andleout C1 640 BPUT handleout fiFF 650 NEXT 660 NEXT 670 CLOSE handleln 680 CLOSE handleout 690 GOTO 90 700 710 REM PCX header block 720 730 DATA fiA 5 1 1 0 0 0 0 SEF 1 fi4F 0 0 0 0 0 740 DATA 0 0 0...

Страница 148: ...t Non screen dumps will be displayed as garbage 10 ON ERROR GOTO 90 20 VDU 26 CLS DIM Z 80 PROCassemble 30 PRINT GRABDISP 40 PRINT Press a key to select a screen grab to display G GET 50 CALL getfile...

Страница 149: ...map_scrn_in 510 520 LD A B003 530 LD state A 540 LD A 67 550 LD B003 A 560 OUT 13 A 570 RET 580 590 map_scrn_out 600 610 LD A state 620 LD B003 A 630 OUT 13 A 640 RET 650 660 flag 670 680 DEFB 0 690 7...

Страница 150: ...0 0 0 Oxff Oxff Oxff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0x3c 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

Страница 151: ...xtremely fast include stdio h include stdlib h include dos h char data 128 0x0a 5 l l 0 0 0 0 0xef l 0x4f 0 0 0 0 0 0 0 0 Oxff Oxff Oxff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

Страница 152: ...fpout fputc Oxff fpout for k 0 k 6 Jc fputc Oxcl fpout fputc OxcO fpout for j 0 j 60 j fputc Oxcl fpout fputc 0x00 fpout fputc Oxcl fpout fputc 0x03 fpout for Jc 0 k 64 k fputc Oxcl fpout fputc OxcO f...

Страница 153: ...back to your Notepad or perhaps convert it to the bordered PCX format It s also useful if you happen to have deleted your original S files include stdio h include stdllb h include dos h char data 128...

Страница 154: ...2 wb if fpout NULL printf nCannot create file s argv 2 exit 0 fseek fpin 128L 0 offset 0 for count 0 count 3840 byte fgetc fpin if byte OxcO OxcO len byte 0x3f val fgetc fpin for n 0 n len n fputc va...

Страница 155: ...the BBC Basic assembler s Offset assembly facility which will allow you to write code that is assembled as if it were at C000 but actually places the code elsewhere so that you can save it to a RAM ca...

Страница 156: ...llow events For example either exit when Stop is pressed or check for a yellow event with KMGETYELLOW and return if the carry flag is set Serious developers may be interested in contacting Ranger Comp...

Страница 157: ...ing the correct OUT statement to ports 10 13 Like this LD A 67 This signifies the screen ram block OUT 10 A for 0000 or OUT fill A for S4000 or OUT 12 A for 8000 or OUT 13 A for fiCOOO However it is s...

Страница 158: ...en X Y location on the screen you have to perform the following steps Save the old memory block Map in the video memory Multiply the Y pixel address 0 to 63 by 64 Add on the X byte address 0 to 60 OR...

Страница 159: ...0 410 SCF 420 430 power 440 450 RRA 460 DJNZ power 470 PUSH AF 480 490 Divide DE by 8 to get pixel address 500 510 SRL D 520 RR E 530 SRL D 540 RR E 550 SRL D 560 RR E 570 580 Add on X address to sta...

Страница 160: ...This moves the pixel to be set to the correct location The RRA command moves all the bits in A to the right at the same time placing the contents of the carry flag in bit 7 on the left and the content...

Страница 161: ...up code PLS spell checking code The NClOO s memory map You will not often need to make use of the Input Output ports on the Notepad but all the details you need are here for when you do including mapp...

Страница 162: ...210 76543210 Pixel No 00000000 00111111 11112222 01234567 89012345 67890123 Character No 0 0 0 0 for 1 row 0 1 2 3 This continues on for subsequent lines For example the second line is the range of by...

Страница 163: ...hich is the fourth 16K of internal RAM into the fourth 16K of mapped RAM so that the processor sees it between C000 and FFFF you would output the value 43 67 decimal to port 13 Here is a broad overvie...

Страница 164: ...l data is set to 1 If programming the UART direcdy ensure that TxD clock is operating xl6 40 WRITE ONLY PARALLEL INTERFACE DATA The byte written here is latched into the parallel port output register...

Страница 165: ...WER OFF CONTROL bit 0 1 no effect 0 power off bits 1 7 Not Used On reset this is set to 1 90 READ WRITE IRQ STATUS bit 0 Rx Ready interrupt bit 1 Tx Ready interrupt bit 2 ACK from parallel interface b...

Страница 166: ...leared automatically and the next scan cycle will start from B0 C0 READ WRITE UART CONTROL DATA C0 UART data register C1 UART status control register The UART is the NEC uPD71051 Programmers are advis...

Страница 167: ...o be preserved as they are used as scratch registers in time critical routines To use any one of these routines just load the registers as described and then call the relevant address Although the run...

Страница 168: ...character 176 Other bits must be set to zero Exit conditions c 0 z l Stop pressed c l z l Empty string input c l z 0 At least one character entered HL Preserved BC Last key token or 1 if Stop used to...

Страница 169: ...fficient room in the buffer The buffer size is user configurable KMSETTICKCOUNT B80C Action Enables the ticker event There are 100 ticks per second When a ticker event occurs a special value of 941 is...

Страница 170: ...minate HL Preserved TESTESCAPE B815 Action Tests whether an Escape key has been pressed either Stop or Function It waits for a key if one is found in the keyboard buffer Entry conditions None Exit con...

Страница 171: ...ved TEXTOUT B81E Action Displays a string Entry conditions HL Pointer to a zero terminated string WARNING HL must not point into an upper ROM Exit conditions All registers preserved TEXTOUTCOUNT B821...

Страница 172: ...s None Exit conditions All registers preserved TXTCURON B82A Action Displays the cursor on the screen Entry conditions None Exit conditions All registers preserved TXTGETCURSOR B82D Action Returns the...

Страница 173: ...Action Displays a character or acts on a control code Entry conditions A character A 7 Beep A 10 Line Feed A 13 Carriage Return All other values are displayed as a character the same as the PC charac...

Страница 174: ...acted upon Entry conditions A Character All values are displayed as per the PC character set Exit conditions All registers preserved TXTBOLDOFF B83F Action Resets the bold attribute The next time tex...

Страница 175: ...to the screen it will be with this attribute Entry conditions None Exit conditions All registers preserved TXTUNDERLINEOFF B84B Action Resets the underline attribute The next time text is written to...

Страница 176: ...l Successful c 0 Not sent A Preserved MCREADYPRINTER B854 Action Tests whether the printer is ready Entry conditions None Exit conditions c 0 Busy c l Ready A Preserved MCSETPRINTER B857 Action Sets t...

Страница 177: ...conditions All registers preserved PADINSERIAL B85D Action Reads a character from the serial port Entry conditions None Exit conditions c l Successful A character c 0 No character read PADOUTPARALLEL...

Страница 178: ...onditions c 0 Busy c l Ready A Preserved PADREADYSERIAL B869 Action Tests whether the serial port is ready Entry conditions None Exit conditions c 0 Busy c l Ready A Preserved PADRESETSERIAL B86C Turn...

Страница 179: ...Action Returns the address of a four byte 100Hz ticker Entry conditions None Exit conditions HL The address of the least significant byte first of four PADGETTIME B875 Action Reads the time and date f...

Страница 180: ...ers preserved PADSETTIME B87B Action Sets the Real Time Clock date and time Entry conditions HL Points to a seven byte data area byte 0 year low byte 1 year high byte 2 month byte 3 date byte 4 hour b...

Страница 181: ...be called each time the memory block is used as it may have moved HEAPFREE B884 Action Frees a block of memory Entry conditions DE Memory handle returned by HEAPALLOC B881 or HEAPREALLOC B88D Exit con...

Страница 182: ...for memory block Exit conditions HL 0 Failed The old block will not be freed but could have moved HLoO Successful NOTE If the block is being expanded it must be assumed that the base of the memory blo...

Страница 183: ...HL Buffer BC Number of bytes to read greater than 0 Exit conditions c l End of file not reached c 0 Eof or error BC Number of bytes read HL Address after last byte read FINCHAR B899 Action Reads a by...

Страница 184: ...ze in bytes low high FINDNEXT B89F Action Finds the next file FINDFIRST B89C must have been called first Entry conditions None Exit conditions HL 0 No more files HLoO HL returns info as with FINDFIRST...

Страница 185: ...Points to zero terminated filename Exit conditions c l Successful DE file handle c 0 File not found DE Corrupt A Corrupt Other registers preserved FOUTBLOCK B8AB Action Writes a block to a file Entry...

Страница 186: ...inated new filename Exit conditions c l Successful c 0 Error file not found FSEEK B8B4 Action Moves the file pointer to a position within a file Entry conditions DE File handle BC Offset from start of...

Страница 187: ...file has been reached Entry conditions DE File handle Exit conditions c l Noteof c 0 Eof SELECTFILE B8C3 Action Displays the file selector clearing the screen first shows all files and allows a select...

Страница 188: ...and FINDNEXT B89F Entry conditions DE Address of a 36 byte buffer which must be in common RAM 8000h BFFF Exit conditions All registers preserved MISCELLANEOUS FUNCTIONS FDATESTAMP B8C9 Action Sets a...

Страница 189: ...an easier way of editing code All BBC Basic programs are saved with the Basic attribute set If the user has not configured the NC100 to display file dates and times via the System Setting menu if a fi...

Страница 190: ...he main menu Entry conditions None Exit conditions c l BC token if a Yellow event is pending An application should exit conditions normally as quickly as possible Any unsaved files should be saved aut...

Страница 191: ...read LAPCAT_SEND B8DB Action Sends a character to the parallel port using Lapcat protocol Entry conditions A Character Exit conditions c l Successful c 0 Error PADGETVERSION B8DE Action Gets the firm...

Страница 192: ...rn known values to selected addresses and only if the correct values are returned for addresses you wish to use should you then assume they are available to you Alternatively you could contact Amstrad...

Страница 193: ...of MMU1 Copy of MMU2 Copy of MMU3 A small stack which is only used in initialisation Therefore you should be able to use this as a temporary storage area when code space is tight 1 bit per key l down...

Страница 194: ...3A7 fs_clicat 01 Non zero if Cat command not Select B3A8 fs_showsizes 01 Non zero if showing file sizes pad default off B3A9 fs_showsys 01 Non zero if showing system files B3AA fs_curfile 01 Current f...

Страница 195: ...COMMENTS A000 100 String accumulator A100 100 String input buffer A200 6C Static variables to Z A2DC 02 PAGE A2DE 02 TOP A2E0 02 LOMEM A2E2 02 Free space pointer A2E4 02 HIMEM A2E6 02 Current line num...

Страница 196: ...cumented reset facility may do so try switching off pressing Function Stop Del and switching on again while holding these keys down If it does get you out of a lock up and back into the system this re...

Страница 197: ...he data stored in the NCI00 Therefore it is very important that you first transfer any programs or documents you need to keep to another computer using the Lapcat communications lead and software It s...

Страница 198: ...dded to A and the result is stored in A ADC A B The contents of B and the carry flag are added to A and the result is stored in A ADC A C The contents of C and the carry flag are added to A and the re...

Страница 199: ...contents of A are added to H and the result is stored in A ADD A L The contents of A are added to L and the result is stored in A ADD A n The value n is added to A and the result is stored in A ADD H...

Страница 200: ...the location pointed to by IX plus displacement d is tested The Z flag returns its state BIT0 IY d Bit 0 of the contents of the location pointed to by IY plus displacement d is tested The Z flag retur...

Страница 201: ...2 H Bit 2 of H is tested The Z flag returns its state BIT 2 L Bit 2 of L is tested The Z flag returns its state BIT 3 HL Bit 3 of the contents of the location pointed to by HL is tested The Z flag re...

Страница 202: ...he Z flag returns its state BIT 5 B Bit 5 of B is tested The Z flag returns its state BIT 5 C Bit 5 of C is tested The Z flag returns its state BIT 5 D Bit 5 of D is tested The Z flag returns its stat...

Страница 203: ...nn When the routine returns using a RET it comes straight back by popping the correct return address off the stack CALL NC nn If C is not set No Carry then push the current contents of the program co...

Страница 204: ...arded The flags are then set according to the result CP B The contents of B are subtracted from A and the result is discarded The flags are then set according to the result CP C The contents of C are...

Страница 205: ...of the location pointed to by HL DEC IX d Decrement the contents of the location pointed to by IX plus displacement d DEC IY d Decrement the contents of the location pointed to by IY plus displacemen...

Страница 206: ...ad A with a byte from port n A supplies bits 8 to 15 of the port address while n provides 0 to 7 IN A C Load A with a byte from port C B must contain bits 8 to 15 of the port address while C contains...

Страница 207: ...n B is decremented and HL is incremented INIR The device addressed by C is read into the memory location pointed to by HL Then B is decremented and HL is incremented This repeats until B equals 0 JP n...

Страница 208: ...n pointed to by HL with the value stored in C LD HL D Load the location pointed to by HL with the value stored in D LD HL JE Load the location pointed to by HL with the value stored in E LD HL H Load...

Страница 209: ...LD nn BC Load the two locations pointed to by nn with the two byte value stored in BC LD nn DE Load the two locations pointed to by nn with the two byte value stored in DE LD nn HL Load the two locati...

Страница 210: ...ad B with the contents of the location pointed to by nn LD B A Load B with the contents of A LD B B Load B with the contents of B LD B C Load B with the contents of C LD B D Load B with the contents o...

Страница 211: ...h the contents of H LD D L Load D with the contents of L LD D n Load D with the value n LD E HL Load E with the contents of the location pointed to by HL LD E IX d Load E with the contents of the loca...

Страница 212: ...IX with the two byte value at location nn LD IX nn Load IX with the two byte value nn LD IY nn Load IY with the two byte value at location nn LD IY nn Load IY with the two byte value nn LD L HL Load L...

Страница 213: ...om 0 and the result is stored in A NOP Do nothing for one clock cycle OR A A is logically ORed with A and the result is stored in A OR B A is logically ORed with B and the result is stored in A OR C A...

Страница 214: ...8 to 15 after decrementing OUTI The contents of the location pointed to by HL are output to the device addressed by C Then B is decremented and HL is incremented C supplies bits 0 to 7 of the ports ad...

Страница 215: ...inted to by SP PUSH IY SP the Stack Pointer is decremented by two and the two byte contents of IY are loaded to the location now pointed to by SP Bit 0 of the location pointed to by HL is reset to 0 R...

Страница 216: ...L Bit 2 RES 3 HL Bit 3 RES 3 ax d Bit 3 toO RES 3 IY d Bit 3 toO RES 3 A Bit 3 RES 33 Bit 3 RES 3 C Bit 3 RES 3 D Bit 3 RES 3JE Bit 3 RES 3 H Bit 3 RES 3 L Bit 3 RES 4 CHL Bit 4 RES 4 ax d Bit 4 to 0...

Страница 217: ...is reset toO RES 6 aY d Bit 6 of the location pointed to by IY plus displacement d is reset toO RES 6 A Bit 6 of A is reset to 0 RES 6 B Bit 6 of B is reset to 0 RES 6 C Bit 6 of C is reset to 0 RES 6...

Страница 218: ...the new address RETI This is the same as RET but must be used when returning from an interrupt to properly handle nested interrupts You must execute and EI before issuing a RET RETN This is the same a...

Страница 219: ...ts of bit 7 is placed in the Carry flag and also bit 0 RLC IX d The contents of the location pointed to by IX plus displacement d is rotated left by one bit The original contents of bit 7 is placed in...

Страница 220: ...ht by one bit The contents of the Carry flag are moved to bit 7 and the contents of bit 0 are moved to the Carry flag RR B The contents of B are shifted to the right by one bit The contents of the Car...

Страница 221: ...e contents of E are rotated to the right by one bit The contents of bit 0 are moved to the Carry flag and also to bit 7 RRC H The contents of H are rotated to the right by one bit The contents of bit...

Страница 222: ...placed in A SBC A B The contents of B are summed with the Carry flag and then subtracted from the contents of A and the result is placed in A SBC A C The contents of C are summed with the Carry flag a...

Страница 223: ...ET 0 H BitO SET 03 BitO SET 1 HL Bit 1 SET l IX d Bit 1 1 SET l IY d Bit 1 1 SET 1 A Bitl SET 1 B Bit 1 SET 1 C Bit 1 SET 1 D Bit 1 SET 13 Bit 1 SET 1 H Bit 1 SET 13 Bit 1 SET 2 HL Bit 2 SET 2 IX d Bi...

Страница 224: ...3 A Bit 3 SET 3 B Bit 3 SET 3 C Bit 3 SET 3 D Bit 3 SET 3 E Bit 3 SET 3 H Bit 3 SET3 L Bit 3 SET 4 HL Bit 4 SET 4 TX d Bit 4 1 SET 4 IY d Bit 4 1 SET 4 A Bit 4 SET 4 B Bit 4 SET 4 C Bit 4 SET 4 D Bit...

Страница 225: ...t to 1 SET 7 HL Bit 7 of the location pointed to by HL is set to 1 SET 7 IX d Bit 7 of the location pointed to by IX plus displacement d is set to 1 SET 7 IY d Bit 7 of the location pointed to by IY p...

Страница 226: ...ts of bit 7 are moved to the Carry flag and bit 0 is loaded with 0 SLA L The contents of L are arithmetically shifted left by one bit The contents of bit 7 are moved to the Carry flag and bit 0 is loa...

Страница 227: ...d to the Carry flag SRL A The contents of A are logically shifted right by one bit Bit 7 is set to 0 and the contents of bit 0 are moved to the Carry flag SRL B The contents of B are logically shifted...

Страница 228: ...sult is stored in A XOR IX d The contents of the location pointed to by IX plus displacement d are exclusive ORed with A and the result is stored in A XOR IY d The contents of the location pointed to...

Страница 229: ...as you are in an assembler section of your program DEFB DD DEFB SBC In this case the new instruction CP hX will be assembled Please remember that because these instructions are undocumented they are...

Страница 230: ...esult is stored in A The high byte of the IY register is ANDed with A and the result is stored in A The low byte of the IY register is ANDed with A and the result is stored in A The conten of the high...

Страница 231: ...in D LD 1X E DD 6B Load the low byte of IX with the value in E LD lX n DD 2E nn Load the low byte of IX with the value n LD 1Y A FD 6F Load the low byte of IY with the value in A LD 1Y B FD 68 Load th...

Страница 232: ...in A OR IX DD B5 The low byte of IX is logically ORed with A and the result is stored in A OR hY FD B4 The high byte of IY is logically ORed with A and the result is stored in A OR IY FD B5 The low b...

Страница 233: ...he Carry flag SLL HL CB 36 The contents of the location pointed to by HL are logically shifted left Bit 0 is set to 0 and the contents of bit 7 are moved to the Carry flag SUB hX DD 94 The high byte o...

Страница 234: ......

Страница 235: ...SECTION 3 APPENDICES...

Страница 236: ...E B890 FDATESTAMP B8C9 FERASE B893 FGETATTR B8CF FINBLOCK B896 FINCHAR B899 FINDFIRST B89C FINDNEXT B89F FOPENIN B8A2 FOPENOUT B8A5 FOPENUP B8A8 FOUTBLOCK B8AB FOUTCHAR B8AE FRENAME B8B1 FSEEK B8B4 FS...

Страница 237: ...PCAT_RECEIVE B8D8 LAPCAT_SEND B8DB MCPRINTCHAR B851 MCREADYPRINTER B854 MCSETPRINTER B857 PADGETTICKER B872 PADGETTIME B875 PADGETVERSION B8DE PADINITSERIAL B85A PADINSERIAL B85D PADOUTPARALLEL B860 P...

Страница 238: ...TBOLDON B842 TXTCLEARWINDOW B824 TXTCUROFF B827 TXTCURON B82A TXTGETCURSOR B82D TXTGETWINDOW B830 TXTINVERSEOFF B845 TXTINVERSEON B848 TXTOUTPUT B833 TXTSETCURSOR B836 TXTSETWINDOW B839 TXTUNDERLINEOF...

Страница 239: ...ate Write only 0040 Parallel port data Write only 0050 0053 Speaker frequency Write only 0060 IRQ Mask Write only 0070 Power on off control Write only 0080 008F Not Used 0090 IRQ request status Read W...

Страница 240: ...Stop 000 000 Tab 009 2E4 2E1 Return 00D 2EC 2EC Space 020 220 2EB 0 021 022 023 024 025 026 1 027 33A 028 029 1 02A 02B J 02C 0AE 02D I 02E 0AF 02F 0A8 0 030 2E1 1 031 211 0AD 2 032 209 33C 3 033 2E6...

Страница 241: ...06D 20D 0E6 306 N 04E 06E 20E 0A4 0A5 0 04F 06F 20F 094 099 P 050 070 3DE 014 210 Q 051 071 211 OAC R 052 072 212 S 053 073 213 0E1 370 0E1 T 054 074 29F 315 EMI 055 075 215 081 09A V 056 076 216 W 0...

Страница 242: ...h v aav ds iH oav ih ih oav 3a iH oav oa iH oav u v oav n v oav h v oav 3 v oav a v oav o v oav a v oav v v oav p ai v oav p xi v oav ih v oav SOINOI I3NI I 6Z aa ei aa 60 aa 68 6Z 61 60 02 90 98 PQ 8...

Страница 243: ...CB 47 BIT 0 A CB 40 BIT 0 B CB 41 BIT 0 C CB 42 BITO D CB 43 BIT 0 E CB 44 BIT 0 H CB 45 BIT 0 L CB 4E BIT 1 HL DD CB 05 4E BIT 1 IX d FD CB 05 4E BIT 1 IY d CB 4F BIT 1 A CB 48 BIT 1 B CB 49 BIT 1 C...

Страница 244: ...IX d FD CB 05 6E BIT 5 IY d CB 6F BIT 5 A CB 68 BIT 5 B CB 69 BIT 5 C CB 6A BIT 5 D CB 6B BIT5 E CB 6C BIT 5 H CB 6D BIT 5 L CB 76 BIT 6 HL DD CB 05 76 BIT 6 IX d FD CB 05 76 BIT 6 IY d CB 77 BIT 6 A...

Страница 245: ...C da A dC 8a a do 6a 0 PO va a do aa 3 dC oa H dO aa 1 dC OZ 3d u dO 6AD3 ado 68 D3 aado ia a3 dldC VI D3 IdC d2 LdC LZ vva 9e L H 03D 90 9e aa p xi 03a 90 9e ad P Al C3D ae v 03a 90 a 03a ao oa 03a a...

Страница 246: ...05 INC IX d FD 34 05 INC lY d 3C INC A 04 INC B 03 INC BC OC INC C 14 INC D 13 INC DE 1C INC E 24 INC H 23 INC HL DD 23 INC IX FD 23 INC IY 2C INC L 33 INC SP DB 20 IN A n ED AA IND ED BA INDR ED A2 I...

Страница 247: ...T P Xl oz 90 98 aa an u p Xl 90 77 Od an A P AI 90 07 Dd an a p ai 90 U Dd an 0 P Al 90 ZL Dd an a pY i 90 37 Dd an 3 P Al 90 PL Od an H P AI 90 97 Dd an i p ai OZ 90 93 FD an u pY l 90 t78 ZZ an A uu...

Страница 248: ...an 8P a o an 617 o o an a o an BP 3 o an op H o an OZ 30 nH a an u o an n o an 99 90 99 aa p xi a an 90 99 Dd p ai a an 79 v a an 09 a a an 19 o a an Z9 a a an 89 3 a an PQ H a an 99 n a an OZ 91 u a...

Страница 249: ...an p ai n an p xi n an nH n an uu ai an uu ai an uu xi an uu xi an Vi an uu hh an uu ih an u h an n H an Hh an 3 h an a H an o h an a H an as D3 OZ 9d sa t a ea 3a ta oa za 90 98 Dd 90 9a aa 99 oo D3...

Страница 250: ...E E5 PUSH HL DD E5 PUSH IX FD E5 PUSH IY CB 86 RES 0 HL DD CB 05 86 RES 0 IX d FD CB 05 86 RES 0 IY d CB 87 RES 0 A CB 80 RES 0 B CB81 RES 0 C CB 82 RES 0 D CB 83 RES0 E CB 84 RES0 H CB 85 RES 0 L CB...

Страница 251: ...A7 RES 4 A CB A0 RES 4 B CB A1 RES 4 C CB A2 RES 4 D CB A3 RES 4 E CB A4 RES 4 H CB A5 RES 4 L CB AE RES 5 HL DD CB 05 AE RES 5 IX d FD CB 05 AE RES 5 IY d CB AF RES 5 A CB A8 RES5 B CB A9 RES 5 C CB...

Страница 252: ...a 91 so ao ad p ai ia Li ao via oi ao a ia a ao o ia zi ao a ia i ao 3 la vi ao h la si ao i la Li via 90 ao ih oia 90 so ao aa p xi oia 90 so ao ad p ai oia zo ao v oia oo ao a oia i o ao o oia zo ao...

Страница 253: ...7 RST 30H FF RST 38H DE 20 SBC A n 9E SBC A HL DD 9E 05 SBC A IX d FD9E 05 SBC A IY d 9F SBC A A 98 SBC A B 99 SBC A C 9A SBC A D 9B SBC A E 9C SBC A H 9D SBC A L ED 42 SBC HL BC ED 52 SBC HL DE ED 62...

Страница 254: ...5 DE SET3 IX d FD CB 05 DE SET 3 IY d CB DF SET3 A CB D8 SET3 B CB D9 SET 3 C CB DA SET3 D CB DB SET3 E CB DC SET3 H CB DD SET3 L CB E6 SET4 HL DD CB 05 E6 SET4 IX d FD CB 05 E6 SET 4 IY d CB E7 SET 4...

Страница 255: ...FC SET 7 H CB FD SET 7 L CB 26 SLA HL DD CB 05 26 SLA IX d FD CB 05 26 SLA lY d CB 27 SLA A CB 20 SLAB CB 21 SLAC CB 22 SLAD CB 23 SLA E CB 24 SLAH CB 25 SLAL CB 2E SRA HL DD CB 05 2E SRA IX d FD CB 0...

Страница 256: ...tepad FD 96 05 SUB lY d 97 SUB A 90 SUB B 91 SUB C 92 SUB D 93 SUB E 94 SUB H 95 SUBL D6 20 SUB n AE XOR HL DD AE 05 XOR IX d FD AE 05 XOR lY d AF XOR A A8 XOR B A9 XOR C AA XOR D AB XOR E AC XOR H AD...

Страница 257: ...from the floppy disk Rather the external drive has been designed as a backup mechanism for storing files or transferring them to a PC To do this an extra option has been added to the menu displayed wh...

Страница 258: ...Europe EXPAND YOUR NOTEPAD WITH A RAM CARD Now you can increase the storage area available on your Notepad by up to a megabyte with a RAM card These are available in 64K 128K 256K 512K or 1Mb sizes P...

Страница 259: ...following format IBM and Compatible Commodore Amiga Atari ST and TT Amstrad PCW Disk Size 3 5 5 25 I enclose a Cheque PO for Please charge my Access Visa card Credit card number Expiry date Name Sign...

Страница 260: ...CALC BAS 12 calculator 12 loan 58 CALL 126 card 229 memory 154 155 RAM 248 channels sound 154 CHART BAS 22 checker style 75 clear 15 clock functions 169 real time 156 world 88 code ASCE 23 decimal 23...

Страница 261: ...FTELL 177 226 FTESTEOF 177 226 functions clock 169 H H 126 HEAPADDRESS 170 226 HEAPALLOC 171 227 HEAPFREE 171 227 HEAPLOCK 171 227 HEAPMAXFREE 172 227 HEAPREALLOC 172 227 hexadecimal 22 hidden verbs 7...

Страница 262: ...arallel port 229 functions 166 passive verbs 79 PCMCIA 145 146 PCX 134 port parallel 166 229 serial 166 POST Power On Self Test 133 power 155 229 print 22 programs external 145 R RAM 100 card 187 248...

Страница 263: ...228 TXTINVERSEON 165 228 TXTOUTPUT 163 228 TXTSETCURSOR 163 228 TXTSETWINDOW 163 228 TXTUNDERLINEOFF 165 228 TXTUNDERLINEON 165 228 TXTWRCHAR 164 228 U UART 156 229 USR 126 V variables system 182 185...

Страница 264: ......

Страница 265: ...nd Archimedes Game Maker s Manual Artificial Intelligence Build Your Own Expert System Naylor 1 1 95 Computational Linguistics McEnery 14 95 Introducing Neural Networks Carling 14 95 Beginners Guides...

Страница 266: ...S File and Program Control Sinclair 12 95 Mastering DesqView Sinclair 1 2 95 Programming C Applications Library Pugh 16 95 Starting MS DOS Assembler Sinclair 12 95 Understanding Occam and the transput...

Страница 267: ......

Страница 268: ...r instructions and dozens of program listings ready to type in And if that isn t enough there s a disk offer inside this book to save time and effort This is Robin Nixon s second book for Sigma Press...

Отзывы: