Master 512 Technical Guide
Total Page:16
File Type:pdf, Size:1020Kb
Master 512 Technical Guide by Robin Burton DABS PRESS Master 512 Technical Guide © Robin Burton 1990 Hardware Expansion Projects © Andrew Smith 1990 Master 512 circuit diagram © Acorn Computers Ltd. 1984-1990 ISBN 1-870336-80-1 First edition, first printing September 1990 Editors: Syd Day, Bruce Smith, David Atherton Typesettng and proofreading: L Atherton, J. Horrocks, A. Wygladala Cover Design. Atherton Clare Designs (0204 654207) The publishers wish to acknowledge with gratitude the assistance provided by Acorn Computers Ltd. in the preparation of this book, without whom publication would have been impossible, and for allowing the publication of the Master 512 circuit diagram. The publishers wish also to thank Richard Russell for allowing his BBCBASIC(86) program to be included on the programs disc. MS-DOS is a registered trademark of Microsoft Corporation. IBM is a registered trademark of International Business Machines Inc. DOS Plus, CP/M80, CP/M86, Concurrent CP/M, and GEM are trademarks and registered trademarks of Digital Research Inc. The letters BBC refer to the British Broadcasting Corporation. All other trademarks and registered trademarks referred to in this book are hereby acknowledged as the property of their respective owners. All rights reserved. No part of this book (except for brief excerpts quoted for critical purposes) or any of the computer programs or electronic circuits to which it relates may be reproduced or translated in any form, by any means mechanical electronic or otherwise, without the prior written consent of the copyright holder. Disclaimer: Because neither the author nor the publisher have any control over the way in which the contents of this book or optional programs disc are used, no warranty is given or should be inferred as to the suitability of the advice or programs for any given application. No liability can be accepted for any consequential loss or damage howsoever caused, arising as a result of using the programs, electronic designs or advice printed in this book. Published by Dabs Press, PO Box 48, Prestwich, Manchester M25 7HF Telephone 061-7738632. Fax 061-7738290. Typeset in 10/11 point Palatino by Dabs Press using an Apple Macintosh desktop publishing system. Author's text prepared on a Master 512 system using PC-Write version 3.0. Printed and bound in the UK by BPCC Wheaton, Exeter, Devon EX2 8RP. Master 512 Technical Guide Contents Introduction Purpose and Scope Terminology Acknowledgements 1: System Overview Functional requirements Host connection Limitations Memory Size Screen Facilities The Keyboard Discs The Printer The RS232 Serial Port The Mouse 2: The 80186 Processor Processor Registers General purpose registers Segment Registers Index and pointer registers 80186 instructions Memory addressing - segmentation Addressing techniques The RAM - Memory size Expansion 3: Firmware Tube Initialization The Bootstrap Loader The 80186 Monitor Monitor Commands D - Dump specified memory to screen DOS - Re boot DOS+ F - Fill memory with a constant GO - Execute code starting at the specified address MON - Enter the 80186 monitor S - Show memory contents (for editing) SR - Search memory for a text string TFER - Transfer between the 512's RAM and host's Host Errors 4:The Tube General Description Tube Operations Tube Protocol The Tube Registers Host MOS calls OSWRCH OSRDCH OSCLI OSBYTE OSWORD OSARGS OSBGET OSBPUT OSFIND OSFILE OSGBPB A Short Conversation 5: 6502.SYS functions Functional Overview Event Processing Unknown OSWORDs IRQ1V OSWORD Functions 6845 Control Screen Output Block Transfers WD1770/2 control Hard disc control Event Functions Outstanding FDC operations Keyboard Processing Asynchronous Operations IRQ1V functions The User Port 6: DOS Plus MOS calls Calling the MOS MOS call types MOS call definitions OSFIND - INT 40h OSGBPB - INT 41h OSBPUT - INT 42h OSBGET - INT 43h OSARGS - INT 44h OSFILE - INT 45h OSRDCH - INT 46h OSASCI - INT 47h OSNEWL - INT 48h OSWRCH - INT 49h OSWORD - INT 4Ah OSBYTE - INT 4Bh OSCLI - INT 4Ch Coding of MOS Calls Block Data Transfer 7: DOS Plus A Short History Elements of DOS Plus The BDOS The DOS emulator The Console Command Processor The XIOS Executable files BAT files COM files Spawning EXE files CMD files RSX files Sticky memory Background tasks Notes 8: DOS Plus Interrupts Introduction Internal hardware interrupts External hardware interrupts Software interrupts The vector table 512 DOS emulation INT 21h - The function dispatcher INT 22h - The terminate handler INT 23h - The CTRL-C handler INT 24h - The critical error handler INT 25h - Absolute disc read INT 26h - Absolute disc write INT 27h - Terminate and stay resident BDOS calls - INT 224 BDOS call notes Host Application Errors 80186 Error Messages Escape Processing 9: DOS Plus Disc Structure Introduction Directories Disc organization Clusters The File Allocation Table 12 and 16 bit FATs 10: The MOVE Utility Introduction Operation Command Parameters and Syntax <source filespec> <dest dirspec> <-fs> [/option] Single file moves Multiple copies between DOS and MOS Copying whole directories DOS to MOS Directory Mapping Copying Files Between MOS and MOS Moving MOS directories Wild Card File Specifications Filename Character Translation 11: EDBIN - The binary editor Introduction Invoking EDBIN EDBIN Command Syntax EDBIN Commands C(ompare) two areas of memory D(ump) specified memory to screen E(dit) an area of memory F(ill) memory with a constant value H(elp) M(ove) a block of memory Q(uit) R(ead) a file into memory S(earch) for a string W(rite) a file to disc EDBIN Error Messages Appendices A: Interrupt Summaries The Interrupt Vectors INT 21h Summary by Function Number INT 21h Function Summary by Operation Type INT E0h (BDOS) Summary by Function Number INT E0h Function Summary by Operation Type INT E0h Function 32h XIOS Subfunctions B: DOS Interrupts - INT 20h to 27h INT 20h - program terminate INT 21h - general function dispatcher INT 21h - functions 0 to 57h INT 25h - Absolute disc read INT 26h - absolute disc write INT 27h - Terminate and Stay Resident C: BDOS interrupts - INT E0h Functions 0 to FFh D: Example CP/M and DOS disc structures E: Tube host code Model B/B+ Source listing Master 128 source listing F: 6502.SYS code 6502.SYS source listing OSWORD &FA source listing G: Hardware Projects Clock add on Master 512 RAM expansion board Building your own hard disc H: Third Party Products Beebug 512 articles Dabs Press Essential Software Various utility packages 512K expansion board Interactive Software Services Fortran development package Margolis & Co. Communications Software Permanent Memory Systems Real Time Clock Shibumi Soft Problem Solver Solidisk Technology Ltd. PC+ Tull Computer Services Mouse Driver I: Glossary J: The Programs Disc K: Bibliography L: Other Dabs Press Products Index Introduction Purpose and Scope The intention of this book is to provide a definitive reference work which provides information to those who wish to know more about the specifics of the symbiosis between the Master 512 co-processor and its BBC Micro host. This volume is concerned mainly with details of both the hardware and software interfaces between the two systems, examining how the system operates internally rather than how to use it. It complements its companion volume, the Master 512 User Guide by Chris Snee, also published by Dabs Press, which details day-to-day operation of the system at the user interface. It is assumed that you are conversant with the essential functions carried out by the host processor's Operating System in native mode since many of these facilities are used directly, either in their standard form or modified, to allow the 512's Operating System to communicate with the outside world. Familiarity with 6502 assembler code is necessary to allow a full understanding of the machine code programs which reside in the host, and which collectively are responsible for handling all inter-processor dialogue across the Tube, the data bus which connects the two machines. While all the appropriate host operating system calls are fully documented, the information supplied relates to the function as used by DOS Plus. Details of how these MOS calls are implemented within the host can be found in BBC Micro technical publications such as the Advanced User Guide by Bray, Dickens and Holmes and Master Operating System: A Dabhand Guide by David Atherton. It is assumed that you are an experienced user of DOS Plus and the 512, and explanations of standard user operations are not included in this book. Knowledge of 8086/80186 architecture or assembly language, while being helpful, is not essential. Such technicalities of the operation of the 80186 as are needed are explained, though it is not the intention of this book to teach you to write assembly code programs for DOS Plus. We are unable to reproduce the source code for any of the versions of DOS Plus as used by the 512. The material is the property and copyright of Digital Research, not of Acorn Computers. This is further complicated by the fact that four different versions have actually been issued. Inclusion of such listings, quite apart from taking up more space on their own than the total size of the book, would, with the addition of copyright licenses, have increased the cost of this volume by an unacceptable amount. There have been several versions of DOS Plus for the 512, version 2.1 being the latest issue. All detailed references to the functions of DOS Plus are based on version 2.1, and while many functions may be identical from the user point of view, the code itself or the memory addresses concerned can differ considerably from version to version. Users of earlier DOS Plus versions should take this into account. Terminology Throughout this book the use of technical terminology is unavoidable, but to experienced programmers of the 6502 only a few new concepts will be introduced.