F8 Guide to Programming
Total Page:16
File Type:pdf, Size:1020Kb
/)J (L 8'N~crJ FAIRCHILO GUIDE TO PROGRAMMING MICRO SYSTEMS GUIDE TO PROGRAMMING 67095664 Copyright Fairchild Camera & Instrument Corp. 1976 Fairchild Micro Systems F=AIRCHILC 1725 Technology Drive, San Jose, CA 95110 MICRO SYSTEMS TABLE OF CONTENTS SECTION PAGE 1.0 INTRODUCTION..................................................................................... 1-1 1.1 ASSUMED READER BACKGROUND ......... ; . 1-1 1.2 SUPPORTING DOCUMENTATION. 1-1 2.0 THE Fa MICROPROCESSOR SYSTEM. 2-1 2.1 WHAT IS A MICROPROCESSOR .............................................................. 2-1 2.2 SOME BASIC CONCEPTS. 2-1 2.2.1 INSTRUCTIONS, PROGRAMS, DATA AND MEMORY. 2-1 2.2.2 INTERRUPTS. 2-2 2.2.3 PROGRAMMABLE CLOCKS. 2-2 2.2.4 DIRECT MEMORY ACCESS . 2-2 2.2.5 A COMPLETE MICROPROCESSOR SYSTEM ............................................. 2-3 2.3 THE F8 SySTEM .............................................. , ................................ 2-4 2.3.1 CHIP AND I/O PORT SELECTION. 2-4 2.4 THE 3850 CPU .................................. '" ........... , .. ................ .............. 2-4 2.4.1 TIMING. 2-4 2.4.2 CPU REGISTERS ......................................... , . 2-6 2.4.3 STATUS............................................................................... 2-6 2.4.4 3850 INPUT/OUTPUT..... ............................................................. 2-7 2.5 THE 3851 PSU................................................................................. 2-7 2.5.1 3851 TIMING ........................ , ........................... '" . ... .. .. ... 2-7 2.5.2 3851 REGiSTERS...................................................................... 2-8 2.5.3 3851 INPUT/OUTPUT .................................................................. 2-9 2.5.4 3851 LOCAL TIMER AND INTERRUPT. 2-9 2.6 THE 3852 DYNAMIC MEMORY INTERFACE. 2-9 2.6.1 3852 TIMING. 2-9 2.6,2 3852 REGiSTERS...................................................................... 2-9 2.6.3 3852 DIRECT MEMORY ACCESS AND MEMORY REFRESH. .. 2-10 ·2.7 THE 3853 STATIC MEMORY INTERFACE........................................................ 2-10 2.8 THE 3854 DIRECT MEMORY ACCESS .......................... 2-11 2.8.1 3854 REGISTERS.. .. .. .. .. .. .. .. .. .. .. .. .. .. 2-11 2.8.2 DMA CONTROL CODES . .. 2-12 3.0 Fa PROGRAMS. 3-1 3.1 FLOWCHARTING. 3-1 3.2 ASS!GNING MEMORY. 3-1 3.3 SOURCE AND OBJECT PROGRAMS. 3-2 4.0 ASSEMBLY LANGUAGE SyNTAX.................................................................... 4-1 4.1 INSTRUCTION TYPES. 4-1 4.1.1 COMMENTS. 4-1 4.1.2 EXECUTABLE INSTRUCTIONS. 4-1 4.1.3 ASSEMBLER DIRECTIVES .............. 4-1 4.2 INSTRUCTION FIELDS. 4-1 4.2.1 LABEL FIELD ........................................................................... 4-1 4.2.2 MNEMONIC FIELD. 4-2 4.2.3 OPERAND FIELD. 4-2 4.2.4 COMMENT FIELD. 4-2 4.2.5 ALIGNING FIELDS ..................................................................... 4-3 4.3 LANGUAGE COMPONENTS. 4-4 4.3.1 VALID CHARACTERS. 4-4 4.3.2 CONSTANTS. 4-4 4.3.3 SYMBOLS. 4-5 4.3.4 EXPRESSIONS. 4-5 5.0 ASSEMBLER DIRECTIVES. 5-1 5.1 BASE - SELECT LISTING NUMERIC BASE.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 5-1 5.2 DC - DEFINE CONSTANT. 5-1 TABLE OF CONTFNTS (Cont'a). SECTION PAGE 5.3 EJECT - EJECT CURRENT LISTING PAGE. 5-1 5.4 END - END OF ASSEMBLY. 5-2 5.5 EOU - EOUATE A SYMBOL TO A NUMERIC VALUE. 5-2 5.5.1 A COMPARISON OF THE EOU AND DC DIRECTIVES. .. .. .. .. .. .. .. 5-2 5.6 MAXCPU - SPECIFY MAXIMUM CPU TIME. 5-2 5.7 ORG - ORIGIN A PROGRAM ................................................................... 5-3 5.8 SYMBOL - ASSEMBLER PROVIDE A SY!\,,4BOL TABLE. 5-3 5.9 TITLE - PRINT A TITLE AT THE HEAD OF THE ASSEMBLER LISTING .............................. 5-3 5.10 XREF - ASSEMBLER PROVIDE A SYMBOL CROSS REFERENCE LISTING . 5-3 5.11 WHEN TO USE ASSEMBLER DIRECTIVES ....................................................... 5-3 6.0 THE INSTRUCTION SET............................................................................. 6-1 6.1 ADC - ADD ACCUMULATOR TO DATA COUNTER.. .. .. .. .. .. .. .. .. .. .. .. .... .. .. ...... .. .. .. 6-2 6.2 AI - ADD IMMEDIATE TO ACCUMULATOR ....................................... '" ........ '" . 6-2 6.3 AM - ADD (BINARY) MEMORY TO ACCUMULATOR. 6-3 6.4 AMD - DECIMAL ADD, MEMORY TO ACCUMULATOR........................................... 6-3 6.5 AS - BINARY ADDITION, SCRATCHPAD MEMORY TO ACCUMULATOR. .. .. .. .. 6-4 6.6 ASD - DECIMAL ADD, SCRATCHPAD TO ACCUMULATOR........................................ 6-4 6.7 BRANCH INSTRUCTIONS . 6-5 6.7.1 BF - BRANCH PM FALSE.............................................................. 6-7 6.7.2 BT - BRANCH ON TRUE................................................................ 6-7 6.8 CI - COMPARE IMMEDIATE. 6-7 6.9 CLR - CLEAR ACCUMULATOR.................................................................. 6-7 6.10 CM - COMPARE MEMORY TO ACCUiviULA TOR ................................................ 6-7 6.11 COM - COMPLEMENT ........................................................................ 6-8 6.12 DCI - LOAD DC IMMEDIATE ................................................................... 6-8 6.13 DI - DISABLE INTERRUPT ..................................................................... 6-8 6.14 OS - DECREMENT SCRATCHPAD CONTENT .................................................... 6-8 6.15 EI - ENABLE INTERRUPT ...................................................................... 6-8 6.16 IN - INPUT LONG ADDRESS ................................................................... 6-8 6.17 INC - INCREMENT ACCUMULATOR ............................................................ 6-9 6.18 INS - INPUT SHORT ADDRESS ................................................................ 6-10 6.19 JMP - BRANCH IMMEDIATE .................................................................. 6-10 6.20 LI - LOAD IMMEDIATE ........................................................................ 6-10 6.21 LIS - LOAD IMMEDIATE SHORT ............................................................... 6-10 6.22 L1SL - LOAD LOWER OCTAL DIGIT OF ISAR .................................................... 6-10 6.23 L1SU - LOAD UPPER OCTAL DIGIT OF ISAR ................................................... .. 6-11 6.24 LM - LOAD ACCUMULATOR FROM MEMORY .................................................. 6-11 6.25 LNK - LINK CARRY TO THE ACCUMULATOR ................................................... 6-11 6.26 LR - LOAD REGISTER ......................................................................... 6-11 6.27 NI- AND IMMEDIATE ......................................................................... 6-11 6.28 NM - LOGICAL AND FROM MEMORY .......................................................... 6-12.