Dragon User December 1983
The DRAGON 32 has been a very successful machine, with over 100,000 produced in the first year; but in the micro industry nothing stands still for long, so Dragon Data has supplemented its range with the Dragon 64. This includes all the features of the Dragon 32, which of course will be very familiar to readers of Dragon User, the main addition being 64K of RAM memory, a serial input/output (RS232) port, and a keyboard auto-repeat routine. This machine is essentially the same as the Dragon model available for the last couple of months in the US through Tano (in a co-operative venture with Dragon Data) except its built to UK power and TV standards.
Familiar Sights
At first sight the new Dragon 64 looks just like the well established Dragon 32 as the same case and keyboard are used, although the case is grey instead of beige (to indicate the enormous memory' perhaps?) and the number on the logo has changed. A closer inspection reveals an extra socket, labelled "S I/O", has appeared on the left side of the machine, next to the right joystick port, and the old "P I/O" port has been renamed as "PRINTER".
On power-up the familiar start message of the 32 appears and if you PRINT MEM you will be surprised to find that the answer is 24871- exactly the same as on the old 32. The reason for this is that Dragon Data has taken care to ensure that the new model is as compatible as possible with the old and hen you first fire up the 64 you are running a machine which is configured as a Dragon 32.
This means that almost all existing software will run on the new model without modification. We believe that this was a very sensible move as it means an extensive range of software is instantly available for the new version. All Dragon 32 Basic programs will function correctly, as will any machine code programs which are either self-contained or use complete ROM routines. Problems should only occur only occur where the programmer has broken into a ROM routine in the middle (which is pretty unlikely). Dragon Data says there will be no problems with any of their own software and a quick check of a range of independent offerings did not reveal any difficulties.
Using extra memory
Of course at this point you may feel that you have been cheated if you have just paid out good money for 64K of memory, so where is it hiding?
To find the answer you simply enter EXEC as your first command after power-up, when the screen will blank for a couple of seconds, and then the start message will appear, but know with a blue flashing cursor to indicate the change of mode. Trying PRINT MEM again now reveals that 41241bytes are available, and if you now enter POKE 25,6: NEW (to delete all the graphic pages) and PRINT MEM again no less than 47385 bytes are at your command for your Basic programming. To understand how these two modes are implemented and how more memory can be added to the Dragon we need to consider a number of factors.
The first is that the SAM chip used in the Dragon can work in two modes known as map type 0 and map type 1. Map 0 will access 32K of RAM and map 1 64K of RAM. In map 0 RAM is accessed in the first 32K addresses and addresses 32768-49151 (&H8000-&HBFFF) and 49152-65279 (&H000-&HFEFF) are available for the Basic interpreter and cartridge port respectively. On the other hand in mode 1 only the 64K of RAM can be accessed so you can have 64K of memory but nothing else!
The standard Dragon 32 can only operate in map 0 but the Dragon 64 can be switched between these two modes. Of course, if you want to run Basic in 64K mode you still have to use 16K of memory to hold the interpreter so only 48K (less some bytes reserved for system use) will actually be available for program and variable use.
It is possible to expand the memory of the Dragon 32 to 64K of RAM and ' unofficial' upgrades are commercially available (in fact certain early models were apparently shipped with 64K RAM inside but not accessed!).
However, simply adding more RAM does not solve all your problems.
The Problem is that the interpreter was written by Microsoft in 'position dependent code' so that it must occupy the same memory addresses as before. If you follow this routine you therefore now have 48K of memory available but is still split into 32K below Basic and 16K above it. This means that it is difficult to access the top portion for Basic programming, although it can be easily used for storing machine code. If you do not want to use Basic at all then you can simply configure to 64K of RAM and use the full memory for machine code programs, alternative languages etc.
Twin ROMs
How Dragon Data got round this difficulty is revealed by looking inside the 64,where you find that there are two 16K ROMs sitting side by side at the back. In the review machine these were 16K EPROMs but we understand that the final masked ROMs have been produced. One of these ROMs is essentially the same as that in the 32, and this is used in 32K mode. The second ROM contains a reassembly of the original source code for the interpreter at higher location (49152-65279, &HC000 - &HFEFF) (the original cartridge port area).
(if you are not familiar with the idea of 'position dependant code' then think about this simple Basic program which will keep printing a message,
10 PRINT "HELLO"
20 GOTO 10
If you change the line numbers by adding 100 to each and rewriting the lines then the program crashes as there is no longer a line 10
110 PRINT "HELLO"
120 GOTO 10
On the other hand if you had used RENUM 100,10 on the original program the GOTO line number would also have been changed so the program would function correctly.
110 PRINT "HELLO"
120 GOTO 110
In effect the original Basic program was 'position dependant' as GOTO 10 referred to an ABSOLUTE line number. Using RENUM was rather equivalent to reassembly as not only the position of the lines but also the address of the jump in GOTO was changed.)
In the 'official' 64K version of the Dragon the Basic interpreter therefore sits at the top of memory with a continuos 48K available below it for programs and variables. Of course using two ROMs must have increased the cost but it is far more elegant solution than trying to patch two separate RAM areas together.
When you EXEC as your first command (or EXEC 4800 at anytime) a new bootstrap routine in the 32K version ROM neatly swaps back and forth between map type 0 and 1 and copies the contents of the 64K version ROM into RAM (using the cassette buffer as a temporary store). Although the interpreter is in RAM it is non-volatile and pressing RESET will produce a 'warm start' so that you remain in 64 mode. As the interpreter is located in RAM it is possible to modify it (although of course you must take care not to crash the system). You can easily change the Basic keywords, so that the old ones are not recognised but only customised versions.