6800 Programming for Logic Design By Adam Osborne Copyright 1977 Introduction ------------ This book explains how an assembly language program within a microcomputer system can replace combinatorial logic- that is, the combined use of "off-the- shelf," non-programmable logic devices, such as standard 7400 series digital logic. If you are a logic designer, this book will teach you how to do your old job in a new way- by creating assembly language programs within a microcomputer system. If you are a programmer, this book will show you how programming has found a new purpose- in logic design. This is a "how to do it" book; as such, it has to become very specific, so a particular type of microcomputer, the MC6800, is referenced directly. Companies manufacturing these microcomputers are: Motorola. Incorporated Semiconductor Products Division 3501 Ed Bluestein Boulevard Austin, Texas 78721 American Microsystems 3800 Homestead Road Santa Clara, California 95051 What This Book Assumes You Know This book is a sequel to "An Introduction To Microcomputers," which was a single volume in its first edition, but is two volumes in its second edition. "An Introduction To Microcomputers" describes microprocessors and microcomputers conceptually; it does not address itself to the practical matter of implementing a concept. This book addresses the practical matter of implementation. In that this book is a sequel, it makes a single assumption- that you have read, or you otherwise understand the material covered in "An Introduction To Microcomputers". However, before launching into a real design project, you will need vendor literature that specifically describes the devices you have elected to use. Note in particular that hardware and timing are not described in this book, either for the MC6800 CPU, or any other microcomputer devices; sufficient information may be found in "An Introduction To Microcomputers", Volume II- Some Real Products. The MC6800 instruction set is described in Chapter 6 of this book, since programming is what this book is all about. Understanding Assembly Language Assembly language instructions are the transfer functions of a microcomputer system; taken together, they constitute an "instruction set," which describes the individual operations which the microcomputer can perform. You define the events which must occur within the microcomputer system serially- as a sequence of instructions, which, taken together, constitute an assembly language program. In reality, understanding what individual instructions do within a microcomputer system is very straightforward; it is one of the simplest aspects of working with microcomputers. Yet it unduly terrifies users who are new to programming. If that includes you, a word of advice - forget about mnemonics and instruction sets; take instructions one at a time as you encounter them in this book. When you do not understand what an instruction is doing, look it up in Chapter 6. The specter of "programming" will haunt you only if you let it. How This Book Has Been Printed Notice that text in this book has been printed in boldface type and lightface type. This has been done to help you skip those parts of the book that cover subject matter with which you are familiar. You can be sure that lightface type only expands on information presented in the previous boldface type. Therefore, only read boldface type until you reach a subject about which you want to know more, at which point start reading the lightface type. Table of Contents ----------------- 1) Introduction 2) Assembly Language and Digital Logic 3) A Direct Digital Logic Simulation 4) A Simple Program 5) A Programmer's Perspective 6) The MC6800 Instruction Set 7) Some Commonly Used Routines