<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.archive.worldofdragon.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tormod</id>
	<title>The Dragon Archive - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://www.archive.worldofdragon.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tormod"/>
	<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Special:Contributions/Tormod"/>
	<updated>2026-04-08T16:20:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.15</generator>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9121</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9121"/>
		<updated>2017-07-09T15:54:24Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* ERROR MESSAGES AND CODES */ pre&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith, THE EDITOR&lt;br /&gt;
&lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound and graphics ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTINUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Addresses of the READ/WRITE routines in ROM. ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
=== RIGHT JUSTIFICATION ROUTINE ===&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DISK DRIVE NUMBERS IN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
=== SELECTING MENU OPTIONS ===&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INVERSE VIDEO ===&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AUTO REPEAT ON THE D32 ===&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DREAM ===&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRINGS ===&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
=== FILEMASTER ===&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LLISTINGS ===&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
=== BASIC ADDRESSES ===&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
=== DISK FILES ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header, otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
 - End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO SAVE GRAPHICS TO TAPE OR DISK ===&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AUTOREPEATING KEYS FOR THE D32 ===&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
=== COLD START ===&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
=== PAUSE ===&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
=== INVERTING GRAPHICS PAGES ===&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
=== RESCUE OPERATION ===&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
=== THREE COLOUR PMODE4 ===&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
=== DISABLE BREAK KEY ===&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
=== SLOW DOWN LIST ===&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
=== EASY MOVING GRAPHICS ===&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLEAR SCREEN IN M/CODE ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER LINE FEED ===&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
=== PRINTER FIELD WIDTH ===&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS - HIDING SCREENS ===&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
=== TEXT IN M/CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
=== INCREASE MEMORY AVAILABLE ===&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS PAGES - ADDRESSES ===&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER - TO AVOID HANG UPS ===&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER - PARAMETER SETTING ===&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
=== DRIVE NUMBER ===&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
=== BAUD RATE CODE ===&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATA TROUBLE ===&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
=== AWAIT KEYPRESS ===&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
=== KEYBOARD DISABLE ===&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS (Colour) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TEXT SCREEN ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CURSOR - TO REDEFINE ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
=== CASSETTE - HIGH SPEED MODE RESCUE ===&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
=== BREAK - TO DISABLE ===&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
=== BREAK - TO DISABLE INCLUDING INPUT LINES ===&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TELEWRITER ===&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
=== PRINT - VARY OUTPUT TO SCREEN OR PRINTER ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CONVERT HEX/DECIMAL/HEX ===&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
=== DISPLAY ===&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
=== LOOPS ===&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
=== CENTERING A TITLE ===&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
=== CASSETTES ===&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
=== WAIT FOR KEYPRESS ===&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
=== CASSETTE LOADING ===&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
=== FC (Function Call) errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
=== OD (Out of data) errors ===&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
=== PAINT errors ===&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
=== USR Routines ===&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BS Bad Subscript errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
=== DD Attempt to redimension an array. ===&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
=== DS Direct statement ===&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
=== FM Bad file mode ===&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
=== NE File non-existent ===&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
=== NF NEXT without FOR ===&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
=== TF Too many open ===&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
=== UL Undefined line ===&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
=== DATA ===&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9120</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9120"/>
		<updated>2017-07-09T15:53:24Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* BAUD RATE CODE */ fixup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith, THE EDITOR&lt;br /&gt;
&lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound and graphics ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTINUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Addresses of the READ/WRITE routines in ROM. ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
=== RIGHT JUSTIFICATION ROUTINE ===&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DISK DRIVE NUMBERS IN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
=== SELECTING MENU OPTIONS ===&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INVERSE VIDEO ===&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AUTO REPEAT ON THE D32 ===&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DREAM ===&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRINGS ===&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
=== FILEMASTER ===&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LLISTINGS ===&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
=== BASIC ADDRESSES ===&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
=== DISK FILES ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header, otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
 - End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO SAVE GRAPHICS TO TAPE OR DISK ===&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AUTOREPEATING KEYS FOR THE D32 ===&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
=== COLD START ===&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
=== PAUSE ===&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
=== INVERTING GRAPHICS PAGES ===&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
=== RESCUE OPERATION ===&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
=== THREE COLOUR PMODE4 ===&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
=== DISABLE BREAK KEY ===&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
=== SLOW DOWN LIST ===&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
=== EASY MOVING GRAPHICS ===&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLEAR SCREEN IN M/CODE ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER LINE FEED ===&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
=== PRINTER FIELD WIDTH ===&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS - HIDING SCREENS ===&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
=== TEXT IN M/CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
=== INCREASE MEMORY AVAILABLE ===&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS PAGES - ADDRESSES ===&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER - TO AVOID HANG UPS ===&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER - PARAMETER SETTING ===&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
=== DRIVE NUMBER ===&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
=== BAUD RATE CODE ===&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATA TROUBLE ===&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
=== AWAIT KEYPRESS ===&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
=== KEYBOARD DISABLE ===&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS (Colour) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TEXT SCREEN ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CURSOR - TO REDEFINE ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
=== CASSETTE - HIGH SPEED MODE RESCUE ===&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
=== BREAK - TO DISABLE ===&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
=== BREAK - TO DISABLE INCLUDING INPUT LINES ===&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TELEWRITER ===&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
=== PRINT - VARY OUTPUT TO SCREEN OR PRINTER ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CONVERT HEX/DECIMAL/HEX ===&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
=== DISPLAY ===&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
=== LOOPS ===&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
=== CENTERING A TITLE ===&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
=== CASSETTES ===&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
=== WAIT FOR KEYPRESS ===&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
=== CASSETTE LOADING ===&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
=== FC (Function Call) errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
=== OD (Out of data) errors ===&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
=== PAINT errors ===&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
=== USR Routines ===&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BS Bad Subscript errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
=== DD Attempt to redimension an array. ===&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
=== DS Direct statement ===&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
=== FM Bad file mode ===&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
=== NE File non-existent ===&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
=== NF NEXT without FOR ===&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
=== TF Too many open ===&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
=== UL Undefined line ===&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
=== DATA ===&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9119</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9119"/>
		<updated>2017-07-09T15:51:42Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* HELPFUL ROUTINES */ pre and headers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith, THE EDITOR&lt;br /&gt;
&lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound and graphics ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTINUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Addresses of the READ/WRITE routines in ROM. ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
=== RIGHT JUSTIFICATION ROUTINE ===&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DISK DRIVE NUMBERS IN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
=== SELECTING MENU OPTIONS ===&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INVERSE VIDEO ===&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AUTO REPEAT ON THE D32 ===&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DREAM ===&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRINGS ===&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
=== FILEMASTER ===&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LLISTINGS ===&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
=== BASIC ADDRESSES ===&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
=== DISK FILES ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header, otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
 - End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO SAVE GRAPHICS TO TAPE OR DISK ===&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AUTOREPEATING KEYS FOR THE D32 ===&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
=== COLD START ===&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
=== PAUSE ===&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
=== INVERTING GRAPHICS PAGES ===&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
=== RESCUE OPERATION ===&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
=== THREE COLOUR PMODE4 ===&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
=== DISABLE BREAK KEY ===&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
=== SLOW DOWN LIST ===&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
=== EASY MOVING GRAPHICS ===&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLEAR SCREEN IN M/CODE ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER LINE FEED ===&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
=== PRINTER FIELD WIDTH ===&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS - HIDING SCREENS ===&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
=== TEXT IN M/CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
=== INCREASE MEMORY AVAILABLE ===&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS PAGES - ADDRESSES ===&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER - TO AVOID HANG UPS ===&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== PRINTER - PARAMETER SETTING ===&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
=== DRIVE NUMBER ===&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
=== BAUD RATE CODE ===&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATA TROUBLE ===&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
=== AWAIT KEYPRESS ===&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
=== KEYBOARD DISABLE ===&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
=== GRAPHICS (Colour) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TEXT SCREEN ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CURSOR - TO REDEFINE ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
=== CASSETTE - HIGH SPEED MODE RESCUE ===&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
=== BREAK - TO DISABLE ===&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
=== BREAK - TO DISABLE INCLUDING INPUT LINES ===&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TELEWRITER ===&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
=== PRINT - VARY OUTPUT TO SCREEN OR PRINTER ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CONVERT HEX/DECIMAL/HEX ===&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
=== DISPLAY ===&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
=== LOOPS ===&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
=== CENTERING A TITLE ===&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
=== CASSETTES ===&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
=== WAIT FOR KEYPRESS ===&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
=== CASSETTE LOADING ===&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
=== FC (Function Call) errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
=== OD (Out of data) errors ===&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
=== PAINT errors ===&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
=== USR Routines ===&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BS Bad Subscript errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
=== DD Attempt to redimension an array. ===&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
=== DS Direct statement ===&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
=== FM Bad file mode ===&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
=== NE File non-existent ===&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
=== NF NEXT without FOR ===&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
=== TF Too many open ===&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
=== UL Undefined line ===&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
=== DATA ===&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9118</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9118"/>
		<updated>2017-07-09T15:38:53Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* PEEKs, POKES and EXECs */ pre&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith, THE EDITOR&lt;br /&gt;
&lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound and graphics ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONTINUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Addresses of the READ/WRITE routines in ROM. ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
=== FC (Function Call) errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
=== OD (Out of data) errors ===&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
=== PAINT errors ===&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
=== USR Routines ===&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BS Bad Subscript errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
=== DD Attempt to redimension an array. ===&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
=== DS Direct statement ===&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
=== FM Bad file mode ===&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
=== NE File non-existent ===&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
=== NF NEXT without FOR ===&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
=== TF Too many open ===&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
=== UL Undefined line ===&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
=== DATA ===&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9117</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9117"/>
		<updated>2017-07-09T15:33:36Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* INTRODUCTION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith, THE EDITOR&lt;br /&gt;
&lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
=== FC (Function Call) errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
=== OD (Out of data) errors ===&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
=== PAINT errors ===&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
=== USR Routines ===&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BS Bad Subscript errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
=== DD Attempt to redimension an array. ===&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
=== DS Direct statement ===&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
=== FM Bad file mode ===&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
=== NE File non-existent ===&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
=== NF NEXT without FOR ===&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
=== TF Too many open ===&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
=== UL Undefined line ===&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
=== DATA ===&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9116</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9116"/>
		<updated>2017-07-09T15:32:02Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DEBUGGING HINTS */ make headers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
=== FC (Function Call) errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
=== OD (Out of data) errors ===&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
=== PAINT errors ===&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
=== USR Routines ===&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BS Bad Subscript errors ===&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
=== DD Attempt to redimension an array. ===&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
=== DS Direct statement ===&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
=== FM Bad file mode ===&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
=== NE File non-existent ===&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
=== NF NEXT without FOR ===&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
=== TF Too many open ===&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
=== UL Undefined line ===&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
=== DATA ===&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9115</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9115"/>
		<updated>2017-07-09T15:28:49Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* GRAPHIC MODES of the DRAGON and COCO */ pre&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC (Function Call) errors&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
OD (Out of data) errors&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
PAINT errors&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
USR Routines&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&lt;br /&gt;
BS Bad Subscript errors&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
DD Attempt to redimension an array.&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
DS Direct statement&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
FM Bad file mode&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
NE File non-existent&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
NF NEXT without FOR&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
TF Too many open&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
UL Undefined line&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9114</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9114"/>
		<updated>2017-07-09T15:26:56Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* SAM CONTROL BITS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC (Function Call) errors&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
OD (Out of data) errors&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
PAINT errors&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
USR Routines&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&lt;br /&gt;
BS Bad Subscript errors&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
DD Attempt to redimension an array.&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
DS Direct statement&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
FM Bad file mode&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
NE File non-existent&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
NF NEXT without FOR&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
TF Too many open&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
UL Undefined line&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9113</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9113"/>
		<updated>2017-07-09T15:26:41Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* INPUT/OUTPUT ROUTINES */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC (Function Call) errors&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
OD (Out of data) errors&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
PAINT errors&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
USR Routines&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&lt;br /&gt;
BS Bad Subscript errors&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
DD Attempt to redimension an array.&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
DS Direct statement&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
FM Bad file mode&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
NE File non-existent&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
NF NEXT without FOR&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
TF Too many open&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
UL Undefined line&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9112</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9112"/>
		<updated>2017-07-09T15:26:06Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* BASIC INTERPRETER CODES */ pre&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC (Function Call) errors&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
OD (Out of data) errors&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
PAINT errors&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
USR Routines&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&lt;br /&gt;
BS Bad Subscript errors&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
DD Attempt to redimension an array.&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
DS Direct statement&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
FM Bad file mode&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
NE File non-existent&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
NF NEXT without FOR&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
TF Too many open&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
UL Undefined line&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9111</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9111"/>
		<updated>2017-07-09T15:24:51Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DRAGONDOS WORK SPACE */ pre&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC (Function Call) errors&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
OD (Out of data) errors&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
PAINT errors&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
USR Routines&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&lt;br /&gt;
BS Bad Subscript errors&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
DD Attempt to redimension an array.&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
DS Direct statement&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
FM Bad file mode&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
NE File non-existent&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
NF NEXT without FOR&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
TF Too many open&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
UL Undefined line&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
                        Page 34&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
                        Page 35&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9110</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9110"/>
		<updated>2017-07-09T15:24:09Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* MEMORY MAP DETAILS */ pre&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC (Function Call) errors&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
OD (Out of data) errors&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
PAINT errors&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
USR Routines&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&lt;br /&gt;
BS Bad Subscript errors&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
DD Attempt to redimension an array.&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
DS Direct statement&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
FM Bad file mode&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
NE File non-existent&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
NF NEXT without FOR&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
TF Too many open&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
UL Undefined line&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
                        Page 34&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
                        Page 35&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9109</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9109"/>
		<updated>2017-07-09T15:21:26Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* BIBLIOGRAPHY */ break up a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC (Function Call) errors&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
OD (Out of data) errors&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
PAINT errors&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
USR Routines&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&lt;br /&gt;
BS Bad Subscript errors&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
DD Attempt to redimension an array.&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
DS Direct statement&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
FM Bad file mode&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
NE File non-existent&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
NF NEXT without FOR&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
TF Too many open&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
UL Undefined line&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
&lt;br /&gt;
Other books, if you can find them, are:&lt;br /&gt;
&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&lt;br /&gt;
          DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
                        Page 34&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
                        Page 35&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9108</id>
		<title>Dragon Notebook</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_Notebook&amp;diff=9108"/>
		<updated>2017-07-09T15:19:37Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DISKS AND THE DRAGON 64 */ add headers and preformated tags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== INTRODUCTION ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Notebook is dedicated to 6809 programmers past, present&lt;br /&gt;
and future and in particular to those whose work has&lt;br /&gt;
contributed so much to unravelling the secrets of the&lt;br /&gt;
DRAGON&amp;#039;S ROM.&lt;br /&gt;
&lt;br /&gt;
The contents have been gleaned from many different sources&lt;br /&gt;
over the years and to all contributors, known and unknown,&lt;br /&gt;
we offer out heartfelt thanks.&lt;br /&gt;
&lt;br /&gt;
The Editor&amp;#039;s gnarled fingers were responsible for the typing&lt;br /&gt;
of all the pages in this book using what he considers to be&lt;br /&gt;
the best word processor for the 6809 computers, namely&lt;br /&gt;
&amp;#039;STYLOGRAPH&amp;#039; operating under OS9. The major drawback to&lt;br /&gt;
using this method is that it is not possible to test any of&lt;br /&gt;
the routines after they have been typed. Consequently,&lt;br /&gt;
although dozens of mistakes have been spotted and corrected,&lt;br /&gt;
it is inevitable that a goodly number will have been&lt;br /&gt;
overlooked.&lt;br /&gt;
&lt;br /&gt;
While every effort has been made to check the routines&lt;br /&gt;
contained in the Notebook it has not been possible in every&lt;br /&gt;
case. Should you become aware of mistakes in any of these&lt;br /&gt;
subroutines, please write and let the Editor know,&lt;br /&gt;
especially if you are able to put matters right. By the same&lt;br /&gt;
token, if you know of any subroutine which would be of&lt;br /&gt;
interest to your fellow members, please drop the Editor a&lt;br /&gt;
line, and he will include it in any future edition. Of&lt;br /&gt;
special interest would be short source code routines from&lt;br /&gt;
DREAM or other assembler, because nothing teaches you better&lt;br /&gt;
to program in machine code than examining experts routines.&lt;br /&gt;
&lt;br /&gt;
The intention of this small publication was to give all our&lt;br /&gt;
members as much information as possible about the Dragon and&lt;br /&gt;
to a lesser extent the Tandy Coco. There are many members,&lt;br /&gt;
new to computing, who have recently acquired a Dragon who&lt;br /&gt;
are struggling to find information with which to augment the&lt;br /&gt;
Basic Manual. We hope this Notebook will help them produce&lt;br /&gt;
worthwhile programs, which they can share with us all&lt;br /&gt;
through the pages of DRAGON UPDATE &amp;amp; UP2DATE.&lt;br /&gt;
&lt;br /&gt;
                                                            &lt;br /&gt;
Ray Smith,&lt;br /&gt;
    THE EDITOR&lt;br /&gt;
&lt;br /&gt;
                    &lt;br /&gt;
== PEEKs, POKES and EXECs ==&lt;br /&gt;
&lt;br /&gt;
WAIT for Keyboard input&lt;br /&gt;
DRAGON EXEC 34091 (COCO EXEC 44539)&lt;br /&gt;
Same as Q$=INKEY$:IF Q$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
&lt;br /&gt;
HIGH SPEED POKE&lt;br /&gt;
POKE 65495,0&lt;br /&gt;
Doubles the processing speed from .89mhz to 1.7mhz - useful&lt;br /&gt;
for data processing and arithmetical functions, but&lt;br /&gt;
POTENTIALLY can be dangerous for your computer as it can&lt;br /&gt;
shorten the life of the chips.&lt;br /&gt;
&lt;br /&gt;
POKE 65494,0&lt;br /&gt;
Returns computer to normal speed.&lt;br /&gt;
Use this poke before inputting or outputting any information&lt;br /&gt;
to tape or disk, if you are using the high speed poke.&lt;br /&gt;
&lt;br /&gt;
POKE 65497,0&lt;br /&gt;
An even faster speed. Screen image is lost and should be&lt;br /&gt;
used with extreme caution with involved arithmetic&lt;br /&gt;
calculations only.&lt;br /&gt;
&lt;br /&gt;
POKE 65496,0&lt;br /&gt;
Turns off above speed poke.&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
POKE113,0&lt;br /&gt;
Produces a cold start whenever the RESET button is pressed.&lt;br /&gt;
&lt;br /&gt;
WARM START&lt;br /&gt;
EXEC 40999 (COCO 46004)&lt;br /&gt;
Produces a warm start, but if used after the above poke,&lt;br /&gt;
will then produce an immediate cold start.&lt;br /&gt;
&lt;br /&gt;
DISABLE LIST COMMAND&lt;br /&gt;
POKE 383,158&lt;br /&gt;
List command will produce garbage.&lt;br /&gt;
Also disables DIR command for disk&lt;br /&gt;
POKE&amp;amp;H180,PEEK(114):POKE&amp;amp;H180, PEEK(115)&lt;br /&gt;
Disables the List command when using disks only.&lt;br /&gt;
&lt;br /&gt;
TRON/TROFF&lt;br /&gt;
POKE175,79&lt;br /&gt;
Turns on Trace flag - same as TRON&lt;br /&gt;
POKE175,0&lt;br /&gt;
Turns it off again - same as TROFF&lt;br /&gt;
&lt;br /&gt;
GRAPHICS MODE&lt;br /&gt;
PEEK(182)&lt;br /&gt;
Returns present PMODE number.&lt;br /&gt;
Returns 0 if graphics not in use.&lt;br /&gt;
&lt;br /&gt;
LOWER CASE CHARACTERS&lt;br /&gt;
Coco POKE 282,0. Dragon POKE 329,0&lt;br /&gt;
Text will be printed to screen in inverse video and to&lt;br /&gt;
printer in lower case.&lt;br /&gt;
&lt;br /&gt;
UPPER CASE CHARACTERS&lt;br /&gt;
DRAGON POKE 329,255 (COCO POKE 282,255)&lt;br /&gt;
Turns off lower case flag and all text will be in Capitals.&lt;br /&gt;
&lt;br /&gt;
PRINT DISK DIRECTORY&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
DEVN routine. Decides which device the text output is&lt;br /&gt;
directed to.&lt;br /&gt;
0=Screen. 255=tape. 254=printer.&lt;br /&gt;
&lt;br /&gt;
TIMER VALUE&lt;br /&gt;
PEEK(274)*256+PEEK(275)&lt;br /&gt;
Gives the value of the timer.&lt;br /&gt;
POKE274,0 and POKE275,0 to return value of Timer to 0.&lt;br /&gt;
&lt;br /&gt;
LAST KEY PRESSED&lt;br /&gt;
PEEK(135)&lt;br /&gt;
Gives the ASCII code of last key pressed in program.&lt;br /&gt;
&lt;br /&gt;
LAST VARIABLE USED&lt;br /&gt;
PEEK(55) + PEEK(56)&lt;br /&gt;
Gives ASCII code of last variable used. Print CHR$ in front&lt;br /&gt;
of the command to get the STRING value of last variable&lt;br /&gt;
used.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for DISK&lt;br /&gt;
POKE25,PEEK(188):NEW&lt;br /&gt;
Will give you an SN error, but PCLEAR0 will have been&lt;br /&gt;
accomplished. Or alternatively:-&lt;br /&gt;
POWER UP:POKE25,14:POKE26,0:NEW&lt;br /&gt;
for the same thing.&lt;br /&gt;
&lt;br /&gt;
PCLEAR0 for TAPE systems&lt;br /&gt;
POKE 25,6:NEW&lt;br /&gt;
&lt;br /&gt;
MOTOR ON / MOTOR OFF&lt;br /&gt;
POKE 65313,4 for motor on.&lt;br /&gt;
POKE 65313,52 for motor off.&lt;br /&gt;
&lt;br /&gt;
MACHINE CODE PROGRAM ADDRESSES&lt;br /&gt;
(a) For tape:&lt;br /&gt;
START: PEEK(487) * 256 + PEEK(488)&lt;br /&gt;
END: PEEK(126) * 256 + PEEK(127)-1&lt;br /&gt;
EXEC: PEEK(157) * 256 + PEEK(158)&lt;br /&gt;
(b) For disk: (Dragon only)&lt;br /&gt;
FOR X=1618 TO 1623 STEP 2: PRINT&lt;br /&gt;
PEEK(X) * 256 + PEEK(X+1);:NEXT&lt;br /&gt;
The resulting numbers will be:&lt;br /&gt;
START, LENGTH and EXEC.&lt;br /&gt;
To find END address, add START and LENGTH together and&lt;br /&gt;
deduct 1.&lt;br /&gt;
&lt;br /&gt;
BASIC PROGRAM ADDRESSES&lt;br /&gt;
PEEK(25)*256+PEEK(26) - START&lt;br /&gt;
PEEK(31)*256+PEEK(32) - END&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN - CURSOR POSITION&lt;br /&gt;
PEEK(136)*256+PEEK(137)&lt;br /&gt;
Shows a position somewhere between 1024(Start of screen) &amp;amp;&lt;br /&gt;
1535(end)&lt;br /&gt;
&lt;br /&gt;
MAXIMUM MEMORY POINTER&lt;br /&gt;
PEEK(116)*256+PEEK(117)&lt;br /&gt;
Shows end of RAM&lt;br /&gt;
&lt;br /&gt;
HIMEM&lt;br /&gt;
PEEK(39)*256+PEEK(40)&lt;br /&gt;
Shows place of protected memory, and is highest address for&lt;br /&gt;
basic.&lt;br /&gt;
&lt;br /&gt;
CHARACTER TO TEXT SCREEN&lt;br /&gt;
POKE (1024-1535),(33-255)&lt;br /&gt;
Pokes a character or graphics block to the text screen.&lt;br /&gt;
&lt;br /&gt;
CHARACTER/COLOR BLOCK to GRAPHIC&lt;br /&gt;
Applies to PMODE 1 and 2 only.&lt;br /&gt;
POKE (1536-4607),(33-255) for tape or POKE&lt;br /&gt;
(3072-6143),(33-255) disk.&lt;br /&gt;
&lt;br /&gt;
DISKS&lt;br /&gt;
PEEK(235) for DRIVE number.&lt;br /&gt;
PEEK(236) for TRACK number.&lt;br /&gt;
PEEK(237) for SECTOR number.&lt;br /&gt;
&lt;br /&gt;
TAPE FILENAME of file last loaded&lt;br /&gt;
&lt;br /&gt;
FORX=474TO481:PRINTCHR$(PEEK(X));: NEXT&lt;br /&gt;
Prints filename of the last tape file loaded in string form.&lt;br /&gt;
&lt;br /&gt;
TEXT TO SCREEN DISABLE&lt;br /&gt;
&lt;br /&gt;
POKE359,255&lt;br /&gt;
After you use this Poke, nothing you type on the keyboard&lt;br /&gt;
appears on the screen. Whatever statement you type will be&lt;br /&gt;
executed, provided it does not require any text to be&lt;br /&gt;
printed on screen. In consequence you can type for example&lt;br /&gt;
SCREEN1,1 or PCLS or SOUND100,1 and these will be executed.&lt;br /&gt;
The DIR command will not work however, as it requires the&lt;br /&gt;
list of files to be printed on the screen. The LIST command&lt;br /&gt;
is also disabled.&lt;br /&gt;
Do not use this poke in your program if you require&lt;br /&gt;
statements to be printed on the screen.&lt;br /&gt;
POKE359,126 &lt;br /&gt;
Although this will not itself appear on the screen, it will&lt;br /&gt;
restore the text etc on screen to normal.&lt;br /&gt;
&lt;br /&gt;
ORANGE TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
POKE359,57&lt;br /&gt;
Lets you use any graphic screen or the text screen&lt;br /&gt;
(SCREEN0,1) without alternating back to the default text&lt;br /&gt;
screen. Consequently SCREEN0,1 will give you an orange&lt;br /&gt;
screen without switching back to the normal green screen.&lt;br /&gt;
Using SCREEN0,1 after this POKE will make your title screens&lt;br /&gt;
have more impact.&lt;br /&gt;
POKE359,126 to recover from above.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER FOR DRAGONDOS&lt;br /&gt;
&lt;br /&gt;
Although you can use the command DRIVE 1 (or 2,3 or 4) in&lt;br /&gt;
your program. You cannot use a variable (in Dragondos) and&lt;br /&gt;
so DRIVE X will produce an error.&lt;br /&gt;
You can however use POKE1546,DR where DR is the variable for&lt;br /&gt;
any Drive number in the range 1 to 4.&lt;br /&gt;
&lt;br /&gt;
CURRENT LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(104)*256+PEEK(105)&lt;br /&gt;
&lt;br /&gt;
CURRENT DATA LINE NUMBER&lt;br /&gt;
&lt;br /&gt;
PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
DISK/TAPE CHECK&lt;br /&gt;
&lt;br /&gt;
PEEK(188)&lt;br /&gt;
This returns a 6 if no disk  drive is installed for both Dragon&lt;br /&gt;
&amp;amp; the Coco. If a disk drive  is installed then a 14 is returned&lt;br /&gt;
for the Coco and a 12 for the Dragon.&lt;br /&gt;
&lt;br /&gt;
SOUND - OCTAVE&lt;br /&gt;
&lt;br /&gt;
PEEK(222)+1&lt;br /&gt;
Returns the current Octave in use.&lt;br /&gt;
&lt;br /&gt;
SOUND - NOTE LENGTH&lt;br /&gt;
&lt;br /&gt;
PEEK(225)&lt;br /&gt;
Notes can be any length from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
SOUND - CURRENT TEMPO&lt;br /&gt;
&lt;br /&gt;
PEEK(226)&lt;br /&gt;
Tempo can be from 1 to 255.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - COLORSET&lt;br /&gt;
&lt;br /&gt;
PEEK(193)&lt;br /&gt;
Returns 8 if using Colorset 1 or 0 if using Colorset 0.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - START BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(186)*256+PEEK(187)&lt;br /&gt;
Returns start address at top of current Hi-res screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - END BYTE&lt;br /&gt;
&lt;br /&gt;
PEEK(183)*256+PEEK(184)&lt;br /&gt;
Returns end address  at  the  bottom  right  of  current hi-res&lt;br /&gt;
screen.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE RADIUS&lt;br /&gt;
&lt;br /&gt;
PEEK(207)*256+PEEK(208)&lt;br /&gt;
Returns the radius of a circle if drawn in PMODE4. Multiply the&lt;br /&gt;
number by 2 to get the radius of a circle in PMODE1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - CIRCLE CENTRE&lt;br /&gt;
&lt;br /&gt;
(a) PEEK(203)*256+PEEK(204)&lt;br /&gt;
Returns the  centre  X  co-ordinate  of  a  circle  in  PMODE4,&lt;br /&gt;
Multiply by 2 for PMODES1 and 3.&lt;br /&gt;
(continued over)&lt;br /&gt;
&lt;br /&gt;
(b) PEEK(205)*256+PEEK(206)&lt;br /&gt;
Returns the centre  Y  (vertical)  co-ordinate  of  a circle in&lt;br /&gt;
PMODE4, multiply by 2 for PMODES 1 and 3.&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - DRAW&lt;br /&gt;
&lt;br /&gt;
(a) ANGLE PEEK(232)&lt;br /&gt;
Returns Draw angle from 0 to3.&lt;br /&gt;
(b) SCALE PEEK(233)&lt;br /&gt;
Returns scale number from 1 to 62&lt;br /&gt;
&lt;br /&gt;
CONTNUE after BREAK&lt;br /&gt;
&lt;br /&gt;
PEEK(41)*256+PEEK(42)&lt;br /&gt;
Gives the line number at  which continuation should begin after&lt;br /&gt;
Break.&lt;br /&gt;
&lt;br /&gt;
DISK DIRECTORY&lt;br /&gt;
&lt;br /&gt;
COCO EXEC 52175&lt;br /&gt;
DRAGON EXEC 55868&lt;br /&gt;
Prints disk directory on screen, same as command DIR.&lt;br /&gt;
&lt;br /&gt;
JOYSTICK - FIRE BUTTON&lt;br /&gt;
&lt;br /&gt;
PEEK(65280)&lt;br /&gt;
COCO: Returns 253 or  125  for  LEFT  joystick  fire button and&lt;br /&gt;
254/126 if RIGHT joystick  button   pressed.  255  if no button&lt;br /&gt;
pressed and 257 if BOTH are pressed.&lt;br /&gt;
DRAGON:  returns  253/125   for   LEFT  joystick,254/126  Right&lt;br /&gt;
joystick, 255/127 if no button pressed and 252 for both.&lt;br /&gt;
&lt;br /&gt;
TAPE: LOADING A HEADERLESS PROGRAM&lt;br /&gt;
&lt;br /&gt;
MOTORON: EXEC &amp;amp;HB714&lt;br /&gt;
This should  load  in  a  program  which  has  been  saved, for&lt;br /&gt;
example, when the motor did not get  up to speed in time and so&lt;br /&gt;
you&amp;#039;ve got a program saved without a header.&lt;br /&gt;
&lt;br /&gt;
TAPE: SLOW STARTING AUTOMATICS&lt;br /&gt;
&lt;br /&gt;
If your tape recorder is  slow  to  start  when it receives the&lt;br /&gt;
signal, remove the remote jack and switch the motor on from the&lt;br /&gt;
program,   or   in   direct    mode   with   MOTORON:SOUND1,20:&lt;br /&gt;
CSAVE&amp;quot;PROGRAM&amp;quot;. This is the method used  by Harvey Grey, and as&lt;br /&gt;
he says it never fails.&lt;br /&gt;
&lt;br /&gt;
TAPE: MERGING TWO PROGRAMS&lt;br /&gt;
&lt;br /&gt;
Have the two programs ready,  by  renumbering Program B so that&lt;br /&gt;
its line numbers start after those of Program A.&lt;br /&gt;
CLOAD&amp;quot;PROGRAMA&amp;quot;:POKE25,PEEK(27):POKE26,PEEK(28)-2:&lt;br /&gt;
CLOAD&amp;quot;PROGRAMB&amp;quot;:POKE25,30:POKE26,1&lt;br /&gt;
They should then have merged.&lt;br /&gt;
&lt;br /&gt;
ERASE - ANY PROGRAM IN MEMORY&lt;br /&gt;
&lt;br /&gt;
DRAGON EXEC 33815      COCO EXEC 44313&lt;br /&gt;
Erases any program - same as the NEW command&lt;br /&gt;
&lt;br /&gt;
CUMANA DOS POKES&lt;br /&gt;
&lt;br /&gt;
Addresses of the READ/WRITE routines in ROM.&lt;br /&gt;
&lt;br /&gt;
00EB    Number of the active drive&lt;br /&gt;
00EE/F  Buffer address (for sector read/write)&lt;br /&gt;
00F6    If non-zero decrement 0605 in each IRQ&lt;br /&gt;
0605    When reaches zero turns off disk motor&lt;br /&gt;
0609    Verify flag: 0=Off else is On&lt;br /&gt;
060A    Drive number&lt;br /&gt;
0697/8  Auto current line number&lt;br /&gt;
0699/A  Auto increment&lt;br /&gt;
069B    Auto flag: 0=Off else is on&lt;br /&gt;
069C/D  Error GOTO - line number&lt;br /&gt;
069E    Error GOTO flag: 0=off else is on&lt;br /&gt;
069F/A0 ERL&lt;br /&gt;
06A1    ERR&lt;br /&gt;
E56D    Sector READ routine&lt;br /&gt;
E643    Sector WRITE routine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== HELPFUL ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RIGHT JUSTIFICATION ROUTINE&lt;br /&gt;
&lt;br /&gt;
Where LL is the line length, and string to be justified is A$.&lt;br /&gt;
&lt;br /&gt;
10 LL=51:P=51&lt;br /&gt;
20 DF=LL-LEN(A$):IF INSTR(A$,&amp;quot;&amp;quot;)=0 THEN80&lt;br /&gt;
30 IF DF=0 THEN80&lt;br /&gt;
40 FOR J=P  TO1STEP-1:IF  MID$(A$,J,1)=&amp;quot;&amp;quot;  THEN A$=LEFT$(A$,J)+&lt;br /&gt;
MID$(A$,J):DF=DF-1:GOTO60&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 P=J-1:IF P&amp;lt;1 THEN P=LEN(A$)&lt;br /&gt;
70 GOTO30&lt;br /&gt;
80 RETURN&lt;br /&gt;
&lt;br /&gt;
AND ANOTHER EXAMPLE&lt;br /&gt;
&lt;br /&gt;
10 A$=&amp;quot;This is just an example of a string&amp;quot;&lt;br /&gt;
20 A$=A$+&amp;quot;&amp;quot;&lt;br /&gt;
30 LL=32:F=0:S=0:N=0:P=1:L=LEN(A$):B$=&amp;quot;&amp;quot;&lt;br /&gt;
40 GOSUB180:GOSUB190:IF F=0 THEN70&lt;br /&gt;
50 S=S-P+F:P=F&lt;br /&gt;
60 IF P&amp;gt;=L THEN N=N+1:GOTO40&lt;br /&gt;
70 IF N=1 THEN210&lt;br /&gt;
80 P=1:GOSUB180&lt;br /&gt;
90 SP=LL-S-P-N+2&lt;br /&gt;
100 B$=B$+STRING$(P-1,32)&lt;br /&gt;
110 DS=INT(SP/(N-1)):MS=SP-(N-1)*DS:PA=1&lt;br /&gt;
120 GOSUB190:IF F=0 THEN200&lt;br /&gt;
130 B$=B$+MID$(A$,P,F-P):P=F&lt;br /&gt;
140 GOSUB180&lt;br /&gt;
150 IF SP=0 THEN B$=B$+&amp;quot; &amp;quot;:GOTO120&lt;br /&gt;
160 IF  PA&amp;gt;=MS  THEN B$=B$-STRING$(DS+2,32):SP=SP-DS-1:PA=PA+1:&lt;br /&gt;
GOTO120&lt;br /&gt;
170 B$=B$+STRING$(DS+1,32):SP=SP-DS:GOTO200&lt;br /&gt;
180 IF MID$(A$,P,1)=&amp;quot; &amp;quot; THEN P=P+1:GOTO180:ELSE&lt;br /&gt;
RETURN&lt;br /&gt;
190 F=INSTR(P,A$,&amp;quot; &amp;quot;):RETURN&lt;br /&gt;
200 B$=LEFT$(B$,LL)&lt;br /&gt;
210 A$=B$:PRINT A$&lt;br /&gt;
&lt;br /&gt;
DISK DRIVE NUMBERS IN PROGRAMS&lt;br /&gt;
&lt;br /&gt;
You can use  specified  drive  numbers  in  programs, using the&lt;br /&gt;
command DRIVE n, where n  is  a  number  from  1  to 4; but you&lt;br /&gt;
cannot specify a variable with this command.&lt;br /&gt;
You can input a variable and  use  it as part of the READ/WRITE&lt;br /&gt;
commands, as follows:&lt;br /&gt;
100 INPUT&amp;quot;drive number&amp;quot;;D&lt;br /&gt;
110 FWRITE CHR$(48+D)+&amp;quot;:FILENAME.DAT&amp;quot;;variable list&lt;br /&gt;
Alternatively you can set the  default drive to whatever number&lt;br /&gt;
from 1 to 4 you specify, with a&lt;br /&gt;
poke: eg POKE 235,D or  POKE1546,D  personally I always use the&lt;br /&gt;
latter.&lt;br /&gt;
&lt;br /&gt;
SELECTING MENU OPTIONS&lt;br /&gt;
&lt;br /&gt;
Suppose the option required is  in  A$ and they are sequential,&lt;br /&gt;
A, B, C etc, then:- ON ASC(A$-64) GOTO 100,200,300,etc.&lt;br /&gt;
If they are NOT sequentioal, ie A,L,M,S,X etc&lt;br /&gt;
10 A$=INKEY$:IF A$=&amp;quot;&amp;quot; THEN 10&lt;br /&gt;
20 ON INSTR(A$,&amp;quot;ALMSX etc&amp;quot;)GOTO100,200,300 etc&lt;br /&gt;
30 PRINT&amp;quot;INVALID OPTION&amp;quot;:GOTO10&lt;br /&gt;
&lt;br /&gt;
INVERSE VIDEO&lt;br /&gt;
&lt;br /&gt;
(A) Changing text screen to green on black. (D32 AND D64)&lt;br /&gt;
&lt;br /&gt;
10 CLEAR200,32539&lt;br /&gt;
20 FORX=32540 TO 32635:READ A$&lt;br /&gt;
30 POKEX,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$):NEXT&lt;br /&gt;
40 FOR X=0TO127:PRINT@0,CHR$(X):POKEX+32627,PEEK(1024):NEXT&lt;br /&gt;
50&lt;br /&gt;
POKE359,126:POKE360,127:POKE361,28:POKE416,126:POKE417,127:POKE&lt;br /&gt;
418,109:CLS&lt;br /&gt;
60 DATA32,62,34,36,9E,88,81,8,26,D,8C,4,0,27,35,86,20,A7,84,A7,&lt;br /&gt;
82,26,15,81,D,26,4,8D,29,20,D,4D,2B,8,10,8E,7F,7D,A6,A6,88,40,&lt;br /&gt;
A7,80,9F,88,8C,5&lt;br /&gt;
70 DATA FF,23,11,8E,4,0,EC,88,20,ED,81,8C,5,E0,25,F6,9F,88,8D,&lt;br /&gt;
2,35,B6,86,20,A7,80,1F,10,C4,1F,26,F6,39,2F,1,39,35,10,8C,BA,62&lt;br /&gt;
,26,F8,C6,20,7E,BA,79&lt;br /&gt;
CLS WILL WORK OKAY,  BUT  CLEAR  OR  RESET  WILL  RESULT IN THE&lt;br /&gt;
SCREEN REVERTING TO BLACK ON GREEN&lt;br /&gt;
&lt;br /&gt;
(B) Green or orange on black for D64 only.&lt;br /&gt;
&lt;br /&gt;
Enter 64 mode &amp;amp; run  following  basic  program: This caters for&lt;br /&gt;
CLS and RESET and sets to an  orange screen if you enter SCREEN&lt;br /&gt;
0,1&lt;br /&gt;
10 POKE 59735,15&lt;br /&gt;
20 POKE 62659,32&lt;br /&gt;
30 POKE 63992,32&lt;br /&gt;
40 POKE 64423,32&lt;br /&gt;
50 POKE 64447,32&lt;br /&gt;
60 POKE 64470,8&lt;br /&gt;
70 POKE 64474,2&lt;br /&gt;
80 POKE 64475,128&lt;br /&gt;
90 POKE 64476,96&lt;br /&gt;
100 POKE 283,105&lt;br /&gt;
110 POKE 284,253&lt;br /&gt;
&lt;br /&gt;
AUTO REPEAT ON THE D32&lt;br /&gt;
&lt;br /&gt;
Although the  D64  has  autorepeat  in  the  64  mode,  the D32&lt;br /&gt;
keyboard will auto repeat with the following subroutine:&lt;br /&gt;
10 POKE &amp;amp;HFF04,(PEEK(&amp;amp;HFF03)AND &amp;amp;HFE)&lt;br /&gt;
20 POKE &amp;amp;H10D,&amp;amp;HBF:POKE &amp;amp;H10E,&amp;amp;H20&lt;br /&gt;
30 POKE &amp;amp;HFF03,(PEEK(&amp;amp;HFF03)OR 1)&lt;br /&gt;
&lt;br /&gt;
DREAM&lt;br /&gt;
&lt;br /&gt;
To make it easier to save  source  code  to tape, as the header&lt;br /&gt;
used in Dream  is  too  short  for  some  recorders  which have&lt;br /&gt;
trouble getting up to speed in time.&lt;br /&gt;
POKE 29788,215:POKE 29789,145&lt;br /&gt;
This lengthens the  header  tone,  but  slows  up the recording&lt;br /&gt;
slightly.&lt;br /&gt;
&lt;br /&gt;
IF THIS STILL DOES NOT WORK, TRY THE FOLLOWING:&lt;br /&gt;
EXIT from  Dream  with  BREAK/Q  and  when  in  Basic  type the&lt;br /&gt;
following:&lt;br /&gt;
CSAVEM&amp;quot;FILENAME&amp;quot;,PEEK(&amp;amp;H5F8A)*256+PEEK(&amp;amp;H5F8B),&amp;amp;H6000,&amp;amp;H6080&lt;br /&gt;
Press PLAY &amp;amp; RECORD on Cassette recorder and then PRESS ENTER.&lt;br /&gt;
To RELOAD into Dream:&lt;br /&gt;
a) Load Dream but don&amp;#039;t EXEC.&lt;br /&gt;
b) CLOAD&amp;quot;FILENAME&amp;quot;&lt;br /&gt;
c) EXEC&lt;br /&gt;
d) Reply &amp;#039;Y&amp;#039; to &amp;#039;Old text?&amp;#039; prompt.&lt;br /&gt;
&lt;br /&gt;
STRINGS&lt;br /&gt;
&lt;br /&gt;
When  you  use  temporary   variables   in  programs,  such  as&lt;br /&gt;
X$=INKEY$,  use  the  same  variables   over  and  over  again,&lt;br /&gt;
otherwise you can get an OS (out of string space error).&lt;br /&gt;
You can force a  Garbage  collection  by  using EXEC36055. This&lt;br /&gt;
makes the computer sort out the string space.&lt;br /&gt;
&lt;br /&gt;
FILEMASTER&lt;br /&gt;
&lt;br /&gt;
When you wish to update a file  and save it with the same name,&lt;br /&gt;
the program justs tags the updated  file  on the end of the old&lt;br /&gt;
file, rather than killing the old  file first. You can get over&lt;br /&gt;
this problem by changing the following lines in OLDFILE.&lt;br /&gt;
3640 MN$+NM$+&amp;quot;DAT&amp;quot;:KILL MN$:FWRITE NM$;RL&lt;br /&gt;
8005 GOTO 3640&lt;br /&gt;
By adding the following line, the  number of each record can be&lt;br /&gt;
printed:-&lt;br /&gt;
5587 PRINT#DV,R(LN)+1&lt;br /&gt;
&lt;br /&gt;
LLISTINGS&lt;br /&gt;
&lt;br /&gt;
To printout listings in the same width as the Dragon screen (ie&lt;br /&gt;
32 characters per line) - POKE &amp;amp;H148,0:POKE &amp;amp;H9B,32:LLIST&lt;br /&gt;
&lt;br /&gt;
BASIC ADDRESSES&lt;br /&gt;
&lt;br /&gt;
START ADDRESS: STADR=PEEK(25)*256+PEEK(26)&lt;br /&gt;
END ADDRESS:   ENADR=PEEK(27)*256+PEEK(28)-1&lt;br /&gt;
&lt;br /&gt;
,CE 1&lt;br /&gt;
DISK FILES&lt;br /&gt;
&lt;br /&gt;
ASCII TEXT FILES&lt;br /&gt;
Last byte is always &amp;quot;1A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
BASIC FILES&lt;br /&gt;
DRAGON - Start with a 9 byte header&lt;br /&gt;
        1) 55(hex)&lt;br /&gt;
        2) File type 01 Basic etc, 02 M/code&lt;br /&gt;
        3/4) Load Address&lt;br /&gt;
        5/6)Length of program ie length of file less 9 header&lt;br /&gt;
bytes.&lt;br /&gt;
        7/8) Exec address  -put  into  &amp;amp;H9D/9E  to tell basic&lt;br /&gt;
where to start execution&lt;br /&gt;
        9) AA(hex)&lt;br /&gt;
        Bytes 1 &amp;amp; 9 are used by Basic to identify the header,&lt;br /&gt;
otherwise the DOS assumes its a DATA file.&lt;br /&gt;
        End with 3 NULL bytes - 00,00,00&lt;br /&gt;
&lt;br /&gt;
NON-SEGMENTED M/L FILES&lt;br /&gt;
DRAGON - as for basic above.&lt;br /&gt;
COCO - Start with a 5 byte header.&lt;br /&gt;
        a) Null byte 00&lt;br /&gt;
        b) 2 bytes  which  specify  number  of  data bytes in&lt;br /&gt;
program -ie length in Hex&lt;br /&gt;
        c) 2 bytes which specify start (LOAD) address&lt;br /&gt;
- End with a 5 byte tail sequence.&lt;br /&gt;
        a) FF byte&lt;br /&gt;
        b) 2 null bytes 00,00&lt;br /&gt;
        c) 2 bytes which specify EXEC address&lt;br /&gt;
- Note - the End  address  is  not  stored, but is calculated&lt;br /&gt;
from LOAD address plus file length minus 1.&lt;br /&gt;
&lt;br /&gt;
SEGMENTED M/L FILES&lt;br /&gt;
COCO - Same as for  non-segmented  files,  but  at the end of&lt;br /&gt;
every segment they have ANOTHER  header  and so on. They only&lt;br /&gt;
have one END sequence and ONE EXEC address.&lt;br /&gt;
&lt;br /&gt;
TO SAVE GRAPHICS TO TAPE OR DISK&lt;br /&gt;
&lt;br /&gt;
If you do not know the address of the page in&lt;br /&gt;
use you can save the currently displayed graphic&lt;br /&gt;
page in any PMODE with the following:-&lt;br /&gt;
&lt;br /&gt;
(C)SAVE(M)&amp;quot;FILENAME&amp;quot;,PEEK(186) *&lt;br /&gt;
256+PEEK(187),PEEK(183) * 256 + PEEK(184),33649&lt;br /&gt;
&lt;br /&gt;
AUTOREPEATING KEYS FOR THE D32&lt;br /&gt;
&lt;br /&gt;
FOR X=337 TO 345: POKE X,255: NEXT: X$=INKEY$&lt;br /&gt;
&lt;br /&gt;
COLD START&lt;br /&gt;
&lt;br /&gt;
A Cold Start can be forced by POKE 113,0 and pressing RESET&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PAUSE&lt;br /&gt;
&lt;br /&gt;
EXEC 41194 can be used on the D32 and the D64 in 32 mode to&lt;br /&gt;
pause  a  program,  eg  following  a  page  of  instructions.&lt;br /&gt;
Pressing any key restarts the program.&lt;br /&gt;
&lt;br /&gt;
INVERTING GRAPHICS PAGES&lt;br /&gt;
&lt;br /&gt;
This short machine code subroutine will invert the first four&lt;br /&gt;
pages of the graphic screens.  That  is change the foreground&lt;br /&gt;
colour to the background colour and vice versa.&lt;br /&gt;
To operate EXEC&amp;amp;H6000 or EXEC 24576.&lt;br /&gt;
110 FOR X=24576 to 24595&lt;br /&gt;
120 READ A$:POKE X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT X&lt;br /&gt;
130 DATA 8E, 06,00,A6,84,88,FF,A7,84,30,01,8C,1E,00,27,03,7E,&lt;br /&gt;
60,03,39&lt;br /&gt;
The Data underlined refer to  the  addresses of the start and&lt;br /&gt;
end of the first four graphic  pages, when using cassette. If&lt;br /&gt;
you are using DISKS then replace with 0C,00 and 24,00.&lt;br /&gt;
&lt;br /&gt;
RESCUE OPERATION&lt;br /&gt;
&lt;br /&gt;
Sometimes  when using a mixture  of BASIC and M/code routines&lt;br /&gt;
you can cause a  crash  when  the   Dragon  freezes. The only&lt;br /&gt;
option being to  press  RESET.  On  occasions  after pressing&lt;br /&gt;
RESET and typing LIST, all you get are the first few lines of&lt;br /&gt;
the BASIC program followed by garbled lines.&lt;br /&gt;
To get your program back simply type RENUM.&lt;br /&gt;
You will be unable to RUN it,  but you can SAVE it and reload&lt;br /&gt;
after a COLD START.&lt;br /&gt;
&lt;br /&gt;
THREE COLOUR PMODE4&lt;br /&gt;
&lt;br /&gt;
10 PMODE3,1:SCREEN1,1:POKE 65314,248&lt;br /&gt;
This line tells BASIC that the  four colour mode is required,&lt;br /&gt;
but the  POKE  tells  the  VIDEO  chip  that  2  colour  high&lt;br /&gt;
resolution is wanted.&lt;br /&gt;
The new colour set has 0  =  WHITE,  1  = BLACK and 2 = LIGHT&lt;br /&gt;
PURPLE&lt;br /&gt;
&lt;br /&gt;
DISABLE BREAK KEY&lt;br /&gt;
&lt;br /&gt;
Enter the following Pokes in DIRECT mode:&lt;br /&gt;
POKE 411,228: POKE412,203:  POKE  413,4:  POKE  414,237: POKE&lt;br /&gt;
415,228&lt;br /&gt;
THEN to DISABLE POKE 410,236&lt;br /&gt;
And to ENABLE POKE 410,57&lt;br /&gt;
&lt;br /&gt;
SLOW DOWN LIST&lt;br /&gt;
&lt;br /&gt;
POKE 359,60    -  This  effects  everything  that  is  OUTPUT&lt;br /&gt;
including PRINTING. POKE 359,57 for NORMAL SPEED.&lt;br /&gt;
&lt;br /&gt;
EASY MOVING GRAPHICS&lt;br /&gt;
&lt;br /&gt;
First DRAW  the  shape  you  want  and  put  it  in  a STRING&lt;br /&gt;
variable, eg C$. Then  assign  a  couple  of variables re the&lt;br /&gt;
LOCATION and DRAW your shape at the desired location.&lt;br /&gt;
10 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
20 C$=&amp;quot;D6F4H4G4E4U3R3L6R3U3R1D1L2U1R1&amp;quot;&lt;br /&gt;
30 X=128:Y=96&lt;br /&gt;
40 DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y)+C$&lt;br /&gt;
and to move the man, change line 30 as follows&lt;br /&gt;
30 FOR X=10 TO 250 STEP 4: Y=96&lt;br /&gt;
50 PCLS:NEXT X&lt;br /&gt;
60 EXEC34091        (to hold graphics in view)&lt;br /&gt;
&lt;br /&gt;
CLEAR SCREEN IN M/CODE&lt;br /&gt;
&lt;br /&gt;
(A) by using existing ROM routine:&lt;br /&gt;
    LDB #$60&lt;br /&gt;
    JSR 47737&lt;br /&gt;
    RTS&lt;br /&gt;
(b) this is the faster way:&lt;br /&gt;
     LDX #$0400&lt;br /&gt;
     LDU #$0600&lt;br /&gt;
LOOP STU ,X++&lt;br /&gt;
     BNE LOOP&lt;br /&gt;
     RTS&lt;br /&gt;
&lt;br /&gt;
PRINTER LINE FEED&lt;br /&gt;
&lt;br /&gt;
If your Printer does not give  an  automatic line feed, or if&lt;br /&gt;
its been turned off for  OS9,  STYLO  etc. POKE330,2 and POKE&lt;br /&gt;
330,1 to turn it off again.&lt;br /&gt;
&lt;br /&gt;
PRINTER FIELD WIDTH&lt;br /&gt;
&lt;br /&gt;
To alter the comma field  width  (default 16), POKE 153, with&lt;br /&gt;
the new field and POKE 154 with the last field.&lt;br /&gt;
Eg: For 6 fields of length 10, POKE 153,10: POKE154,50&lt;br /&gt;
Useful for printing columns, but  dont  use the value 0,which&lt;br /&gt;
makes the Printer hang!&lt;br /&gt;
&lt;br /&gt;
GRAPHICS - HIDING SCREENS&lt;br /&gt;
&lt;br /&gt;
You  can  hide  Graphics   Screens  behind  Loading  Screens,&lt;br /&gt;
providing you DIM correctly.&lt;br /&gt;
PMODE 0     DIM 307 per screen&lt;br /&gt;
PMODE 1 &amp;amp; 2 DIM 614 per screen&lt;br /&gt;
PMODE 3 &amp;amp; 4 DIM 1228 per screen&lt;br /&gt;
GET(0,0)-(255,191),A,B,C etc and PUT back when required.&lt;br /&gt;
&lt;br /&gt;
TEXT IN M/CODE PROGRAMS&lt;br /&gt;
&lt;br /&gt;
To  check  for  text  in   long  machine  code  programs,  eg&lt;br /&gt;
Adventures etc, to look for clues?&lt;br /&gt;
FOR X=0 TO &amp;amp;H7FFF:PRINT CHR$(PEEK(X));: NEXT&lt;br /&gt;
&lt;br /&gt;
INCREASE MEMORY AVAILABLE&lt;br /&gt;
&lt;br /&gt;
To increase memory available to the maximum when using DISKS,&lt;br /&gt;
ie to perform a PCLEAR 0  - No graphic pages.&lt;br /&gt;
COCO: POKE 25,14: POKE 3584,0: NEW&lt;br /&gt;
DRAGON: POKE 25,12:POKE3072,0: NEW&lt;br /&gt;
This gives 28967 available bytes of memory&lt;br /&gt;
&lt;br /&gt;
To increase memory when  not  using  disks  -  POKE 25,6: NEW&lt;br /&gt;
before loading cassette&lt;br /&gt;
&lt;br /&gt;
GRAPHICS PAGES - ADDRESSES&lt;br /&gt;
&lt;br /&gt;
To find START and END addresses of Graphic Pages in use:-&lt;br /&gt;
PRINT PEEK(186)*256+PEEK(187) - for the START&lt;br /&gt;
PRINT PEEK(183)*256+PEEK(184) - for the END&lt;br /&gt;
&lt;br /&gt;
PRINTER - TO AVOID HANG UPS&lt;br /&gt;
&lt;br /&gt;
Insert the following line in your program to ensure that your&lt;br /&gt;
printer is on line, so that the program will not &amp;#039;hang&amp;#039;.&lt;br /&gt;
P=PEEK(65314) AND 1: IF P=1 THEN PRINT&amp;quot;PRINTER NOT ON LINE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PRINTER - PARAMETER SETTING&lt;br /&gt;
&lt;br /&gt;
Characters per line PEEK(155) - Default 132&lt;br /&gt;
To alter to 80 or  even  40  etc  POKE  328,0: POKE 155,80 or&lt;br /&gt;
whatever.&lt;br /&gt;
&lt;br /&gt;
DRIVE NUMBER&lt;br /&gt;
&lt;br /&gt;
Some Dragons will allow you  to  use  DRIVE and the number in&lt;br /&gt;
programs, but if you get an error, use POKE&amp;amp;H60,2 or number.&lt;br /&gt;
&lt;br /&gt;
BAUD RATE CODE&lt;br /&gt;
&lt;br /&gt;
This short subroutine will fill  in  the  array with the baud&lt;br /&gt;
rate associated with the array index:&lt;br /&gt;
DIM BD(15)&lt;br /&gt;
FOR X=1 to 15: READ BD(X):NEXT&lt;br /&gt;
DATA&lt;br /&gt;
50,75,110,135,150,300,600,1200,1800,2400,3600,4800,7200,9600&lt;br /&gt;
&lt;br /&gt;
DATA TROUBLE&lt;br /&gt;
&lt;br /&gt;
When using HEX loaders etc,  to  find  the line number of the&lt;br /&gt;
last DATA statement loaded:&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50)&lt;br /&gt;
&lt;br /&gt;
AWAIT KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If two keypresses are required then EXEC41184 (otherwise&lt;br /&gt;
EXEC34091)&lt;br /&gt;
&lt;br /&gt;
KEYBOARD DISABLE&lt;br /&gt;
&lt;br /&gt;
(A) POKE 65281,50  (B) POKE 65301,0&lt;br /&gt;
AND POKE 65301,20 TO ENABLE AGAIN (from the program!)&lt;br /&gt;
&lt;br /&gt;
RESET - TO DISABLE - POKE 113,85&lt;br /&gt;
&lt;br /&gt;
GRAPHICS (Colour)&lt;br /&gt;
&lt;br /&gt;
(a) Striped effects -&lt;br /&gt;
    Poke 178,N:LINE(X,Y)-(X1,Y1),PSET,BF&lt;br /&gt;
(b) Foreground colour - PEEK (178)&lt;br /&gt;
(c) Background colour - PEEK (179)&lt;br /&gt;
(d) Active colour     - PEEK (180)&lt;br /&gt;
(e) Graphic Mode      - PEEK (181/2)&lt;br /&gt;
&lt;br /&gt;
TEXT SCREEN&lt;br /&gt;
&lt;br /&gt;
(a) Move to lower half of screen - POKE 136,5&lt;br /&gt;
(b) Move to upper half of screen - POKE 136,4&lt;br /&gt;
(c) Cursor position in Low-res   - PEEK (136/7)&lt;br /&gt;
(d) ASCII code of last keypress  - PEEK (135)&lt;br /&gt;
&lt;br /&gt;
CURSOR - TO REDEFINE&lt;br /&gt;
&lt;br /&gt;
POKE 363,(ASCII code of required character):&lt;br /&gt;
POKE 364,167:&lt;br /&gt;
POKE 365,159: POKE 366,0: POKE 367,136&lt;br /&gt;
To ACTIVATE above - POKE 362,134 and to DEACTIVATE&lt;br /&gt;
POKE362,57&lt;br /&gt;
&lt;br /&gt;
CASSETTE - HIGH SPEED MODE RESCUE&lt;br /&gt;
&lt;br /&gt;
If you accidentally CSAVE a program while in the High Speed&lt;br /&gt;
mode then load it back at normal speed then:&lt;br /&gt;
POKE 146,8: POKE 147,4: POKE 148,8&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE&lt;br /&gt;
&lt;br /&gt;
To turn the BREAK key on and off within a program, use this&lt;br /&gt;
subroutine:&lt;br /&gt;
10 CLEAR 300, 32735&lt;br /&gt;
20 FOR X = 32736 TO 32756&lt;br /&gt;
30 READ A$: A=VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
40 POKE X,A: NEXT&lt;br /&gt;
50 POKE 411,127: POKE 412,224&lt;br /&gt;
60 PRINT&amp;quot;BREAK DISABLED&amp;quot;: POKE 410,126&lt;br /&gt;
70 FOR DL=1 TO 2500:NEXT&lt;br /&gt;
80 CLS: PRINT &amp;quot;BREAK ENABLED&amp;quot;: POKE 410,57&lt;br /&gt;
90 FOR DL=1 TO 2500: NEXT: GOTO60&lt;br /&gt;
100 DATA&lt;br /&gt;
32,62,1C,AF,BD,80,06,26,07,81,13,26,03,7E,85,2B,&lt;br /&gt;
97,87,7E,84,A6&lt;br /&gt;
&lt;br /&gt;
OR AN EVEN SHORTER ROUTINE:&lt;br /&gt;
10 FOR X=&amp;amp;HF8 TO &amp;amp;HFE: READ A: POKE X,A:NEXT&lt;br /&gt;
20 FOR X=&amp;amp;H19A TO &amp;amp;H19C: READ A: POKE X,A: NEXT&lt;br /&gt;
30 DATA 50,98,28,175,126,173,165&lt;br /&gt;
40 DATA 126,0,248&lt;br /&gt;
NOTE: These routines do not work during INPUT lines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BREAK - TO DISABLE INCLUDING INPUT LINES&lt;br /&gt;
&lt;br /&gt;
This short M/code subroutine will disable the BREAK key,&lt;br /&gt;
including during INPUT lines.&lt;br /&gt;
10 CLEAR 200, 32550&lt;br /&gt;
20 FOR X-0 TO 55: READ A$: POKE32551+X,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$): NEXT&lt;br /&gt;
30 DATA 8E,7F,3C,BF,01,6B,8E,7F,54,BF,01,9B,86,7E,B7,01&lt;br /&gt;
        6A,B7,01,9A,39,0D,6F,27,01,39,32,62,34,14,BD,80&lt;br /&gt;
        09,BD,80,06,27,F8,81,03,27,F4,7E,B5,42,9F,DF,35&lt;br /&gt;
        10,30,04,34,10,9E,DF,39&lt;br /&gt;
40 EXEC 32551&lt;br /&gt;
&lt;br /&gt;
TELEWRITER&lt;br /&gt;
&lt;br /&gt;
For those who have the Cassette version, you can change the&lt;br /&gt;
colour set and have a green on black screen by POKE&lt;br /&gt;
&amp;amp;H2FDF,240 before loading.&lt;br /&gt;
&lt;br /&gt;
PRINT - VARY OUTPUT TO SCREEN OR PRINTER&lt;br /&gt;
&lt;br /&gt;
100 INPUT&amp;quot;OUTPUT TO GO TO SCREEN OR PRINTER&amp;quot;; A$&lt;br /&gt;
110 A$=LEFT$(A$,1)&lt;br /&gt;
120 IF A$=&amp;quot;S&amp;quot; THEN P=0:GOTO(Screen Print routine at 150 etc&lt;br /&gt;
using PRINT#P)&lt;br /&gt;
130 IF A$=&amp;quot;P&amp;quot; THEN P= -2 ELSE GOTO100&lt;br /&gt;
140 PRINT#P,(Your Printer routine)&lt;br /&gt;
&lt;br /&gt;
CONVERT HEX/DECIMAL/HEX&lt;br /&gt;
&lt;br /&gt;
Let the DRAGON (a) work it out: DECIMAL/HEX   ? HEX$(n)&lt;br /&gt;
       HEX/DECIMAL   ? VAL(&amp;amp;Hetc)&lt;br /&gt;
               (b) add them for you ? HEX$(&amp;amp;H0A+&amp;amp;HFF)&lt;br /&gt;
&lt;br /&gt;
DISPLAY&lt;br /&gt;
&lt;br /&gt;
To change the TEXT screen from GREEN to ORANGE, in order to&lt;br /&gt;
highlight instructions etc - POKE 65314,13&lt;br /&gt;
&lt;br /&gt;
LOOPS&lt;br /&gt;
&lt;br /&gt;
Use FOR/NEXT loops in preference to GOTO for Speed and&lt;br /&gt;
Efficiency.&lt;br /&gt;
&lt;br /&gt;
CENTERING A TITLE&lt;br /&gt;
&lt;br /&gt;
CLS: PRINT TAB((X-LEN(A$))/2)A$&lt;br /&gt;
Where A$ is the Title and X is the number of characters per&lt;br /&gt;
screen line/printer line.&lt;br /&gt;
&lt;br /&gt;
CASSETTES&lt;br /&gt;
&lt;br /&gt;
To load a headerless program - MOTORON: EXEC 46868&lt;br /&gt;
&lt;br /&gt;
WAIT FOR KEYPRESS&lt;br /&gt;
&lt;br /&gt;
If you use EXEC 34091, The Key pressed can be read from the&lt;br /&gt;
A Register.&lt;br /&gt;
EXEC 34091: X$= INKEY$: PRINT X$&lt;br /&gt;
or get value of X$ with Y=ASC(X$)-48 (for numbers 1 to 9)&lt;br /&gt;
&lt;br /&gt;
CASSETTE LOADING&lt;br /&gt;
&lt;br /&gt;
To resurrect programs accidentally saved  at the faster speed&lt;br /&gt;
(POKE 65495,0).&lt;br /&gt;
Load the program back using the double speed poke.&lt;br /&gt;
AUDIO ON: POKE65497,0: CLOAD&lt;br /&gt;
You lose video at this speed and  so  the Audio is on to tell&lt;br /&gt;
you when the tape has  finished  loading. Press RESET and try&lt;br /&gt;
listing program. If the DRAGON does not return to normal mode&lt;br /&gt;
POKE  65495,126  and   then   list.   The  program  sometimes&lt;br /&gt;
unfortunately is not recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DISKS AND THE DRAGON 64 ==&lt;br /&gt;
&lt;br /&gt;
=== (A) DETACH DOS ===&lt;br /&gt;
&lt;br /&gt;
Unplug your DOS using Software instead of manually unplugging&lt;br /&gt;
the cartridge and risking damaging the connections.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLS7:PCLEAR4&lt;br /&gt;
2 POKE1541,2&lt;br /&gt;
3 FOR X=0 TO 146:POKE3073+X,PEEK(46010+X):NEXT&lt;br /&gt;
4 POKE 3072,18:POKE3197,0&lt;br /&gt;
5 FOR X=1 TO 3: READ S,F:  FOR J=S TO F: READ A$&lt;br /&gt;
6 POKE 3072+J,VAL(&amp;quot;&amp;amp;H&amp;quot;+A$)&lt;br /&gt;
7 NEXT J,X&lt;br /&gt;
8 DATA 148,156,8E,0C,9C,BD,90,E5,7E,83,71,157,188&lt;br /&gt;
9 DATA 44,4F,53,20,44,45,54,41,43,48,20,28,43,29,20,31,&lt;br /&gt;
       39,38,35,20,44,52,41,47,4F,4E,20,55,53,45,52,00&lt;br /&gt;
10 DATA 13,17,8E,7F,FE,20,0E&lt;br /&gt;
11 POKE 114,12:POKE 115,0&lt;br /&gt;
12 PRINT@224,STRING$(32,236);&lt;br /&gt;
13 PRINT@256,&amp;quot;  PRESS RESET TO DETACH DOS  &amp;quot;&lt;br /&gt;
14 PRINT@288,STRING$(32,227);&lt;br /&gt;
15 SCREEN 0,1&lt;br /&gt;
16 GOTO16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
TO &amp;#039;UNPLUG&amp;#039; DOS, RUN PROGRAM and press RESET on cue.&lt;br /&gt;
TO REGAIN DOS, POKE 113,0 and press RESET.&lt;br /&gt;
&lt;br /&gt;
=== (B) MOVING BASIC AND DOS TO HIGH MEMORY ===&lt;br /&gt;
&lt;br /&gt;
Enabling DISKS to  be  used  in  the  D64  mode  and giving a&lt;br /&gt;
further 8k available for program storage from 57344 onwards.&lt;br /&gt;
M/code source - assemble in DREAM etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        ORCC    #255    Disable IRQ&amp;#039;s&lt;br /&gt;
        LDX     #32768  Start of Basic&lt;br /&gt;
LOOP    STA     $FFDE   ROM mode&lt;br /&gt;
        LDA     ,X      Get byte from ROM&lt;br /&gt;
        STA     $FFDF   RAM mode&lt;br /&gt;
        STA     ,X+     Store in RAM&lt;br /&gt;
        CMPX    #57344  All copied&lt;br /&gt;
        BLO     LOOP    No Branch again&lt;br /&gt;
        ANDCC   #255-16 Enable IRQ&amp;#039;s&lt;br /&gt;
        RTS             Return to Basic in 64k mode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This produces through DREAM the following Data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1 CLEAR 600&lt;br /&gt;
2 FOR A=1 to 18&lt;br /&gt;
3 SREAD 1,16,A,A$,B$&lt;br /&gt;
4 SWRITE 1,20,A,A$,B$&lt;br /&gt;
5 NEXT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If that doesn&amp;#039;t accomplish it, which means  that Track 16&lt;br /&gt;
was also corrupted, then hard luck! You&amp;#039;ll either have to&lt;br /&gt;
reformat the disk or rebuild the Directory Track, using a&lt;br /&gt;
DISK FIXIT type program. Try Pam D&amp;#039;Arcy&amp;#039;s program &amp;#039;DISKFIX&amp;#039;&lt;br /&gt;
from the NDUG.&lt;br /&gt;
&lt;br /&gt;
=== (D) CARTRIDGE INTERFACE ===&lt;br /&gt;
&lt;br /&gt;
ODD number lines are on the UPPER side and are all GROUND.&lt;br /&gt;
EVEN numbered lines are on the LOWER side.&lt;br /&gt;
Looking down on the Cartridge Edge connector the pins run&lt;br /&gt;
from 2 to 34, from right to left.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        2&lt;br /&gt;
        4&lt;br /&gt;
        6&lt;br /&gt;
        8   INDEX&lt;br /&gt;
        10  DRIVE 0&lt;br /&gt;
        12  DRIVE 1&lt;br /&gt;
        14&lt;br /&gt;
        16  MOTOR&lt;br /&gt;
        18  DIRECTION&lt;br /&gt;
        20 STEP&lt;br /&gt;
        22  WRITE DATA&lt;br /&gt;
        24  WRITE GATE&lt;br /&gt;
        26  TRACK 0&lt;br /&gt;
        28  WRITE PROTECT&lt;br /&gt;
        30  READ DATA&lt;br /&gt;
        32  SIDE 1&lt;br /&gt;
        34  READY - Not connected in Dragondos&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== (E) DISK - TO PRINT DIRECTORY ===&lt;br /&gt;
&lt;br /&gt;
POKE 111,254:DIR&lt;br /&gt;
&lt;br /&gt;
=== (F) DISK - DELTADOS ===&lt;br /&gt;
&lt;br /&gt;
This POKE allows long BASIC programs to be run without OM&lt;br /&gt;
errors.&lt;br /&gt;
LOAD program and if it does not contain a CLEAR statement,&lt;br /&gt;
insert at the beginning of the program:-&lt;br /&gt;
POKE 377,57: CLEAR 200, &amp;amp;H7FFF&lt;br /&gt;
Otherwise just insert the POKE on its own.&lt;br /&gt;
NOW SAVE TO DISK and then RUN. If the DOS space was not&lt;br /&gt;
overwritten when the program was run, then the DOS can be&lt;br /&gt;
RE-ENABLED  with POKE 377,126:CLEAR 200,&amp;amp;H78FF.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - FINDING CO-ORDINATES ==&lt;br /&gt;
&lt;br /&gt;
To convert PMODE4 co-ordinates (X,Y) to PRINT ` positions on&lt;br /&gt;
the TEXT screen:&lt;br /&gt;
P=INT(X/8)+32*INT(Y/12): PRINT P: PRINT@P,&amp;quot;*&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
== LIST ==&lt;br /&gt;
&lt;br /&gt;
=== (A) TO SLOW DOWN ===&lt;br /&gt;
The more common method but NOT TO BE USED WITH DOS  OR ANY&lt;br /&gt;
CARTRIDGE in place.&lt;br /&gt;
POKE 359,19 and if still too fast POKE 360,19 also.&lt;br /&gt;
RESET by poking a value of 57 to both locations.&lt;br /&gt;
&lt;br /&gt;
=== (B) TO DISABLE ===&lt;br /&gt;
POKE 383,157: POKE 383,158&lt;br /&gt;
To re-enable POKE 383,126&lt;br /&gt;
&lt;br /&gt;
== Program loading tricks ==&lt;br /&gt;
&lt;br /&gt;
=== FINDING ADDRESS OF M/CODE PROGRAM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PRINT PEEK(487)*256+PEEK(458)  ......(A)&lt;br /&gt;
PRINT PEEK(126)*256+PEEK(127)-1 .....(B)&lt;br /&gt;
PRINT PEEK(157)*256+PEEK(158)  ......(C)&lt;br /&gt;
SAVE OR CSAVEM&amp;quot;PROGRAM&amp;quot;, A, B, C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TO DISABLE AUTORUN PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
CLOADM&amp;quot;PROGRAM&amp;quot;, 1298&lt;br /&gt;
CSAVEM&amp;quot;PROGRAM&amp;quot;, A+1298, B+1298, C+1298&lt;br /&gt;
&lt;br /&gt;
=== TO RELOCATE MACHINE CODE PROGRAMS ===&lt;br /&gt;
&lt;br /&gt;
(A) ON DISK - LOAD &amp;quot;PROGRAM.BIN&amp;quot;, n&lt;br /&gt;
(B) ON TAPE - CLOADM&amp;quot;PROGRAM&amp;quot;, n&lt;br /&gt;
Where &amp;#039;n&amp;#039; is the offset, found by subtracting the old address&lt;br /&gt;
from the new address,  providing  the  new  address is higher&lt;br /&gt;
than the original address.&lt;br /&gt;
If the new address  is  below  the  original address than the&lt;br /&gt;
value of &amp;#039;n&amp;#039; = 65536 plus new address less original address.&lt;br /&gt;
&lt;br /&gt;
=== TAPE LOADING DIFFICULTIES ===&lt;br /&gt;
Before saving to cassette:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        POKE &amp;amp;H745B,255: POKE144,1   To  raise  output signal level&lt;br /&gt;
        POKE144,3: POKE 144,0 to return to default setting.&lt;br /&gt;
        POKE &amp;amp;H746b,128 for a longer header.&lt;br /&gt;
               (or try values between 1 &amp;amp; 255)&lt;br /&gt;
        POKE 65313,8   Motor on&lt;br /&gt;
        POKE 65313,247 Motor off&lt;br /&gt;
        EXEC &amp;amp;H8015    Turns on Cassette relay&lt;br /&gt;
        EXEC &amp;amp;H8018    Turns it off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARROW KEYS ===&lt;br /&gt;
Checking that one of the four arrow keys has been used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
10 IF INKEY$=CHR$(8) OR CHR$(21) THEN GOTO...(LEFT ARROW)&lt;br /&gt;
20 IF INKEY$=CHR$(9) OR CHR$(93) THEN GOTO...(RIGHT ARROW)&lt;br /&gt;
30 IF INKEY$=CHR$(10)OR CHR$(91) THEN GOTO...(DOWN ARROW)&lt;br /&gt;
40 IF INKEY$=CHR$(94)OR CHR$(95) THEN GOTO...(UP ARROW)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second CHR$ character is SHIFT plus the ARROW key.&lt;br /&gt;
&lt;br /&gt;
== GRAPHICS - HINTS and ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OVERLAYING ONE SCREEN ON ANOTHER&lt;br /&gt;
&lt;br /&gt;
The basic method is to PCLEAR8 and load one screen into Page&lt;br /&gt;
1 and the other into Page 5 (using Hi-res screens, then GET&lt;br /&gt;
the picture and PUT it over the Page 1 screen.&lt;br /&gt;
&lt;br /&gt;
10 PCLEAR8&lt;br /&gt;
20 PMODE4,1:SCREEN1,1:PCLS&lt;br /&gt;
30 LOAD &amp;quot;PICTURE1.EXT&amp;quot; &amp;#039;for disk&lt;br /&gt;
35 CLOADM&amp;quot;PICTURE1&amp;quot; &amp;#039;for tape&lt;br /&gt;
40 PMODE4,5:SCREEN1,1:PCLS&lt;br /&gt;
50 LOAD&amp;quot;PICTURE2.EXT&amp;quot;,9216 &amp;#039;or&lt;br /&gt;
55 CLOADM&amp;quot;PICTURE2&amp;quot;,6144 &amp;#039;tape&lt;br /&gt;
60 DIM A(160):GET(0,0) - (255,191),A,G&lt;br /&gt;
70 PMODE4,1:PUT(0,0)-(255,191),A,AND&lt;br /&gt;
80 GOTO80&lt;br /&gt;
&lt;br /&gt;
(FOR PMODE3 SCREENS USE &amp;#039;OR&amp;#039; IN LINE 70 INSTEAD OF &amp;#039;AND&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXTRA PAGES ON DRAGON 32&lt;br /&gt;
&lt;br /&gt;
These extra pages are Pages 17 to 20 and work on the D32,&lt;br /&gt;
but not apparently on the D64. On the latter machine pages&lt;br /&gt;
can be stored in high memory.&lt;br /&gt;
PCLEAR8&lt;br /&gt;
PMODE4,1:SCREEn1,1&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE1&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+4:NEXT&lt;br /&gt;
(I.E.) Put it into Page 5 on.&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE2&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
FORX=1TO4:PCOPY X TO X+16:NEXT&lt;br /&gt;
(C)LOAD(M)&amp;quot;PICTURE3&amp;quot;(.EXT&amp;quot;)&lt;br /&gt;
You should now have 3 pictures in memory and to see them&lt;br /&gt;
....&lt;br /&gt;
EXEC41194 &amp;#039;Picture 3 visible&lt;br /&gt;
FORX=1TO4:PCOPY X+16 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 2 on screen&lt;br /&gt;
FORX=1TO4:PCOPY X+4 TO X:NEXT&lt;br /&gt;
EXEC41194 &amp;#039;Picture 1 is back!&lt;br /&gt;
&lt;br /&gt;
DRAW COMMAND&lt;br /&gt;
&lt;br /&gt;
The Draw command always starts by fixing a point on screen&lt;br /&gt;
from which to draw and this point can be defined by&lt;br /&gt;
variables.&lt;br /&gt;
This command usually reads:&lt;br /&gt;
DRAW&amp;quot;BM&amp;quot;+STR$(X)+&amp;quot;,&amp;quot;+STR$(Y) etc&lt;br /&gt;
and most people tend to leave out that comma.&lt;br /&gt;
The DRAGON will perform the same function using the simpler:&lt;br /&gt;
DRAW&amp;quot;BM=X;=Y;&amp;quot; etc&lt;br /&gt;
Where X is the horizontal and Y is the vertical co-ordinate&lt;br /&gt;
in pixels.&lt;br /&gt;
&lt;br /&gt;
You can MOVE your graphic by simply putting the co-ordinates&lt;br /&gt;
in a loop.&lt;br /&gt;
&lt;br /&gt;
HI-RES SCREEN FLIPPER&lt;br /&gt;
&lt;br /&gt;
This Basic sub-routine will flip the screen upside down.&lt;br /&gt;
10 DIM A(10),B(10)&lt;br /&gt;
20 PMODE4,1:SCREEN1,1&lt;br /&gt;
30 FORX=0TO95:GET(0,X)-(255,X),A&lt;br /&gt;
,G:GET(0,191-X)-(255,191-X),B,G&lt;br /&gt;
40 PUT(0,X)-(255,X),B,PSET: PUT (0,191-X)-(255,191-X),A,PSET&lt;br /&gt;
50 NEXT&lt;br /&gt;
60 EXEC41194&lt;br /&gt;
&lt;br /&gt;
GET/PUT: SIZE OF DIM REQUIRED&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes used in your graphics. There are&lt;br /&gt;
1536 per graphics page, or 6144 in a PMODE3 or PMODE4 4&lt;br /&gt;
page screen, but only 3072 in PMODEs 1 and 2.&lt;br /&gt;
So take this number and divide by 20 for the odd PMODEs (1 &amp;amp;&lt;br /&gt;
3) and divide by 40 for the even modes (2 &amp;amp; 4) then&lt;br /&gt;
subtract one.&lt;br /&gt;
The result is the length of the one dimensional array&lt;br /&gt;
required to store the picture. The same applies to portions&lt;br /&gt;
of a screen.&lt;br /&gt;
For example half the entire PMODE4 screen (3072 pixels)&lt;br /&gt;
would require a DIM of :&lt;br /&gt;
(3072/40)-1 or 76&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCREEN ADDRESSES (GRAPHICS) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These depend whether you are using a disk operating system,&lt;br /&gt;
as most DOS use the first page of graphics and so with DOS&lt;br /&gt;
in place graphics start one page higher.&lt;br /&gt;
&lt;br /&gt;
Page    Tape         Disk&lt;br /&gt;
1  &amp;amp;H0600-&amp;amp;H0BFF   &amp;amp;H0C00-&amp;amp;H11FF&lt;br /&gt;
2  &amp;amp;H0C00-&amp;amp;H11FF   &amp;amp;H1200-&amp;amp;H17FF&lt;br /&gt;
3  &amp;amp;H1200-&amp;amp;H17FF   &amp;amp;H1800-&amp;amp;H1DFF&lt;br /&gt;
4  &amp;amp;H1800-&amp;amp;H1DFF   &amp;amp;H1E00-&amp;amp;H23FF&lt;br /&gt;
5  &amp;amp;H1E00-&amp;amp;H23FF   &amp;amp;H2400-&amp;amp;H29FF&lt;br /&gt;
6  &amp;amp;H2300-&amp;amp;H29FF   &amp;amp;H2A00-&amp;amp;H2FFF&lt;br /&gt;
7  &amp;amp;H2A00-&amp;amp;H2FFF   &amp;amp;H3000-&amp;amp;H35FF&lt;br /&gt;
8  &amp;amp;H3000-&amp;amp;H35FF   &amp;amp;H3600-&amp;amp;H3BFF&lt;br /&gt;
&lt;br /&gt;
To save and load screens to tape use the above scale as&lt;br /&gt;
follows for PMODE4 for example:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,&amp;amp;H600,&amp;amp;H1DFF,&amp;amp;H0600&lt;br /&gt;
or in decimal this would be:&lt;br /&gt;
CSAVEM&amp;quot;FILE&amp;quot;,1536,7679,1536&lt;br /&gt;
CLOADM&amp;quot;PIX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
But to save screens to disk you need to save one more byte,&lt;br /&gt;
else the byte in the bottom right hand cormer of the screen&lt;br /&gt;
will not be saved. Eg:-&lt;br /&gt;
SAVE&amp;quot;FILE&amp;quot;,&amp;amp;HC00,&amp;amp;H2400,&amp;amp;HC00&lt;br /&gt;
which will save it to the default extension &amp;quot;.BIN&amp;quot;, but if&lt;br /&gt;
you wish to distinguish your graphic screens from machine&lt;br /&gt;
code programs save them with an extension such as &amp;quot;.PIX&amp;quot;.&lt;br /&gt;
In decimal this would be:&lt;br /&gt;
SAVE&amp;quot;FILE.PIX&amp;quot;,3072,9216,3072.  (Superdos 9215)&lt;br /&gt;
&lt;br /&gt;
== DEBUGGING HINTS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC (Function Call) errors&lt;br /&gt;
&lt;br /&gt;
These usually occur in  the  GET,  PUT,  DRAW,  PLAY and LINE&lt;br /&gt;
commands.&lt;br /&gt;
An FC error usually means  that  you  are asking one of these&lt;br /&gt;
commands to do something they cannot  do, and the most likely&lt;br /&gt;
causes are:&lt;br /&gt;
(a) Co-ordinates out  of  range.  For  example horizontal and&lt;br /&gt;
vertical must be positive  with  horizontal less than 256 and&lt;br /&gt;
vertical less than 192.&lt;br /&gt;
(b) Dimensions of  PUT  command  may  be  more  than  the GET&lt;br /&gt;
statement.&lt;br /&gt;
(c) Execution of a string  with  an  illegal character in it.&lt;br /&gt;
For example DRAW&amp;quot;BM100,100;XL$(2);&amp;quot; -  where there is nothing&lt;br /&gt;
wrong with the DRAW command as such  - but on looking back at&lt;br /&gt;
XL$(2) you find this = &amp;quot;D2L2P2&amp;quot;  - in other words it contains&lt;br /&gt;
an illegal character in it, ie &amp;quot;P2&amp;quot;.&lt;br /&gt;
(d) The most common causes of  this error are not necessarily&lt;br /&gt;
found in the line in  question,  but  you should look back at&lt;br /&gt;
the definition of the individual components.&lt;br /&gt;
&lt;br /&gt;
OD (Out of data) errors&lt;br /&gt;
&lt;br /&gt;
These occur as a rule when you:-&lt;br /&gt;
(a) repeat or omit data statements&lt;br /&gt;
(b) or you write or copy hexloader addresses wrongly.&lt;br /&gt;
&lt;br /&gt;
PRINT PEEK(49)*256+PEEK(50) will give you  the line number of&lt;br /&gt;
the current DATA statement.&lt;br /&gt;
PRINT PEEK(51)*256+PEEK(52) will give you  the address of the&lt;br /&gt;
next item in the current Data statement.&lt;br /&gt;
&lt;br /&gt;
PAINT errors&lt;br /&gt;
&lt;br /&gt;
Paint errors can be catastrophic  in graphics, when the paint&lt;br /&gt;
spreads everywhere and while  an  error  is  NOT reported, it&lt;br /&gt;
figures that you will  not  be  too  happy  with  the mess it&lt;br /&gt;
causes!&lt;br /&gt;
If you don&amp;#039;t  know  which  particular  PAINT  command  is the&lt;br /&gt;
trouble, find where the  previous  SCREEN command is situated&lt;br /&gt;
(say line 100) and put  a  GOTO100  before each PAINT command&lt;br /&gt;
until you locate the one at fault.&lt;br /&gt;
Then check the co-ordinates  and  colour  codes for validity,&lt;br /&gt;
the co-ordinates must be INSIDE  the  area you wish to paint.&lt;br /&gt;
If  this  should  fail  then   check  the  lines  where  that&lt;br /&gt;
particular graphic shape was  formulated  and ensure that the&lt;br /&gt;
outline is completely closed off.  Check  for a one pixel gap&lt;br /&gt;
in the outline somewhere.&lt;br /&gt;
&lt;br /&gt;
USR Routines&lt;br /&gt;
&lt;br /&gt;
A well known bug in the ROM  of  the Dragon 32 means that the&lt;br /&gt;
USR command must  contain  a  zero  before  each numbered USR&lt;br /&gt;
function, but this was  corrected  in  the  Dragon 64 and the&lt;br /&gt;
zero in that machine causes an error.&lt;br /&gt;
No zero in the 32, or a zero in the 64, both show an error.&lt;br /&gt;
The  following  routine  inserted   in   your  programs  will&lt;br /&gt;
circumvent this and will  ensure  the  program should  run on&lt;br /&gt;
both machines.&lt;br /&gt;
&lt;br /&gt;
5 VS$=CHR$(PEEK(49052) + PEEK(49053)) &amp;#039;TO TEST WHETHER&lt;br /&gt;
DRAGON 32 OR 64&lt;br /&gt;
6 IF VS$=&amp;quot;64&amp;quot; THEN DEF USR1=30000 ELSE DEF USR01=30000&lt;br /&gt;
where 30000 can be any address......&lt;br /&gt;
and then later in the program...&lt;br /&gt;
IF VS$=&amp;quot;64&amp;quot; THEN X=USR1(A) ELSE X=USR01(A)&lt;br /&gt;
&lt;br /&gt;
BS Bad Subscript errors&lt;br /&gt;
&lt;br /&gt;
These usually occur when the  subscripts  in an array are out&lt;br /&gt;
of range. Use a  DIM  statement  to  dimension the array. For&lt;br /&gt;
example, if you have X$(12) in  your program but you have not&lt;br /&gt;
informed the computer of the  12  elements  by the use of the&lt;br /&gt;
DIM command. Remember you  are  not  required  to use the DIM&lt;br /&gt;
command UNLESS you plan to use more than 10 subscripts.&lt;br /&gt;
When you use DIM(11) you are  planning on using 12 subscripts&lt;br /&gt;
as the DIM count starts with zero.&lt;br /&gt;
&lt;br /&gt;
DD Attempt to redimension an array.&lt;br /&gt;
&lt;br /&gt;
Be careful where you put the  DIM  statement in your program,&lt;br /&gt;
because if the program returns to  the line in which you have&lt;br /&gt;
placed the DIM statement, you will  get this error. Make sure&lt;br /&gt;
in planning your program that  the initialisation process, of&lt;br /&gt;
which the DIM statement may  be  an essential part, occurs at&lt;br /&gt;
the beginning and the program does not regress.&lt;br /&gt;
&lt;br /&gt;
DS Direct statement&lt;br /&gt;
&lt;br /&gt;
Can occur because there is a direct statement in a data file,&lt;br /&gt;
perhaps by loading an  ASCII  file  which  has  &amp;#039;lost&amp;#039; a line&lt;br /&gt;
number. Files loaded off Bulletin  Boards  were prone to this&lt;br /&gt;
error.&lt;br /&gt;
&lt;br /&gt;
FM Bad file mode&lt;br /&gt;
&lt;br /&gt;
If you have both double and single drives you may be prone to&lt;br /&gt;
this error, or use a mix of  single and double sided disks on&lt;br /&gt;
your drives. The reason is  that  if  you  use a single sided&lt;br /&gt;
disk in a double  sided  drive,  the  DOS  reads  the disk on&lt;br /&gt;
startup or reset and expects  the  same  type of disk in that&lt;br /&gt;
drive, so when you put a double sided disk in the drive it is&lt;br /&gt;
reading from Sector 18 to Sector 1 and doesn&amp;#039;t recognise that&lt;br /&gt;
the program continues on Sector 19 etc.&lt;br /&gt;
The solution is to press the RESET button.&lt;br /&gt;
Of course  if  you&amp;#039;ve  got  single  sided  drives  and you&amp;#039;re&lt;br /&gt;
attempting to read a double sided disk, you&amp;#039;ll get this error&lt;br /&gt;
and there&amp;#039;s nothing you can do about it!&lt;br /&gt;
&lt;br /&gt;
NE File non-existent&lt;br /&gt;
&lt;br /&gt;
The Computer can&amp;#039;t find the file you want. If you&amp;#039;ve got more&lt;br /&gt;
than one drive you may  have  omitted  to prefix the filename&lt;br /&gt;
with the drive number and a colon. or in the case of the Coco&lt;br /&gt;
placed these AFTER the filename.&lt;br /&gt;
e.g. Dragon - LOAD&amp;quot;2:FILENAME&lt;br /&gt;
     Coco   - LOAD&amp;quot;FILENAME:1&lt;br /&gt;
Although the numbers are  different,  in  both  cases you are&lt;br /&gt;
loading the file from Drive 2.&lt;br /&gt;
This error also occurs if  you  are  using  the COPY, KILL or&lt;br /&gt;
RENAME commands and omit the extension.&lt;br /&gt;
&lt;br /&gt;
NF NEXT without FOR&lt;br /&gt;
&lt;br /&gt;
This occurs when the command NEXT is used without a matching&lt;br /&gt;
FOR. Sometimes occurs through bad programming practice such&lt;br /&gt;
as jumping into loops. Often occurs when the NEXT commands&lt;br /&gt;
are reversed in nested loops.&lt;br /&gt;
As programs are increased in speed by NOT using the variable&lt;br /&gt;
with NEXT (ie NEXT X), the variable is unnecessary; the&lt;br /&gt;
computer knows which variable to use, even if you&amp;#039;ve&lt;br /&gt;
forgotten!&lt;br /&gt;
&lt;br /&gt;
TF Too many open&lt;br /&gt;
&lt;br /&gt;
Files that is. One of the easiest errors to fall into, when&lt;br /&gt;
you go from using Coco disk drives to the Dragon. The Coco&lt;br /&gt;
keeps track of its files differently to the Dragon reserving&lt;br /&gt;
buffer space etc. You dont have to keep closing Coco files,&lt;br /&gt;
but it is good practice to do so on the Dragon.&lt;br /&gt;
There are 19 fonts in the DESKTOP program and in order to&lt;br /&gt;
copy these to another disk, I often wrote a short little&lt;br /&gt;
program to copy from 1 to 19 fonts. This would grind to a&lt;br /&gt;
halt with this error after copying 10 fonts, if a CLOSE&lt;br /&gt;
command was not included.&lt;br /&gt;
&lt;br /&gt;
UL Undefined line&lt;br /&gt;
&lt;br /&gt;
Occurs when a GOTO or a GOSUB is used with a line number&lt;br /&gt;
that is not in the program.&lt;br /&gt;
When you are using hybrid programs which are a mix of Basic&lt;br /&gt;
and machine code routines, this error may be the first&lt;br /&gt;
indication that your program has crashed. The program is&lt;br /&gt;
possibly trying to jump to a line near the end of the&lt;br /&gt;
program, but when you list it you find you&amp;#039;ve lost the end&lt;br /&gt;
of your program. You can sometimes RESCUE it by using the&lt;br /&gt;
RENUM command and although it won&amp;#039;t Run, you can save it and&lt;br /&gt;
when reloaded it will probably run.&lt;br /&gt;
&lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
Most mistakes occur when you type in programs from magazines&lt;br /&gt;
etc, through the misreading of 8 and B in machine code, or&lt;br /&gt;
by using an O in Hex notation instead of an 0. An the&lt;br /&gt;
reverse is the case in music notation using an 0 in mistake&lt;br /&gt;
for the O for the octave.&lt;br /&gt;
Programmers who use an I or an O for a variable are asking&lt;br /&gt;
you to fall in the trap and type a 1 or an 0. They are so&lt;br /&gt;
difficult to spot if you go wrong. Especially if you get an&lt;br /&gt;
FC error which refers to a string some lines back.&lt;br /&gt;
&lt;br /&gt;
Remember Murphy&amp;#039;s Law, &amp;quot;If you don&amp;#039;t want it to happen it&lt;br /&gt;
probably will&amp;quot;. I remember one program of Pam D&amp;#039;Arcy&amp;#039;s that&lt;br /&gt;
I had on tape in the days when I first purchased a disk&lt;br /&gt;
drive. It was called TAPESCAN or SCANTAPE and as its name&lt;br /&gt;
implies, used to scan through a tape and tell you what was&lt;br /&gt;
on the tape and if the program was in machine code, what the&lt;br /&gt;
relevent addresses were. In those days, I was always&lt;br /&gt;
leaving a disk in the drive (a bad practice which I don&amp;#039;t&lt;br /&gt;
recommend to anyone). Anyway, every time I used TAPESCAN it&lt;br /&gt;
did a grand job on my tape, but it wiped the disk directory&lt;br /&gt;
and replaced it with gobbledegook. It used to drive me mad,&lt;br /&gt;
but it taught me to never leave disks in the drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GRAPHIC MODES of the DRAGON and COCO ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE - Modes 3 to 9 are not supported by Basic, but can be&lt;br /&gt;
poked and used in your programs. One such program was called&lt;br /&gt;
&amp;#039;Semigraphics 24&amp;#039; and was written by A C Daniel, it appeared&lt;br /&gt;
in Dragon User magazine August 1985.&lt;br /&gt;
&lt;br /&gt;
MODE 1 Standard text screen 32 x 16 bytes (512)&lt;br /&gt;
&lt;br /&gt;
MODE 2 Semigraphic 4 SET/RESET as above screen.&lt;br /&gt;
       Same as Alphanumeric screen above and is&lt;br /&gt;
       supported by basic. Element size 64 x 32.&lt;br /&gt;
&lt;br /&gt;
MODE 3 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphic 6  Element size 64 x 48&lt;br /&gt;
       512 bytes - 4 colours per colour set.&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,AAND7+16+C&lt;br /&gt;
       Where C=0 or C=8 for Colorset 0 or 1.&lt;br /&gt;
       POKE65476,0:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 4 (not supported by Basic&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 8 - Element size 64 X 64&lt;br /&gt;
       2048 bytes - 8 colours - Border black&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65475,0:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 5 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 12 - Element size 64 x 96&lt;br /&gt;
       3072 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK(65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65474,0:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
MODE 6 not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       Semigraphics 24 - Element size 64 x 192&lt;br /&gt;
       6144 bytes - 8 colours - Black border&lt;br /&gt;
       SELECT with the following:-&lt;br /&gt;
       A=PEEK65314):POKE65314,(A AND 7)&lt;br /&gt;
       POKE65477,1:POKE65475,1:POKE65472,0&lt;br /&gt;
&lt;br /&gt;
NOTE - In the Semigraphic 8 colour modes, the colours are&lt;br /&gt;
set with the MSB which ALWAYS has bit 7 set (1) and the rest&lt;br /&gt;
of the MSB (ie bits 6,5 &amp;amp;4) are set for the colours as&lt;br /&gt;
follows:&lt;br /&gt;
       000 GREEN        001 YELLOW&lt;br /&gt;
       010 BLUE         011 RED&lt;br /&gt;
       100 BUFF         101 CYAN&lt;br /&gt;
       110 MAGENTA      111 RED&lt;br /&gt;
&lt;br /&gt;
MODE 7 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       64 X 64 GRAPHICS - FOUR COLOUR&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+C&lt;br /&gt;
       Where C=0 for Colour set 0&lt;br /&gt;
             c=8 for Colour set 1&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       Uses 1024 bytes. To START see end of section.&lt;br /&gt;
&lt;br /&gt;
MODE 8 (not supported by Basic)&lt;br /&gt;
&lt;br /&gt;
       128 x 64 TWO COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+16+C&lt;br /&gt;
       WHERE C=0 OR C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65473,1:POKE65474,0:POKE65476,0&lt;br /&gt;
       AGAIN USES 1024 BYTES. TO START SEE END.&lt;br /&gt;
&lt;br /&gt;
MODE 9 (AGAIN NOT SUPPORTED)&lt;br /&gt;
&lt;br /&gt;
       128 X 64 FOUR COLOURS&lt;br /&gt;
       Select with -&lt;br /&gt;
       A=PEEK(65314):POKE65314,(AAND7)+128+32+C&lt;br /&gt;
       WHERE C=0 OF C=8 FOR COLOUR SETS 0 OR 1.&lt;br /&gt;
       POKE65472,0:POKE65475,0:POKE65476,1&lt;br /&gt;
       Uses 2048 bytes.&lt;br /&gt;
&lt;br /&gt;
MODE10 is PMODE0 - 1536 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE11 is PMODE1 - 3072 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE12 is PMODE2 - 3072 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
MODE13 is PMODE3 - 6144 bytes - 4 colour&lt;br /&gt;
&lt;br /&gt;
MODE14 is PMODE4 - 6144 bytes - 2 colour&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BIBLIOGRAPHY ==&lt;br /&gt;
&lt;br /&gt;
The Major work regarding Graphics is William Barden&amp;#039;s COLOR&lt;br /&gt;
COMPUTER GRAPHICS published by TANDY (now out of print in&lt;br /&gt;
this country). He describes bit mapping for all the non&lt;br /&gt;
supported modes. Although intended for the TANDY COCO, it&lt;br /&gt;
also applies to the Dragon, which uses the same SAM chip.&lt;br /&gt;
Other books, if you can find them, are:-&lt;br /&gt;
ADVANCED SOUND AND GRAPHICS by Keith and Steven Brain -&lt;br /&gt;
published by SUNSHINE Books.&lt;br /&gt;
PROGRAMMING THE DRAGON for GAMES &amp;amp; GRAPHICS by Geoff&lt;br /&gt;
Phillips - published by McGRAW-HILL&lt;br /&gt;
INSIDE THE DRAGON by Duncan Smeed &amp;amp; Ian Sommerville -&lt;br /&gt;
published by ADDISON-WESLEY.&lt;br /&gt;
Chapter 7 applies.&lt;br /&gt;
DRAGON 32 PROGRAMMER&amp;#039;S REFERENCE GUIDE by John Vander Reydon&lt;br /&gt;
- published by MELBOURNE HOUSE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRAGON 32 and 64 in 32 mode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    0 -  1023  0000 - 03FF      SYSTEM USE&lt;br /&gt;
 1024 -  1535  0400 - 05FF      TEXT SCREEN&lt;br /&gt;
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1&lt;br /&gt;
 3072 -  4607  0C00 - 11FF                PAGE 2&lt;br /&gt;
 4608 -  6143  1200 - 17FF                PAGE 3&lt;br /&gt;
 6144 -  7679  1800 - 1DFF                PAGE 4&lt;br /&gt;
 7680 -  9215  1E00 - 23FF                PAGE 5&lt;br /&gt;
 9216 - 10751  2400 - 29FF                PAGE 6&lt;br /&gt;
10752 - 12287  2A00 - 2FFF                PAGE 7&lt;br /&gt;
12288 - 13823  3000 - 35FF                PAGE 8&lt;br /&gt;
13824 - 32767  3600 - 7FFF      PROGRAM USE&lt;br /&gt;
32768 - 49151  8000 - BFFF      BASIC ROM&lt;br /&gt;
49152 - 65279  C000 - FEFF      CARTRIDGE USE&lt;br /&gt;
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE:&lt;br /&gt;
With disks in use, the Disk work space occupies the first&lt;br /&gt;
page of graphics (1536 to 3071) and in consequence Graphics&lt;br /&gt;
screens are moved up one page, starting at 3072 (&amp;amp;H0C00) and&lt;br /&gt;
ending at 15359 (&amp;amp;H3BFF).&lt;br /&gt;
On start up the Dragon does a PCLEAR4 and in consequence the&lt;br /&gt;
memory available for program use starts at 7680, or 9216&lt;br /&gt;
with the DOS Controller in place.&lt;br /&gt;
&lt;br /&gt;
DRAGON 64 in 64 MODE.&lt;br /&gt;
&lt;br /&gt;
Same as above, except the BASIC ROM is moved from 32768&lt;br /&gt;
(&amp;amp;H8000) to 49152 (&amp;amp;HC000), which gives a substantial&lt;br /&gt;
increase in memory available for program use, but means that&lt;br /&gt;
disks cannot be used as the ROM overlays the Cartridge area.&lt;br /&gt;
Programs exist to overcome this problem however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;13824 - 49151  3600 - BFFF      PROGRAM USE&lt;br /&gt;
49152 - 65279  C000 - FEFF      BASIC ROM&lt;br /&gt;
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT&lt;br /&gt;
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS&lt;br /&gt;
65504 - 65535  FFE0 - FFFF      MPU VECTORS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE&lt;br /&gt;
&lt;br /&gt;
The following pages contain details of the Dragon&amp;#039;s memory,&lt;br /&gt;
both the Basic work pages and the Basic ROM. While every&lt;br /&gt;
effort has been made to ensure the accuracy of these&lt;br /&gt;
details, the Editor has had to rely on a number of sources&lt;br /&gt;
and it has not been possible to check them all.&lt;br /&gt;
Where possible details have also been given of the Tandy&lt;br /&gt;
Coco2 equivalent, making it possible for the conversion of&lt;br /&gt;
programs from American sources. In so doing you are reminded&lt;br /&gt;
that the Coco disk system differs greatly from Dragondos and&lt;br /&gt;
is closer to the cassette system in the way that it handles&lt;br /&gt;
data files.&lt;br /&gt;
One other major difference is the way that graphic binary&lt;br /&gt;
files are stored, they are usually 512 bytes higher in&lt;br /&gt;
memory than Dragon graphics.&lt;br /&gt;
&lt;br /&gt;
== MEMORY MAP DETAILS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       0       BREAK message flag&lt;br /&gt;
1       1       STRING delimiting character&lt;br /&gt;
2       2       Another delimiting character&lt;br /&gt;
3       3       General counter&lt;br /&gt;
4       4       Count of IF&amp;#039;s seen looking for ELSE&lt;br /&gt;
5       5       DIM flag&lt;br /&gt;
6       6       VARIABLE type flag 0=numeric 255=string&lt;br /&gt;
7       7       Garbage collection flag&lt;br /&gt;
8       8       Subscript allowed flag&lt;br /&gt;
9       9       INPUT/READ flag&lt;br /&gt;
10      A       Arithmetic use&lt;br /&gt;
11)     B)      String pointer - first free temporary&lt;br /&gt;
12)     C)&lt;br /&gt;
13)     D)      String pointer - last used temporory&lt;br /&gt;
15-24   E-18    Temporary results&lt;br /&gt;
25/26   19/1A   Start address of Basic program&lt;br /&gt;
27/28   1B/1C   Start address of simple variables table&lt;br /&gt;
                see D User 1/86 p38 for details of&lt;br /&gt;
                variables.&lt;br /&gt;
29/30   1D/1E   Start address of ARRAY table&lt;br /&gt;
31/32   1F/20   End of storage (last byte used by Basic)&lt;br /&gt;
33/34   21/22   Top of Stack. ((Stack grows down)&lt;br /&gt;
35/36   23/24   Top of free STRING space. By subtracting the&lt;br /&gt;
                contents of 33/34 you get free string space&lt;br /&gt;
37/38   25/26   Pointer to STRING in string space&lt;br /&gt;
39/40   27/28   Top of RAM available to Basic&lt;br /&gt;
41/42   29/2A   Line number used in &amp;#039;CONT&amp;#039; command&lt;br /&gt;
43/44   2B/2C   Temp G.P. line number store&lt;br /&gt;
45/46   2D/2E   Pointer to statement to be executed&lt;br /&gt;
47/48   2F/30   Direct mode command text pointer&lt;br /&gt;
49/50   31/32   Current DATA statement line number&lt;br /&gt;
51/52   33/34   Address of next item in current data sta&amp;#039;nt&lt;br /&gt;
53/54   35/36   Address of keyboard input buffer&lt;br /&gt;
55/56   37/38   Pointer to VARIABLE last in use&lt;br /&gt;
57/58   39/3A   VARPTR address of variable last in use&lt;br /&gt;
59/78   3B/4E   Evaluation variables&lt;br /&gt;
65/66   41/42   High end destination address for block move&lt;br /&gt;
67/68   43/44   High end origin address&lt;br /&gt;
69/70   45/46   Low end destination address&lt;br /&gt;
71/72   47/48   Low end origin address&lt;br /&gt;
79/84   4F/54   Floating Point Accumulator: No 1&lt;br /&gt;
79      4F      Exponent )&lt;br /&gt;
80/83   50/53   Mantissa ) Details of FPA&lt;br /&gt;
84      54      Sign     )&lt;br /&gt;
85      55      Temporary sign of FAC&lt;br /&gt;
86      56      String variable length&lt;br /&gt;
92/97   5C/61   Floating Pt Acc No 2: details as before&lt;br /&gt;
98      62      Sign comparison&lt;br /&gt;
99      63      Extended precision byte-Coco&lt;br /&gt;
104/105 68/69   Current line number (65535 in direct mode)&lt;br /&gt;
106     6A      VDU Comma field width (default 16)&lt;br /&gt;
107     6B      VDU Last Comma field (screen width - above)&lt;br /&gt;
108     6C      VDU Current column number (0 - 31)&lt;br /&gt;
109     6D      VDU Line width. No of characters per line&lt;br /&gt;
110     6E      Cassette I/O flag. Set FF on input incurring&lt;br /&gt;
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt&lt;br /&gt;
112     70      Cassette EOF flag: EOF reached if non zero&lt;br /&gt;
113     71      Restart flag. If&amp;lt;&amp;gt;$55 - cold start on reset&lt;br /&gt;
114/115 72/73   Restart vector. If flag=$55 &amp;amp; vector points&lt;br /&gt;
                points to a NOP then warm start else&lt;br /&gt;
                a cold start.&lt;br /&gt;
116/117 74/75   Physical end of RAM&lt;br /&gt;
120     78      Cassette status:0=closed 1=input 2=output&lt;br /&gt;
121     79      I/O buffer size&lt;br /&gt;
122/3   7A/B    Header buffer address:where f&amp;#039;name block is&lt;br /&gt;
124     7C      Cassette block type:&lt;br /&gt;
                0=f&amp;#039;name block 1=data block 255=EOF marker b&lt;br /&gt;
125     7D      BLKLEN:Cass Block length:Bytes to read/write&lt;br /&gt;
126/7   7E/F    Cassette I/O buffer address&lt;br /&gt;
128     80      Used internally to calculate the checksum&lt;br /&gt;
129     81      I/O error code 1=CRC 2=attempt load into RAM&lt;br /&gt;
130/2   82/4    Temp store used by COS&lt;br /&gt;
133     85      Last sine value&lt;br /&gt;
134     86      Data for Lo-res SET/RESET routine&lt;br /&gt;
135     87      ASCII code of last key pressed&lt;br /&gt;
136/7   88/89   Current VDU cursor address (ie screen pos)&lt;br /&gt;
138/9   8A/B    G.P. (16 bit) scratch pad&lt;br /&gt;
140     8C      Sound pitch value (frequency)&lt;br /&gt;
141/2   8D/E    GP Countdown facility (?duration of sound)&lt;br /&gt;
143     8F      Cursor Flash Counter&lt;br /&gt;
144/5   90/1    Cassette leader byte count (number of &amp;amp;H55s)&lt;br /&gt;
146     92      Min Cycle width of 1200HZ - Init=12&lt;br /&gt;
147     93      Min Pulse width of 1200HZ - Init=0A&lt;br /&gt;
148     94      Max pulse width of 1200HZ - Init=12&lt;br /&gt;
149/50  95/6    Dragon - Motor on delay&lt;br /&gt;
                Coco - Serial printer Baud rate constant&lt;br /&gt;
                HEX    Msb  Lsb (decimal) Baud&lt;br /&gt;
                       149  150&lt;br /&gt;
                02EB     2  235             75&lt;br /&gt;
                01CA     1  202            120&lt;br /&gt;
                0173     1  115            150&lt;br /&gt;
                00BE     0  180            300&lt;br /&gt;
                0057     0   87            600 (default)&lt;br /&gt;
                0028     0   41           1200&lt;br /&gt;
                0012     0   18           2400&lt;br /&gt;
                0006     0    6           4800&lt;br /&gt;
                0001     0    1           9600&lt;br /&gt;
151/2   97/8    Keyboard Scan Delay constant: Init=&amp;amp;H045E&lt;br /&gt;
153     99      Printer Comma Field Width: Default 16&lt;br /&gt;
154     9A      Printer Last Comma Field&lt;br /&gt;
155     9B      Printer Line Width: Set this to width 80?&lt;br /&gt;
156     9C      Printer Head Column:same as POS(-2) in basic&lt;br /&gt;
157/8   9D/E    Exec Entry address&lt;br /&gt;
159/170 9F/AA   Self modifying routine which reads next char&lt;br /&gt;
166/7   A6/7    Address of current sig byte - next char pntr&lt;br /&gt;
171/4   AB/E    Used by RND command&lt;br /&gt;
175     AF      TRON/TROFF flag: Non zero - trace on&lt;br /&gt;
176/7   B0/1    Address os start of USR address table&lt;br /&gt;
178     B2      Current foreground colour&lt;br /&gt;
179     B3      Current Background colour&lt;br /&gt;
180     B4      Temp colour in use&lt;br /&gt;
181     B5      Byte value for current colour: ie bits set&lt;br /&gt;
182     B6      Graphics PMODE number in use.&lt;br /&gt;
183/4   B7/8    Address of LAST byte of current graphics&lt;br /&gt;
185     B9      Number of bytes per line in current PMODE&lt;br /&gt;
186/7   BA/B    Address of FIRST byte: current graphics disp&lt;br /&gt;
188     BC      Start of graphics pages (MSB) defaults to 06&lt;br /&gt;
                Changed to 0C by Dragondos&lt;br /&gt;
189/90  BD/E    Current X Cursor position (not available&lt;br /&gt;
191/2   BF/C0   Current Y Cursor position (n.a.)&lt;br /&gt;
193     C1      Colour Set currently in use&lt;br /&gt;
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set&lt;br /&gt;
195/96  C3/4    Current Horizontal Pixel number&lt;br /&gt;
197/8   C5/6    Current Vertical Pixel number&lt;br /&gt;
199/200 C7/C8   Current X cursor co-ordinate&lt;br /&gt;
201/2   C9/CA   Current Y cursor co-ordinate&lt;br /&gt;
203/4   CB/CC   Circle command X co-ordinate&lt;br /&gt;
205/6   CD/CE   Circle command Y co-ordinate&lt;br /&gt;
207/8   CF/D0   RENUMber increment value&lt;br /&gt;
209/10  D1/2    RENUMber Start line (original number)&lt;br /&gt;
211/2   D3/4    CLOADM: 2&amp;#039;s complement load offset value&lt;br /&gt;
213/4   D5/6    RENUMber New Start line (new number)&lt;br /&gt;
215     D7      Editor line length - not user available&lt;br /&gt;
216/221 D8/DD   Graphics use&lt;br /&gt;
222     DE      Current octave in use (0 - 4)&lt;br /&gt;
223/4   DF/E0   Volume data for volume setting in PLAY&lt;br /&gt;
225     E1      Current note length in PLAY&lt;br /&gt;
226     E2      Current TEMPO for PLAY command&lt;br /&gt;
227/8   E3/4    Music duration count&lt;br /&gt;
229     E5      Music dotted note flag&lt;br /&gt;
230     E6      Coco - Baud rate constant&lt;br /&gt;
231     E7      Coco - Input timeout constant&lt;br /&gt;
232     E8      Current ANGLE used in DRAW routine&lt;br /&gt;
233     E9      Current SCALE used in DRAW routine&lt;br /&gt;
234     EA      Disk operation code-what operation specified&lt;br /&gt;
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)&lt;br /&gt;
236     EC      Disk read/write TRACK number&lt;br /&gt;
237     ED      Disk read/write SECTOR number&lt;br /&gt;
238/9   EE/F    Disk read/write Sector Buffer address&lt;br /&gt;
240     F0      Disk Error Status byte (Convt to DDOS code)&lt;br /&gt;
241     F1      Disk File Control Block number (1 - 10)&lt;br /&gt;
242     F2      Number of bytes in Disk buffer area&lt;br /&gt;
243     F3      No of bytes to transfer to/from buffer&lt;br /&gt;
244     F4      Number of SIDES/TRACKS for current drive&lt;br /&gt;
                00=1 side 40 tracks     01=2 sides 40 tracks&lt;br /&gt;
                FF=1 side 80 tracks     FE=2 sides 80 tracks&lt;br /&gt;
                The FORMAT of a disk is taken from the last&lt;br /&gt;
                few bytes of Sector 1 of Track 20 in Drogon&lt;br /&gt;
                DOS, on first access of disk after switch on&lt;br /&gt;
                or RESET.&lt;br /&gt;
245     F5      File Read/write flag&lt;br /&gt;
                0=read, 1=write &amp;amp; FF=verify&lt;br /&gt;
246     F6      Disk I/O in progress flag&lt;br /&gt;
256/8   100/2   SWI3 JUMP VECTOR - called from &amp;amp;HFFF2&lt;br /&gt;
                Execution of a SWI3 instruction of &amp;amp;H113F&lt;br /&gt;
                will stack Registers and jump here&lt;br /&gt;
259/61  103/5   SWI2 JUMP VECTOR - called from &amp;amp;HFFF4&lt;br /&gt;
                Execution of a SWI2 instruction of &amp;amp;H103F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
262/4   106/8   SWI1 JUMP  VECTOR - called from &amp;amp;HFFFA -&amp;amp;H3F&lt;br /&gt;
                will stack registers and jump here&lt;br /&gt;
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt&lt;br /&gt;
                called from &amp;amp;HFFFC, set to &amp;amp;H7ED7AE JUMPD7AE&lt;br /&gt;
                by initialisation of disk operating system&lt;br /&gt;
                in the Coco. Okay for Dragon?&lt;br /&gt;
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called&lt;br /&gt;
                from &amp;amp;HFFF8. Set to &amp;amp;H7EA9B3 to initialise&lt;br /&gt;
                Basic, Set to &amp;amp;H7E894C for initialisation of&lt;br /&gt;
                extended Basic or set to &amp;amp;H7ED7BC for the&lt;br /&gt;
                initialisation of DOS in the Coco.&lt;br /&gt;
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request&lt;br /&gt;
                called from &amp;amp;HFFF6, set to &amp;amp;H7EA0F6 by the&lt;br /&gt;
                initialisation of Basic and causes a jump to&lt;br /&gt;
                the Cartridge Port in the Coco.&lt;br /&gt;
274/6   112/4   In Coco this is EXEC of USR basic function&lt;br /&gt;
274/5   112/3   Timer - current value of system timer&lt;br /&gt;
                In both Dragon and Coco (double function)&lt;br /&gt;
277/81  115/9   Random number seeds used in RND function&lt;br /&gt;
282/7   11A/F   Unused in Dragon&lt;br /&gt;
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case&lt;br /&gt;
283/4   11B/C   Coco - keyboard delay constant&lt;br /&gt;
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)&lt;br /&gt;
288     120     Number of Basic commands (reserved words)&lt;br /&gt;
289/90  121/2   Address of list of Basic commands&lt;br /&gt;
291/2   123/4   Address of Command Despatch Table&lt;br /&gt;
293     125     Number of Basic functions&lt;br /&gt;
294/5   126/7   Address of list of Basic functions&lt;br /&gt;
296/7   128/9   Address of Function Despatch Table&lt;br /&gt;
298/307 12A/133 As for 288 to 297, but in Dragon refers to&lt;br /&gt;
                Disk commands and functions, but in the Coco&lt;br /&gt;
                to Extended Basic commands and functions.&lt;br /&gt;
308/317 134/13D These addresses as above re COCO disks.&lt;br /&gt;
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)&lt;br /&gt;
                This USR table is switched to 1667 to 1686,&lt;br /&gt;
                or Hex 683 to 696 when DOS is connected and&lt;br /&gt;
                is replaced with Disk Stub3 which acts as a&lt;br /&gt;
                terminator.&lt;br /&gt;
328     148     PRINTER AUTO LF/CR Flag&lt;br /&gt;
329     149     Dragon - Caps Lock flag:non zero=upper case&lt;br /&gt;
330     14A     Number of chars in end of line sequence(1-4)&lt;br /&gt;
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL&lt;br /&gt;
                This sequence is sent to printer when a&lt;br /&gt;
                carriage return is output.&lt;br /&gt;
336/45  150/9   Dragon Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
338/45  152/9   Coco Keyboard &amp;#039;Roll-over&amp;#039; table&lt;br /&gt;
&lt;br /&gt;
          DRAGON/COCO KEYBOARD ROLLOVER TABLE&lt;br /&gt;
&lt;br /&gt;
                        Response:&lt;br /&gt;
 Address    191    223   239   247   251   253   254&lt;br /&gt;
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C&lt;br /&gt;
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @&lt;br /&gt;
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A&lt;br /&gt;
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B&lt;br /&gt;
341  155              ;  S  3  K     C  S  ;  K  3  C&lt;br /&gt;
342  156              ,  T  4  L     D  T  ,  L  4  D&lt;br /&gt;
343  157              -  U  5  M     E  U  -  M  5  E&lt;br /&gt;
344  158              .  V  6  N     F  V  .  N  6  F&lt;br /&gt;
345  159          SPC /  W  7  O SPC G  W  /  O  7  G&lt;br /&gt;
&lt;br /&gt;
RESPONSE IS 255 OR &amp;amp;HFF IF NO KEY IS PRESSED&lt;br /&gt;
&lt;br /&gt;
346     15A     Right Joystick(0) - X value&lt;br /&gt;
347     15B     Right Joystick(1) - Y value&lt;br /&gt;
348     15C     Left Joystick (2) - X value&lt;br /&gt;
349     15D     Left Joystick (3) - Y value&lt;br /&gt;
&lt;br /&gt;
350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)&lt;br /&gt;
350/2   15E/160 Device Open- called just before OPEN command&lt;br /&gt;
353/5   161/3   Device Number-called when a DEVN is verified&lt;br /&gt;
356/8   164/6   Device Initialisation- called before setting&lt;br /&gt;
                up the Device parameters in Loctn 106 to 109&lt;br /&gt;
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-&lt;br /&gt;
                putting char in A Reg to DEVN&lt;br /&gt;
362/4   16A/C   INPUT CHAR FROM DEVN: called just before&lt;br /&gt;
                inputting a char from DEVN into A Register&lt;br /&gt;
365/7   16D/F   INPUT FILE: called just before inputting a&lt;br /&gt;
                file using INPUT&lt;br /&gt;
368/70  170/2   OUTPUT FILE: called just before outputting&lt;br /&gt;
                to a file using PRINT&lt;br /&gt;
371/3   173/5   CLOSE ALL FILES: called before all files are&lt;br /&gt;
                closed, action only taken if Cassette open&lt;br /&gt;
374/6   176/8   CLOSE FILE: called before device is CLOSED&lt;br /&gt;
                action only taken if DEVN is -1 (tape)&lt;br /&gt;
377/9   179/B   COMMAND INTERPRETER: called before interpret&lt;br /&gt;
                of token in A Reg as command, used by Delta&lt;br /&gt;
380/2   17C/E   RE-REQUEST INPUT. Called before requesting&lt;br /&gt;
                more data from keyboard- ie before ?? prompt&lt;br /&gt;
383/5   17F/181 CHECK KEYS. Called before keyboard scanned&lt;br /&gt;
                for BREAK and SHIFT/@. Keyboard not scanned&lt;br /&gt;
                if DEVN is -1.&lt;br /&gt;
386/8   182/4   LINE INPUT FILE. Called before Line Input is&lt;br /&gt;
                executed on current DEVN&lt;br /&gt;
389/91  185/7   CLOSE FILE &amp;amp; COMMAND. Called before closing&lt;br /&gt;
                an ASCII file just read in as a Basic prog&amp;#039;m&lt;br /&gt;
                by CLOAD &amp;amp; returning to COMMAND mode.&lt;br /&gt;
392/4   188/A   CHECK EOF. Called before checking for EOF&lt;br /&gt;
                for current DEVN&lt;br /&gt;
395/7   18B/D   EVALUATE EXPRESSION. (obvious)&lt;br /&gt;
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,&lt;br /&gt;
                that is in Basic, to trap error messages.&lt;br /&gt;
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the&lt;br /&gt;
                &amp;#039;system&amp;#039;, ie Basic extension ROMs to trap&lt;br /&gt;
                errors (used by Dragondos)&lt;br /&gt;
404/6   194/6   RUN LINK. Called when RUN command is about&lt;br /&gt;
                to be executed. Patched by DDOS to allow a&lt;br /&gt;
                disk filename to be specified.&lt;br /&gt;
407/9   197/9   RESET BASIC MEMORY. Called from two routines&lt;br /&gt;
                in ROM before Basic Memory vectors are&lt;br /&gt;
                changed, ie by entering or editing lines,&lt;br /&gt;
                running programs etc.&lt;br /&gt;
410/2   19A/C   GET NEXT COMMAND. Called before reading in&lt;br /&gt;
                the next Basic command to be executed while&lt;br /&gt;
                program is running.&lt;br /&gt;
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)&lt;br /&gt;
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and&lt;br /&gt;
                PUT commands are executed.&lt;br /&gt;
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line&lt;br /&gt;
                is tokenised in internal Basic format&lt;br /&gt;
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised&lt;br /&gt;
                line is converted to ASCII characters&lt;br /&gt;
425/464 or 1A9/1D0  STRING BUFFER AREA&lt;br /&gt;
465     1D1     Cassette filename length&lt;br /&gt;
466/73  1D2/9   Cassette filename to search for/or write out&lt;br /&gt;
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER&lt;br /&gt;
                Area of memory used to load filename block &amp;amp;&lt;br /&gt;
                ASCII data blocks - if this contains a file-&lt;br /&gt;
                name block then this can be peeked (474-488)&lt;br /&gt;
474/81  1DA/1E1 Cassette filename (in buffer)&lt;br /&gt;
482     1E2     File type: 0=token basic 1=ASCII 2=binary&lt;br /&gt;
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.&lt;br /&gt;
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files&lt;br /&gt;
485/6   1E5/6   Execution address of machine code file&lt;br /&gt;
487/8   1E7/8   Load address of ungapped machine code file&lt;br /&gt;
729/33  2D9/C   Basic line input buffer preamble&lt;br /&gt;
734/984 2DD/3D8 Basic line input buffer&lt;br /&gt;
985/1002 3D9/EA BUFFER space&lt;br /&gt;
1003/20 3EB/3FC Unused&lt;br /&gt;
1021/2  3FD/E   End of line delay - RS 232 port on D64&lt;br /&gt;
1023    3FF     D64 RS 232 port Baud rate controller port&lt;br /&gt;
1024)   400)    TEXT SCREEN&lt;br /&gt;
1535)   5FF)         Default area.&lt;br /&gt;
&lt;br /&gt;
The Coco Buffer areas are slightly different:&lt;br /&gt;
733/988 2DD/3DC 255 byte Keyboard buffer&lt;br /&gt;
737/827 2E1/33B 90 byte Screen buffer&lt;br /&gt;
&lt;br /&gt;
The Disk Work area is from 1536 to 3071, or &amp;amp;H0600 to &amp;amp;H0BFF&lt;br /&gt;
Otherwise if disks are not installed these addresses are in&lt;br /&gt;
respect of the first of the Graphic pages, but with the DOS&lt;br /&gt;
installed the Graphics page 1 starts at 3072 (&amp;amp;H0C00).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DRAGONDOS WORK SPACE ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1536    0600    Start of Disk work space or Graphics Page 1&lt;br /&gt;
                when Disk cartridge not installed&lt;br /&gt;
1541    0605    Countdown to Disk motor off: Off when zero&lt;br /&gt;
1544    0608    Auto Verify ON/OFF: 0=off else checks sector&lt;br /&gt;
1546    060A    Current Default drive No. Used when no Drive&lt;br /&gt;
                number is specified in the command&lt;br /&gt;
1549/50 060D/E  Auto command line number in use&lt;br /&gt;
1551/2  060F/10 Auto command increment value&lt;br /&gt;
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN&lt;br /&gt;
1555    0613    Auto command ON/OFF flag: 0=off else Auto on&lt;br /&gt;
1556    0614    Error command ON/OFF flag: 0=off else ERR on&lt;br /&gt;
1557/8  0615/6  ERROR trap line number: Basic line error rtn&lt;br /&gt;
1559/60 0617/8  ERL: line number of last error&lt;br /&gt;
1561    0619    ERR: Error code of last basic error&lt;br /&gt;
1562/3  061A/B  Address of start of statement in error&lt;br /&gt;
1564/9  061C/21 Drive 1 details&lt;br /&gt;
1570/5  0622/7  Drive 2 details&lt;br /&gt;
1576/81 0628/D  Drive 3 details&lt;br /&gt;
1582/7  062E/33 Drive 4 details&lt;br /&gt;
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each&lt;br /&gt;
1615)   064F)&lt;br /&gt;
1616/66 0650/82 Current Drive information&lt;br /&gt;
1618/9  0652/3  Start address of program loaded&lt;br /&gt;
1620/1  1654/5  Length of program loaded&lt;br /&gt;
1622/3  1656/7  Entry (EXEC) address of M/code program&lt;br /&gt;
1667/86 1683/96 USR Vector table: relocated from 308-327(dec&lt;br /&gt;
1687 to 1706)   Disk Drive Parameter table&lt;br /&gt;
0697 to 06AA)   4 bytes per parameter - 1 for each drive&lt;br /&gt;
1687/90 0697/A  On Line Flag: Non zero means dive on line&lt;br /&gt;
1691/4  069B/E  Current Track, if Drive on line&lt;br /&gt;
1695/8  069F/A2 Head Stepping rate: This should only be&lt;br /&gt;
                changed if slower drives are used.&lt;br /&gt;
1699/702&lt;br /&gt;
        06A3/6  Disk Tracks on each drive&lt;br /&gt;
1703/6  06A7/A  Disk Sectors per track on each drive&lt;br /&gt;
1707/24 06AB/BC Directory Sector status&lt;br /&gt;
1725/2034       File Control Blocks: 10 in all: One for each&lt;br /&gt;
        6BD/7F2 open file: Each FCB 32 bytes long&lt;br /&gt;
2035/47 7F3/F   Temporary variables&lt;br /&gt;
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long&lt;br /&gt;
        800/BFF)&lt;br /&gt;
&lt;br /&gt;
3072    0C00    Start of Graphic Page 1 when disks in place&lt;br /&gt;
                otherwise start of Graphic Page 2 for tapes.&lt;br /&gt;
&lt;br /&gt;
== BASIC INTERPRETER CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
32768   8000    Hardware initialisation&lt;br /&gt;
32771   8003    Software initialisation&lt;br /&gt;
32774   8006    POLCAT:Keyboard input:put into Register A&lt;br /&gt;
32777   8009    Cursor Blink&lt;br /&gt;
32780   800C    CHROUT:Write character in Reg A to screen&lt;br /&gt;
32783   800F    Writes out character in Reg A to printer&lt;br /&gt;
32786   8012    Joystick input:stored in addresses 346/9 dec&lt;br /&gt;
32789   8015    Cassette on&lt;br /&gt;
32792   8018    Cassette off&lt;br /&gt;
32795   801B    Write leader to cassette (or A00C)&lt;br /&gt;
32798   801E    Output byte from Reg A to cassette&lt;br /&gt;
32801   8021    CSRDON:Cassette on, prepare for reading&lt;br /&gt;
32804   8024    Input one byte from cassette to Register A&lt;br /&gt;
32807   8027    Gets one bit in from cassette into carry&lt;br /&gt;
32810   802A    Reads in a byte from another computer&lt;br /&gt;
32813   802D    Sends a byte to another computer&lt;br /&gt;
32816   8030    Select Baud rate of communications line&lt;br /&gt;
&lt;br /&gt;
From here on the Coco equivalents are given in brackets and&lt;br /&gt;
only a few Hex addresses will be given&lt;br /&gt;
&lt;br /&gt;
33604  (44102)  SYSERR: Generates appropriate action for&lt;br /&gt;
                Error code in B Reg&lt;br /&gt;
33649  (44147)  CMDMODE: prints OK prompt &amp;amp; returns to the&lt;br /&gt;
                command mode&lt;br /&gt;
33773  (44271)  BASVECT2: complete initialisation process&lt;br /&gt;
                after Basic program loaded&lt;br /&gt;
33815  (44313)  NEW Basic:removes current Basic program from&lt;br /&gt;
                memory, resets stack &amp;amp; clears variables&lt;br /&gt;
33823  (44321)  BASVECT1: Sets up various necessary vectors,&lt;br /&gt;
                once a Basic program has been loaded&lt;br /&gt;
33844  (44339)  RESETS STACK: Resets stack to initial pos&amp;#039;tn&lt;br /&gt;
                all entries are lost&lt;br /&gt;
33951  (44446)  RUN BASIC: runs a basic program in memory,&lt;br /&gt;
                used to AUTORUN programs&lt;br /&gt;
34091   851B    (44539) WAIT KEY: waits for a key press, and&lt;br /&gt;
                when key pressed puts it in A Register&lt;br /&gt;
34935  (45382)  GET EXPR: routine will evaluate &amp;amp; put VARPTR&lt;br /&gt;
                address of following expression into 82/83&lt;br /&gt;
34951  (45398)  GET STRG: compiles a string and puts it into&lt;br /&gt;
                free string space&lt;br /&gt;
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a&lt;br /&gt;
                closed bracket&lt;br /&gt;
35239  (45674)  CKOPBRAK: as for above, but checks for an&lt;br /&gt;
                open bracket&lt;br /&gt;
35242  (45677)  CKCOMA: Checks to see next significant char&lt;br /&gt;
                in command line is a comma, and if not it&lt;br /&gt;
                produces a SYNTAX error&lt;br /&gt;
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char&lt;br /&gt;
                in B Register&lt;br /&gt;
35476  (45911)  GETVAR: Get VARPTR address of the follwing&lt;br /&gt;
                variable&amp;#039;s name&lt;br /&gt;
35625  (46057)  GETUSR: Returns value of the argument in the&lt;br /&gt;
                USR function as 16 bit number in D register&lt;br /&gt;
35632           INTCNV: pass parameters to M/code routine&lt;br /&gt;
35641           GIVABF:used to pass values from M/C to Basic&lt;br /&gt;
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to&lt;br /&gt;
                a numeric variable&lt;br /&gt;
                        Page 34&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage&lt;br /&gt;
                collection of string space&lt;br /&gt;
36255  (46681)  DELVAR: frees space taken by a variable&lt;br /&gt;
36433  (46859)  GET-8-BIT: returns value of the following&lt;br /&gt;
                number in B Register&lt;br /&gt;
36483  (46909)  GET-16-BIT: returns value of the following&lt;br /&gt;
                number in X register&lt;br /&gt;
36522  (46948)  LIST BASIC: lists basic program in memory to&lt;br /&gt;
                to DEVN (device specified)&lt;br /&gt;
37025   90A1    (47448) PRINT CR/LE: moves cursor position&lt;br /&gt;
                to start of a new line&lt;br /&gt;
37093   90E5    (47516) OUT STRING:Outputs a text string to&lt;br /&gt;
                device number in DEVN&lt;br /&gt;
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number&lt;br /&gt;
                in D Reg to DEVN&lt;br /&gt;
38798   978E    RANDOM NUMBER: Generates an 8 bit random&lt;br /&gt;
                number and puts it in location 278&lt;br /&gt;
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns&lt;br /&gt;
                value in Locs 82/83 to a variable&lt;br /&gt;
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for&lt;br /&gt;
                a keypress, flashing cursor at print pos.&lt;br /&gt;
43207  (38201)  CLEAR GRAPHICS:clears current graphics&lt;br /&gt;
                screen to data in B Register on entry&lt;br /&gt;
43304  (38298)  SET COLOURS: sets up locations 180 &amp;amp; 181&lt;br /&gt;
43320  (38314)  SELECT DISPLAY: Selects text or graphics&lt;br /&gt;
                depending on Z condition code, if Z=1 text&lt;br /&gt;
43322   95AC    (38316) RESET VDU: resets default VDU mode&lt;br /&gt;
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg&lt;br /&gt;
43421  (38415)  SET VDG OFFSET: sets display offset for the&lt;br /&gt;
                graphics mode&lt;br /&gt;
43428  (38422)  SELECT VDG COL: selects required VDG colour&lt;br /&gt;
                set from the data in location 193&lt;br /&gt;
43489  (38483)  SELECT PAGE: on entry B reg contains page no&lt;br /&gt;
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,&lt;br /&gt;
                according to data in B reg&lt;br /&gt;
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics&lt;br /&gt;
                and moves basic if necessary&lt;br /&gt;
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,&lt;br /&gt;
                other parameters should be set up&lt;br /&gt;
45137  (40118)  DRAW:allows access to all facilities of DRAW&lt;br /&gt;
46004  (40999)  RESET:resets whole works, as if reset button&lt;br /&gt;
                has been pressed&lt;br /&gt;
46080  (41142)  BOOT BASIC: restarts the Basic interpreter&lt;br /&gt;
                as if on power up or reset&lt;br /&gt;
46410   B54A    (41602) OUTCHAR:outputs character in A Reg&lt;br /&gt;
                to device number in DEVN (location 111)&lt;br /&gt;
46687  (42029)  CLOSE FILES: closes any open tape stream and&lt;br /&gt;
                flushes buffer&lt;br /&gt;
46757  (42089)  WRITE BASIC: writes current basic program to&lt;br /&gt;
                cassette&lt;br /&gt;
46920  (42257)  READ BINARY: reads in BIN file from tape&lt;br /&gt;
47283  (42625)  FIND FILE: searches tape for matching f&amp;#039;name&lt;br /&gt;
47411  (42753)  READ 1ST BLOCK:gets filename block into tape&lt;br /&gt;
                buffer&lt;br /&gt;
47422   B93E    (42763) BLKIN: reads a block of data into&lt;br /&gt;
                cassette buffer&lt;br /&gt;
47505  (42981)  WRITE 1ST BLOCK: (obvious)&lt;br /&gt;
47513   B999    (42996) BLKOUT: write block of data to tape&lt;br /&gt;
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains&lt;br /&gt;
                Lo-res screen address, B Reg colour &amp;amp; loc184&lt;br /&gt;
                the OR data&lt;br /&gt;
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,&lt;br /&gt;
                Pixel reset to Black&lt;br /&gt;
                        Page 35&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
47656  (43225)  CALC PIXEL POS:on entry the top of stack&lt;br /&gt;
                must contain Lo-res vertical co-ordinate,&lt;br /&gt;
                preceded by horizontal co-ordinate&lt;br /&gt;
47735   BA77    (43304) CLEAR SCREEN: clears screen to space&lt;br /&gt;
                and &amp;#039;homes&amp;#039; cursor&lt;br /&gt;
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen&lt;br /&gt;
                to character in B Reg&lt;br /&gt;
47776  (43345)  BEEP:sound Beep for length held in B Reg and&lt;br /&gt;
                pitch set by location 140&lt;br /&gt;
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315&lt;br /&gt;
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting&lt;br /&gt;
                Bit 3 of 65315&lt;br /&gt;
47828  (43397)  RESET D/A: Puts value $7E into D/A converter&lt;br /&gt;
                address&lt;br /&gt;
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C&lt;br /&gt;
47852  (43421)  AUDIO ON:on entry the B Reg must be zero&lt;br /&gt;
48000   BB80    BOOT BASIC64K: Boots 64 mode&lt;br /&gt;
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor&lt;br /&gt;
48101   BBE5    (41409) POLCAT: scans keyboard and puts the&lt;br /&gt;
                character in A Register&lt;br /&gt;
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU&lt;br /&gt;
                line from the cursor position&lt;br /&gt;
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU&lt;br /&gt;
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer&lt;br /&gt;
48394   BD0A    PCRLF:moves print head to start of next line&lt;br /&gt;
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer&lt;br /&gt;
48449  (43426)  SELECT JSK:selects joystick sources (ports -&lt;br /&gt;
                0 - 3) from A Register&lt;br /&gt;
48466   BD52    (43486) READ JSKS: Updates all joystick data&lt;br /&gt;
                locations (346/9)&lt;br /&gt;
48549   BDA5    (42837) BIT IN:reads a single bit(see below)&lt;br /&gt;
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape&lt;br /&gt;
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21&lt;br /&gt;
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21&lt;br /&gt;
48615  (42876)  READ LEADER: motor on &amp;amp; prepares COS to read&lt;br /&gt;
48658  (43050)  BYTE OUT: writes byte in A Reg to tape&lt;br /&gt;
48746   BE6A    WRTLDR:turns cassette on and writes a leader&lt;br /&gt;
&lt;br /&gt;
THE FOLLOWING ARE DRAGONDOS ROUTINES&lt;br /&gt;
&lt;br /&gt;
49166   C00E    LENFIL: Report file length&lt;br /&gt;
49168   C010    CLOSAL: Close all files&lt;br /&gt;
49176   C018    GETFRE: Get free space&lt;br /&gt;
49178   C01A    DELETE: Delete a file&lt;br /&gt;
49180   C01C    PROTECT/UNPROTECT a file&lt;br /&gt;
49182   C01E    RENAME a file&lt;br /&gt;
49184   C020    GETDIR: Get directory entry&lt;br /&gt;
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk&lt;br /&gt;
49412   C104    READ SECTOR: reads 256 bytes from disk&lt;br /&gt;
49509   C165    DRIVE INIT: initialises DOS hardware&lt;br /&gt;
49513   C169    HARDWARE I/O: low level command to hardware&lt;br /&gt;
50108   C3BC    FORMAT DISK: in the DEFD drive&lt;br /&gt;
53581   D14D    GET FREE SPACE: free bytes on current drive&lt;br /&gt;
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)&lt;br /&gt;
                in Y Reg to Track/Sector&lt;br /&gt;
55868   DA3C    DIR DSK: directory of disk in DEFD drive to&lt;br /&gt;
                DEVN&lt;br /&gt;
56229   DBA5    BEEP: on entry B Reg should contain number&lt;br /&gt;
                of beeps&lt;br /&gt;
56267   DBCB    WAIT TIME:on entry X Reg should contain the&lt;br /&gt;
                number of milliseconds to wait&lt;br /&gt;
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive&lt;br /&gt;
&lt;br /&gt;
== INPUT/OUTPUT ROUTINES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These refer to DRAGONDOS.&lt;br /&gt;
&lt;br /&gt;
65280   FF00    Bits 0 to 6 Keyboard row input&lt;br /&gt;
                Bit 7 koystick comparator input&lt;br /&gt;
                Decimal value 255/127 if no fire but pressed&lt;br /&gt;
                Dec value 254 or 126 if right joystick&lt;br /&gt;
                button pressed&lt;br /&gt;
                Dec value 253 or 125 if left joystick fire&lt;br /&gt;
                button pressed&lt;br /&gt;
65282   FF02    Bits 0 to 7 keyboard column output&lt;br /&gt;
65312   FF20    Bit 0 - cassette data input&lt;br /&gt;
                    1 - RS232 data output&lt;br /&gt;
                    2/7 - 6 bit D/A(.25 to 4.75 volts out)&lt;br /&gt;
65313   FF21    Bit 0 - control of CD&lt;br /&gt;
                0=FIRQ to CPU disabled, 1=enabled&lt;br /&gt;
                Bit 1 - RS 232 status input&lt;br /&gt;
                0=set flag falling edge CD, 1=rising edge&lt;br /&gt;
                Bit 2 - normal Data Direction Register addsd&lt;br /&gt;
                0=change FF20 to DDR&lt;br /&gt;
                Bit 3 - Cass Motor control, 0=off, 1=on&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - CD interrupt flag&lt;br /&gt;
65314   FF22    Bit 0 - RS 232 data input&lt;br /&gt;
                    1 - single bit cound output&lt;br /&gt;
                    2 - RAM size input&lt;br /&gt;
                    3 - VDG Control Output CSS(color set ct)&lt;br /&gt;
                    4 - VDG Control Output GM0&amp;amp;NOT(INT)/EXT&lt;br /&gt;
                    5 - VDG Cont Output GM1&lt;br /&gt;
                    6 - VDG Cont Output GM2&lt;br /&gt;
                    7 - VDG Cont Output NOT(A)/G&lt;br /&gt;
65315   FF23    (Coco) POKE 54 to disable auto exec of cartr&lt;br /&gt;
                POKE 55 to enable auto execute of cartridge&lt;br /&gt;
                Not certain re above for Dragon&lt;br /&gt;
                Bit 0 - control of cartridge&lt;br /&gt;
                0=FIRQ to CPU disabled, 1= enabled&lt;br /&gt;
                Bit 1 - Interrupt input&lt;br /&gt;
                0=sets flag on falling edge of cartridge&lt;br /&gt;
                1=sets flag on rising edge of cartridge&lt;br /&gt;
                Bit 2 - Normally 1, 0=changes FF22 to DDReg&lt;br /&gt;
                    3 - 6 bit sound enable&lt;br /&gt;
                    4 - always 1&lt;br /&gt;
                    5 - always 1&lt;br /&gt;
                    6 - not used&lt;br /&gt;
                    7 - Cartridge Interrupt Flag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SAM CONTROL BITS ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
65472/7 FFC0/5  VDG Control Registers for 6883 SAM&lt;br /&gt;
                Contains 3 pairs of addresses (V0-V2), and&lt;br /&gt;
                poking any value to EVEN addresses sets Bit&lt;br /&gt;
                Off(0) in VDG circuitry. Poking value to ODD&lt;br /&gt;
                addresses set Bit ON(1) in 6847 VDG circuit&lt;br /&gt;
65472/3 FFC0/1  Control of Bit 0 (V0)&lt;br /&gt;
65474/5 FFC2/3                 1 (V1)&lt;br /&gt;
65476/7 FFC4/5                 2 (V2)&lt;br /&gt;
65478/91        Page Select Register contains 7 pairs of&lt;br /&gt;
        FFC6/D3 (F0-F6) control Display Start address (Bin)&lt;br /&gt;
                Address os upper left most display element=&lt;br /&gt;
                0000+1/2*OFFSET. Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0) in Page select.&lt;br /&gt;
                Poking any value to ODD addresses sets Bit&lt;br /&gt;
                ON(1) in Page Select Circuitry.&lt;br /&gt;
                Also BASEPAGE is set by converting binary&lt;br /&gt;
                value of F  (Bits F0 to F6) to decimal and&lt;br /&gt;
                multiplying this decimal number by 512.&lt;br /&gt;
65478/9 FFC6/7  Control of Bit 0 (F0)&lt;br /&gt;
65480/1 FFC8/9                 1 (F1)&lt;br /&gt;
65482/3 FFCA/B                 2 (F2)&lt;br /&gt;
65484/5 FFCC/D                 3 (F3)&lt;br /&gt;
65486/7 FFCE/F                 4 (F4)&lt;br /&gt;
65488/9 FFD0/1                 5 (F5)&lt;br /&gt;
65490/1 FFD2/3                 6 (F6)&lt;br /&gt;
&lt;br /&gt;
65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal&lt;br /&gt;
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even&lt;br /&gt;
                addresses sets Bit OFF (0). Poking any value&lt;br /&gt;
                to ODD addresses sets bit ON (1).&lt;br /&gt;
65494/5 FFD6/7  Control of Bit R0&lt;br /&gt;
65496/7 FFD8/9  Control of Bit R1&lt;br /&gt;
                R0=0, R1=0 (slow mode defa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPU VECTORS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3&lt;br /&gt;
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5&lt;br /&gt;
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7&lt;br /&gt;
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9&lt;br /&gt;
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B&lt;br /&gt;
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D&lt;br /&gt;
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ERROR MESSAGES AND CODES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0       NF      NEXT without FOR&lt;br /&gt;
2       SN      Syntax error&lt;br /&gt;
4       RG      RETURN without GOSUB&lt;br /&gt;
6       OD      Out of Data in READ&lt;br /&gt;
8       FC      Illegal Function call&lt;br /&gt;
10      OV      Overflow&lt;br /&gt;
12      OM      Out of Memory&lt;br /&gt;
14      UL      Undefined Line&lt;br /&gt;
16      BS      Bad subscript&lt;br /&gt;
18      DD      Redimension array&lt;br /&gt;
20      /0      Division by Zero&lt;br /&gt;
22      ID      Illegal Direct Statement&lt;br /&gt;
24      TM      Type mismatch&lt;br /&gt;
26      OS      Out of String space&lt;br /&gt;
28      LS      String too long&lt;br /&gt;
30      ST      String too complex&lt;br /&gt;
32      CN      Can&amp;#039;t continue&lt;br /&gt;
34      UF&lt;br /&gt;
36      FD      Faulty data&lt;br /&gt;
38      AO      File already open&lt;br /&gt;
40      DN      Drive number&lt;br /&gt;
42      IO      Input/Output error&lt;br /&gt;
44      FM      Wrong file mode&lt;br /&gt;
46      NO      File not open&lt;br /&gt;
48      IE      Input past EOF (ER on the Coco)&lt;br /&gt;
50      DS      Direct statement&lt;br /&gt;
128  *  NR      Not ready&lt;br /&gt;
130  *  SK      Seek&lt;br /&gt;
132     WP      Write protect&lt;br /&gt;
134  *  RT      Record Type&lt;br /&gt;
136  *  RF      Record not found&lt;br /&gt;
138  *  CC      Cyclic redundancy&lt;br /&gt;
140  *  LD      Lost data&lt;br /&gt;
142  *  BT      Boot error&lt;br /&gt;
144  *  IV      Invalid Directory&lt;br /&gt;
146  *  FD      Directory full&lt;br /&gt;
148     DF      Disk full&lt;br /&gt;
150     FS      File Spec&lt;br /&gt;
152  *  PT      Protection on&lt;br /&gt;
154  *  PE      READ past EOF&lt;br /&gt;
156  *  FF      File not found&lt;br /&gt;
158  *  FE      File exists  (AE on the Coco)&lt;br /&gt;
160     NE      Non-existent&lt;br /&gt;
162  *  TF      Too many open&lt;br /&gt;
164  *  PR      Parameter error&lt;br /&gt;
*    * These error messages are not on the Coco,&lt;br /&gt;
       but the following are and are not on the Dragon.&lt;br /&gt;
        BR      Bad record number (in data)&lt;br /&gt;
        FN      Bad file name&lt;br /&gt;
        FO      Field overflow re data files&lt;br /&gt;
        OB      Out of Buffer space&lt;br /&gt;
        SE      Set to non-fielded string (data)&lt;br /&gt;
        VF      Verification error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Software]] [[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=System_Software&amp;diff=8294</id>
		<title>System Software</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=System_Software&amp;diff=8294"/>
		<updated>2016-05-07T20:50:40Z</updated>

		<summary type="html">&lt;p&gt;Tormod: links to OS-9_System&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Dragon Data ==&lt;br /&gt;
&lt;br /&gt;
[[Dragon DOS]]&lt;br /&gt;
&lt;br /&gt;
[[OS-9_System|OS-9 Level 1]]&lt;br /&gt;
&lt;br /&gt;
[[OS-9_System|OS-9 Level 2]]&lt;br /&gt;
&lt;br /&gt;
== Compusense ==&lt;br /&gt;
&lt;br /&gt;
[[FLEX]]&lt;br /&gt;
&lt;br /&gt;
== Premier Micro Systems ==&lt;br /&gt;
&lt;br /&gt;
[[Delta DOS]]&lt;br /&gt;
&lt;br /&gt;
== Eurohard ==&lt;br /&gt;
&lt;br /&gt;
[[OS-9_System|OS-9 Level 1 V2.0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
&lt;br /&gt;
== The NitrOS-9 project ==&lt;br /&gt;
&lt;br /&gt;
[[NitrOS-9]] Level 1&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=NitrOS-9&amp;diff=8293</id>
		<title>NitrOS-9</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=NitrOS-9&amp;diff=8293"/>
		<updated>2016-05-07T20:47:33Z</updated>

		<summary type="html">&lt;p&gt;Tormod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NitrOS-9 is a multi-task operating system for the Dragon and CoCo computers. It was originally based on OS-9 from Microware as an optimized version for the 6309 microprocessor. Over time it turned into a open-source project and is still under development. NitrOS-9 Level 1 is similar to OS-9 Level 1 and can run on the Dragon 64. It can actually boot on a Dragon 32 as well, but with very little RAM left to do anything useful. NitrOS-9 Level 2 is similar to OS-9 Level 2 and requires the GIME memory management unit (MMU) and extra memory of the CoCo3.&lt;br /&gt;
&lt;br /&gt;
NitrOS-9 has support for the Dragon Data disk controller (thanks to Phill) and for [[DriveWire]].&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.nitros9.org NitrOS-9 project] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]][[Category:System Software]][[Category:OS-9]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Programador_de_EPROM_(Resistor_magazine)&amp;diff=8292</id>
		<title>Programador de EPROM (Resistor magazine)</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Programador_de_EPROM_(Resistor_magazine)&amp;diff=8292"/>
		<updated>2016-05-07T20:45:24Z</updated>

		<summary type="html">&lt;p&gt;Tormod: missing gallery end tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An EPROM programmer cartridge sold as kit through the Spanish electronics magazine &amp;#039;&amp;#039;Resistor&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Resistor_EPROM_Programmer_PCB_Top.jpg|PCB Top&lt;br /&gt;
Image:Resistor_EPROM_Programmer_PCB_Bottom.jpg|PCB Bottom&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=UDW_SD-card_DriveWire_microserver&amp;diff=8291</id>
		<title>UDW SD-card DriveWire microserver</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=UDW_SD-card_DriveWire_microserver&amp;diff=8291"/>
		<updated>2016-05-07T20:39:23Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* uDW (by Tormod) */ linkify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= uDW (by Tormod) =&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;uDW DriveWire microserver&amp;#039;&amp;#039; is a standalone, SD card based mass-storage solution for the Dragon. It plugs into the printer port (instead of a [[Dragon_32/64_Drivewire_Adapter|DriveWire adapter]]) and contains an embedded [[DriveWire]] server. Programs and files are stored on a micro SD card and are accessed the same way as if they were on a PC-based DriveWire server.&lt;br /&gt;
&lt;br /&gt;
* Dimensions 10 x 5 x 3 cm&lt;br /&gt;
* Compatible with all DriveWire software ([[DWLOAD]], HDB-DOS, [[NitrOS-9]], ...)&lt;br /&gt;
* Connects to printer port via IDC flat cable&lt;br /&gt;
* Powered by the Dragon&lt;br /&gt;
* Uses standard micro-SD cards (FAT formatted)&lt;br /&gt;
* Built-in real time clock&lt;br /&gt;
* Firmware upgradeable over USB&lt;br /&gt;
&lt;br /&gt;
[[File:udw.jpg]]&lt;br /&gt;
&lt;br /&gt;
http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4981&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dweebs&amp;diff=8290</id>
		<title>Dweebs</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dweebs&amp;diff=8290"/>
		<updated>2016-05-07T20:33:44Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DOS */ linkify NitrOS-9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What are dweebs? ==&lt;br /&gt;
&lt;br /&gt;
They&amp;#039;re &amp;#039;[[DWLOAD]] Extensible Execution Blocks&amp;#039;, a method for extending the functionality of [[DWLOAD]], a tool used to access [[DriveWire]].&lt;br /&gt;
&lt;br /&gt;
== How do they work? ==&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client is relatively simple, due to the space constraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.&lt;br /&gt;
&lt;br /&gt;
The best example is the &amp;quot;SAVE&amp;quot; dweeb. There is not enough room in the ROM to include support for saving files over DriveWire. However, this functionality can be loaded on demand. DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot; saves a BASIC program to the DriveWire server. The SAVE functionality is only temporarily loaded into RAM and used during this invocation.&lt;br /&gt;
&lt;br /&gt;
Since a dweeb uses the I/O routines of the calling DWLOAD, it is independent of the real transport being used, which makes development with for instance the Becker interface in XRoar very convenient.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;MYIMAGE.VDK&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
   DLOAD&amp;quot;DOS&amp;quot;&lt;br /&gt;
   DLOAD&amp;quot;LROM&amp;quot;&amp;quot;GAME.ROM&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== How do you install them? ==&lt;br /&gt;
&lt;br /&gt;
Normally, dweebs live in the top directory of your Drivewire server - simply unzip the archive and put the files in there. However, you can create subdirectories in your Drivewire directory, for example:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;DWEEB/DATE&amp;quot;&lt;br /&gt;
   DLOAD&amp;quot;VDK/VDIR&amp;quot;&amp;quot;DISK.VDK&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can also use variables with your dweebs, for example:&lt;br /&gt;
&lt;br /&gt;
   D$=&amp;quot;DWEEB/DATE&amp;quot;&lt;br /&gt;
   DLOADD$&lt;br /&gt;
&lt;br /&gt;
== The Dweeb Directory ==&lt;br /&gt;
&lt;br /&gt;
This is a list of the known Dweebs, extracted from posts on the forum. Please feel free to add any others to this list. &lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; CocoSDC users will use DWLOAD instead of DLOAD for all these examples.&lt;br /&gt;
&lt;br /&gt;
=== File Manipulation Dweebs ===&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;p=12300&amp;amp;hilit=LDAF#p12300 LDAF] ====&lt;br /&gt;
Allows the user to load an ASCII basic file.&lt;br /&gt;
   DLOAD&amp;quot;LDAF&amp;quot;&amp;quot;HELLO.BAS&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; See [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=LDAF&amp;amp;start=50#p14791 this post]] for the latest version. Also note that LDA (and the original version of LDAF) &amp;#039;&amp;#039;&amp;#039;only&amp;#039;&amp;#039;&amp;#039; work with DOS files.&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968#p12106 LROM] ====&lt;br /&gt;
Allows the user to load (and run) any ROM file.&lt;br /&gt;
   DLOAD&amp;quot;LROM&amp;quot;&amp;quot;ROMName (no need to put the .ROM extension)&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=CAS&amp;amp;start=50#p13706 CAS] ====&lt;br /&gt;
A simple CAS parser to load CAS files directly from the DriveWire server.&lt;br /&gt;
   DLOAD&amp;quot;CAS&amp;quot;&amp;quot;MYFILE.CAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 SAVE/RESAVE] ====&lt;br /&gt;
Save a basic program to the DriveWire server. &amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; The commonly used Java based DW4 server currently doesn&amp;#039;t support saving to a new file. In this case, use RESAVE to save over the top of an existing, possibly empty, file.&lt;br /&gt;
   DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
   DLOAD&amp;quot;RESAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Disk Manipulation Dweebs ===&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=FLO2V#p12107 FLO2V] ====&lt;br /&gt;
Allows copying a floppy from the default Dragon drive to a new VDK file in the PC Windows file system so you can save a backup of the disk and use it on XRoar as well.&lt;br /&gt;
   DLOAD&amp;quot;FLO2V&amp;quot;&amp;quot;VDKName.VDK&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; See [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VLOAD&amp;amp;start=40#p13154 this post]] for the latest version&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=V2FLO#p12107 V2FLO] ====&lt;br /&gt;
Allows copying an VDK to a floppy on the default Dragon drive to restore a previous backup or simply to transfer a XRoar disk to the real Dragon drives.&lt;br /&gt;
   DLOAD&amp;quot;V2FLO&amp;quot;&amp;quot;VDKName.VDK&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; See [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VLOAD&amp;amp;start=40#p13154 this post]] for the latest version&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VDIR#p12108 VDIR] ====&lt;br /&gt;
Produces a directory list of the disk image.&lt;br /&gt;
   DLOAD&amp;quot;VDIR&amp;quot;&amp;quot;DiskName&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; See [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VDIR&amp;amp;start=30#p13033 this post] for the latest version&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VLOAD#p12110 VLOAD] ====&lt;br /&gt;
Allows the user to load and run/execute any program contained in any VDK image&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;DiskName&amp;quot;&amp;quot;FileName.Ext&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; Also see [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VLOAD&amp;amp;start=30#p13037 this post] for the latest version.&lt;br /&gt;
&lt;br /&gt;
=== Drivewire and other Dweebs ===&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DATE] ====&lt;br /&gt;
Displays date and time from the DW4 server&lt;br /&gt;
   DLOAD&amp;quot;DATE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=DW&amp;amp;start=10#p12164 DW] ====&lt;br /&gt;
Sends requests to the DriveWire server.&lt;br /&gt;
   DLOAD&amp;quot;DW&amp;quot;&amp;quot;DW SERVER STATUS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DOS] ====&lt;br /&gt;
Boot from disk 0 on DW4 server (for launching [[NitrOS-9]])&lt;br /&gt;
  DLOAD&amp;quot;DOS&amp;quot;&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=8289</id>
		<title>DriveWire</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=8289"/>
		<updated>2016-05-07T20:33:00Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DriveWire software */ linkify NitrOS-9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
DriveWire is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like the [[uDW SD-card DriveWire microserver|uDW]] can be used.&lt;br /&gt;
&lt;br /&gt;
== DriveWire software ==&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and [[NitrOS-9]] have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive. See [[Drivewire for dummies]] for how to use HDB-DOS and DriveWire.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also [[DWLOAD]] - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
== DriveWire adapters ==&lt;br /&gt;
&lt;br /&gt;
On the Dragon you will need an adapter to convert the printer port signals to a compatible serial port (or USB virtual serial port).&lt;br /&gt;
&lt;br /&gt;
See [[Dragon_32/64_Drivewire_Adapter]].&lt;br /&gt;
&lt;br /&gt;
== DriveWire server software ==&lt;br /&gt;
&lt;br /&gt;
The Drivewire4 (DW4) server is a Java application and can be downloaded here: https://sites.google.com/site/drivewire4/download&lt;br /&gt;
&lt;br /&gt;
A lightweight alternative is &amp;quot;DriveWire Lite&amp;quot;: A reimplementation in C of the server side of the DriveWire 3 protocol: http://sourceforge.net/projects/dwlite/&lt;br /&gt;
&lt;br /&gt;
There is also an open-source DriveWire server written in Python: https://github.com/6809/DwLoadServer&lt;br /&gt;
&lt;br /&gt;
== Drivewire4 (DW4) server usage ==&lt;br /&gt;
&lt;br /&gt;
Just choose CoCo2 in the DriveWire4 server &amp;quot;Simple Config Wizard&amp;quot;.&lt;br /&gt;
Keep all the default selections.&lt;br /&gt;
&lt;br /&gt;
If you would like to use the server under Windows without installing the JRE, use this batch file for startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SET JDK=%~dp0\jre&lt;br /&gt;
SET JAVA_EXE=%JDK%\bin\java.exe&lt;br /&gt;
&amp;quot;%JAVA_EXE%&amp;quot; -XX:+UseConcMarkSweepGC -jar DW4UI.jar --backup &amp;amp;&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download a JRE and put it into DriveWire directory together with this batch file.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/p/drivewireserver/wiki/DriveWire_Specification/ DriveWire specification]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Repository&amp;diff=8288</id>
		<title>Repository</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Repository&amp;diff=8288"/>
		<updated>2016-05-07T20:32:15Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* linkify NitrOS-9 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are many Software projects around 6809, Dragon and CoCo ...&lt;br /&gt;
&lt;br /&gt;
Here a link collection of theses:&lt;br /&gt;
&lt;br /&gt;
=== ToolShed ===&lt;br /&gt;
&lt;br /&gt;
ToolShed is a package of utilities to perform cross-development from Windows, Linux or Mac OS X computers to the Tandy Color Computer and Dragon microcomputers. Tools are included to read/write both OS-9 RBF disk images and CoCo Disk BASIC disk images, generate cassette WAV files and more.&lt;br /&gt;
&lt;br /&gt;
* Webpage: http://toolshed.sourceforge.net/&lt;br /&gt;
* Project page: http://sourceforge.net/projects/toolshed/&lt;br /&gt;
* Sourcecode repo: http://sourceforge.net/p/toolshed/code/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== LWTOOLS ===&lt;br /&gt;
&lt;br /&gt;
LWTOOLS is a set of cross-development tools for the Motorola 6809 and Hitachi 6309 microprocessors. It supports assembling to raw binaries, CoCo LOADM binaries, and a proprietary object file format for later linking. It also supports macros and file inclusion among other things.&lt;br /&gt;
&lt;br /&gt;
* Project page / Sourcecode: http://lwtools.projects.l-w.ca/&lt;br /&gt;
&lt;br /&gt;
=== M6809 computer tools ===&lt;br /&gt;
&lt;br /&gt;
Stuff for the M6809-based Dragon and similar computers.&lt;br /&gt;
&lt;br /&gt;
* https://gitorious.org/m6809-computer-tools&lt;br /&gt;
&lt;br /&gt;
==== conv-tools ====&lt;br /&gt;
Various conversion tools for e.g. cassette and disk binary formats.&lt;br /&gt;
* https://gitorious.org/m6809-computer-tools/conv-tools&lt;br /&gt;
&lt;br /&gt;
==== dload-dragon ====&lt;br /&gt;
Patched DLOAD command for Dragon 32. Uses HDB-DOS DriveWire routines to talk serial on the Dragon printer port.&lt;br /&gt;
* https://gitorious.org/m6809-computer-tools/dload-dragon&lt;br /&gt;
&lt;br /&gt;
==== dload-server ====&lt;br /&gt;
A server for the DLOAD protocol, to be run on the host computer. Originally written by Burt Mitchell and ported to UNIX by Bryan Clingman.&lt;br /&gt;
* https://gitorious.org/m6809-computer-tools/dload-server&lt;br /&gt;
&lt;br /&gt;
=== m6809 ===&lt;br /&gt;
Motorola 6809 dev tools: Linux packages &amp;#039;&amp;#039;&amp;#039;xroar&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;lwtools&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;toolshed&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* https://launchpad.net/~tormodvolden/+archive/ubuntu/m6809&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;6809&amp;#039; GitHub organization ===&lt;br /&gt;
Stuff around 6809 CPU and homecomputers like Dragon 32/64, CoCo...&lt;br /&gt;
* https://github.com/6809/&lt;br /&gt;
&lt;br /&gt;
==== DwLoadServer ====&lt;br /&gt;
DWLOAD server implemented in Python &lt;br /&gt;
* https://github.com/6809/DwLoadServer&lt;br /&gt;
&lt;br /&gt;
==== dragonlib ====&lt;br /&gt;
Python library around 6809 computers like Dragon 32/64, CoCo... &lt;br /&gt;
* https://github.com/6809/dragonlib&lt;br /&gt;
&lt;br /&gt;
==== sbc09 ====&lt;br /&gt;
sbc09 stands for Lennart Benschop 6809 Single Board Computer.&lt;br /&gt;
It contains a assembler and simulator for the Motorola M6809 processor.&lt;br /&gt;
* https://github.com/6809/sbc09&lt;br /&gt;
&lt;br /&gt;
==== rom-info ====&lt;br /&gt;
Collected Informations/Comments for 6809 ROM Images like Dragon 32 / 64 etc... &lt;br /&gt;
* https://github.com/6809/rom-info&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NitrOS-9 ===&lt;br /&gt;
[[NitrOS-9]] is an open-source OS-9 variant for Dragon and Tandy CoCo&lt;br /&gt;
* Webpage: http://www.nitros9.org/&lt;br /&gt;
* Project page: http://sourceforge.net/projects/nitros9/&lt;br /&gt;
* Sourcecode repo: http://sourceforge.net/p/nitros9/code/&lt;br /&gt;
&lt;br /&gt;
=== FUZIX ===&lt;br /&gt;
A new UNIX-like operating system for 8-bit computers, including Dragon and Tandy CoCo &lt;br /&gt;
* https://github.com/EtchedPixels/FUZIX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Missing links? Just edit this page and insert it ;)&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:6809]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=8287</id>
		<title>DWLOAD</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=8287"/>
		<updated>2016-05-07T20:31:21Z</updated>

		<summary type="html">&lt;p&gt;Tormod: linkify NitrOS-9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DriveWire overview ==&lt;br /&gt;
&lt;br /&gt;
[[DriveWire]] is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like the [[uDW SD-card DriveWire microserver|uDW microserver]] can be used.&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and [[NitrOS-9]] have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also DWLOAD - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
== DWLOAD concept ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is designed to be so small that it fits into unused parts of the Dragon BASIC ROM. Nonetheless, it allows you to simply download and run files from the DriveWire server from within BASIC without any resident use of memory. DWLOAD can be enhanced by &amp;quot;DriveWire Executable Extension Blocks&amp;quot; (dweebs) which are small program loaded from the server to provide further DriveWire capabilities on demand. Some examples are &amp;quot;VLOAD&amp;quot; to load files from VDK images residing on the DriveWire server, &amp;quot;LROM&amp;quot; to load a ROM image into high RAM, and &amp;quot;DOS&amp;quot; to boot NitrOS-9 over DriveWire.&lt;br /&gt;
&lt;br /&gt;
DWLOAD can also be used together with HDB-DOS or Dragon DOS. You can for instance load files from the PC (plain files or from inside VDK images) and save them on your Dragon DOS floppy drive. Or load files from your Dragon DOS floppy drive and save them on the PC (currently only BASIC files supported via the &amp;quot;SAVE&amp;quot; dweeb).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In addition to your Dragon 32 or Dragon 64 or compatible home computer you will need either&lt;br /&gt;
&lt;br /&gt;
    DriveWire adapter + PC running DriveWire server (DW4) &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uDW microserver &lt;br /&gt;
&lt;br /&gt;
Of course, on the Dragon you will need DriveWire software. If you have the DWLOAD EPROM you are all set and can load everything (also HDB-DOS or NitrOS-9) via DriveWire. Otherwise, software (including a DWLOAD program) can be loaded from disk or cassette tape to get started. &lt;br /&gt;
&lt;br /&gt;
== Using DWLOAD ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is a small DriveWire client for BASIC which works without needing a DOS. It loads files as-is from the DriveWire server, that is, not using disk images like HDB-DOS or NitrOS-9 does.&lt;br /&gt;
&lt;br /&gt;
Simply put: Just drop the files in your DriveWire4 server folder, and access them from the Dragon using DWLOAD.&lt;br /&gt;
&lt;br /&gt;
The files can be Dragon DOS binary or BASIC files, or DECB binaries.&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client can be loaded from tape or disk or, most conveniently, embedded into the BASIC ROM, like the DWLOAD EPROM.&lt;br /&gt;
&lt;br /&gt;
If you have the DWLOAD EPROM, use the &amp;quot;DLOAD&amp;quot; command to load files. Examples:&lt;br /&gt;
&lt;br /&gt;
    DLOAD&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
to load and run the file &amp;quot;MYFILE.BAS&amp;quot; from the DriveWire server. To only load the program, use &amp;quot;DLOADN&amp;quot;:&lt;br /&gt;
    DLOADN&amp;quot;BROKEN.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the filename ending is not significant, since the DWLOAD deduces the file type from its content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD Extensible Execution Blocks (dweeb) ==&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client is relatively simple, due to the space constraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.&lt;br /&gt;
&lt;br /&gt;
More information, including a directory of available dweebs, can be found on the [[Dweebs]] wiki page.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DWLOAD forum thread]&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968 dweebs forum thread]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Software]][[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=System_Software&amp;diff=8286</id>
		<title>System Software</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=System_Software&amp;diff=8286"/>
		<updated>2016-05-07T20:28:55Z</updated>

		<summary type="html">&lt;p&gt;Tormod: add NitrOS-9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Dragon Data ==&lt;br /&gt;
&lt;br /&gt;
[[Dragon DOS]]&lt;br /&gt;
&lt;br /&gt;
[[OS-9 Level 1]]&lt;br /&gt;
&lt;br /&gt;
[[OS-9 Level 2]]&lt;br /&gt;
&lt;br /&gt;
== Compusense ==&lt;br /&gt;
&lt;br /&gt;
[[FLEX]]&lt;br /&gt;
&lt;br /&gt;
== Premier Micro Systems ==&lt;br /&gt;
&lt;br /&gt;
[[Delta DOS]]&lt;br /&gt;
&lt;br /&gt;
== Eurohard ==&lt;br /&gt;
&lt;br /&gt;
[[OS-9 Level 1 V2.0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
&lt;br /&gt;
== The NitrOS-9 project ==&lt;br /&gt;
&lt;br /&gt;
[[NitrOS-9]] Level 1&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=NitrOS-9&amp;diff=8285</id>
		<title>NitrOS-9</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=NitrOS-9&amp;diff=8285"/>
		<updated>2016-05-07T20:27:04Z</updated>

		<summary type="html">&lt;p&gt;Tormod: add categories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NitrOS-9 is a multi-task operating system for the Dragon and CoCo computers. It was originally based on OS-9 from Microware as an optimized version for the 6309 microprocessor. Over time it turned into a open-source project and is still under development. NitrOS-9 Level 1 is similar to OS-9 Level 1 and can run on the Dragon 64. It can actually boot on a Dragon 32 as well, but with very little RAM left to do anything useful. NitrOS-9 Level 2 is similar to OS-9 Level 2 and requires the GIME memory management unit (MMU) and extra memory of the CoCo3.&lt;br /&gt;
&lt;br /&gt;
NitrOS-9 has support for the Dragon Data disk controller (thanks to Phill) and for [[DriveWire]].&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.nitros9.org NitrOS-9 project] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]][[Category:System Software]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=NitrOS-9&amp;diff=8284</id>
		<title>NitrOS-9</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=NitrOS-9&amp;diff=8284"/>
		<updated>2016-05-07T20:25:52Z</updated>

		<summary type="html">&lt;p&gt;Tormod: Created page with &amp;quot;NitrOS-9 is a multi-task operating system for the Dragon and CoCo computers. It was originally based on OS-9 from Microware as an optimized version for the 6309 microprocessor...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NitrOS-9 is a multi-task operating system for the Dragon and CoCo computers. It was originally based on OS-9 from Microware as an optimized version for the 6309 microprocessor. Over time it turned into a open-source project and is still under development. NitrOS-9 Level 1 is similar to OS-9 Level 1 and can run on the Dragon 64. It can actually boot on a Dragon 32 as well, but with very little RAM left to do anything useful. NitrOS-9 Level 2 is similar to OS-9 Level 2 and requires the GIME memory management unit (MMU) and extra memory of the CoCo3.&lt;br /&gt;
&lt;br /&gt;
NitrOS-9 has support for the Dragon Data disk controller (thanks to Phill) and for [[DriveWire]].&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.nitros9.org NitrOS-9 project] for more information.&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dweebs&amp;diff=8180</id>
		<title>Dweebs</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dweebs&amp;diff=8180"/>
		<updated>2016-05-04T21:47:19Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* SAVE/RESAVE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What are dweebs? ==&lt;br /&gt;
&lt;br /&gt;
They&amp;#039;re &amp;#039;[[DWLOAD]] Extensible Execution Blocks&amp;#039;, a method for extending the functionality of [[DWLOAD]], a tool used to access [[DriveWire]].&lt;br /&gt;
&lt;br /&gt;
== How do they work? ==&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client is relatively simple, due to the space constraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.&lt;br /&gt;
&lt;br /&gt;
The best example is the &amp;quot;SAVE&amp;quot; dweeb. There is not enough room in the ROM to include support for saving files over DriveWire. However, this functionality can be loaded on demand. DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot; saves a BASIC program to the DriveWire server. The SAVE functionality is only temporarily loaded into RAM and used during this invocation.&lt;br /&gt;
&lt;br /&gt;
Since a dweeb uses the I/O routines of the calling DWLOAD, it is independent of the real transport being used, which makes development with for instance the Becker interface in XRoar very convenient.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;MYIMAGE.VDK&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
   DLOAD&amp;quot;DOS&amp;quot;&lt;br /&gt;
   DLOAD&amp;quot;LROM&amp;quot;&amp;quot;GAME.ROM&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== How do you install them? ==&lt;br /&gt;
&lt;br /&gt;
Normally, dweebs live in the top directory of your Drivewire server - simply unzip the archive and put the files in there. However, you can create subdirectories in your Drivewire directory, for example:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;DWEEB/DATE&amp;quot;&lt;br /&gt;
   DLOAD&amp;quot;VDK/VDIR&amp;quot;&amp;quot;DISK.VDK&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can also use variables with your dweebs, for example:&lt;br /&gt;
&lt;br /&gt;
   D$=&amp;quot;DWEEB/DATE&amp;quot;&lt;br /&gt;
   DLOADD$&lt;br /&gt;
&lt;br /&gt;
== The Dweeb Directory ==&lt;br /&gt;
&lt;br /&gt;
This is a list of the known Dweebs, extracted from posts on the forum. Please feel free to add any others to this list. &lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; CocoSDC users will use DWLOAD instead of DLOAD for all these examples.&lt;br /&gt;
&lt;br /&gt;
=== File Manipulation Dweebs ===&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;p=12300&amp;amp;hilit=LDAF#p12300 LDAF] ====&lt;br /&gt;
Allows the user to load an ASCII basic file.&lt;br /&gt;
   DLOAD&amp;quot;LDAF&amp;quot;&amp;quot;HELLO.BAS&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; See [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=LDAF&amp;amp;start=50#p14791 this post]] for the latest version. Also note that LDA (and the original version of LDAF) &amp;#039;&amp;#039;&amp;#039;only&amp;#039;&amp;#039;&amp;#039; work with DOS files.&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968#p12106 LROM] ====&lt;br /&gt;
Allows the user to load (and run) any ROM file.&lt;br /&gt;
   DLOAD&amp;quot;LROM&amp;quot;&amp;quot;ROMName (no need to put the .ROM extension)&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=CAS&amp;amp;start=50#p13706 CAS] ====&lt;br /&gt;
A simple CAS parser to load CAS files directly from the DriveWire server.&lt;br /&gt;
   DLOAD&amp;quot;CAS&amp;quot;&amp;quot;MYFILE.CAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 SAVE/RESAVE] ====&lt;br /&gt;
Save a basic program to the DriveWire server. &amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; The commonly used Java based DW4 server currently doesn&amp;#039;t support saving to a new file. In this case, use RESAVE to save over the top of an existing, possibly empty, file.&lt;br /&gt;
   DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
   DLOAD&amp;quot;RESAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Disk Manipulation Dweebs ===&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=FLO2V#p12107 FLO2V] ====&lt;br /&gt;
Allows copying a floppy from the default Dragon drive to a new VDK file in the PC Windows file system so you can save a backup of the disk and use it on XRoar as well.&lt;br /&gt;
   DLOAD&amp;quot;FLO2V&amp;quot;&amp;quot;VDKName.VDK&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; See [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VLOAD&amp;amp;start=40#p13154 this post]] for the latest version&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=V2FLO#p12107 V2FLO] ====&lt;br /&gt;
Allows copying an VDK to a floppy on the default Dragon drive to restore a previous backup or simply to transfer a XRoar disk to the real Dragon drives.&lt;br /&gt;
   DLOAD&amp;quot;V2FLO&amp;quot;&amp;quot;VDKName.VDK&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; See [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VLOAD&amp;amp;start=40#p13154 this post]] for the latest version&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VDIR#p12108 VDIR] ====&lt;br /&gt;
Produces a directory list of the disk image.&lt;br /&gt;
   DLOAD&amp;quot;VDIR&amp;quot;&amp;quot;DiskName&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; See [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VDIR&amp;amp;start=30#p13033 this post] for the latest version&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VLOAD#p12110 VLOAD] ====&lt;br /&gt;
Allows the user to load and run/execute any program contained in any VDK image&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;DiskName&amp;quot;&amp;quot;FileName.Ext&amp;quot;&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; Also see [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=VLOAD&amp;amp;start=30#p13037 this post] for the latest version.&lt;br /&gt;
&lt;br /&gt;
=== Drivewire and other Dweebs ===&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DATE] ====&lt;br /&gt;
Displays date and time from the DW4 server&lt;br /&gt;
   DLOAD&amp;quot;DATE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968&amp;amp;hilit=DW&amp;amp;start=10#p12164 DW] ====&lt;br /&gt;
Sends requests to the DriveWire server.&lt;br /&gt;
   DLOAD&amp;quot;DW&amp;quot;&amp;quot;DW SERVER STATUS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DOS] ====&lt;br /&gt;
Boot from disk 0 on DW4 server (for launching NitrOS-9)&lt;br /&gt;
  DLOAD&amp;quot;DOS&amp;quot;&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=8179</id>
		<title>DriveWire</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=8179"/>
		<updated>2016-05-04T21:44:25Z</updated>

		<summary type="html">&lt;p&gt;Tormod: link to spec + minor fixups&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
DriveWire is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like the [[uDW SD-card DriveWire microserver|uDW]] can be used.&lt;br /&gt;
&lt;br /&gt;
== DriveWire software ==&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive. See [[Drivewire for dummies]] for how to use HDB-DOS and DriveWire.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also [[DWLOAD]] - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
== DriveWire adapters ==&lt;br /&gt;
&lt;br /&gt;
On the Dragon you will need an adapter to convert the printer port signals to a compatible serial port (or USB virtual serial port).&lt;br /&gt;
&lt;br /&gt;
See [[Dragon_32/64_Drivewire_Adapter]].&lt;br /&gt;
&lt;br /&gt;
== DriveWire server software ==&lt;br /&gt;
&lt;br /&gt;
The Drivewire4 (DW4) server is a Java application and can be downloaded here: https://sites.google.com/site/drivewire4/download&lt;br /&gt;
&lt;br /&gt;
A lightweight alternative is &amp;quot;DriveWire Lite&amp;quot;: A reimplementation in C of the server side of the DriveWire 3 protocol: http://sourceforge.net/projects/dwlite/&lt;br /&gt;
&lt;br /&gt;
There is also an open-source DriveWire server written in Python: https://github.com/6809/DwLoadServer&lt;br /&gt;
&lt;br /&gt;
== Drivewire4 (DW4) server usage ==&lt;br /&gt;
&lt;br /&gt;
Just choose CoCo2 in the DriveWire4 server &amp;quot;Simple Config Wizard&amp;quot;.&lt;br /&gt;
Keep all the default selections.&lt;br /&gt;
&lt;br /&gt;
If you would like to use the server under Windows without installing the JRE, use this batch file for startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SET JDK=%~dp0\jre&lt;br /&gt;
SET JAVA_EXE=%JDK%\bin\java.exe&lt;br /&gt;
&amp;quot;%JAVA_EXE%&amp;quot; -XX:+UseConcMarkSweepGC -jar DW4UI.jar --backup &amp;amp;&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download a JRE and put it into DriveWire directory together with this batch file.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/p/drivewireserver/wiki/DriveWire_Specification/ DriveWire specification]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_32/64_Drivewire_Adapter&amp;diff=7244</id>
		<title>Dragon 32/64 Drivewire Adapter</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_32/64_Drivewire_Adapter&amp;diff=7244"/>
		<updated>2015-08-28T22:27:37Z</updated>

		<summary type="html">&lt;p&gt;Tormod: explain what adapter it is and how it works&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Drivewire.jpg]]‎ &lt;br /&gt;
&lt;br /&gt;
See also [[DriveWire]] and [[Drivewire_for_dummies]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
[[DriveWire]] on Dragon uses pins on the printer port to communicate with an external DriveWire server. To convert the signal from the printer port (driven by bit-banger routines in software) into a RS232-compatible serial line, a signal inverter and level converters are needed.&lt;br /&gt;
&lt;br /&gt;
The DriveWire adapter presented on this page is made by Tormod and combines an inverting circuit and a USB interface to provide a solution that plugs directly to the Dragon printer port on one end and a normal USB port in the other end.&lt;br /&gt;
&lt;br /&gt;
Note that the specialized, standalone [[uDW SD-card DriveWire microserver|uDW]] DriveWire server has input circuitry adapted to the Dragon printer port and can therefore be plugged in directly without any adapter. &lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
The built-in serial UART is the CP2102 from Silicon Labs.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
Windows driver can be downloaded from the chip manufacturer: http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
&lt;br /&gt;
In most cases, you simply need to run &amp;quot;sudo adduser $USER dialout&amp;quot;. Read on for more details. &lt;br /&gt;
&lt;br /&gt;
Some helpful commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
~ $ sudo lsusb | grep UART&lt;br /&gt;
Bus 001 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light&lt;br /&gt;
&lt;br /&gt;
$ dmesg | grep -ie cp210*&lt;br /&gt;
[17479.466698] usb 1-1: Product: CP2102 USB to UART Bridge Controller&lt;br /&gt;
[17479.548508] usbcore: registered new interface driver cp210x&lt;br /&gt;
[17479.548520] usbserial: USB Serial support registered for cp210x&lt;br /&gt;
[17479.548535] cp210x 1-1:1.0: cp210x converter detected&lt;br /&gt;
[17480.428168] usb 1-1: cp210x converter now attached to ttyUSB0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the last line, to see that the adapter is assigned to &amp;#039;&amp;#039;&amp;#039;ttyUSB0&amp;#039;&amp;#039;&amp;#039;. Check which groups have access to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l /dev/ttyUSB0 &lt;br /&gt;
crw-rw---- 1 root dialout 188, 0 Nov 11 13:15 /dev/ttyUSB0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case you should assure that your user is in the user group &amp;#039;&amp;#039;&amp;#039;dialout&amp;#039;&amp;#039;&amp;#039;, e.g.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ groups # Display the user groups for the current user&lt;br /&gt;
user_foo : user_foo adm tty dialout fax cdrom floppy tape sudo audio dip video plugdev netdev fuse lpadmin scanner&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Is the group is not listed, add your user to the group, e.g:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo adduser $USER dialout&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will have to logout and relogin after this command!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=781 DIY instructions]&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4270 buy a tormod&amp;#039;s Drivewire Adapter]&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4854 buy a tormod&amp;#039;s Drivewire deluxe cased adapters]&lt;br /&gt;
* [[DWLOAD]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Repository&amp;diff=7240</id>
		<title>Repository</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Repository&amp;diff=7240"/>
		<updated>2015-08-23T10:58:23Z</updated>

		<summary type="html">&lt;p&gt;Tormod: add NitrOS-9 and FUZIX&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are many Software projects around 6809, Dragon and CoCo ...&lt;br /&gt;
&lt;br /&gt;
Here a link collection of theses:&lt;br /&gt;
&lt;br /&gt;
=== ToolShed ===&lt;br /&gt;
&lt;br /&gt;
ToolShed is a package of utilities to perform cross-development from Windows, Linux or Mac OS X computers to the Tandy Color Computer and Dragon microcomputers. Tools are included to read/write both OS-9 RBF disk images and CoCo Disk BASIC disk images, generate cassette WAV files and more.&lt;br /&gt;
&lt;br /&gt;
* Webpage: http://toolshed.sourceforge.net/&lt;br /&gt;
* Project page: http://sourceforge.net/projects/toolshed/&lt;br /&gt;
* Sourcecode repo: http://sourceforge.net/p/toolshed/code/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== LWTOOLS ===&lt;br /&gt;
&lt;br /&gt;
LWTOOLS is a set of cross-development tools for the Motorola 6809 and Hitachi 6309 microprocessors. It supports assembling to raw binaries, CoCo LOADM binaries, and a proprietary object file format for later linking. It also supports macros and file inclusion among other things.&lt;br /&gt;
&lt;br /&gt;
* Project page / Sourcecode: http://lwtools.projects.l-w.ca/&lt;br /&gt;
&lt;br /&gt;
=== M6809 computer tools ===&lt;br /&gt;
&lt;br /&gt;
Stuff for the M6809-based Dragon and similar computers.&lt;br /&gt;
&lt;br /&gt;
* https://gitorious.org/m6809-computer-tools&lt;br /&gt;
&lt;br /&gt;
==== conv-tools ====&lt;br /&gt;
Various conversion tools for e.g. cassette and disk binary formats.&lt;br /&gt;
* https://gitorious.org/m6809-computer-tools/conv-tools&lt;br /&gt;
&lt;br /&gt;
==== dload-dragon ====&lt;br /&gt;
Patched DLOAD command for Dragon 32. Uses HDB-DOS DriveWire routines to talk serial on the Dragon printer port.&lt;br /&gt;
* https://gitorious.org/m6809-computer-tools/dload-dragon&lt;br /&gt;
&lt;br /&gt;
==== dload-server ====&lt;br /&gt;
A server for the DLOAD protocol, to be run on the host computer. Originally written by Burt Mitchell and ported to UNIX by Bryan Clingman.&lt;br /&gt;
* https://gitorious.org/m6809-computer-tools/dload-server&lt;br /&gt;
&lt;br /&gt;
=== m6809 ===&lt;br /&gt;
Motorola 6809 dev tools: Linux packages &amp;#039;&amp;#039;&amp;#039;xroar&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;lwtools&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;toolshed&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* https://launchpad.net/~tormodvolden/+archive/ubuntu/m6809&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;6809&amp;#039; GitHub organization ===&lt;br /&gt;
Stuff around 6809 CPU and homecomputers like Dragon 32/64, CoCo...&lt;br /&gt;
* https://github.com/6809/&lt;br /&gt;
&lt;br /&gt;
==== DwLoadServer ====&lt;br /&gt;
DWLOAD server implemented in Python &lt;br /&gt;
* https://github.com/6809/DwLoadServer&lt;br /&gt;
&lt;br /&gt;
==== dragonlib ====&lt;br /&gt;
Python library around 6809 computers like Dragon 32/64, CoCo... &lt;br /&gt;
* https://github.com/6809/dragonlib&lt;br /&gt;
&lt;br /&gt;
==== sbc09 ====&lt;br /&gt;
sbc09 stands for Lennart Benschop 6809 Single Board Computer.&lt;br /&gt;
It contains a assembler and simulator for the Motorola M6809 processor.&lt;br /&gt;
* https://github.com/6809/sbc09&lt;br /&gt;
&lt;br /&gt;
==== rom-info ====&lt;br /&gt;
Collected Informations/Comments for 6809 ROM Images like Dragon 32 / 64 etc... &lt;br /&gt;
* https://github.com/6809/rom-info&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NitrOS-9 ===&lt;br /&gt;
An open-source OS-9 variant for Dragon and Tandy CoCo&lt;br /&gt;
* Webpage: http://www.nitros9.org/&lt;br /&gt;
* Project page: http://sourceforge.net/projects/nitros9/&lt;br /&gt;
* Sourcecode repo: http://sourceforge.net/p/nitros9/code/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FUZIX ===&lt;br /&gt;
A new UNIX-like operating system for 8-bit computers, including Dragon and Tandy CoCo &lt;br /&gt;
* https://github.com/EtchedPixels/FUZIX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Missing links? Just edit this page and insert it ;)&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:6809]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7239</id>
		<title>DWLOAD</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7239"/>
		<updated>2015-08-22T20:33:33Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DriveWire overview */ link to uDW&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DriveWire overview ==&lt;br /&gt;
&lt;br /&gt;
[[DriveWire]] is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like the [[uDW SD-card DriveWire microserver|uDW microserver]] can be used.&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also DWLOAD - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
== DWLOAD concept ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is designed to be so small that it fits into unused parts of the Dragon BASIC ROM. Nonetheless, it allows you to simply download and run files from the DriveWire server from within BASIC without any resident use of memory. DWLOAD can be enhanced by &amp;quot;DriveWire Executable Extension Blocks&amp;quot; (dweebs) which are small program loaded from the server to provide further DriveWire capabilities on demand. Some examples are &amp;quot;VLOAD&amp;quot; to load files from VDK images residing on the DriveWire server, &amp;quot;LROM&amp;quot; to load a ROM image into high RAM, and &amp;quot;DOS&amp;quot; to boot NitrOS-9 over DriveWire.&lt;br /&gt;
&lt;br /&gt;
DWLOAD can also be used together with HDB-DOS or Dragon DOS. You can for instance load files from the PC (plain files or from inside VDK images) and save them on your Dragon DOS floppy drive. Or load files from your Dragon DOS floppy drive and save them on the PC (currently only BASIC files supported via the &amp;quot;SAVE&amp;quot; dweeb).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In addition to your Dragon 32 or Dragon 64 or compatible home computer you will need either&lt;br /&gt;
&lt;br /&gt;
    DriveWire adapter + PC running DriveWire server (DW4) &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uDW microserver &lt;br /&gt;
&lt;br /&gt;
Of course, on the Dragon you will need DriveWire software. If you have the DWLOAD EPROM you are all set and can load everything (also HDB-DOS or NitrOS-9) via DriveWire. Otherwise, software (including a DWLOAD program) can be loaded from disk or cassette tape to get started. &lt;br /&gt;
&lt;br /&gt;
== Using DWLOAD ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is a small DriveWire client for BASIC which works without needing a DOS. It loads files as-is from the DriveWire server, that is, not using disk images like HDB-DOS or NitrOS-9 does.&lt;br /&gt;
&lt;br /&gt;
Simply put: Just drop the files in your DriveWire4 server folder, and access them from the Dragon using DWLOAD.&lt;br /&gt;
&lt;br /&gt;
The files can be Dragon DOS binary or BASIC files, or DECB binaries.&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client can be loaded from tape or disk or, most conveniently, embedded into the BASIC ROM, like the DWLOAD EPROM.&lt;br /&gt;
&lt;br /&gt;
If you have the DWLOAD EPROM, use the &amp;quot;DLOAD&amp;quot; command to load files. Examples:&lt;br /&gt;
&lt;br /&gt;
    DLOAD&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
to load and run the file &amp;quot;MYFILE.BAS&amp;quot; from the DriveWire server. To only load the program, use &amp;quot;DLOADN&amp;quot;:&lt;br /&gt;
    DLOADN&amp;quot;BROKEN.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the filename ending is not significant, since the DWLOAD deduces the file type from its content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD Extensible Execution Blocks (dweeb) ==&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client is relatively simple, due to the space constraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.&lt;br /&gt;
&lt;br /&gt;
The best example is the &amp;quot;SAVE&amp;quot; dweeb. There is not enough room in the ROM to include support for saving files over DriveWire. However, this functionality can be loaded on demand. DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot; saves a BASIC program to the DriveWire server. The SAVE functionality is only temporarily loaded into RAM and used during this invocation.&lt;br /&gt;
&lt;br /&gt;
Another typical dweeb is &amp;quot;DOS&amp;quot; for booting an operating system (NitrOS-9), similar to the DOS command in HDB-DOS or the DWDOS program.&lt;br /&gt;
&lt;br /&gt;
Pere has also created some dweebs for accessing VDK disk images on the DriveWire server, this is very useful for accessing Dragon DOS program collections without using a disk drive or DOS.&lt;br /&gt;
&lt;br /&gt;
Since a dweeb uses the I/O routines of the calling DWLOAD, it is independent of the real transport being used, which makes development with for instance the Becker interface in XRoar very convenient.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;MYIMAGE.VDK&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;DOS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;LROM&amp;quot;&amp;quot;GAME.ROM&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DWLOAD forum thread]&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968 dweebs forum thread]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Software]][[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=7238</id>
		<title>DriveWire</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=7238"/>
		<updated>2015-08-22T20:30:34Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* Overview */ add uDW link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
DriveWire is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like the [[uDW SD-card DriveWire microserver|uDW]] can be used.&lt;br /&gt;
&lt;br /&gt;
== DriveWire software ==&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive. See [[Drivewire for dummies]] for how to use HDB-DOS and DriveWire.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also [[DWLOAD]] - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
== DriveWire adapters ==&lt;br /&gt;
&lt;br /&gt;
On the Dragon you will need an adapter to convert the printer port signals to a compatible serial port (or USB virtual serial port).&lt;br /&gt;
&lt;br /&gt;
See [[Dragon_32/64_Drivewire_Adapter]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DriveWire servers ==&lt;br /&gt;
&lt;br /&gt;
The Drivewire4 server is a Java application and can be downloaded here: https://sites.google.com/site/drivewire4/download&lt;br /&gt;
&lt;br /&gt;
There exist also &amp;quot;DriveWire Lite&amp;quot;: a reimplementation in C of the server side of the DriveWire 3 protocol: http://sourceforge.net/projects/dwlite/&lt;br /&gt;
&lt;br /&gt;
There is also a OpenSource DriveWire Server written in Python: https://github.com/6809/DwLoadServer&lt;br /&gt;
&lt;br /&gt;
== Drivewire4 (DW4) server usage ==&lt;br /&gt;
&lt;br /&gt;
Just choose CoCo2 in the DriveWire4 server &amp;quot;Simple Config Wizard&amp;quot;.&lt;br /&gt;
Keep all the default selections.&lt;br /&gt;
&lt;br /&gt;
If you would like to use the server under Windows without installing the JRE, use this batch file for startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SET JDK=%~dp0\jre&lt;br /&gt;
SET JAVA_EXE=%JDK%\bin\java.exe&lt;br /&gt;
&amp;quot;%JAVA_EXE%&amp;quot; -XX:+UseConcMarkSweepGC -jar DW4UI.jar --backup &amp;amp;&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download a JRE and put it into DriveWire directory together with this batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=UDW_SD-card_DriveWire_microserver&amp;diff=7237</id>
		<title>UDW SD-card DriveWire microserver</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=UDW_SD-card_DriveWire_microserver&amp;diff=7237"/>
		<updated>2015-08-22T20:26:19Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* uDW (by Tormod) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= uDW (by Tormod) =&lt;br /&gt;
&lt;br /&gt;
The uDW DriveWire microserver is a standalone, SD card based mass-storage solution for the Dragon. It plugs into the printer port (instead of a DriveWire adapter) and contains an embedded DriveWire server. Programs and files are stored on a micro SD card and are accessed the same way as if they were on a PC-based DriveWire server.&lt;br /&gt;
&lt;br /&gt;
* Dimensions 10 x 5 x 3 cm&lt;br /&gt;
* Compatible with all DriveWire software (DWLOAD, HDB-DOS, NitrOS-9, ...)&lt;br /&gt;
* Connects to printer port via IDC flat cable&lt;br /&gt;
* Powered by the Dragon&lt;br /&gt;
* Uses standard micro-SD cards (FAT formatted)&lt;br /&gt;
* Built-in real time clock&lt;br /&gt;
* Firmware upgradeable over USB&lt;br /&gt;
&lt;br /&gt;
[[File:udw.jpg]]&lt;br /&gt;
&lt;br /&gt;
http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4981&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DIY_Projects&amp;diff=7236</id>
		<title>DIY Projects</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DIY_Projects&amp;diff=7236"/>
		<updated>2015-08-22T20:24:54Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* Cartridges &amp;amp; Expansions */ added uDW&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Dragon series of computers offers programming models and a cartridge expansion connector that are ideally suited to hardware hackers and hobbyist experimenters. Below, you can find a selection of projects that have been created by members of the Dragon community.&lt;br /&gt;
&lt;br /&gt;
Click the item to learn more about it, buy one or download schematics and associated software (where applicable). &lt;br /&gt;
&lt;br /&gt;
== Adapters &amp;amp; Cables ==&lt;br /&gt;
* [[Replacement power supply unit]]&lt;br /&gt;
* [[Dragon32/iPhone Bi-Directional Data Cable (Rink)]]&lt;br /&gt;
* [[Dragon 32/64 Drivewire Adapter]]&lt;br /&gt;
* [[Floppy Cable]]&lt;br /&gt;
&lt;br /&gt;
== Cartridges &amp;amp; Expansions ==&lt;br /&gt;
* [[Multicart by Prime (Phill Harvey-Smith)]]&lt;br /&gt;
* [[DragonMMC SDCard Interface by Prime (Phill Harvey-Smith)]]&lt;br /&gt;
* [[Dragon ROM/RAM Cartridge (Rink)]]&lt;br /&gt;
* [[Dragon I/O Cartridge (Rink)]]&lt;br /&gt;
* [[Dragon Multi Cartridge version 1.0 (Rolo)]]&lt;br /&gt;
* [[Dragon Multi Cartridge version 1.5 (Rolo)]]&lt;br /&gt;
* [[80 Column WordPak]] (CoCoDemus)&lt;br /&gt;
* [[Dragon Lab-Cartridge version 1.0 (Rolo)]]&lt;br /&gt;
* [[uDW SD-card DriveWire microserver]] (Tormod)&lt;br /&gt;
&lt;br /&gt;
== 6809 DIY construction kits ==&lt;br /&gt;
Here a list of external DIY instructions to build a own 6809 based computer:&lt;br /&gt;
&lt;br /&gt;
* [http://searle.hostei.com/grant/Multicomp/ Grant&amp;#039;s Low-cost FPGA project &amp;quot;MULTICOMP&amp;quot;]&lt;br /&gt;
* [http://searle.hostei.com/grant/6809/Simple6809.html Grant&amp;#039;s 6-chip 6809 computer]&lt;br /&gt;
* [http://www.msarnoff.org/projects/6809/ Ultim809: Homebrew 8-Bit Computer]&lt;br /&gt;
* [http://www.8bitforce.com/simon6809/ Simon 6809]&lt;br /&gt;
* [http://laurent68k.free.fr/Site/RedBoard6809.html HOMEBREW Computer 6809: RedBoard]&lt;br /&gt;
&lt;br /&gt;
See also forums thread related to this list: http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=8&amp;amp;t=4338&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=UDW_SD-card_DriveWire_microserver&amp;diff=7235</id>
		<title>UDW SD-card DriveWire microserver</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=UDW_SD-card_DriveWire_microserver&amp;diff=7235"/>
		<updated>2015-08-22T20:24:06Z</updated>

		<summary type="html">&lt;p&gt;Tormod: new uDW page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= uDW (by Tormod) =&lt;br /&gt;
&lt;br /&gt;
The uDW DriveWire microserver is a standalone, SD card based mass-storage solution for the Dragon. It plugs into the printer port (instead of a DriveWire adapter) and contains an embedded DriveWire server. Programs and files are stored on a micro SD card and are accessed the same way as if they were on a PC-based DriveWire server.&lt;br /&gt;
&lt;br /&gt;
* Dimensions 10 x 5 x 3 cm&lt;br /&gt;
* Compatible with all DriveWire software (DWLOAD, HDB-DOS, NitrOS-9, ...)&lt;br /&gt;
* Connects to printer port via IDC flat cable&lt;br /&gt;
* Powered by the Dragon&lt;br /&gt;
* Uses standard micro-SD cards (FAT formatted)&lt;br /&gt;
* Built-in real time clock&lt;br /&gt;
* Firmware upgradeable over USB&lt;br /&gt;
&lt;br /&gt;
[[File:udw.jpg]]&lt;br /&gt;
&lt;br /&gt;
http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4981&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=File:Udw.jpg&amp;diff=7234</id>
		<title>File:Udw.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=File:Udw.jpg&amp;diff=7234"/>
		<updated>2015-08-22T20:21:46Z</updated>

		<summary type="html">&lt;p&gt;Tormod: uDW DriveWire microserver by Tormod&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;uDW DriveWire microserver by Tormod&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7233</id>
		<title>DWLOAD</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7233"/>
		<updated>2015-08-22T17:05:24Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DriveWire overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DriveWire overview ==&lt;br /&gt;
&lt;br /&gt;
[[DriveWire]] is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like uDW can be used.&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also DWLOAD - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
== DWLOAD concept ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is designed to be so small that it fits into unused parts of the Dragon BASIC ROM. Nonetheless, it allows you to simply download and run files from the DriveWire server from within BASIC without any resident use of memory. DWLOAD can be enhanced by &amp;quot;DriveWire Executable Extension Blocks&amp;quot; (dweebs) which are small program loaded from the server to provide further DriveWire capabilities on demand. Some examples are &amp;quot;VLOAD&amp;quot; to load files from VDK images residing on the DriveWire server, &amp;quot;LROM&amp;quot; to load a ROM image into high RAM, and &amp;quot;DOS&amp;quot; to boot NitrOS-9 over DriveWire.&lt;br /&gt;
&lt;br /&gt;
DWLOAD can also be used together with HDB-DOS or Dragon DOS. You can for instance load files from the PC (plain files or from inside VDK images) and save them on your Dragon DOS floppy drive. Or load files from your Dragon DOS floppy drive and save them on the PC (currently only BASIC files supported via the &amp;quot;SAVE&amp;quot; dweeb).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In addition to your Dragon 32 or Dragon 64 or compatible home computer you will need either&lt;br /&gt;
&lt;br /&gt;
    DriveWire adapter + PC running DriveWire server (DW4) &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uDW microserver &lt;br /&gt;
&lt;br /&gt;
Of course, on the Dragon you will need DriveWire software. If you have the DWLOAD EPROM you are all set and can load everything (also HDB-DOS or NitrOS-9) via DriveWire. Otherwise, software (including a DWLOAD program) can be loaded from disk or cassette tape to get started. &lt;br /&gt;
&lt;br /&gt;
== Using DWLOAD ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is a small DriveWire client for BASIC which works without needing a DOS. It loads files as-is from the DriveWire server, that is, not using disk images like HDB-DOS or NitrOS-9 does.&lt;br /&gt;
&lt;br /&gt;
Simply put: Just drop the files in your DriveWire4 server folder, and access them from the Dragon using DWLOAD.&lt;br /&gt;
&lt;br /&gt;
The files can be Dragon DOS binary or BASIC files, or DECB binaries.&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client can be loaded from tape or disk or, most conveniently, embedded into the BASIC ROM, like the DWLOAD EPROM.&lt;br /&gt;
&lt;br /&gt;
If you have the DWLOAD EPROM, use the &amp;quot;DLOAD&amp;quot; command to load files. Examples:&lt;br /&gt;
&lt;br /&gt;
    DLOAD&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
to load and run the file &amp;quot;MYFILE.BAS&amp;quot; from the DriveWire server. To only load the program, use &amp;quot;DLOADN&amp;quot;:&lt;br /&gt;
    DLOADN&amp;quot;BROKEN.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the filename ending is not significant, since the DWLOAD deduces the file type from its content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD Extensible Execution Blocks (dweeb) ==&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client is relatively simple, due to the space constraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.&lt;br /&gt;
&lt;br /&gt;
The best example is the &amp;quot;SAVE&amp;quot; dweeb. There is not enough room in the ROM to include support for saving files over DriveWire. However, this functionality can be loaded on demand. DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot; saves a BASIC program to the DriveWire server. The SAVE functionality is only temporarily loaded into RAM and used during this invocation.&lt;br /&gt;
&lt;br /&gt;
Another typical dweeb is &amp;quot;DOS&amp;quot; for booting an operating system (NitrOS-9), similar to the DOS command in HDB-DOS or the DWDOS program.&lt;br /&gt;
&lt;br /&gt;
Pere has also created some dweebs for accessing VDK disk images on the DriveWire server, this is very useful for accessing Dragon DOS program collections without using a disk drive or DOS.&lt;br /&gt;
&lt;br /&gt;
Since a dweeb uses the I/O routines of the calling DWLOAD, it is independent of the real transport being used, which makes development with for instance the Becker interface in XRoar very convenient.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;MYIMAGE.VDK&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;DOS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;LROM&amp;quot;&amp;quot;GAME.ROM&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DWLOAD forum thread]&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968 dweebs forum thread]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Software]][[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=7232</id>
		<title>DriveWire</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=7232"/>
		<updated>2015-08-22T17:00:25Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DriveWire software */ link to DWLOAD and Drivewire for dummies&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
DriveWire is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like uDW can be used.&lt;br /&gt;
&lt;br /&gt;
== DriveWire software ==&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive. See [[Drivewire for dummies]] for how to use HDB-DOS and DriveWire.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also [[DWLOAD]] - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
== DriveWire adapters ==&lt;br /&gt;
&lt;br /&gt;
On the Dragon you will need an adapter to convert the printer port signals to a compatible serial port (or USB virtual serial port).&lt;br /&gt;
&lt;br /&gt;
See [[Dragon_32/64_Drivewire_Adapter]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DriveWire servers ==&lt;br /&gt;
&lt;br /&gt;
The Drivewire4 server is a Java application and can be downloaded here: https://sites.google.com/site/drivewire4/download&lt;br /&gt;
&lt;br /&gt;
There exist also &amp;quot;DriveWire Lite&amp;quot;: a reimplementation in C of the server side of the DriveWire 3 protocol: http://sourceforge.net/projects/dwlite/&lt;br /&gt;
&lt;br /&gt;
There is also a OpenSource DriveWire Server written in Python: https://github.com/6809/DwLoadServer&lt;br /&gt;
&lt;br /&gt;
== Drivewire4 (DW4) server usage ==&lt;br /&gt;
&lt;br /&gt;
Just choose CoCo2 in the DriveWire4 server &amp;quot;Simple Config Wizard&amp;quot;.&lt;br /&gt;
Keep all the default selections.&lt;br /&gt;
&lt;br /&gt;
If you would like to use the server under Windows without installing the JRE, use this batch file for startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SET JDK=%~dp0\jre&lt;br /&gt;
SET JAVA_EXE=%JDK%\bin\java.exe&lt;br /&gt;
&amp;quot;%JAVA_EXE%&amp;quot; -XX:+UseConcMarkSweepGC -jar DW4UI.jar --backup &amp;amp;&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download a JRE and put it into DriveWire directory together with this batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Drivewire_for_dummies&amp;diff=7231</id>
		<title>Drivewire for dummies</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Drivewire_for_dummies&amp;diff=7231"/>
		<updated>2015-08-22T16:56:45Z</updated>

		<summary type="html">&lt;p&gt;Tormod: this is HDB-DOS only, link to DriveWire page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Drivewire for Dummies - by  Robert Hermanek &lt;br /&gt;
(originally posted on the CoCo mailing list)&lt;br /&gt;
&lt;br /&gt;
NOTE: This is only about HDB-DOS - see [[DriveWire]] for more general information.&lt;br /&gt;
&lt;br /&gt;
== Drivewire for Dummies - Part 1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Background: Once upon a time, if you were lucky you had a color computer with a disk controller. (If not, you were biting your nails hoping your cassettes loaded.) If you had a disk system, then you could have up to 4 drives, and they were labelled drives 0 through 3, and you selected which disk drive you wanted to use with the drive command: &lt;br /&gt;
&lt;br /&gt;
DRIVE n &lt;br /&gt;
&lt;br /&gt;
Each of these four physical 5 1/4 floppies would store approximately 160k of data. Back in the day, this was pretty huge. Although disks were more reliable and much faster than cassette, disk failures or directory crashes were still quite common. &lt;br /&gt;
&lt;br /&gt;
After the floppy era, hard drives started making an appearance. Harddrives are orders of magnitude larger (megs vs. kilobytes) however for usage in disk extended basic on a color computer, these larger devices would still have to be presented as &amp;quot;virtual floppies&amp;quot; of 160k each, so that a massive rewrite of DECB (disk extended color basic) would not be necessary, and also to avoid incompatibilities with old software. &lt;br /&gt;
&lt;br /&gt;
HDB-DOS appeared on the scene eventually in order to facilitate connecting to a hard drive from DECB and getting access to your new space in friendly 160k virtual disks. &lt;br /&gt;
&lt;br /&gt;
Next, some very clever folks (insert list of all the geniuses involved here) came up with &amp;quot;DriveWire.&amp;quot; For the coco, it still comes down to be connected to some large &amp;quot;device.&amp;quot; But in fact all read/write disk requests are redirected out the rs-232 port, and a server application on the far side (on a modern PC) will respond to the request and send data back to the coco. The coco sees this data as the response of a sector read (for example) from a floppy disk, just like back in the day when it was connected to actual coco disk drives via a disk controller. &lt;br /&gt;
&lt;br /&gt;
For drivewire to work then, there are four things you need: &lt;br /&gt;
# a coco running HDB-DOS &lt;br /&gt;
# a cable connecting rs-232 to serial port on PC &lt;br /&gt;
# a drivewire server application running on the PC &lt;br /&gt;
# a disk image mounted and ready in the drivewire server app. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now a little discussion of disk images, and people can correct me if I&amp;#039;m wrong. &lt;br /&gt;
&lt;br /&gt;
Once, disk images (files with a DSK extension) were just a handy way of storing the data on a 35 track standard coco disk, so again about a 160k file. This file simply contains each track, each sector, in order, and the 256 bytes that make up each sector. &lt;br /&gt;
&lt;br /&gt;
For the purpose of drivewire however, these DSK images started being placed in collections, since we didn&amp;#039;t want to just work with one virtual floppy, but many virtual floppies. &lt;br /&gt;
&lt;br /&gt;
Going back to the coco running HDB-DOS, there are now two commands for selecting which drive you want to access: &lt;br /&gt;
&lt;br /&gt;
DRIVE n &lt;br /&gt;
&lt;br /&gt;
This is the same command I mentioned above, and it will choose which virtual disk you want to use on the currently selected device. Now for original coco&amp;#039;s running a disk controller, there was no talk of what device you wanted to access--you were accessing your disk controller, and if you were lucky you had more than one drive connected to it. You could then say DRIVE 0 or DRIVE 3 to access your disks. &lt;br /&gt;
&lt;br /&gt;
When connecting to scsi devices came about, a new command was added: &lt;br /&gt;
&lt;br /&gt;
DRIVE #n &lt;br /&gt;
&lt;br /&gt;
Yes, looks the same except for the # symbol. This command selects which device you want to access. For example, if you had a scsi controller connected to your coco, with 2 physical harddrives attached, each of these harddrives would contain their own collections of virtual floppy disks. So all of the following are possible: &lt;br /&gt;
&lt;br /&gt;
DRIVE #0 &lt;br /&gt;
DRIVE 0 - first virtual disk on device 0 &lt;br /&gt;
DRIVE 1 - next virutal disk on device 0 &lt;br /&gt;
(etc) &lt;br /&gt;
&lt;br /&gt;
DRIVE #1 &lt;br /&gt;
DRIVE 0 - first virtual disk on device 1 &lt;br /&gt;
DRIVE 1 - next virtual disk on device 1 &lt;br /&gt;
&lt;br /&gt;
(etc) &lt;br /&gt;
&lt;br /&gt;
Now we get our sites back on drivewire, and here is what we come up with: &lt;br /&gt;
&lt;br /&gt;
1) When you use the DRIVE #n command, you are selecting the &amp;quot;device,&amp;quot; but for drivewire this simply means which source file (collection) of virtual floppies you wish to use. This collection is a single file (like a single physical harddrive back in the day) that contains, one after another, virtual floppy disk images. &lt;br /&gt;
&lt;br /&gt;
2) When you use the DRIVE n command, you are choosing which virtual floppy on the currently selected collection you wish to use. &lt;br /&gt;
&lt;br /&gt;
3) The real bonus: Back in the day with physical devices, you were limited to how many devices and disks you had by what you really had--in drivewire there is no limit other than the device and disk #&amp;#039;s have to be a byte value. That means you can select any device # 0 - 255 (DW4 server), and any drive # 0 to 255 on each device. 256 X 256 = 65,536 virtual disks that can be accessed by a coco connected to a drivewire server. That&amp;#039;s a whole bunch of space! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So a final summary is: &lt;br /&gt;
&lt;br /&gt;
# Get HDB-DOS running on coco, get server running on PC, get connected with a cable. (we&amp;#039;ll get the specifics of the cable soon) &lt;br /&gt;
# In the server application, choose as many disk collections (that will be seen as &amp;quot;devices&amp;quot; in HDB-DOS) mounted as you would like. &lt;br /&gt;
# Select your current collection from the coco using the DRIVE #n command, and then choose your current virtual floppy disk using the DRIVE n command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Drivewire for Dummies - Part 2 - The Cable ==&lt;br /&gt;
&lt;br /&gt;
Dragon Adapter&lt;br /&gt;
[[Dragon_32/64_Drivewire_Adapter]]&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
CoCo Drivewire Cable&lt;br /&gt;
http://www.mediafire.com/?c91gj67kw7q6yzu (CoCo DriveWire Serial Cable &lt;br /&gt;
pin-out diagrams) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Drivewire for Dummies - Part 3 - Chicken and Egg ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All the previous explanation assumes that you have HDB-DOS running on your coco. So how do you get it running on your coco? &lt;br /&gt;
&lt;br /&gt;
1) If you have a disk system, you can get or create a physical disk that contains the HDB-DOS program. This includes a loader that basically gets HDB-DOS into RAM, then pulls the rug out from under DECB and replaces it with HDB-DOS. From then on you are accessing virtual disks through your rs-232 port instead of real disks through your controller cartridge. &lt;br /&gt;
&lt;br /&gt;
There have been .DSK images posted here, that if restored to a physical floppy, would give you a nice HDB-DOS loader disk. However if you do not have drivewire already running, it can be pretty difficult to get the .DSK copied to a real floppy. There are PC utilities that can do this, assuming you have properly configured floppy drives on your PC (I&amp;#039;ve never gotten this to work myself.) Your best bet might be to have someone you know help you out and mail you a disk. Otherwise, does anyone know if you can still get a HDB-DOS disk from cloud9tech? That would be a valuable service I think... &lt;br /&gt;
&lt;br /&gt;
2) You can load HDB-DOS loader from cassette. Now, you don&amp;#039;t have to use an actual tape -- if you have a .WAV file on your PC that contains all the screeching and wailing we all know and love from our younger days, you can get the audio out on your PC connected to the audio in on your coco, then hit play on your .WAV file and &amp;quot;load&amp;quot; it into your coco. Or, you could play the .WAV onto an actual tape recorder if you wanted to load from a physical cassette. I feel like someone recently successfully loaded HDB-DOS using a .WAV file, if so, please reply directly to me with your audio file if you are willing--I&amp;#039;d like to test it myself, keep it on hand, and possibly help other drivewire newbies in the future... &lt;br /&gt;
&lt;br /&gt;
3) You can burn an eprom with hdb-dos and place it in a cartridge so that it loads on boot. This is by far the most elegant, but also the most technically challenging. How to burn and install ROM images is a subject all its own, and I&amp;#039;m afraid I do not know enough about it. Again, cloud9tech will help you out, they did me!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Drivewire for Dummies - Part 4 - DRIVE #n vs. DRIVE n ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When it comes to daily usage, the most initially confusing thing about DriveWire I think is all this talk of &amp;quot;devices&amp;quot; versus &amp;quot;disks,&amp;quot; and sometimes other terms are used. I&amp;#039;m not really sure what the best approach is to clarify this, but I&amp;#039;ll take a shot at it... &lt;br /&gt;
&lt;br /&gt;
First, it is unfortunate perhaps that we did not choose a different file extension for files that are collections of images, as opposed to a single image. If you have a .DSK file that contains a single image, this is what you will have (in terms of DECB):&lt;br /&gt;
&lt;br /&gt;
35 tracks X 18 sectors X 256 bytes per sector = 161,280 bytes, or approximately a 160k file. &lt;br /&gt;
&lt;br /&gt;
For the purposes of DriveWire, however, when you mount a .DSK file as DRIVE #0 for example (in the slot for device 0), this .DSK file is actually a collection of images, and as I mentioned before, perhaps we should have chosen a different file extension such as &amp;quot;.DEV&amp;quot; for &amp;quot;device&amp;quot; or &amp;quot;DWD&amp;quot; for drivewire disks (or something.) Regardless, this file is simple, and is just virtual disk images lined up one after another. The server application figures out what offset is necessary to find the right data. &lt;br /&gt;
&lt;br /&gt;
An example: Let&amp;#039;s say you mount file &amp;quot;MyUtils.DSK&amp;quot; in slot 0 on DriveWire server, and &amp;quot;MyGames.DSK&amp;quot; in slot 1 on DriveWire server. Then the following HDB-DOS commands on your CoCo will perform these functions: &lt;br /&gt;
&lt;br /&gt;
DRIVE #0 &lt;br /&gt;
-- selects MyUtils.DSK &lt;br /&gt;
&lt;br /&gt;
DRIVE 0 &lt;br /&gt;
-- will access first 160k disk, data starting at byte 1 through byte 161,280. &lt;br /&gt;
&lt;br /&gt;
DRIVE 1 &lt;br /&gt;
-- will access second disk, data starting at byte 161,281 through byte 322,560 &lt;br /&gt;
&lt;br /&gt;
DRIVE 2 &lt;br /&gt;
-- will access third disk, data starting at byte 322,561 through byte 483,840 &lt;br /&gt;
&lt;br /&gt;
To access your games... &lt;br /&gt;
&lt;br /&gt;
DRIVE #1 &lt;br /&gt;
-- selects MyGames.DSK &lt;br /&gt;
&lt;br /&gt;
Now, the DRIVE 0 command mentioned above will not give you access to the first disk on your Utils collection, but instead the first disk in your Games collection. &lt;br /&gt;
&lt;br /&gt;
In the new Drivewire4 server application, it sounds like all these mappings can be changed as needed, but for this discussion I&amp;#039;m just assuming that DRIVE 0 through DRIVE 255 on the coco are mapped in the same order into a corresponding file on the server side. &lt;br /&gt;
&lt;br /&gt;
This is basically all you need to know about DriveWire to access data from your PC... When I have a little more time, I&amp;#039;ll try to list the commands for some of the more common things people do with Drivewire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:Software]] [[Category:DIY_Projects]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_32/64_Drivewire_Adapter&amp;diff=7230</id>
		<title>Dragon 32/64 Drivewire Adapter</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_32/64_Drivewire_Adapter&amp;diff=7230"/>
		<updated>2015-08-22T16:52:23Z</updated>

		<summary type="html">&lt;p&gt;Tormod: link to DriveWire page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Drivewire.jpg]]‎ &lt;br /&gt;
&lt;br /&gt;
See also [[DriveWire]] and [[Drivewire_for_dummies]]&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
The built-in serial UART is the CP2102 from Silicon Labs.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
Windows driver can be downloaded from the chip manufacturer: http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
&lt;br /&gt;
In most cases, you simply need to run &amp;quot;sudo adduser $USER dialout&amp;quot;. Read on for more details. &lt;br /&gt;
&lt;br /&gt;
Some helpful commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
~ $ sudo lsusb | grep UART&lt;br /&gt;
Bus 001 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light&lt;br /&gt;
&lt;br /&gt;
$ dmesg | grep -ie cp210*&lt;br /&gt;
[17479.466698] usb 1-1: Product: CP2102 USB to UART Bridge Controller&lt;br /&gt;
[17479.548508] usbcore: registered new interface driver cp210x&lt;br /&gt;
[17479.548520] usbserial: USB Serial support registered for cp210x&lt;br /&gt;
[17479.548535] cp210x 1-1:1.0: cp210x converter detected&lt;br /&gt;
[17480.428168] usb 1-1: cp210x converter now attached to ttyUSB0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the last line, to see that the adapter is assigned to &amp;#039;&amp;#039;&amp;#039;ttyUSB0&amp;#039;&amp;#039;&amp;#039;. Check which groups have access to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l /dev/ttyUSB0 &lt;br /&gt;
crw-rw---- 1 root dialout 188, 0 Nov 11 13:15 /dev/ttyUSB0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case you should assure that your user is in the user group &amp;#039;&amp;#039;&amp;#039;dialout&amp;#039;&amp;#039;&amp;#039;, e.g.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ groups # Display the user groups for the current user&lt;br /&gt;
user_foo : user_foo adm tty dialout fax cdrom floppy tape sudo audio dip video plugdev netdev fuse lpadmin scanner&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Is the group is not listed, add your user to the group, e.g:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo adduser $USER dialout&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will have to logout and relogin after this command!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=781 DIY instructions]&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DWLOAD]&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4270 buy a tormod&amp;#039;s Drivewire Adapter]&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4854 buy a tormod&amp;#039;s Drivewire deluxe cased adapters]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Technical&amp;diff=7229</id>
		<title>Technical</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Technical&amp;diff=7229"/>
		<updated>2015-08-22T16:51:22Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* Informations */ add DriveWire link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;PLEASE NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;The Dragon Archive and all of its contributors accept no liability for any injury or damage resulting from any persons attempting to use or follow any instructions contained within this section. The content is provided for information only and the resposibility for using that information lies with the individual performing the work.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schematics ==&lt;br /&gt;
&lt;br /&gt;
[[Dragon 32 Schematics]]&lt;br /&gt;
&lt;br /&gt;
[[Dragon 64 Schematics]]&lt;br /&gt;
&lt;br /&gt;
[[Project Alpha / Dragon Professional Schematics]]&lt;br /&gt;
&lt;br /&gt;
[[Project Beta / Dragon 128 Schematics]]&lt;br /&gt;
&lt;br /&gt;
[[Dragon DOS Schematic]]&lt;br /&gt;
&lt;br /&gt;
[[Cumana DOS Schematic]]&lt;br /&gt;
&lt;br /&gt;
== Hardware Pictures ==&lt;br /&gt;
&lt;br /&gt;
[[Motherboard_Pictures|Motherboard Pictures]]&lt;br /&gt;
&lt;br /&gt;
[[PSU_Pictures|PSU Pictures]]&lt;br /&gt;
&lt;br /&gt;
[[Game_Cartridges|Cartridge PCB Pictures]].&lt;br /&gt;
&lt;br /&gt;
== Service Sheets ==&lt;br /&gt;
&lt;br /&gt;
[[Dragon 32 - Service Information (RWEW/KA/0080a)]]&lt;br /&gt;
 &lt;br /&gt;
[[Dragon 32 - Service Information (RWEW/KA/0081a)]]&lt;br /&gt;
&lt;br /&gt;
[[Dragon 32 - Service Information (RWEW/RA/0082a) ]]&lt;br /&gt;
&lt;br /&gt;
[[Dragon 32 - REPLACEMENT OF POWER SUPPLY AND CENTRAL PROCESSING UNITS ON THE DRAGON 32]]&lt;br /&gt;
&lt;br /&gt;
[[Dragon 32 - CPU and PSU Modifcations and Compatibility]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== N.D.U.G ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Dragon 32 - 64K Upgrade]]&lt;br /&gt;
&lt;br /&gt;
[[Dragon Notebook]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
[[Importing images into the Dragon]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DIY Projects ==&lt;br /&gt;
&lt;br /&gt;
[[Dragon Peripheral Controller (Electrónica Fácil magazine)]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Dragon 32 Input/Output Ports (Maplin Projects Book Eight)]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Dragon 32 RS232 Modem Interface (Maplin Projects Book Eight)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Informations ==&lt;br /&gt;
&lt;br /&gt;
* [[Keyboard]]&lt;br /&gt;
* [[CharMap]]&lt;br /&gt;
* [[Tokens]]&lt;br /&gt;
* [[DriveWire]]&lt;br /&gt;
&lt;br /&gt;
Chips:&lt;br /&gt;
&lt;br /&gt;
* [[MC6809E]] - Dragon CPU&lt;br /&gt;
* [[MC6847]] - Video Display Generator (VDG)&lt;br /&gt;
* [[SN74LS783]] - Synchronous Address Multiplexor (SAM)&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragon_32/64_Drivewire_Adapter&amp;diff=7228</id>
		<title>Dragon 32/64 Drivewire Adapter</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragon_32/64_Drivewire_Adapter&amp;diff=7228"/>
		<updated>2015-08-22T16:48:52Z</updated>

		<summary type="html">&lt;p&gt;Tormod: moved server software parts to new DriveWire page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Drivewire.jpg]]‎ &lt;br /&gt;
&lt;br /&gt;
See also: [[Drivewire_for_dummies]]&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
The built-in serial UART is the CP2102 from Silicon Labs.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
Windows driver can be downloaded from the chip manufacturer: http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
&lt;br /&gt;
In most cases, you simply need to run &amp;quot;sudo adduser $USER dialout&amp;quot;. Read on for more details. &lt;br /&gt;
&lt;br /&gt;
Some helpful commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
~ $ sudo lsusb | grep UART&lt;br /&gt;
Bus 001 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light&lt;br /&gt;
&lt;br /&gt;
$ dmesg | grep -ie cp210*&lt;br /&gt;
[17479.466698] usb 1-1: Product: CP2102 USB to UART Bridge Controller&lt;br /&gt;
[17479.548508] usbcore: registered new interface driver cp210x&lt;br /&gt;
[17479.548520] usbserial: USB Serial support registered for cp210x&lt;br /&gt;
[17479.548535] cp210x 1-1:1.0: cp210x converter detected&lt;br /&gt;
[17480.428168] usb 1-1: cp210x converter now attached to ttyUSB0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the last line, to see that the adapter is assigned to &amp;#039;&amp;#039;&amp;#039;ttyUSB0&amp;#039;&amp;#039;&amp;#039;. Check which groups have access to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l /dev/ttyUSB0 &lt;br /&gt;
crw-rw---- 1 root dialout 188, 0 Nov 11 13:15 /dev/ttyUSB0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case you should assure that your user is in the user group &amp;#039;&amp;#039;&amp;#039;dialout&amp;#039;&amp;#039;&amp;#039;, e.g.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ groups # Display the user groups for the current user&lt;br /&gt;
user_foo : user_foo adm tty dialout fax cdrom floppy tape sudo audio dip video plugdev netdev fuse lpadmin scanner&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Is the group is not listed, add your user to the group, e.g:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo adduser $USER dialout&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will have to logout and relogin after this command!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=781 DIY instructions]&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DWLOAD]&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4270 buy a tormod&amp;#039;s Drivewire Adapter]&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=6&amp;amp;t=4854 buy a tormod&amp;#039;s Drivewire deluxe cased adapters]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=7227</id>
		<title>DriveWire</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DriveWire&amp;diff=7227"/>
		<updated>2015-08-22T16:47:38Z</updated>

		<summary type="html">&lt;p&gt;Tormod: new page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
DriveWire is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like uDW can be used.&lt;br /&gt;
&lt;br /&gt;
== DriveWire software ==&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also DWLOAD - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command. &lt;br /&gt;
&lt;br /&gt;
== DriveWire adapters ==&lt;br /&gt;
&lt;br /&gt;
On the Dragon you will need an adapter to convert the printer port signals to a compatible serial port (or USB virtual serial port).&lt;br /&gt;
&lt;br /&gt;
See [[Dragon_32/64_Drivewire_Adapter]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DriveWire servers ==&lt;br /&gt;
&lt;br /&gt;
The Drivewire4 server is a Java application and can be downloaded here: https://sites.google.com/site/drivewire4/download&lt;br /&gt;
&lt;br /&gt;
There exist also &amp;quot;DriveWire Lite&amp;quot;: a reimplementation in C of the server side of the DriveWire 3 protocol: http://sourceforge.net/projects/dwlite/&lt;br /&gt;
&lt;br /&gt;
There is also a OpenSource DriveWire Server written in Python: https://github.com/6809/DwLoadServer&lt;br /&gt;
&lt;br /&gt;
== Drivewire4 (DW4) server usage ==&lt;br /&gt;
&lt;br /&gt;
Just choose CoCo2 in the DriveWire4 server &amp;quot;Simple Config Wizard&amp;quot;.&lt;br /&gt;
Keep all the default selections.&lt;br /&gt;
&lt;br /&gt;
If you would like to use the server under Windows without installing the JRE, use this batch file for startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SET JDK=%~dp0\jre&lt;br /&gt;
SET JAVA_EXE=%JDK%\bin\java.exe&lt;br /&gt;
&amp;quot;%JAVA_EXE%&amp;quot; -XX:+UseConcMarkSweepGC -jar DW4UI.jar --backup &amp;amp;&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download a JRE and put it into DriveWire directory together with this batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7226</id>
		<title>DWLOAD</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7226"/>
		<updated>2015-08-22T16:34:37Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* DWLOAD Extensible Execution Blocks (dweeb) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DriveWire overview ==&lt;br /&gt;
&lt;br /&gt;
DriveWire is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like uDW can be used.&lt;br /&gt;
DriveWire software&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also DWLOAD - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD concept ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is designed to be so small that it fits into unused parts of the Dragon BASIC ROM. Nonetheless, it allows you to simply download and run files from the DriveWire server from within BASIC without any resident use of memory. DWLOAD can be enhanced by &amp;quot;DriveWire Executable Extension Blocks&amp;quot; (dweebs) which are small program loaded from the server to provide further DriveWire capabilities on demand. Some examples are &amp;quot;VLOAD&amp;quot; to load files from VDK images residing on the DriveWire server, &amp;quot;LROM&amp;quot; to load a ROM image into high RAM, and &amp;quot;DOS&amp;quot; to boot NitrOS-9 over DriveWire.&lt;br /&gt;
&lt;br /&gt;
DWLOAD can also be used together with HDB-DOS or Dragon DOS. You can for instance load files from the PC (plain files or from inside VDK images) and save them on your Dragon DOS floppy drive. Or load files from your Dragon DOS floppy drive and save them on the PC (currently only BASIC files supported via the &amp;quot;SAVE&amp;quot; dweeb).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In addition to your Dragon 32 or Dragon 64 or compatible home computer you will need either&lt;br /&gt;
&lt;br /&gt;
    DriveWire adapter + PC running DriveWire server (DW4) &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uDW microserver &lt;br /&gt;
&lt;br /&gt;
Of course, on the Dragon you will need DriveWire software. If you have the DWLOAD EPROM you are all set and can load everything (also HDB-DOS or NitrOS-9) via DriveWire. Otherwise, software (including a DWLOAD program) can be loaded from disk or cassette tape to get started. &lt;br /&gt;
&lt;br /&gt;
== Using DWLOAD ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is a small DriveWire client for BASIC which works without needing a DOS. It loads files as-is from the DriveWire server, that is, not using disk images like HDB-DOS or NitrOS-9 does.&lt;br /&gt;
&lt;br /&gt;
Simply put: Just drop the files in your DriveWire4 server folder, and access them from the Dragon using DWLOAD.&lt;br /&gt;
&lt;br /&gt;
The files can be Dragon DOS binary or BASIC files, or DECB binaries.&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client can be loaded from tape or disk or, most conveniently, embedded into the BASIC ROM, like the DWLOAD EPROM.&lt;br /&gt;
&lt;br /&gt;
If you have the DWLOAD EPROM, use the &amp;quot;DLOAD&amp;quot; command to load files. Examples:&lt;br /&gt;
&lt;br /&gt;
    DLOAD&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
to load and run the file &amp;quot;MYFILE.BAS&amp;quot; from the DriveWire server. To only load the program, use &amp;quot;DLOADN&amp;quot;:&lt;br /&gt;
    DLOADN&amp;quot;BROKEN.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the filename ending is not significant, since the DWLOAD deduces the file type from its content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD Extensible Execution Blocks (dweeb) ==&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client is relatively simple, due to the space constraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.&lt;br /&gt;
&lt;br /&gt;
The best example is the &amp;quot;SAVE&amp;quot; dweeb. There is not enough room in the ROM to include support for saving files over DriveWire. However, this functionality can be loaded on demand. DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot; saves a BASIC program to the DriveWire server. The SAVE functionality is only temporarily loaded into RAM and used during this invocation.&lt;br /&gt;
&lt;br /&gt;
Another typical dweeb is &amp;quot;DOS&amp;quot; for booting an operating system (NitrOS-9), similar to the DOS command in HDB-DOS or the DWDOS program.&lt;br /&gt;
&lt;br /&gt;
Pere has also created some dweebs for accessing VDK disk images on the DriveWire server, this is very useful for accessing Dragon DOS program collections without using a disk drive or DOS.&lt;br /&gt;
&lt;br /&gt;
Since a dweeb uses the I/O routines of the calling DWLOAD, it is independent of the real transport being used, which makes development with for instance the Becker interface in XRoar very convenient.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;MYIMAGE.VDK&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;DOS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;LROM&amp;quot;&amp;quot;GAME.ROM&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DWLOAD forum thread]&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968 dweebs forum thread]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Software]][[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7225</id>
		<title>DWLOAD</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7225"/>
		<updated>2015-08-22T16:32:50Z</updated>

		<summary type="html">&lt;p&gt;Tormod: /* Links */ Add link to forum thread on dweebs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DriveWire overview ==&lt;br /&gt;
&lt;br /&gt;
DriveWire is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like uDW can be used.&lt;br /&gt;
DriveWire software&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also DWLOAD - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD concept ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is designed to be so small that it fits into unused parts of the Dragon BASIC ROM. Nonetheless, it allows you to simply download and run files from the DriveWire server from within BASIC without any resident use of memory. DWLOAD can be enhanced by &amp;quot;DriveWire Executable Extension Blocks&amp;quot; (dweebs) which are small program loaded from the server to provide further DriveWire capabilities on demand. Some examples are &amp;quot;VLOAD&amp;quot; to load files from VDK images residing on the DriveWire server, &amp;quot;LROM&amp;quot; to load a ROM image into high RAM, and &amp;quot;DOS&amp;quot; to boot NitrOS-9 over DriveWire.&lt;br /&gt;
&lt;br /&gt;
DWLOAD can also be used together with HDB-DOS or Dragon DOS. You can for instance load files from the PC (plain files or from inside VDK images) and save them on your Dragon DOS floppy drive. Or load files from your Dragon DOS floppy drive and save them on the PC (currently only BASIC files supported via the &amp;quot;SAVE&amp;quot; dweeb).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In addition to your Dragon 32 or Dragon 64 or compatible home computer you will need either&lt;br /&gt;
&lt;br /&gt;
    DriveWire adapter + PC running DriveWire server (DW4) &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uDW microserver &lt;br /&gt;
&lt;br /&gt;
Of course, on the Dragon you will need DriveWire software. If you have the DWLOAD EPROM you are all set and can load everything (also HDB-DOS or NitrOS-9) via DriveWire. Otherwise, software (including a DWLOAD program) can be loaded from disk or cassette tape to get started. &lt;br /&gt;
&lt;br /&gt;
== Using DWLOAD ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is a small DriveWire client for BASIC which works without needing a DOS. It loads files as-is from the DriveWire server, that is, not using disk images like HDB-DOS or NitrOS-9 does.&lt;br /&gt;
&lt;br /&gt;
Simply put: Just drop the files in your DriveWire4 server folder, and access them from the Dragon using DWLOAD.&lt;br /&gt;
&lt;br /&gt;
The files can be Dragon DOS binary or BASIC files, or DECB binaries.&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client can be loaded from tape or disk or, most conveniently, embedded into the BASIC ROM, like the DWLOAD EPROM.&lt;br /&gt;
&lt;br /&gt;
If you have the DWLOAD EPROM, use the &amp;quot;DLOAD&amp;quot; command to load files. Examples:&lt;br /&gt;
&lt;br /&gt;
    DLOAD&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
to load and run the file &amp;quot;MYFILE.BAS&amp;quot; from the DriveWire server. To only load the program, use &amp;quot;DLOADN&amp;quot;:&lt;br /&gt;
    DLOADN&amp;quot;BROKEN.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the filename ending is not significant, since the DWLOAD deduces the file type from its content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD Extensible Execution Blocks (dweeb) ==&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client is relatively simple, due to the space constraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.&lt;br /&gt;
&lt;br /&gt;
The best example is the &amp;quot;SAVE&amp;quot; dweeb. There is not enough room in the ROM to include support for saving files over DriveWire. However, this functionality can be loaded on demand. DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot; saves a BASIC program to the DriveWire server. The SAVE functionality is only temporarily loaded into RAM and used during this invocation.&lt;br /&gt;
&lt;br /&gt;
Another typical dweeb is &amp;quot;DOS&amp;quot; for booting an operating system (NitrOS-9), similar to the DOS command in HDB-DOS or the DWDOS program.&lt;br /&gt;
&lt;br /&gt;
Pere has also created some dweebs for accessing VDK disk images on the DriveWire server, this is very useful for accessing Dragon DOS program collections without using a disk drive or DOS.&lt;br /&gt;
&lt;br /&gt;
Since a dweeb uses the I/O routines of the calling DWLOAD, it is independent of the real transport being used, which makes development with for instance the Becker interface in XRoar very convenient.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;MYIMAGE.VDK&amp;quot;&amp;quot;MYFILE.BAS&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;DOS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DWLOAD forum thread]&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4968 dweebs forum thread]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Software]][[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7224</id>
		<title>DWLOAD</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=DWLOAD&amp;diff=7224"/>
		<updated>2015-08-22T16:31:05Z</updated>

		<summary type="html">&lt;p&gt;Tormod: Add my own DWLOAD information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== DriveWire overview ==&lt;br /&gt;
&lt;br /&gt;
DriveWire is a way to connect your Dragon to a PC. It allows you to transfer files from the PC to your Dragon, or to use the PC as a virtual disk for the Dragon. A server program runs on the PC and services requests from the Dragon. Instead of a PC, a stand-alone DriveWire server like uDW can be used.&lt;br /&gt;
DriveWire software&lt;br /&gt;
&lt;br /&gt;
DriveWire on the Dragon uses the printer port. On the Dragon, software is needed that can &amp;quot;talk&amp;quot; to the DriveWire server through the printer port. Operating systems like HDB-DOS and NitrOS-9 have support for DriveWire, and can use the DriveWire server as a full replacement for a normal floppy or hard disk drive.&lt;br /&gt;
&lt;br /&gt;
For Dragon there is also DWLOAD - a small program that can be used to load programs from the DriveWire server without needing a disk operating system. DWLOAD can be embedded in a modified BASIC ROM, replacing the &amp;quot;DLOAD&amp;quot; command. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD concept ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is designed to be so small that it fits into unused parts of the Dragon BASIC ROM. Nonetheless, it allows you to simply download and run files from the DriveWire server from within BASIC without any resident use of memory. DWLOAD can be enhanced by &amp;quot;DriveWire Executable Extension Blocks&amp;quot; (dweebs) which are small program loaded from the server to provide further DriveWire capabilities on demand. Some examples are &amp;quot;VLOAD&amp;quot; to load files from VDK images residing on the DriveWire server, &amp;quot;LROM&amp;quot; to load a ROM image into high RAM, and &amp;quot;DOS&amp;quot; to boot NitrOS-9 over DriveWire.&lt;br /&gt;
&lt;br /&gt;
DWLOAD can also be used together with HDB-DOS or Dragon DOS. You can for instance load files from the PC (plain files or from inside VDK images) and save them on your Dragon DOS floppy drive. Or load files from your Dragon DOS floppy drive and save them on the PC (currently only BASIC files supported via the &amp;quot;SAVE&amp;quot; dweeb).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In addition to your Dragon 32 or Dragon 64 or compatible home computer you will need either&lt;br /&gt;
&lt;br /&gt;
    DriveWire adapter + PC running DriveWire server (DW4) &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    uDW microserver &lt;br /&gt;
&lt;br /&gt;
Of course, on the Dragon you will need DriveWire software. If you have the DWLOAD EPROM you are all set and can load everything (also HDB-DOS or NitrOS-9) via DriveWire. Otherwise, software (including a DWLOAD program) can be loaded from disk or cassette tape to get started. &lt;br /&gt;
&lt;br /&gt;
== Using DWLOAD ==&lt;br /&gt;
&lt;br /&gt;
DWLOAD is a small DriveWire client for BASIC which works without needing a DOS. It loads files as-is from the DriveWire server, that is, not using disk images like HDB-DOS or NitrOS-9 does.&lt;br /&gt;
&lt;br /&gt;
Simply put: Just drop the files in your DriveWire4 server folder, and access them from the Dragon using DWLOAD.&lt;br /&gt;
&lt;br /&gt;
The files can be Dragon DOS binary or BASIC files, or DECB binaries.&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client can be loaded from tape or disk or, most conveniently, embedded into the BASIC ROM, like the DWLOAD EPROM.&lt;br /&gt;
&lt;br /&gt;
If you have the DWLOAD EPROM, use the &amp;quot;DLOAD&amp;quot; command to load files. Examples:&lt;br /&gt;
&lt;br /&gt;
    DLOAD&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
to load and run the file &amp;quot;MYFILE.BAS&amp;quot; from the DriveWire server. To only load the program, use &amp;quot;DLOADN&amp;quot;:&lt;br /&gt;
    DLOADN&amp;quot;BROKEN.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the filename ending is not significant, since the DWLOAD deduces the file type from its content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DWLOAD Extensible Execution Blocks (dweeb) ==&lt;br /&gt;
&lt;br /&gt;
The DWLOAD client is relatively simple, due to the space constraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.&lt;br /&gt;
&lt;br /&gt;
The best example is the &amp;quot;SAVE&amp;quot; dweeb. There is not enough room in the ROM to include support for saving files over DriveWire. However, this functionality can be loaded on demand. DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot; saves a BASIC program to the DriveWire server. The SAVE functionality is only temporarily loaded into RAM and used during this invocation.&lt;br /&gt;
&lt;br /&gt;
Another typical dweeb is &amp;quot;DOS&amp;quot; for booting an operating system (NitrOS-9), similar to the DOS command in HDB-DOS or the DWDOS program.&lt;br /&gt;
&lt;br /&gt;
Pere has also created some dweebs for accessing VDK disk images on the DriveWire server, this is very useful for accessing Dragon DOS program collections without using a disk drive or DOS.&lt;br /&gt;
&lt;br /&gt;
Since a dweeb uses the I/O routines of the calling DWLOAD, it is independent of the real transport being used, which makes development with for instance the Becker interface in XRoar very convenient.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;SAVE&amp;quot;&amp;quot;MYFILE.BAS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;VLOAD&amp;quot;&amp;quot;MYIMAGE.VDK&amp;quot;&amp;quot;MYFILE.BAS&lt;br /&gt;
&lt;br /&gt;
   DLOAD&amp;quot;DOS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&amp;amp;t=4964 DWLOAD Forum Thread]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Hardware]] [[Category:DIY_Projects]] [[Category:Software]][[Category:Drivewire]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Category:Drivewire&amp;diff=7223</id>
		<title>Category:Drivewire</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Category:Drivewire&amp;diff=7223"/>
		<updated>2015-08-22T15:58:01Z</updated>

		<summary type="html">&lt;p&gt;Tormod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All pages about Drivewire&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=The_Dragon_Composer&amp;diff=6795</id>
		<title>The Dragon Composer</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=The_Dragon_Composer&amp;diff=6795"/>
		<updated>2015-04-11T10:46:50Z</updated>

		<summary type="html">&lt;p&gt;Tormod: add manual cover page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=&amp;quot;right&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|{{Infobox Game&lt;br /&gt;
|Image = [[Image:DragonComposer_Screenshot01.png|center|300px]]&lt;br /&gt;
|Gamenumber = &lt;br /&gt;
|Company = [[Microdeal]]&lt;br /&gt;
|Developer =&lt;br /&gt;
|Publisher = [[Microdeal]]&lt;br /&gt;
|Musician = &lt;br /&gt;
|Release = [[:Category:Game_1983|1983]]&lt;br /&gt;
|Platform = [[Dragon 32]] or [[Dragon 64]]&lt;br /&gt;
|Genre = Music&lt;br /&gt;
|Gamemode = 1P&lt;br /&gt;
|Operation = {{Keyboard}}&lt;br /&gt;
|Media = {{Cassette}}&lt;br /&gt;
|Language = {{EN}} &lt;br /&gt;
|Info =&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Dragon Composer is a music program by [[Microdeal]]. It compiles a basic file with the melody into machine code and allows playing them back and modify parameters such as tempo.&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
&lt;br /&gt;
[[File:DragonComposer_Screenshot02.png|300px|Screen02]][[File:DragonComposer_Screenshot03.png|300px|Screen03]]&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
[[File:DragonComposer.jpg|500px|Cover]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:DragonComposer_Tape.jpg|300px|Cassette]]&lt;br /&gt;
[[File:Composer-manual-cover-bw.jpg|300px|Manual cover page]]&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
* [http://archive.worldofdragon.org/archive/index.php?dir=Tapes/Dragon/cas/&amp;amp;file=The%20Dragon%20Composer%20%281983%29%28Microdeal%29%5B%21%5D.zip The Dragon Composer] (Zipped .CAS file)&lt;br /&gt;
&lt;br /&gt;
[[Category:Games]] [[Category:Game_Online]] [[Category:Game_1983]] [[Category:Music]]&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=File:Composer-manual-cover-bw.jpg&amp;diff=6794</id>
		<title>File:Composer-manual-cover-bw.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=File:Composer-manual-cover-bw.jpg&amp;diff=6794"/>
		<updated>2015-04-11T10:43:56Z</updated>

		<summary type="html">&lt;p&gt;Tormod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=Dragonstikka&amp;diff=6793</id>
		<title>Dragonstikka</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=Dragonstikka&amp;diff=6793"/>
		<updated>2015-04-11T10:34:24Z</updated>

		<summary type="html">&lt;p&gt;Tormod: add cover of all my issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Dragonstikka ==&lt;br /&gt;
&lt;br /&gt;
* Publisher: Dragonklubben (Nesbru, Norway)&lt;br /&gt;
* Editors: Ole Garm &amp;amp; Erik Hicks&lt;br /&gt;
&lt;br /&gt;
[[Image:Dragonstikka-cover-1985nr3.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1985nr5.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1985nr6.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1985nr7.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1985nr8.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1985nr9.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1986nr1.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1986nr2.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1986nr3.jpg|200px]]&lt;br /&gt;
[[Image:Dragonstikka-cover-1986nr4.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
1985:&lt;br /&gt;
* Nr.1 ?&lt;br /&gt;
* Nr.2 ?&lt;br /&gt;
* Nr.3&lt;br /&gt;
* Nr.4 ?&lt;br /&gt;
* Nr.5&lt;br /&gt;
* Nr.6 &lt;br /&gt;
* Nr.7&lt;br /&gt;
* Nr.8&lt;br /&gt;
* Nr.9/10&lt;br /&gt;
1986:&lt;br /&gt;
* Nr.1&lt;br /&gt;
* Nr.2 (March)&lt;br /&gt;
* Nr.3 (May)&lt;br /&gt;
* Nr.4 (October)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Program Library (Programbiblioteket) 3/1985&lt;br /&gt;
* 1 A Roadrace&lt;br /&gt;
* 2 B Regnskap&lt;br /&gt;
* 3 B Tegning&lt;br /&gt;
* 4 B Kalkyler&lt;br /&gt;
* 5 A Squash&lt;br /&gt;
* 6 A Enarmet banditt&lt;br /&gt;
* 7 A Lunar Lander&lt;br /&gt;
&lt;br /&gt;
Program Library (Programbiblioteket) 7/1985&lt;br /&gt;
* 1 A Roadrace	O.Garm&lt;br /&gt;
* 2 B Regnskap	O.Garm&lt;br /&gt;
* 3 B Tegning	O.Garm&lt;br /&gt;
* 4 A Enarmet banditt	E.Hicks&lt;br /&gt;
* 5 A Lunar Lander	O.Garm&lt;br /&gt;
* 6 A Bygderennet	S.Aurlund &amp;amp; R.Nomedal&lt;br /&gt;
* 7 A 3D-Maze	T.Olsen&lt;br /&gt;
* 8 C/D Klokka	O.Garm&lt;br /&gt;
* 9 A Island	O.Garm&lt;br /&gt;
* 10 A Romkamp	O.Garm&lt;br /&gt;
* 11 A Dragonflight	J.Baustad&lt;br /&gt;
* 12 A Lander	J.Baustad&lt;br /&gt;
* 13 A Sjokkmann	J.Baustad&lt;br /&gt;
* 14 D Hires-2	R.Michelsen&lt;br /&gt;
* 15 A Hangman	R.Michelsen&lt;br /&gt;
* 16 A Geografi	O.Garm&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
	<entry>
		<id>http://www.archive.worldofdragon.org/index.php?title=File:Dragonstikka-cover-1986nr4.jpg&amp;diff=6792</id>
		<title>File:Dragonstikka-cover-1986nr4.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.archive.worldofdragon.org/index.php?title=File:Dragonstikka-cover-1986nr4.jpg&amp;diff=6792"/>
		<updated>2015-04-11T10:22:00Z</updated>

		<summary type="html">&lt;p&gt;Tormod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tormod</name></author>
		
	</entry>
</feed>