Memory Map

From The Dragon Archive
Jump to: navigation, search

MEMORY MAP

DRAGON 32 and 64 in 32 mode

    0 -  1023  0000 - 03FF      SYSTEM USE
 1024 -  1535  0400 - 05FF      TEXT SCREEN
 1536 -  3071  0600 - 0BFF      GRAPHICS: PAGE 1
 3072 -  4607  0C00 - 11FF                PAGE 2
 4608 -  6143  1200 - 17FF                PAGE 3
 6144 -  7679  1800 - 1DFF                PAGE 4
 7680 -  9215  1E00 - 23FF                PAGE 5
 9216 - 10751  2400 - 29FF                PAGE 6
10752 - 12287  2A00 - 2FFF                PAGE 7
12288 - 13823  3000 - 35FF                PAGE 8
13824 - 32767  3600 - 7FFF      PROGRAM USE
32768 - 49151  8000 - BFFF      BASIC ROM
49152 - 65279  C000 - FEFF      CARTRIDGE USE
65280 - 65535  FF00 - FFFF      INPUT/OUTPUT

PLEASE NOTE: With disks in use, the Disk work space occupies the first page of graphics (1536 to 3071) and in consequence Graphics screens are moved up one page, starting at 3072 (&H0C00) and ending at 15359 (&H3BFF). On start up the Dragon does a PCLEAR4 and in consequence the memory available for program use starts at 7680, or 9216 with the DOS Controller in place.

DRAGON 64 in 64 MODE.

Same as above, except the BASIC ROM is moved from 32768 (&H8000) to 49152 (&HC000), which gives a substantial increase in memory available for program use, but means that disks cannot be used as the ROM overlays the Cartridge area. Programs exist to overcome this problem however.

13824 - 49151  3600 - BFFF      PROGRAM USE
49152 - 65279  C000 - FEFF      BASIC ROM
65280 - 65375  FF00 - FF5F      INPUT/OUTPUT
65376 - 65503  FF60 - FFDF      SAM CONTROL BITS
65504 - 65535  FFE0 - FFFF      MPU VECTORS


NOTE

The following pages contain details of the Dragon's memory, both the Basic work pages and the Basic ROM. While every effort has been made to ensure the accuracy of these details, the Editor has had to rely on a number of sources and it has not been possible to check them all. Where possible details have also been given of the Tandy Coco2 equivalent, making it possible for the conversion of programs from American sources. In so doing you are reminded that the Coco disk system differs greatly from Dragondos and is closer to the cassette system in the way that it handles data files. One other major difference is the way that graphic binary files are stored, they are usually 512 bytes higher in memory than Dragon graphics.

MEMORY MAP DETAILS

0       0       BREAK message flag
1       1       STRING delimiting character
2       2       Another delimiting character
3       3       General counter
4       4       Count of IF's seen looking for ELSE
5       5       DIM flag
6       6       VARIABLE type flag 0=numeric 255=string
7       7       Garbage collection flag
8       8       Subscript allowed flag
9       9       INPUT/READ flag
10      A       Arithmetic use
11)     B)      String pointer - first free temporary
12)     C)
13)     D)      String pointer - last used temporory
15-24   E-18    Temporary results
25/26   19/1A   Start address of Basic program
27/28   1B/1C   Start address of simple variables table
                see D User 1/86 p38 for details of
                variables.
29/30   1D/1E   Start address of ARRAY table
31/32   1F/20   End of storage (last byte used by Basic)
33/34   21/22   Top of Stack. ((Stack grows down)
35/36   23/24   Top of free STRING space. By subtracting the
                contents of 33/34 you get free string space
37/38   25/26   Pointer to STRING in string space
39/40   27/28   Top of RAM available to Basic
41/42   29/2A   Line number used in 'CONT' command
43/44   2B/2C   Temp G.P. line number store
45/46   2D/2E   Pointer to statement to be executed
47/48   2F/30   Direct mode command text pointer
49/50   31/32   Current DATA statement line number
51/52   33/34   Address of next item in current data sta'nt
53/54   35/36   Address of keyboard input buffer
55/56   37/38   Pointer to VARIABLE last in use
57/58   39/3A   VARPTR address of variable last in use
59/78   3B/4E   Evaluation variables
65/66   41/42   High end destination address for block move
67/68   43/44   High end origin address
69/70   45/46   Low end destination address
71/72   47/48   Low end origin address
79/84   4F/54   Floating Point Accumulator: No 1
79      4F      Exponent )
80/83   50/53   Mantissa ) Details of FPA
84      54      Sign     )
85      55      Temporary sign of FAC
86      56      String variable length
92/97   5C/61   Floating Pt Acc No 2: details as before
98      62      Sign comparison
99      63      Extended precision byte-Coco
104/105 68/69   Current line number (65535 in direct mode)
106     6A      VDU Comma field width (default 16)
107     6B      VDU Last Comma field (screen width - above)
108     6C      VDU Current column number (0 - 31)
109     6D      VDU Line width. No of characters per line
110     6E      Cassette I/O flag. Set FF on input incurring
111     6F      DEVN: re text output: 0=VDU 255=tape 254=prt
112     70      Cassette EOF flag: EOF reached if non zero
113     71      Restart flag. If<>$55 - cold start on reset
114/115 72/73   Restart vector. If flag=$55 & vector points
                points to a NOP then warm start else
                a cold start.
116/117 74/75   Physical end of RAM
120     78      Cassette status:0=closed 1=input 2=output
121     79      I/O buffer size
122/3   7A/B    Header buffer address:where f'name block is
124     7C      Cassette block type:
                0=f'name block 1=data block 255=EOF marker b
125     7D      BLKLEN:Cass Block length:Bytes to read/write
126/7   7E/F    Cassette I/O buffer address
128     80      Used internally to calculate the checksum
129     81      I/O error code 1=CRC 2=attempt load into RAM
130/2   82/4    Temp store used by COS
133     85      Last sine value
134     86      Data for Lo-res SET/RESET routine
135     87      ASCII code of last key pressed
136/7   88/89   Current VDU cursor address (ie screen pos)
138/9   8A/B    G.P. (16 bit) scratch pad
140     8C      Sound pitch value (frequency)
141/2   8D/E    GP Countdown facility (?duration of sound)
143     8F      Cursor Flash Counter
144/5   90/1    Cassette leader byte count (number of &H55s)
146     92      Min Cycle width of 1200HZ - Init=12
147     93      Min Pulse width of 1200HZ - Init=0A
148     94      Max pulse width of 1200HZ - Init=12
149/50  95/6    Dragon - Motor on delay
                Coco - Serial printer Baud rate constant
                HEX    Msb  Lsb (decimal) Baud
                       149  150
                02EB     2  235             75
                01CA     1  202            120
                0173     1  115            150
                00BE     0  180            300
                0057     0   87            600 (default)
                0028     0   41           1200
                0012     0   18           2400
                0006     0    6           4800
                0001     0    1           9600
151/2   97/8    Keyboard Scan Delay constant: Init=&H045E
153     99      Printer Comma Field Width: Default 16
154     9A      Printer Last Comma Field
155     9B      Printer Line Width: Set this to width 80?
156     9C      Printer Head Column:same as POS(-2) in basic
157/8   9D/E    Exec Entry address
159/170 9F/AA   Self modifying routine which reads next char
166/7   A6/7    Address of current sig byte - next char pntr
171/4   AB/E    Used by RND command
175     AF      TRON/TROFF flag: Non zero - trace on
176/7   B0/1    Address os start of USR address table
178     B2      Current foreground colour
179     B3      Current Background colour
180     B4      Temp colour in use
181     B5      Byte value for current colour: ie bits set
182     B6      Graphics PMODE number in use.
183/4   B7/8    Address of LAST byte of current graphics
185     B9      Number of bytes per line in current PMODE
186/7   BA/B    Address of FIRST byte: current graphics disp
188     BC      Start of graphics pages (MSB) defaults to 06
                Changed to 0C by Dragondos
189/90  BD/E    Current X Cursor position (not available
191/2   BF/C0   Current Y Cursor position (n.a.)
193     C1      Colour Set currently in use
194     C2      Plot/Unplot flag:0=Reset, Non-zero=Set
195/96  C3/4    Current Horizontal Pixel number
197/8   C5/6    Current Vertical Pixel number
199/200 C7/C8   Current X cursor co-ordinate
201/2   C9/CA   Current Y cursor co-ordinate
203/4   CB/CC   Circle command X co-ordinate
205/6   CD/CE   Circle command Y co-ordinate
207/8   CF/D0   RENUMber increment value
209/10  D1/2    RENUMber Start line (original number)
211/2   D3/4    CLOADM: 2's complement load offset value
213/4   D5/6    RENUMber New Start line (new number)
215     D7      Editor line length - not user available
216/221 D8/DD   Graphics use
222     DE      Current octave in use (0 - 4)
223/4   DF/E0   Volume data for volume setting in PLAY
225     E1      Current note length in PLAY
226     E2      Current TEMPO for PLAY command
227/8   E3/4    Music duration count
229     E5      Music dotted note flag
230     E6      Coco - Baud rate constant
231     E7      Coco - Input timeout constant
232     E8      Current ANGLE used in DRAW routine
233     E9      Current SCALE used in DRAW routine
234     EA      Disk operation code-what operation specified
235     EB      Disk Drive number(1 - 4) Coco(1 - 3)
236     EC      Disk read/write TRACK number
237     ED      Disk read/write SECTOR number
238/9   EE/F    Disk read/write Sector Buffer address
240     F0      Disk Error Status byte (Convt to DDOS code)
241     F1      Disk File Control Block number (1 - 10)
242     F2      Number of bytes in Disk buffer area
243     F3      No of bytes to transfer to/from buffer
244     F4      Number of SIDES/TRACKS for current drive
                00=1 side 40 tracks     01=2 sides 40 tracks
                FF=1 side 80 tracks     FE=2 sides 80 tracks
                The FORMAT of a disk is taken from the last
                few bytes of Sector 1 of Track 20 in Drogon
                DOS, on first access of disk after switch on
                or RESET.
245     F5      File Read/write flag
                0=read, 1=write & FF=verify
246     F6      Disk I/O in progress flag
256/8   100/2   SWI3 JUMP VECTOR - called from &HFFF2
                Execution of a SWI3 instruction of &H113F
                will stack Registers and jump here
259/61  103/5   SWI2 JUMP VECTOR - called from &HFFF4
                Execution of a SWI2 instruction of &H103F
                will stack registers and jump here
262/4   106/8   SWI1 JUMP  VECTOR - called from &HFFFA -&H3F
                will stack registers and jump here
265/7   109/B   NMI JUMP VECTOR -non-maskable interrupt
                called from &HFFFC, set to &H7ED7AE JUMPD7AE
                by initialisation of disk operating system
                in the Coco. Okay for Dragon?
268/70  10C/E   IRQ JUMP SECTOR - Interrupt request called
                from &HFFF8. Set to &H7EA9B3 to initialise
                Basic, Set to &H7E894C for initialisation of
                extended Basic or set to &H7ED7BC for the
                initialisation of DOS in the Coco.
271/3   10F/111 FIRQ JUMP VECTOR - Fast interrupt request
                called from &HFFF6, set to &H7EA0F6 by the
                initialisation of Basic and causes a jump to
                the Cartridge Port in the Coco.
274/6   112/4   In Coco this is EXEC of USR basic function
274/5   112/3   Timer - current value of system timer
                In both Dragon and Coco (double function)
277/81  115/9   Random number seeds used in RND function
282/7   11A/F   Unused in Dragon
282     11A     Coco - Caps lock 1=lock 0=unlock (lower case
283/4   11B/C   Coco - keyboard delay constant
285/7   11D/F   Coco - Vector to 45509 (JUMP $8489)
288     120     Number of Basic commands (reserved words)
289/90  121/2   Address of list of Basic commands
291/2   123/4   Address of Command Despatch Table
293     125     Number of Basic functions
294/5   126/7   Address of list of Basic functions
296/7   128/9   Address of Function Despatch Table
298/307 12A/133 As for 288 to 297, but in Dragon refers to
                Disk commands and functions, but in the Coco
                to Extended Basic commands and functions.
308/317 134/13D These addresses as above re COCO disks.
308/327 134/147 DRAGON - USR Table (20 bytes 2 each USR)
                This USR table is switched to 1667 to 1686,
                or Hex 683 to 696 when DOS is connected and
                is replaced with Disk Stub3 which acts as a
                terminator.
328     148     PRINTER AUTO LF/CR Flag
329     149     Dragon - Caps Lock flag:non zero=upper case
330     14A     Number of chars in end of line sequence(1-4)
331/4   14B/E   End of Line Characters: Set to CR/LF/NUL/NUL
                This sequence is sent to printer when a
                carriage return is output.
336/45  150/9   Dragon Keyboard 'Roll-over' table
338/45  152/9   Coco Keyboard 'Roll-over' table

DRAGON/COCO KEYBOARD ROLLOVER TABLE

                        Response:
 Address    191    223   239   247   251   253   254
Dec  Hex   D   C   D  C  D  C  D  C  D  C  D  C  D  C
338  152  ENT ENT  X  8  P  0  H  X  @  P  8  H  0  @
339  153  CLR CLR  Y  9  Q  1  I  Y  A  Q  8  I  1  A
340  154  BRK BRK  Z  :  R  2  J  Z  B  R  :  J  2  B
341  155              ;  S  3  K     C  S  ;  K  3  C
342  156              ,  T  4  L     D  T  ,  L  4  D
343  157              -  U  5  M     E  U  -  M  5  E
344  158              .  V  6  N     F  V  .  N  6  F
345  159          SPC /  W  7  O SPC G  W  /  O  7  G

RESPONSE IS 255 OR &HFF IF NO KEY IS PRESSED

346     15A     Right Joystick(0) - X value
347     15B     Right Joystick(1) - Y value
348     15C     Left Joystick (2) - X value
349     15D     Left Joystick (3) - Y value

350 to 424 15E to 1A8   RAM HOOKS (each 3 bytes)
350/2   15E/160 Device Open- called just before OPEN command
353/5   161/3   Device Number-called when a DEVN is verified
356/8   164/6   Device Initialisation- called before setting
                up the Device parameters in Loctn 106 to 109
359/61  167/9   OUTPUT CHAR TO DEVN:called just before out-
                putting char in A Reg to DEVN
362/4   16A/C   INPUT CHAR FROM DEVN: called just before
                inputting a char from DEVN into A Register
365/7   16D/F   INPUT FILE: called just before inputting a
                file using INPUT
368/70  170/2   OUTPUT FILE: called just before outputting
                to a file using PRINT
371/3   173/5   CLOSE ALL FILES: called before all files are
                closed, action only taken if Cassette open
374/6   176/8   CLOSE FILE: called before device is CLOSED
                action only taken if DEVN is -1 (tape)
377/9   179/B   COMMAND INTERPRETER: called before interpret
                of token in A Reg as command, used by Delta
380/2   17C/E   RE-REQUEST INPUT. Called before requesting
                more data from keyboard- ie before ?? prompt
383/5   17F/181 CHECK KEYS. Called before keyboard scanned
                for BREAK and SHIFT/@. Keyboard not scanned
                if DEVN is -1.
386/8   182/4   LINE INPUT FILE. Called before Line Input is
                executed on current DEVN
389/91  185/7   CLOSE FILE & COMMAND. Called before closing
                an ASCII file just read in as a Basic prog'm
                by CLOAD & returning to COMMAND mode.
392/4   188/A   CHECK EOF. Called before checking for EOF
                for current DEVN
395/7   18B/D   EVALUATE EXPRESSION. (obvious)
398/400 18E/190 USER ERROR TRAP. Can be patched by the user,
                that is in Basic, to trap error messages.
401/3   191/3   SYSTEM ERROR TRAP. Can be patched by the
                'system', ie Basic extension ROMs to trap
                errors (used by Dragondos)
404/6   194/6   RUN LINK. Called when RUN command is about
                to be executed. Patched by DDOS to allow a
                disk filename to be specified.
407/9   197/9   RESET BASIC MEMORY. Called from two routines
                in ROM before Basic Memory vectors are
                changed, ie by entering or editing lines,
                running programs etc.
410/2   19A/C   GET NEXT COMMAND. Called before reading in
                the next Basic command to be executed while
                program is running.
413/5   19D/F   ASSIGN STRING VARIABLE. (obvious)
416/8   1A0/2   SCREEN ACCESS. Called before the CLS,GET and
                PUT commands are executed.
419/21  1A3/5   TOKENISE LINE. Called before an ASCII line
                is tokenised in internal Basic format
422/4   1A6/8   DETOKENISE LINE. Called before a Tokenised
                line is converted to ASCII characters
425/464 or 1A9/1D0  STRING BUFFER AREA
465     1D1     Cassette filename length
466/73  1D2/9   Cassette filename to search for/or write out
474/728 or 1DA/2D8  CASSETTE FILE DATA BUFFER
                Area of memory used to load filename block &
                ASCII data blocks - if this contains a file-
                name block then this can be peeked (474-488)
474/81  1DA/1E1 Cassette filename (in buffer)
482     1E2     File type: 0=token basic 1=ASCII 2=binary
483     1E3     ASCII flag: 0=binary, non-zero=ASCII files.
484     1E4     Gap flag: 1=continuous, 255(FF)=gapped files
485/6   1E5/6   Execution address of machine code file
487/8   1E7/8   Load address of ungapped machine code file
729/33  2D9/C   Basic line input buffer preamble
734/984 2DD/3D8 Basic line input buffer
985/1002 3D9/EA BUFFER space
1003/20 3EB/3FC Unused
1021/2  3FD/E   End of line delay - RS 232 port on D64
1023    3FF     D64 RS 232 port Baud rate controller port
1024)   400)    TEXT SCREEN
1535)   5FF)         Default area.

The Coco Buffer areas are slightly different: 733/988 2DD/3DC 255 byte Keyboard buffer 737/827 2E1/33B 90 byte Screen buffer

The Disk Work area is from 1536 to 3071, or &H0600 to &H0BFF Otherwise if disks are not installed these addresses are in respect of the first of the Graphic pages, but with the DOS installed the Graphics page 1 starts at 3072 (&H0C00).

DRAGONDOS WORK SPACE

1536    0600    Start of Disk work space or Graphics Page 1
                when Disk cartridge not installed
1541    0605    Countdown to Disk motor off: Off when zero
1544    0608    Auto Verify ON/OFF: 0=off else checks sector
1546    060A    Current Default drive No. Used when no Drive
                number is specified in the command
1549/50 060D/E  Auto command line number in use
1551/2  060F/10 Auto command increment value
1553    0611    Program LOAD/RUN flag: 0=Load else Load/RUN
1555    0613    Auto command ON/OFF flag: 0=off else Auto on
1556    0614    Error command ON/OFF flag: 0=off else ERR on
1557/8  0615/6  ERROR trap line number: Basic line error rtn
1559/60 0617/8  ERL: line number of last error
1561    0619    ERR: Error code of last basic error
1562/3  061A/B  Address of start of statement in error
1564/9  061C/21 Drive 1 details
1570/5  0622/7  Drive 2 details
1576/81 0628/D  Drive 3 details
1582/7  062E/33 Drive 4 details
1588)   0634)   Disk Buffers 1 to 4 details, 7 bytes each
1615)   064F)
1616/66 0650/82 Current Drive information
1618/9  0652/3  Start address of program loaded
1620/1  1654/5  Length of program loaded
1622/3  1656/7  Entry (EXEC) address of M/code program
1667/86 1683/96 USR Vector table: relocated from 308-327(dec
1687 to 1706)   Disk Drive Parameter table
0697 to 06AA)   4 bytes per parameter - 1 for each drive
1687/90 0697/A  On Line Flag: Non zero means dive on line
1691/4  069B/E  Current Track, if Drive on line
1695/8  069F/A2 Head Stepping rate: This should only be
                changed if slower drives are used.
1699/702
        06A3/6  Disk Tracks on each drive
1703/6  06A7/A  Disk Sectors per track on each drive
1707/24 06AB/BC Directory Sector status
1725/2034       File Control Blocks: 10 in all: One for each
        6BD/7F2 open file: Each FCB 32 bytes long
2035/47 7F3/F   Temporary variables
2048/3071      )Disk Buffers: 4 in all, each 256 bytes long
        800/BFF)

3072    0C00    Start of Graphic Page 1 when disks in place
                otherwise start of Graphic Page 2 for tapes.

BASIC INTERPRETER CODES

32768   8000    Hardware initialisation
32771   8003    Software initialisation
32774   8006    POLCAT:Keyboard input:put into Register A
32777   8009    Cursor Blink
32780   800C    CHROUT:Write character in Reg A to screen
32783   800F    Writes out character in Reg A to printer
32786   8012    Joystick input:stored in addresses 346/9 dec
32789   8015    Cassette on
32792   8018    Cassette off
32795   801B    Write leader to cassette (or A00C)
32798   801E    Output byte from Reg A to cassette
32801   8021    CSRDON:Cassette on, prepare for reading
32804   8024    Input one byte from cassette to Register A
32807   8027    Gets one bit in from cassette into carry
32810   802A    Reads in a byte from another computer
32813   802D    Sends a byte to another computer
32816   8030    Select Baud rate of communications line

From here on the Coco equivalents are given in brackets and only a few Hex addresses will be given

33604  (44102)  SYSERR: Generates appropriate action for
                Error code in B Reg
33649  (44147)  CMDMODE: prints OK prompt & returns to the
                command mode
33773  (44271)  BASVECT2: complete initialisation process
                after Basic program loaded
33815  (44313)  NEW Basic:removes current Basic program from
                memory, resets stack & clears variables
33823  (44321)  BASVECT1: Sets up various necessary vectors,
                once a Basic program has been loaded
33844  (44339)  RESETS STACK: Resets stack to initial position
                all entries are lost
33951  (44446)  RUN BASIC: runs a basic program in memory,
                used to AUTORUN programs
34091   851B    (44539) WAIT KEY: waits for a key press, and
                when key pressed puts it in A Register
34935  (45382)  GET EXPR: routine will evaluate & put VARPTR
                address of following expression into 82/83
34951  (45398)  GET STRG: compiles a string and puts it into
                free string space
35236  (45671)  CKCLBRAK: as for CKCOMA, but checks for a
                closed bracket
35239  (45674)  CKOPBRAK: as for above, but checks for an
                open bracket
35242  (45677)  CKCOMA: Checks to see next significant char
                in command line is a comma, and if not it
                produces a SYNTAX error
35244  (45679)  CKCHAR: as for CKCOMA, but checks for char
                in B Register
35476  (45911)  GETVAR: Get VARPTR address of the follwing
                variable's name
35625  (46057)  GETUSR: Returns value of the argument in the
                USR function as 16 bit number in D register
35632           INTCNV: pass parameters to M/code routine
35641           GIVABF:used to pass values from M/C to Basic
35893  (46322)  ASSIGN-16-BIT:assigns value in D Register to
                a numeric variable
35894  (46323)  ASSIGN-8-BIT:assigns value in B register to
                a numeric variable
36055  (46481)  GARBAGE COLLECT: forces a controlled garbage
                collection of string space
36255  (46681)  DELVAR: frees space taken by a variable
36433  (46859)  GET-8-BIT: returns value of the following
                number in B Register
36483  (46909)  GET-16-BIT: returns value of the following
                number in X register
36522  (46948)  LIST BASIC: lists basic program in memory to
                to DEVN (device specified)
37025   90A1    (47448) PRINT CR/LE: moves cursor position
                to start of a new line
37093   90E5    (47516) OUT STRING:Outputs a text string to
                device number in DEVN
38266   957A    (48588) PRINT NUMBER:outputs 16 bit number
                in D Reg to DEVN
38798   978E    RANDOM NUMBER: Generates an 8 bit random
                number and puts it in location 278
39998  (34830)  ASSIGN-16-BITB:alternative to 35893, assigns
                value in Locs 82/83 to a variable
41194   A0EA    (36038) WAIT WITH CURSOR:scans keyboard for
                a keypress, flashing cursor at print pos.
43207  (38201)  CLEAR GRAPHICS:clears current graphics
                screen to data in B Register on entry
43304  (38298)  SET COLOURS: sets up locations 180 & 181
43320  (38314)  SELECT DISPLAY: Selects text or graphics
                depending on Z condition code, if Z=1 text
43322   95AC    (38316) RESET VDU: resets default VDU mode
43401  (38395)  SET VDG MODE:sets VDG in mode given in A Reg
43421  (38415)  SET VDG OFFSET: sets display offset for the
                graphics mode
43428  (38422)  SELECT VDG COL: selects required VDG colour
                set from the data in location 193
43489  (38483)  SELECT PAGE: on entry B reg contains page no
43536  (38530)  SELECT COL SET: selects colour set 0 or 1,
                according to data in B reg
43555  (38549)  RESERVE HRG RAM: reserves RAM for graphics
                and moves basic if necessary
44698  (39639)  PLAY NOTE: A Reg contains ASC code of note,
                other parameters should be set up
45137  (40118)  DRAW:allows access to all facilities of DRAW
46004  (40999)  RESET:resets whole works, as if reset button
                has been pressed
46080  (41142)  BOOT BASIC: restarts the Basic interpreter
                as if on power up or reset
46410   B54A    (41602) OUTCHAR:outputs character in A Reg
                to device number in DEVN (location 111)
46687  (42029)  CLOSE FILES: closes any open tape stream and
                flushes buffer
46757  (42089)  WRITE BASIC: writes current basic program to
                cassette
46920  (42257)  READ BINARY: reads in BIN file from tape
47283  (42625)  FIND FILE: searches tape for matching filename
47411  (42753)  READ 1ST BLOCK:gets filename block into tape
                buffer
47422   B93E    (42763) BLKIN: reads a block of data into
                cassette buffer
47505  (42981)  WRITE 1ST BLOCK: (obvious)
47513   B999    (42996) BLKOUT: write block of data to tape
47583  (43149)  SET LRG LEVEL:on entry the X Reg contains
                Lo-res screen address, B Reg colour & loc184
                the OR data
47623  (43189)  RESET LRG PIXEL:as above but B Reg ignored,
                Pixel reset to Black
47656  (43225)  CALC PIXEL POS:on entry the top of stack
                must contain Lo-res vertical co-ordinate,
                preceded by horizontal co-ordinate
47735   BA77    (43304) CLEAR SCREEN: clears screen to space
                and 'homes' cursor
47737   BA79    (43306) CLEAR SCREEN to CHR: clears screen
                to character in B Reg
47776  (43345)  BEEP:sound Beep for length held in B Reg and
                pitch set by location 140
47811  (43380)  AUDIO OFF: disables sound:clears bit 3 65315
47813  (43382)  ENABLE SOUND: enables 6 bit sound by setting
                Bit 3 of 65315
47828  (43397)  RESET D/A: Puts value $7E into D/A converter
                address
47830  (43399)  WRITE D/A: puts contents of A Reg into D/A C
47852  (43421)  AUDIO ON:on entry the B Reg must be zero
48000   BB80    BOOT BASIC64K: Boots 64 mode
48053   BBB5    (41369) UPDATE CURSOR: flashes cursor
48101   BBE5    (41409) POLCAT: scans keyboard and puts the
                character in A Register
48288   BCA0    (41763) CLEAR VDU LINE: clears current VDU
                line from the cursor position
48299   BCAB    (41738) VDU OUT: prints char in A Reg to VDU
48373   BCF5    PRINTER DIR OUT: char in A Reg sent printer
48394   BD0A    PCRLF:moves print head to start of next line
48410   BD1A    (41663) PRINTER OUT:Char in Reg A to printer
48449  (43426)  SELECT JSK:selects joystick sources (ports -
                0 - 3) from A Register
48466   BD52    (43486) READ JSKS: Updates all joystick data
                locations (346/9)
48549   BDA5    (42837) BIT IN:reads a single bit(see below)
48557   BDAD    (42825) BYTE IN:reads a byte into A Reg(tape
48591  (42954)  MOTOR ON: tape - sets bit 3 of $FF21
48604  (42987)  MOTOR OFF: tape - clears bit 3 of $FF21
48615  (42876)  READ LEADER: motor on & prepares COS to read
48658  (43050)  BYTE OUT: writes byte in A Reg to tape
48746   BE6A    WRTLDR:turns cassette on and writes a leader

THE FOLLOWING ARE DRAGONDOS ROUTINES

49166   C00E    LENFIL: Report file length
49168   C010    CLOSAL: Close all files
49176   C018    GETFRE: Get free space
49178   C01A    DELETE: Delete a file
49180   C01C    PROTECT/UNPROTECT a file
49182   C01E    RENAME a file
49184   C020    GETDIR: Get directory entry
49406   C0FC    WRITE SECTOR: Writes 256 bytes to disk
49412   C104    READ SECTOR: reads 256 bytes from disk
49509   C165    DRIVE INIT: initialises DOS hardware
49513   C169    HARDWARE I/O: low level command to hardware
50108   C3BC    FORMAT DISK: in the DEFD drive
53581   D14D    GET FREE SPACE: free bytes on current drive
54033   D311    CONVERT SECTOR:converts LSN(Logical sect no)
                in Y Reg to Track/Sector
55868   DA3C    DIR DSK: directory of disk in DEFD drive to
                DEVN
56229   DBA5    BEEP: on entry B Reg should contain number
                of beeps
56267   DBCB    WAIT TIME:on entry X Reg should contain the
                number of milliseconds to wait
56330   DC0A    BOOT DSK: boots an OS off disk in DEFD drive

INPUT/OUTPUT ADDRESSES

Addr Device Comments and references Bit by bit
FEFF RACE Computer Expansion Cage Bits 0-1 : slot selection
FF00
  • Dragon 32
  • Dragon 64
PIA 0 side A data register ([1] p.48, [2] p.196)
  • Bit 0 right joystick button
  • Bit 1 left joystick button
  • Bits 0 to 6 Keyboard row input
  • Bit 7 joystick comparator input
FF01
  • Dragon 32
  • Dragon 64
PIA 0 side A control register ([3] p.48)
FF02
  • Dragon 32
  • Dragon 64
PIA 0 side B data register ([4] p.48) Bits 0 to 7: keyboard column output
FF03
  • Dragon 32
  • Dragon 64
PIA 0 side B control register ([5] p.48)
FF04-FF07
  • Dragon 64
  • Dragon Alpha
ACIA
FF20
  • Dragon 32
  • Dragon 64
PIA 1 side A data register ([6] p.48)
  • Bit 0 - cassette data input
  • Bit 1 - RS232 data output
  • Bits 2-7 : 6 bit D/A(.25 to 4.75 volts out)
FF21
  • Dragon 32
  • Dragon 64
PIA 1 side A control register ([7] p.48)
  • Bit 0 - control of CD : 0=FIRQ to CPU disabled, 1=enabled
  • Bit 1 - RS 232 status input - 0=set flag falling edge CD, 1=rising edge
  • Bit 2 - normal Data Direction Register addsd - 0=change FF20 to DDR
  • Bit 3 - Cass Motor control, 0=off, 1=on
  • Bit 4,5 - always 1
  • Bit 6 - not used
  • Bit 7 - CD interrupt flag
FF22
  • Dragon 32
  • Dragon 64
PIA 1 side B data register ([8] p.48)
  • Bit 0 - RS 232 data input
  • Bit 1 - single bit cound output
  • Bit 2 - RAM size input
  • Bit 3 - VDG Control Output CSS(color set ct)
  • Bit 4 - VDG Control Output GM0&NOT(INT)/EXT
  • Bit 5 - VDG Cont Output GM1
  • Bit 6 - VDG Cont Output GM2
  • Bit 7 - VDG Cont Output NOT(A)/G
FF23
  • Dragon 32
  • Dragon 64
PIA 1 side B control register ([9] p.48)
  • Bit 0 - control of cartridge, 0=FIRQ to CPU disabled, 1= enabled
  • Bit 1 - Interrupt input, 0=sets flag on falling edge of cartridge, 1=sets flag on rising edge of cartridge
  • Bit 2 - Normally 1, 0=changes FF22 to DDReg
  • Bit 3 - 6 bit sound enable
  • Bits 4,5 - always 1
  • Bit 6 - not used
  • Bit 7 - cartridge interrupt flag
FF24-FF27 Dragon Alpha Dragon Alpha PIA
FF28 Dragon Alpha Dragon Alpha 6850 Modem Port
FF2C-FF2F Dragon Alpha Dragon Alpha Floppy Disk Controller
FF40-FF5F Dragon I/O Cartridge (Rink) To control which output pins are high and which are low, you write a single byte to any address between 0xFF40 and 0xFF5F.
FF40-FF43 (mirrored upto FF5F) Voltmace Delta 14B multi-button joystick adapter 6821 PIA [10]
FF40-FF44 (?) Delta DOS (from a quick disassembly of Delta DOS ROM)
FF40
  • Dragon FDC
  • Coco FDC
  • CocoSDC
Command/status register
FF41
  • Dragon FDC
  • Coco FDC
  • CocoSDC
  • Becker Port (DriveWire)
Track register
FF42-FF43 JCB Microsystems' Dragon Speech Synthesis PIA data and control registers ([11])
FF42
  • Dragon FDC
  • Coco FDC
  • CocoSDC
  • Becker Port (DriveWire)
Sector register
FF43
  • Dragon FDC
  • Coco FDC
  • CocoSDC
Floppy data register
FF48
  • Dragon FDC
  • Coco FDC
Disk controller latch
FF49 Cloud-9 Coco miniFlash Flash bank selection register (selectable between FF49, FF59, FF69, FF79) [12]
FF4A CocoSDC Flash Data Register
FF4A CocoSDC Flash Control Register
FF4C-FF4F (mirrors once at FF5C-FF5F) Ikon Drive [13]
FF50 DragonMMC Dragon D CMD_REG Command/Result ( [14], [15])
FF50 Burke & Burke Coco-XT MFM disk controller - HDDATA - data transfer byte (read/write)
FF51 DragonMMC Dragon MMC D_LATCH_REG - single byte parameters ( [16], [17])
FF51 Burke & Burke Coco-XT MFM disk controller: read HDSTAT status, write HDRSET reset
FF52 DragonMMC Dragon MMC D_READ_DATA_REG ( [18], [19])
FF52 Burke & Burke Coco-XT MFM disk controller: write HDATTN ; get attention of controller
FF53 DragonMMC Dragon MMC D_WRITE_DATA_REG ( [20], [21])
FF53 Burke & Burke Coco-XT MFM disk controller: write HDMASK ; controller dma and interrupts (not used on coco or dragon)
FF54 DragonMMC Dragon MMC D_STATUS_REG AVR status ( [22])
FF55 DragonMMC Dragon MMC D_PIA_MAP PIA redirect (write only) ( [23])
FF56 DragonMMC Dragon D_RAM_CTRL RAM / ROM control register ( [24])
FF56-FF57 Dragon-MSX2+ (in MPI mode) YM2413 ports ([25])
FF58 DragonMMC D_SAMBITS_MSB (16 bits as programmed to SAM) ( [26])
FF59 DragonMMC D_SAMBITS_LSB (16 bits as programmed to SAM) ( [27])
FF58-FF5B Dragon-MSX2+ (in MPI mode) V9958 ports
FF59 Cloud-9 Coco miniFlash Flash bank selection register (selectable between FF49, FF59, FF69, FF79) [28]
FF5A-FF5B DragonMMC RAM bank read / write registers ( [29])
FF5C-FF5F Touchmaster Tablet PIA ( [30])
FF5C-FF5D Dragon-MSX2+ (in MPI mode) YM2149 ports
FF5E Dragon-MSX2+ (in MPI mode) Video select port Only bit 0
FF69 Cloud-9 Coco miniFlash Flash bank selection register (selectable between FF49, FF59, FF69, FF79) [31]
FF76-FF77 Dragon-MSX2+ (in native mode) YM2413 ports ([32])
FF78-FF7B Dragon-MSX2+ (in native mode) V9958 ports
FF79 Cloud-9 Coco miniFlash Flash bank selection register (selectable between FF49, FF59, FF69, FF79) [33]
FF7A-FF7B Orchestra 90
FF7C-FF7D Dragon-MSX2+ (in native mode) YM2149 ports
FF7E Dragon-MSX2+ (in native mode) Video select port Only bit 0
FF7F
  • MPI
  • Mega-Mini MPI
MPI (and clones) slot selection ([34], p.59 )
  • Bits 5-4: # of active CTS slot (ROM)
  • Bits 1-0: # of active SCS slot (Floppy Disk Controller)
FF80-FF8F The Dragon's Claw - default addresses Rockwell 6522 VIA - 16 registers, base address can be changed to FF90, FFA0 or FFB0 with a wire link
FF90-FF9F The Dragon's Claw - alternate addresses Rockwell 6522 VIA - 16 registers, base address can be changed to FF90, FFA0 or FFB0 with a wire link
FF90-91 MooH
FFA0-FFAF The Dragon's Claw - alternate addresses Rockwell 6522 VIA - 16 registers, base address can be changed to FF90, FFA0 or FFB0 with a wire link
FFA0-FFAF MooH
FFB0-FFBF The Dragon's Claw - alternate addresses Rockwell 6522 VIA - 16 registers, base address can be changed to FF90, FFA0 or FFB0 with a wire link
FFC0-FFD9 All Dragons SAM Control bits (see below)
FFE0 Compusense Dragon Plus 6845 control register ([35])
FFE1 Compusense Dragon Plus 6845 data register
FFE2 Compusense Dragon Plus Memory bank register & status of 6845 display
  • Bits 1-2 : select 32K bank (00 = standard lower 32K ; 01= bank A ; 11 = bank B)
  • Read bit 0 : 0=video display available (i.e. blanking) / 1=video display not available (not blanking)
  • Write bit 0: 1=select video RAM in the lower 2K

SAM CONTROL BITS

65472/7 FFC0/5  VDG Control Registers for 6883 SAM
                Contains 3 pairs of addresses (V0-V2), and
                poking any value to EVEN addresses sets Bit
                Off(0) in VDG circuitry. Poking value to ODD
                addresses set Bit ON(1) in 6847 VDG circuit
65472/3 FFC0/1  Control of Bit 0 (V0)
65474/5 FFC2/3                 1 (V1)
65476/7 FFC4/5                 2 (V2)
65478/91        Page Select Register contains 7 pairs of
        FFC6/D3 (F0-F6) control Display Start address (Bin)
                Address os upper left most display element=
                0000+1/2*OFFSET. Poking any value to even
                addresses sets Bit OFF (0) in Page select.
                Poking any value to ODD addresses sets Bit
                ON(1) in Page Select Circuitry.
                Also BASEPAGE is set by converting binary
                value of F  (Bits F0 to F6) to decimal and
                multiplying this decimal number by 512.
65478/9 FFC6/7  Control of Bit 0 (F0)
65480/1 FFC8/9                 1 (F1)
65482/3 FFCA/B                 2 (F2)
65484/5 FFCC/D                 3 (F3)
65486/7 FFCE/F                 4 (F4)
65488/9 FFD0/1                 5 (F5)
65490/1 FFD2/3                 6 (F6)

65492/3 FFD4/5  Page #1 P1 control of Bit 7: (F7) 0=Normal
65494/7 FFD6/9  Clock Speed (R0-R1) Poking any value to even
                addresses sets Bit OFF (0). Poking any value
                to ODD addresses sets bit ON (1).
65494/5 FFD6/7  Control of Bit R0
65496/7 FFD8/9  Control of Bit R1
                R0=0, R1=0 (slow mode defa

MPU VECTORS

65522/3 FFF2/3  SWI 3 Vector mapped to 49138/9 BFF2/3
65524/5 FFF4/5  SWI 2 vector           49140/1 BFF4/5
65526/7 FFF6/7  FIRQ  vector           49142/3 BFF6/7
65528/9 FFF8/9  IRQ   vector           49144/5 BFF8/9
65530/1 FFFA/B  SWI 1 vector           49146/7 BFFA/B
65532/3 FFFC/D  NMI   vector           49148/9 BFFC/D
65534/5 FFFE/F  RESET vector           49150/1 BFFE/F