CODINGDDI-1 Firmware: The Complete CPC 464 DISC Operating System ROM Specification

DDI-1 Firmware: Chapter 1-Overview
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

Chapter 1-Overview

The disc system hardware consists of a DDI-1 interface and one or two FD-1 floppy disc drives. The DDI-1 interface plugs into the edge connector at the rear of the CPC464 labelled ‘FLOPPY DISC'. The disc drive(s) are connected to the interface via a single ribbon cable. Each disc drive takes a single 3” floppy disc. Either side of the disc may be used, depending on which way up the disc is inserted into the drive. The DDI-1 interface contains a 16K expansion ROM, 8K of which contains the disc driving software, the remainder being used by DR LOGO.

Two disc operating systems are provided: AMSDOS, which enables BASIC programs to use disc files in much the same way as cassette files; and CP/M 2.2, the industry standard operating system. Both AMSDOS and CP/M use the same file structure and may read and write each other's files.

CP/M 2.2 is invoked from BASIC by typing |CPM. Part of CP/M (the CCP and BDOS) is loaded from the disc in drive A: The CP/M BIOS resides in the DDI-1 ROM.

AMSDOS is enabled whenever BASIC is used with the DDI-1 interface connected. This intercepts most of the cassette firmware routines and redirects them to disc. Thus existing BASIC programs which use cassette files can use disc files with little or no modification. AMSDOS also provides a number of external commands for erasing and renaming files and redirecting the cassette firmware routines.

Provided with the disc system are a number of utility programs for formatting and copying discs and for changing various system parameters. These all run under CP/M.

1.1 CP/M 2.2

CP/M 2.2 is the industry standard operating system for 8080/8085/Z80 based computers. With CP/M 2.2 literally hundreds of application programs are available.

To invoke CP/M from BASIC use the |CPM command.

The CPC464 implementation of CP/M offers a TPA of 39.5K, 180K per side disc capacity, the IOBYTE, support for a two channel serial interface and access to the low level device driving routines.

The TPA (Transient Program Area) is the area of RAM into which an application program is loaded and run. This area always starts at #0100. The end of the area is different on different CP/M systems. The address of the first byte after the TPA is held in the word at #0006. On the CPC464 the TPA normally extends to #9F05. See chapter 2.2.

The discs have a capacity of 180K bytes per side. Two tracks are reserved for the CP/M system, and 2K is used for the directory. This leaves 169K per side for files. Two other disc formats are available for specialist use, see chapter 2.11. It is possible to use other non-AMSTRAD disc formats by patching the relevant extended disc Parameter Block (XPB) see chapter 2.15.

The IOBYTE is an optional CP/M feature for redirecting character I/O. It is fully implemented on the CPC464. See the CP/M Operating System Manual for details on the use of the IOBYTE.

The BIOS will drive a two channel asynchronous serial interface, if fitted. This interface is not supplied with the DDI-1. See chapter 5.2.

Many of the low-level device driving routines are available to an application program via an extended BIOS jumpblock. Facilities include reading and writing sectors to disc, formatting a track, specifying various system parameters and initializing the serial interface (if fitted). See chapter 2.14.

Existing application programs written for CP/M 2.2 should run on the CPC464 without any difficulty. The only potential problems are:

Programs which use the Z80 alternate or IY registers.

Provided that the BIOS is set up to save these registers then an application program may use the alternate and IY registers (see chapter 2.17). The system as supplied saves these registers. The utility SETUP is used to enable or disable this facility (see chapter 4.10). Programs which have been designed to run on the Intel 8080 or 8085 will run regardless of this facility.

Programs which use the restart instructions and/or locations.

CP/M application programs tend not to use the restart instructions precisely because they are often used for interrupts. On the CPC464 only RST6 is available to application programs. RSTs 1..5 are used by the firmware, they may be used for other purposes if special steps are taken, see chapter 2.16. RST7 is reserved for interrupts.

Programs which require a TPA bigger than 39.5K.

Will require modification before they can be run on the CPC464.

The effect of control codes sent to the screen is as described in the CPC464 Firmware Manual Appendix VII.

The keyboard may be re-configured as required. The utility SETUP is used to define the required keyboard layout, that is which key should return what. The information is stored on disc in the configuration sector and is used to initialize the keyboard during cold boot. The system as supplied does not re-configure the keyboard, the layout is as given in the Firmware Manual Appendices I..IV.

1.2 AMSDOS

AMSDOS stands for AMStrad Disc Operating System. AMSDOS has been designed to enable BASIC programs to use disc files in exactly the same manner as cassette files. Whenever the DDI-1 interface is connected all BASIC file operations are redirected to the disc instead of the cassette. AMSDOS uses the same file structure as CP/M so files can be freely interchanged between the two systems.

The following BASIC commands will all work with the disc:

LOAD, RUN, SAVE, CHAIN, MERGE, CHAIN MERGE, OPENIN, OPENOUT, CLOSEIN, CLOSEOUT, CAT, EOF, INPUT #9, LINE INPUT #9, WRITE #9, LIST #9.

The main point to watch out for is that filenames must conform to CP/M conventions.

The cassette can still be used: |TAPE switches all file operations back to the cassette, |DISC switches back to disc. |TAPE.IN switches just the input file operations to tape, |DISC. IN switches just the input file operations to disc, similarly |TAPE.OUT and |DISC.OUT switch just the output operations.

The CAT command will display the disc directory. It is sorted into alphabetical order, shows the size of each file, together with the remaining free space on the disc.

Files can be renamed and erased by the external commands |REN and |ERA. For example to erase a disc file TEXT.DOC

FILENAME$ = "TEXT.DOC"
|ERA,@FILENAME$

To rename the file RED.BAS to GREEN.BAS

OLDNAME$="RED.BAS"
NEWNAME$ = "GREEN.BAS"
|REN,@NEWNAME$,@OLDNAME$

This somewhat convoluted syntax is used because strings must be passed to external commands by address.

If the drive letter is omitted from a filename then the current default drive is assumed, initially drive A :. For two drive systems I B will select drive B : as the default and I A will reselect drive A :.

Just part of the directory may be displayed, if required, by using the |DIR command. This takes an optional parameter of a filename which may contain wild cards. Only those files which match the filename are displayed. This is very similar to the CP/M DIR command. For example, to display just the files ending in .BAS

FILENAMES = "*.BAS"
|DIR,@FILENAME$

User numbers are a means of logically dividing the disc into sixteen different ‘users' numbered 0..15 each with its own directory. This is a CP/M feature also supported by AMSDOS. The default user is initially set to 0. The default user may be changed by the |USER command. For example the command |USER, 10 will change the default user to 10. Alternatively when specifying a filename the user number may be prefixed to the drive part of the name. For example to rename a file from user 5 to user 11:

OLDNAME$="5:OLDNAME"
NEWNAME$="11:NEWNAME"
|REN,@NEWNAME,@OLDNAME

The USER command has a counterpart in CP/M, however, it is not possible to specify a user as part of a filename except under AMSDOS. The user number can be incorporated whenever a drive name is used. For example to display the directory of all files in user 7 on drive B : which start with the letter Z and have a type part of .HEX

FILENAME$="7B:Z*.HEX"
|DIR,@FILENAME$

AMSDOS works by intercepting most of the cassette firmware entries, so a machine code program loaded via BASIC can also use AMSDOS. AMSDOS requires an area of RAM for its own puposes, a machine code program must take care not to overwrite this area while AMSDOS is using it. See chapter 3.9 for more details.

AMSDOS uses the CP/M BIOS to access the discs. Some of the extended BIOS routines are also available to AMSDOS. See chapters 3.8 and 2.14.

1.3 Utilities

The disc system is supplied with a number of utility programs, they all run under CP/M 2.2. Some of these are supplied by Digital Reasearch and are standard CP/M utilities, the others have been specially developed for the CPC464 by AMSTRAD and should not be used on other CP/M systems. Also supplied is the programming language DR LOGO, see the AMSTRAD DDI-1 User Instruction Manual and ‘A Guide to LOGO' SOFT160.

AMSDOS.COM (AMSTRAD)

Returns to AMSDOS and BASIC from CP/M. The inverse operation of |CPM.

ASM.COM (Digital Research)

8080 assembler. Although the processor used in the CPC464 is a Zilog Z80A this assembler may still be used because the Z80 supports all the 8080 opcodes. The converse is not true.

BOOTGEN. COM (AMSTRAD)

Copies the boot and configuration sectors from one disc to another.

CLOAD.COM (AMSTRAD)

Copies a file from cassette to disc.

CSAVE.COM (AMSTRAD)

Copies a file from disc to cassette.

CHKDISC.COM (AMSTRAD)

Compares two discs using two drives.

COPYDISC.COM (AMSTRAD)

Copies one disc to another using two drives.

DDT.COM (Digital Research - patched by AMSTRAD to use RST6)

Dynamic Debugging Tool, 8080 debugger.

DISCCHK.COM (AMSTRAD)

Compares two discs using one drive.

DISCCOPY. COM(AMSTRAD)

Copies one disc to another using one drive.

DUMP.COM (Digital Reasearch)

Displays a file on the screen in hex.

ED.COM (Digital Research)

Text editor.

FILECOPY.COM (AMSTRAD)

Copies files from one disc to another using one drive.

FORMAT. COM (AMSTRAD)

Formats a disc.

LOAD.COM (Digital Research)

Reads a file in Intel HEX format and produces a .COM file.

MOVCPM.C0M (Digital Research - patched by AMSTRAD for page boundaries)

Constructs a CP/M system of any given size. Used to make room for RSXs.

PIP.COM (Digital Research)

Peripheral Interchange Program, copies files on disc and between the other peripherals.

SETUP.COM (AMSTRAD)

Changes the parameters in the configuration sector.

STAT.COM (Digital Research)

Gives details on files, discs, users and the IOBYTE. Can also change the IOBYTE.

SUBMIT.COM (Digital Research)

Takes CP/M commands from a file instead of from the keyboard.

SYSGEN. COM (AMSTRAD)

Writes the CP/M system onto the system tracks.

XSUB.COM (Digital Research)

Used with SUBMIT. COM to provide buffered input for programs.

★ AUTHOR: Paul OVERELL
★ NOTE: RÉF SOFT158A

Page précédente : DDI-1 Firmware: The Complete CPC 464 DISC Operating System ROM Specification
Je participe au site:

» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.732-desktop/c
Page créée en 108 millisecondes et consultée 852 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.