/)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 ACCUiviULATOR ................................................ . 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
6.29 NOP- NO OP ................................................................................ . 6-13
6.30 NS - LOGICAL AND FROM SCRATCHPAD MEMORY ............................................ . 6-13
6.31 01 - OR IMMEDIATE .......................................................................... . 6-13
6.32 OM - LOGICAL "OR" FROM MEMORY ......................................................... . 6-13
6.33 OUT - OUTPUT LONG ADDRESS .............................................................. . 6-14
6.34 OUTS - OUTPUT SHORT ADDRESS ............................................................ . 6-14
6.35 PI - CALL TO SUBROUTINE IMMEDIATE ....................................................... . 6-14
6.36 PK - CALL TO SUBROUTINE DIRECT AND RETURN FROM
SUBROUTINE DIRECT ..................................................................... . 6-14
6.37 POP - RETURN FROM SUBROUTINE ........................................................... . 6-15
6.38 SL - SHIFT LEFT .............................................................................. . 6-15
6.39 SR - SHIFT RIGHT ............................................................................ . 6-15
6.40 ST - STORE TO MEMORY ..................................................................... . 0-15
6.41 XDC - EXCHANGE DATA COUNTERS .......................................................... . 6-16
6.42 XI - EXCLUSIVE OR IMMEDIATE .................................................... , ... , .. . 6-16
6.43 XM - EXCLUSIVE OR FROM MEMORY ... , ..................................................... . 6-16
6.44 XS - EXCLUSIVE OR FROM SCRATCHPAD ........ , . . . , ......... , , , . , , , . , .. , .... , ....... . 6-16
TABLE OF CONTENTS (Cont'd)
SECTION PAGE
7.0 PROGRAMMING TECHNIQUES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
7.1 MANIPULATING DATA IN THE SCRATCHPAD . . . . .. .. . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
7.1.1 SIMPLE SCRATCHPAD BUFFER OPERATIONS........................................... 7-1
7.1.2 INCREMENTING UP, AND DECREMENTING DOWN SCRATCHPAD BUFFERS. . . .. . . . . . . . . . . 7-1
7.1.3 USING SCRATCHPAD REGISTERS AS COUNTERS. . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7.1.4 USING SCRATCHPAD REGISTERS FOR SHORT DATA OPERATIONS....................... 7-3
7.2 ROM, RAM AND DATA TABLES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
7.2.1 READING DATA OUT OF TABLES IN ROM. .. .. .. .. . .. .. .. . ...... .. .. . .. .. .. .. .. .. .. .. . .. 7-4
7.2.2 ACCESSING DATA TABLES IN RAM..................................................... 7-4
7.3 SUBROUTINES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
7.3.1 THE CONCEPT OF A SUBROUTINE ..................................................... 7-6
7.3.2 SUBROUTINE PROGRAM STEPS........................................................ 7-7
7.3.3 SIMPLE SUBROUTINE CALLS AND RETURNS............................................ 7-7
7.3.4 NESTED SUBROUTINES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
7.3.5 MULTIPLE SUBROUTINE RETURNS .................................................... " 7-12
7.3.6 PASSING PARAMETERS ............................................................... 7-13
7.4 MACROS ...................................................................................... 7-14
7.4.1 DEFINING AND USING MACROS ...................................................... " 7-14
7.4.2 MACROS WITH PARAMETERS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 7-14
7.4.3 RULES FOR DEFINING AND USING MACROS... .. .. .. .. .. .. .. .. .. .. . .. .. .. .. . .. .. . .. .... 7-15
7.4.4 WHEN MACROS SHOULD BE USED. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 7-15
7.5 JUMP TABLES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 7-15
7.5.1 JUMP TABLE USING JUMP INSTRUCTIONS ............................................. 7-16
7.5.2 JUMP TABLE USING ADDRESS CONSTANTS.. . .. .. .. . . . . . . .. . . . .. .. .. . .. .. .. . .. .. .. .... 7-16
7.5.3 JUMP TABLE USING DISPLACEMENT TABLES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 7-16
7.6 STATUS, BITS AND BOOLEAN LOGiC ........................................................... 7-17
7.6.1 MANIPULATING INDIVIDUAL BITS ...................................................... 7-17
7.6.2 TESTING FOR STATUS ................................................................. 7-18
7.7 POWERING UP AND STARTING PROGRAM EXECUTION .......................................... 7-18
8.0 INPUT/OUTPUT PROGRAMMING. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.1 PROGRAMMED I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.1.1 POLLING ON STATUS.................................................................. 8-1
8.1.2 DATA, STATUS AND CONTROLS......................................................... 8-2
8.1.3 PARALLEL DATA AND CONTROL PORTS. .. .... .. .. .. .. .. . .. .. .. .. .. .. .. . .. .. .. .. .. .. .. . 8-3
8.2 INTERRUPT I/O .,. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8.2.1 THE INTERRUPT SEQUENCE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8.2.2 ENABLING AND DISABLING INTERRUPTS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
8.2.3 INTERRUPT PRIORITIES ................................................................ 8-4
8.2.4 PROGRAM RESPONSE TO AN INTERRUPT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8.2.5 MAKING 3851 PSU INTERRUPT ADDRESS PROGRAMMABLE ............................ 8-5
8.2.6 SIMPLE I/O INTERRUPTS ..... , ......... , .................................. ~ ... .... ... .. 8-5
8.2.7 A SAMPLE PROGRAM.. .. .. .. . .. . . .. .. ... .. . .. .. .... .. . .. .. .. .. .. . .. .. .. . .. .. . .. . .. .. . 8-6
8.3 LOCAL TIMERS (PROGRAMMABLE TIMERS)..................................................... 8-7
8.3.1 LOCAL TIMER I/O PORTS .. . .. . . .. . .. .. . .. .. . . .. . .. . .. .. .. .. . .. .. .. .. .. .. . .. .. .. .. .. .. . 8-7
8.3.2 PROGRAMMING LOCAL TIMERS ....................................................... 8-8
8.3.3 A PROGRAMMING EXAMPLE - THE TIME OF DAY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
8.4 DIRECT MEMORY ACCESS .,. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
8.4.1 WHEN TO USE DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
8.4.2 PROGRAMMING DMA ................................................................. 8-10
8.4.3 CATCHING DMA ON THE FLY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8-11
9.0 PROGRAM OPTIMIZATION .......................................................... '" .. .. .. .. .. .. . 9-1
9.1 COUNTING CYCLES AND BYTES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
9.2 ELEMENTARY OPTIMIZATION TECHNIQUES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
9.2.1 SCRATCHPAD AND RAM MEMORY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
9.2.2 IMMEDIATE INSTRUCTIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
iii
TABLE OF CONTENTS (Cont'd)
SECTION PAGE
9.2.3 SHORT iNSTRUCTiONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 9-7
9.2.4 USE OF OS INSTRUCTION TO DECREMENT AND TEST .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 9-7
9.2.5 USE OF THE SR7 INSTRUCTiON ........................................................ 9-7
9.3 PROGRAMMING FOR SPEED OR MEMORY ECONOMY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 9-2
9.3.1 MACROS AND SUBROUTINES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 9-2
9.3.2 TABLE LOOKUPS VERSUS DATA MANiPULATION....................................... 9-3
10.0 SOME USEFUL PROGRAMS ......................................................................... 10-1
10.1 GENERATING TEXT ........................................................................ , ... 10-1
10.1.1 SIMPLE AND DEDICATED TEXT PROGRAMS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 10-1
10.1.2 UNPACKING DECIMAL DIGITS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 10-1
10.1.3 VARIABLE TEXT ....................................................................... 10-1
10.2 MULTIBYTE ADDITION AND SUBTRACTION ...................................................... 10-2
10.2.1 16-BIT, BINARY ADDITION AND SUBTRACTION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . .. 10-2
10.2.2 MULTIBYTE BINARY OR DECIMAL ADDITION AND SUBTRACTION ........................ 10-3
10.3 MULTiPLICATION.............................................................................. 10-3
10.4 DIVISION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 10-5
APPENDIX A BINARY NUMBER SYSTEM .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
APPENDIX B ASCII CODES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
APPENDIX C CONVERSION TABLES/TIMER COUNTS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-l
APPENDIX 0 INSTRUCTION SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
LIST OF ILLUSTRATIONS
FiGURE PAGE
2-1 Multifunction Logic Device ...................................................................... . 2-1
2-2 Data and Instruction Paths in a Multifunction Logic Device ........................................ . 2-1
2-3 Program P Being Interrupted to Execute Program R ............................................... . 2-2
2-4 Logical Components, Data Paths and Control Paths in any Microprocessor System .................. . 2-3
2-5 F8 Microprocessor System Configurations ............................................ , .......... , 2-4
2-6 Logical Functions of the 3850 CPU .............................................................. . 2-5
2-7 Instruction Timing .............................................................................. . 2-5
2-8 3850 CPU Programmable Registers ............................................................. . 2-6
2-9 Logical Functions of the 3851 PSU .............................................................. . 2-8
2-10 Logical Functions of the 3852 DMI Device ....................................................... . 2-10
2-11 Logical Functions of the 3853 SMI Device ....................................................... . 2-11
2-12 Logical Functions of the 3854 DMA Device ...................................................... . 2-12
3-1 Flowchart for a Program to Move Data from One RAM Buffer to Another ........................... . 3-1
3-2 Flowchart for Program to Add Two Multibyte Numbers and Output the Result ...................... . 3-2
3-3 Source and Object Programs .................................................................... . 3-3
4-1 Four Comment Lines (Shaded) in a Source Program .............................................. . 4-1
4-2 Label Fields (Shaded) in a Source Program ....................................................... . 4-2
4-3 Mnemonic Field (Vertical Shaded) in a Source Program ........................................... . 4-2
4-4 Operand Fields (Shaded) in a Source Program .................................................... . 4-3
4-5 Comment Fields (Shaded) in a Source Program ................................................... . 4-3
4-6 Source Program with Unaligned Fields .......................................................... . 4-3
4-7 Symbols in a Source Program ................................................................... . 4-5
5-1 Assembler Directives (Shaded) in a Source Program .............................................. . 5-1
6-1 Generation of a Displacement Object Program Byte in Response to a Forward Branch ............... . 6-5
6-2 Generation of a Displacemnt Object Program Byte in Response to a Backward Branch .............. . 6-6
iv
TABLE OF CONTENTS (Cont'd)
FIGURE PAGE
7-1 Use of H, Q and DC1 Registers to Hold Three Buffer Addresses.................................... 7-6
7-2 Subroutine, as Compared to a Macro. . . .... .. .. . . . . . .. .. .. .. .. . .. . ...... ... .. ... ..... .. ........ .. 7-7
7 -3 Scratchpad Stack ............................................................................... 7-10
8-1 Daisy Chaining and Interrupt Priority Determination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
8-2 Two Levels of Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
8-3 Two Devices Servicing a Keyboard to Cassette Application. . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . 8-6
8-4 How BUFC and BUFD are used to Control DMA Operations ........................................ 8-10
9-1 Counting Cycles and Bytes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
LIST OF TABLES
TABLE PAGE
2-1 Summary of Status Bits '.' ...................................................................... . 2-6
2-2 Hexadecimal Addresses of Four I/O Ports used as Registers by Four 3854 DMA Registers .......... . 2-11
4-1 Summary of Restricted Characters .............................................................. . 4-4
6-1 Operand Symbols .............................................................................. . 6-1
6-2 Operands Referencing Scratchpad Memory, as Specified by Symbol Sreg .......................... . 6-1
6-3 Branch Conditions ............................................................................. . 6-6
6-4 Branch Conditions for BF Instruction ............................................................ . 6-6
6-5 Branch Conditions for BT Instruction ............................................................ . 6-7
6-6 I/O Port Address Assignments .................................................................. . 6-9
6-7 LR Instruction Operand Definitions .............................................................. . 6-12
7-1 Scratchpad Memory Utilization................................................................... 7-1
7-2 Use of a Memory Stack for Executing Multiple Level Subroutines. .. . . . . . . . . . . . . .. . . . . . . . . . . . . .. . . .. 7-10
8-1 Contents of Interrupt Control I/O Ports ........................................................... 8-4
v
INTRODUCTION
This manual explains how to write programs for the Fairchild 1.1 ASSUMED READER BACKGROUND
F8 microprocessor system, and how these F8 programs cause
a microprocessor system to function as a discrete logic This manual has been written for logic designers with little
replacement. or no background in programming.
The Fairchild F8 family of logic devices consists of a Central The reader is assumed to understand the following:
Processing Unit and a number of complementary devices,
manufactured using n-channel Isoplanar MOS technology. 1) Binary, octal, binary coded decimal and hexadecimal
Components of the F8 family include the following devices: number systems
2) Signed and unsigned binary arithmetic
1) The 3850 Central Processing Unit (CPU) 3) Boolean logic
2) The 3851 Program Storage Unit (PSU) 4) ASCII and EBCDIC character codes
3) The 3852 Dynamic Memory Interface (DMI)
4) The 3853 Static Memory Interface (SMI) For readers without the assumed background, a summary of
5) The 3854 Direct Memory Access (DMA) this basic information is given in Appendix A.
Complete microprocessor based systems may vary in size and 1.2 SUPPORTING DOCUMENTATION
complexity from as little as two devices-the 3850 CPU and
the 3851 PSU-to large systems incorporating the above The following manuals provide additional information on the
five devices, plus any standard static and/or dynamic Random F8 microprocessor:
Access Memory (RAM) devices.
1) F8 Circuit Data Book which provides electrical param-
eter data for all Fairchild F8 Microprocessor devices.
The following are some general characteristics of this micro- 2) F8 Timeshare Operating Systems Manual which ex-
processor device set: plains how to assemble and debug F8 Microprocessor
programs on NCSS and GE Timeshare Networks.
• 8-bit data organization 3) F8 Circuit Reference Manual which describes the
• 2#-ls instruction cycle time interactive timing and signal sequences which occur
• Over 70 microprocessor instructions between devices in the F8 Microprocessor family.
• 64 general purpose registers in the CPU
• Binary and decimal arithmetic, and logic functions 4) F8S and F8SEM Users Manuals which describe how
• Up to 65,536 bytes of ROM and RAM, in any combination to assemble and debug microprocessor programs on
• No need for special external interface devices the F8S and F8SEM hardware modules.
• Internal, programmable real time clocks
• Internal power on and reset logic 5) F8 Formulator Users and Reference Manuals which
• Multi-level interrupt handling describe how to use and maintain Fairchild's F8
• Clock and timing circuits Formulator developmental hardware.
i -i
THE Fa MICROPROCESSOR SYSTEM
The purpose of a microprocessor system is to replace discrete In order to function, the multifunction logic device will need
logic; but in order to understand why a microprocessor system the following parts:
is effective as a logic design tool, it is first necessary to
understand what is in a microprocessor system. A) An Arithmetic Logic Unit (ALU), containing the neces-
sary basic logic functions.
B) A control unit, which decodes instructions and enables
2.1 WHAT IS A MICROPROCESSOR? elements of the ALU, as needed.
After a product has been fabricated using discrete logic com- C) Registers to hold instruction codes and data, as needed.
ponents, it consists of one or more logic cards; each card may D) Data paths within the CPU, and between the CPU and
be visualized as generating a variety of signals output at the external devices.
card edge, based on signals input at the card edge. The logic
devices on the card are specifically selected and sequenced
to generate the required product. Parts A), B), C), and D) are the basic components of any
Central Processing Unit (CPU). A CPU must be the focal point
of any computer-maxi, mini or micro.
If the same product is implemented using the Fa micropro-
cessor, the Fa CPU and its five supporting devices can be Referring to Figure 2-1, where do "instructions" and "data
made to function in the same way as anyone of many mil- in" come from, and where will "data out" go? There are two
lions of different discrete logic device combinations. In other possibilities: memory or external devices.
words, the F8 CPU, optionally in conjunction with the sup-
porting devices, has the capacity to duplicate the performance Refer to Figure 2-2. Memory is a passive depository of infor-
of any discrete logic design, limited only by speed consider- mation where data or instruction codes may be stored.
ations. Fa microprocessor systems have a 2 J.,ls instruction Memory must be divided into individually addressable loca-
cycle time. The functions that will be performed by the Fa tions, each of which can store one element of instruction
microprocessor system are established by a sequence code or one element of data. In an Fa system, each individ-
of "instructions", stored in a memory device as a sequence ually addressable location will be an a-bit data unit (a byte),
of binary codes. Taken as a whole, the sequence of instruc- since the Fa is an a-bit microprocessor.
tions are referred to as a "stored program".
MEMORY
2.2 SOME BASIC CONCEPTS
Any logic device may be reconstituted from some or all of
the following basic functions:
1) Binary addition
2) The logical operations AND, OR and EXCLUSIVE-OR
3) Shifts and rotates of binary digit sequences which MULTIFUNCTION
LOGIC
are being interpreted as numerical entities (e.g., a DEVICE
byte = eight bits). (CPUl
A general purpose logic device can be created by implement-
ing the basic functions listed above on a single chip. If the
single chip is to duplicate the performance of other logic de-
vices, it must be provided with a sequence of instructions that
enable the required logic in the proper order, plus aa stream I/O PORT EXTERNAL DEVICES I/O PORT
of data that is operated on by the specified logic. This is
illustrated in Figure 2-1.
Fig. 2-2. Data and Instruction Paths in a Multifunction Logic
Device
INSTRUCTIONS IN
"External devices" refer to any data source or destination
beyond the perimeter of the microprocessor system. Drawing
1 an analogy with a logic card, "external devices" will refer to
the world beyond the card edge connector. Data passes be-
tween the microprocessor system and external devices via
MULTIFUNCTION Input/Output (I/O) ports.
DATA _ _--I~ LOGIC 1--_---1~ DATA
IN DEVICE OUT
(CPU)
2.2.1 Instructions, Programs, Data and Memory
For a microprocessor to perform any specified operation, it
will receive and process a sequence of instructions. The se-
Fig. 2-1. Multifunction Logic Device quence may be very long-numbering even into the thousands
2-1
of instructions. A sequence of instructions that can be taken In Figure 2-3, P represents the program performing numerical
as a unit is called a program; the purpose of this manual is operations on the data. Data is coilected by repeated eXecu-
to describe how a program is constructed out of a sequence tion of program R. Events occur as follows:
of instructions.
1) Program P is executing.
Data may (aiid usually will) be stored in memory. !n fact. the 2) When the external instrument has data which it is
256 possible combinations of eight binary digits (or byte) may ready to transmit, it sends an interrupt signal (I) to
represent any of the following types of information: the microprocessor, along with the starting address
of program R.
1) An instruction code 3) Upon receiving interrupt signal I, the microprocessor
2) Numeric or address data that is part of an instruction's does some elementary "housekeeping"; for example,
code it saves the address of the program P instruction it
3) Numeric or address data that is independent of was about to execute, plus any intermediate data being
instruction codes held iii temporary storage registers.
4) A coded representation of a letter of the alphabet, digit 4) The microprocessor completely executes program R.
or printable character 5) Upon completion of program R execution, the micro-
processor restores values saved in step 3, then con-
It would be impossible to determine the content of any tinues program P execution from the point where
memory byte by random inspection. This does not cause prob- interrupt I occurred. Thus execution of program P ap-
lems, since a program will occupy one or more segments of pears to have gone into "suspended animation" for
contiguous memory bytes, and data resides in blocks of the duration of program R execution.
memory as assigned by the programmer.
The sequence of events illustrated in Figure 2-3 is quite com-
mon in microprocessor applications, and is called an external
2.2.2 Interrupts interrupt. Interrupt programming is described in Section 8.2.
The number of programs which may be stored in memory is
limited only by the amount of memory available for program 2.2.3 Programmable Clocks
storage. If ten programs were stored in memory, by simply There are many microprocessor applications in which it is
identifying one program, the same microprocessor system important that the microprocessor system be synchronized
could be made to function in one of ten different ways. with the real time of the outside world. Such synchronization
is accomplished using programmabie ciocks, which are reg-
If a microprocessor has more than one program available for isters that count at a known rate. When the shift register
execution, how is the one program which is to be executed counts to zero, the event is marked by an interrupt (as de-
identified? There are two separate and distinct ways in which cribed in Section 2.2.2); in this case the interrupt is defined
a program may be identified for execution: as a "time out" interrupt. Since the rate at which the clock
register counts will be known for any microprocessor system,
A) Program identification may itself be a programmed setting a real time interval simply involves loading the
function; for example, each program, upon completing register with the correct initial count.
execution, may identify the next program to be exe-
cuted. The key to this method of program identification 2.2.4 Direct Memory Access
is that it is internally controlled, within the logic of Notice from Figure 2-2 that data may be input to the micro-
the microprocessor system. processor from memory or from an external device, via an
I/O port.
B) Programs may be called into execution by external
devices; this may happen even if another program is It is easy to imagine how, in many applications, data will be
in the middle of execution. For example, take the sim- transferred from an external device, via an I/O port and the
ple case of a microprocessor that is recording data CPU, to memory; the data will then be accessed from memory
input by an external instrument; while receiving data in the normal course of program execution.
from the external instrument. the microprocessor per-
forms numerical operations on the collected data. It makes little sense to tie up the logic of the CPU while shunt-
Program executions are illustrated in Figure 2-3. ing data from an liD port to memory; therefore, provisions
are made for Direct Memory Access (DMA), whereby data is
moved between memory and an "1/0 port", bypassing the
CPU entirely. The DMA "1/0 port" is called a "DMA channel".
I In order to implement DMA, the microprocessor system must
I~ / p
have logic (outside the CPU) which provides the following
I~\--+/
three pieces of information:
~
p
1) A starting memory address for a data block.
II f
/ n ~ t .-. .\ 2) A byte length for the data block.
3) The direction of the data movement.
I
If the microprocessor has this logic, data may be transferred
I between memory and an liD port independent of, and in
Fig. 2-3. Program P Being Interrupted to Execute Program R parallel with, unrelated CPU-memory operations.
2-2
2.2.5 A Complete Microprocessor System 4) 1/0 ports, through which bidirectional data pas-
ses between the microprocessor system and external
devices.
5) DMA logic, which provides a direct data path between
To summarize, a complete microprocessor system wi" have memory and external devices, bypassing the CPU.
the following logical components: 6) Interrupt logic, which causes the CPU to temporarily
suspend current program execution. Along with each
interrupt request signal, interrupt logic identifies the
1) A CPU, which is the multifunction logic device of the program which is to implement operations required by
system. the source of the interrupt.
2) Memory (of various types and combinations), in which 7) Real time clock logic, which synchronizes the entire
programs and data are stored. microprocessor system with the real outside world by
3) Memory interface logic which identifies: generating interrupts at variably definable time
a) the next memory location which must be accessed intervals.
to fetch instruction codes for the CPU, and
b) the memory location from which a byte of data wi" Figure 2-4 illustrates these seven logical components, with
be read, or to which a byte of data wi" be written. associated data flow paths.
.. • DATA PATHS
... - - -. . CONTROL PATHS
REAL
TIME ~
~
CLOCK
/~II...----""'
/
I I ~~
/
/
"" I
()~
/
/
""- I
/
/
""
/
/ "
/ INTERRUPT
I LOGIC
,
I
MEMORY
I
MEMORY
INTERFACE
~ LOGIC
executed when an F8 system is powered up is the instruction
3851 17 stored in memory byte O.
psu It/>
17
II)
2.4 THE 3850 CPU
w
II)
II)
Figure 2-6 illustrates the logical functions implemented on
::;)
3851
III PSU the 3850 CPU.
...I
o
a:
I-
z The heart of the Fa microprocessor system is the 3850 CPU,
o which contains data manipulation logic in an Arithmetic Logic
o
o Unit (ALU). Eight-bit instruction codes are decoded by a
Z 3853
3.5 + n
or 1.5n > 3.5 will decrement scratch pad byte n, return to BACK if byte n
or n> 2.33 did not contain 0, but continue if byte n did contain O.
ONE, TWO and THRE occupy less memory when: 9.2.5 Use of the BR7 Instruction
2n > (3 + n) The BR7 instruction is very useful when manipulating data
or n> 3 buffers in scratchpad memory, as described in Section 7.1.
In conclusion, if a 2-byte immediate instruction occurs iden- 9.3 PROGRAMMING FOR SPEED OR MEMORY
tically (same operand) three or more times in a program, it ECONOMY
is more efficient to load the immediate operand into a scratch- In the following subsections, programming techniques that
pad byte out of which it is referenced (providing a scratchpad tradeoff between execution speed and the amount of memory
byte is available). used are described.
9.2.3 Short Instructions 9.3.1 Macros and Subroutines
Always go over a source program, making sure that the shon io gain execution speed, pussibly with a heavy inciea5e in
instructions LIS, INS and OUTS have been used wherever the amount of memory required, convert subroutines into
the operand is small enough. macros as described in Section 7.4.
9-2
Always carefully examine subroutines, particularly those *ONE OF EIGHT DECODER PROGRAM USING TABLE
which are infrequently called or receive parameters from the *LOOKUPS
calling program, to see if converting the subroutine into a LKUP DC 0
macro would save memory bytes and, at the same time, DC 2
increase execution speed. DC 4
DC 8
As described in Section 7.3, programs can be made much DC 16
faster and will require less memory if subroutine nesting is DC 32
limited to a first level. If a main program calls a subroutine, DC 64
the subroutine can then call another subroutine. However, DC 128
a subroutine cannot call another subroutine if it was, itself,
called by a subroutine. Limiting subroutine nesting to a level
of one means that return addresses can be stored in the
stack register (PC1 ) and in the K registers of the scratch pad, INS 0 INPUT OCTAL CODE
eliminating the need for memory stacks. DCI LKUP LOAD TABLE BASE
ADDRESS
9.3.2 Table Lookups Versus Data Manipulation ADC ADD INPUT CODE TO BASE
Program execution speed can frequently be increased by ADDRESS
looking up data out of tables in ROM. LM LOAD OUTPUT
OUTS OUTPUT RESULT
The concept is illustrated below, for the simple case of a 1-
of-8 decoder. Efficiencies compare as follows:
An octal digit is input into the low order three bits of 1/0 port Non-Table Lookup Table Lookup
O. The CPU must output, via 1/0 port 1, a data byte as follows: Instructions 10 5
Memory bytes 13 15
Execution cycles min: 15 15
Input From Port 0 Output At Port 1 max: 69.5 15
00000001 00000001
00000010 00000010
00000011 00000100
00000100 00001000
00000110 00100000
00000111 01000000
OOOOOOOO 10000000
*ONE OF EIGHT DECODER PROGRAM, NOT USING TABLE
*LOOKUP
INS o !NPUT OCTAL CODE
BNZ 110 INPUT IS NOT ZERO
LIS 8 LOOP COUNTER
iiO LR O,A TO LOOP COUNTER
LIS 1 LOAD OUTPUT FOR 1
LOOP OS 0 DECREMENT INPUT
BZ OUT BRANCH OUT IF END
SL 1 SHIFT LEFT ONE BIT IF
NOT END
BR LOOP
OUT OUTS 1 OUTPUT RESULT
9-3
SOME USEFUL PROGRAMS
Some generally useful programs are given in this section. If scratchpad byte 0 is not available, any other byte may be
Programs are not shown as subroutines or as macros. The used for data storage.
instructions implementing required logic are given, making it
easy to incorporate an example into a program as a sub-
routine, a macro or directly as a section of main memory. If scratch pad byte 1 is not available, any other scratchpad
These programs are intended to show programming techniques, byte, or the immediate instruction:
rather than to demonstrate optimum program efficiency.
AI H'30'
10.1 GENERATING TEXT may be used.
10.1.1 Simple and Dedicated Text Programs 10. 1.3 Variable Text
It is possible to have a text generation program in ROM that
The simplest text generation logic takes characters out of a outputs variable text, temporarily stored in RAM. In other
memory buffer and outputs them via an I/O port. The I/O words, a fixed ROM program outputs messages of variable
operation may be under program control, or interrupt I/O may length and content. This is useful in word processing or human
be used. in each case, text is fetched via an elementary dialog applications. For example, an F8 microprocessor may
instruction sequence such as: drive a CRT used to collect data from convention attendees;
the text program described below allows the dialog that will
DCI TEXT LOAD TEXT BUFFER be displayed to be changed at any time, without changing the
STARTING ADDRESS text generation program.
LOOP LM LOAD NEXT TEXT BYTE
*TEST FOR END-OF-RECORD CHARACTER. INSTRUCTIONS
*FOR THIS TEXT ARE NOT SHOWN, SINCE THEY ARE A FUNC- The text table (labeled TEXT below) contains characters in
*TION OF THE APPLICATION. any mixed sequence.
OUT PRTN OUTPUT CHARACTER VIA
PORTN The index table (labeled TIND below) consists of the following
BR LOOP RETURN FOR NEXT 3-byte sequence:
CHARACTER
10.1.2 Unpacking Decimal Digits This variable text generation program uses two data tables:
a text table and an index table.
A byte containing two BCD digits is converted into two ASCII
digits as follows:
LM LOAD BYTE WITH TWO
BCD DIGITS Bytes 1 and 2 - Displacement from TEXT to first character
LR O,A SAVE BYTE IN SCRATCHPAD to be output. If Byte 1 =H'FF', end of mes-
BYTE 0 sage is indicated. Byte 1 displacement
SL 4 cannot be H'FF.
SR 4 ISOLATE LOW ORDER DIGIT Byte 3 - Number of characters to be printed.
AS 1 ADD HIGH ORDER FOUR
ASCII BITS
LR 2,A SAVE IN SCRATCHPAD
BYTE 2 Messages are identified by number, starting at 1. A mes-
LR A,O LOAD TWO BCD DIGITS sage's number is its sequential location, as identified by H'FF"
SR 4 ISOLATE HIGH ORDER DIGIT codes in TIND.
AS 1 ADD HIGH ORDER FOUR
BITS
*CHARACTER OUTPUT SEQUENCE FOLLOWS HERE Consider the following very simple example. The following
four messages are to be generated:
This instruction sequence assumes that scratchpad byte 0 is
available for temporary storage and that scratchpad byte 1
contains H'30'. Refer to Appendix B. A decimal digit becomes 1) ENTER PRODUCT NUMBER:
an ASCII character as follows: 2) NO SUCH PRODUCT RE-ENTER:
3) NUMBER OF UNITS:
4) PRODUCT SHIP DATE:
76543210 Bit No.
0011XXXX
'
The following TEXT table will be needed:
L LoeCimal digit, 0000 through 1001
This code identifies an ASCII decimal digit
10-1
RE-ENTERiSPRODUCT
iSNUMBER:iSNOiSSUCH
iSOFiSUNITS :SH IPiSD
ATE:iS
The following TIND table will be needed: LR 10,A
LR DC,H
Byte No. Contents L3 LM LOAD NEXT CHARACTER TO
(Hexadecimal) (Hexadecimal) BE OUTPUT
Pi COUT OUTPUT CHARACTER
~}
0 Message 1 is 20
1 characters, starting at * ANY OUTPUT CODE MAY REPLACE THE CALL TO SUB-
2 14 character 4 *ROUTINE COUT
3 FF End of message 1 DS 2 DECREMENT CHARACTER
COUNTER
~}
4
5 NO SUCH BNZ L3 RETURN FOR MORE
6 08 CHARACTERS
XDC AT END OF MESSAGE
~}
7
8 PRODUCT BR T10 SEGMENT, RESTORE TIND
9 08 ADDRESS TO DCO
OUT END OF PROGRAM. ANY
~}
A
B RE-ENTER OTHER INSTRUCTIONS MAY
C FOLLOW HERE
D FF End of message 2
~}
E
F NUMBER
10 06 TIND ORG X'0800' ORIGIN ARBITRARILY
SELECTED
~}
11
12 OF UNITS DC H'OO' DISPLACEMENT TO HIGH
13 OA BYTE
14 FF End of message 3 DC H'03' DISPLACEMENT TO LOW
BYTE
~l
15
16 PRODUCT DC H'16' NUMBER OF CHARACTERS
17 08 J IN THIS SEGMENT
DC H'FF' END OF MESSAGE 1
~l
18
19 SHIP DATE:
1A OBJ
1B FF End of message 4
DC H'OB'
The following program assumes that the message number DC H'FF'
is in the accumulator. The program generates the specified
message.
TGEN LR O,A SAVE MESSAGE NUMBER 10.2 MULTIBYTE ADDITION AND
IN BYTE 0 SUBTRACTION
DCI TIND LOAD TEXT INDEX STARTING
ADDRESS 10.2.1 16-Bit, Binary Addition and Subtraction
L1 DS 0 DECREMENT MESSAGE
COUNTER The following program adds a 16-bit value in scratch pad
BZ T10 MESSAGE FOUND bytes 1 (high) and 0 (low) to another 16-bit value in scratch-
L2 LM SEEK NEXT H'FF' BYTE IN pad bytes 3 (high) and 2 (low), as follows:
TIND
COM
BNZ L2 BYTE LOADED IS NOT H'FF'
BR L1 BYTE LOADED IS H'FF' LR A,O LOAD LOW ORDER
T11'\
IIV LM MESSAGE FOUND. LOAD AUGEND BYTE
LR O,A NEXT THREE BYTES OF TIND AS 2 ADD LOW ORDER
COM AND SAVE IN SCRATCHPAD ADDEND BYTE
BZ OUT BYTES 0, 1 AND 2. TEST LR 2,A SAVE ANSWER
LM FIRST BYTE FOR H'FF' LR A,1 LOAD HIGH ORDER
SIGNIFYING END OF AUGEND BYTE
MESSAGE LNK ADD ANY CARRY
LR 1,A BNO A1 IF NO OVERFLOW,
LM CONTINUE
LR 2,A BR ERROR MAKE ERROR EXIT FOR
XDC SAVE TIND ADDRESS IN DC1 CARRY
DCI TEXT LOAD TEXT ADDRESS INTO A1 AS 3 ADD HIGH ORDER
DCa ADDEND BYTE
LR A,O ADD SCRATCHPAD BYTES LR 3,A SAVE ANSWER
ADC 1 AND OTO DCO BNO NEXT IF NO OVERFLOW,
LR H,DC CONT!NUE
LR
AS ,
A,10 BR ERROR MAKE ERROR EXIT FOR
CARRY
1D··2
To perform 16-bit binary subtraction, the two's complement To perform multibyte decimal subtraction, the routine should
of the 16-bit value in scratchpad bytes 1 and 0 is added to be changed as follows:
the 16-bit value in H. Instructions required are as follows:
LR DC,H MOVE SUBTRAHEND TO DC BUFA EaU H'0838' THE CONTENTS OF BUFA
LR A,O LOAD LOW ORDER BYTE BUFB EaU H'0920' AND BUFB ARE ADDED. THE
OF MINUEND BUFC EaU H'077C' RESl ILT IS STORED IN BUFC.
COM COMPLEMENT IT CNT H'OA' 10 B'.'TE BUFFERS ARE
ADC ADD TO SUBTRAHEND ASSUMED.
LIS ADD 1 TO SUBTRAHEND
ADC
LR H,DC RESTORE PARTIAL SUM TO H
LR A,l LOAD HIGH ORDER BYTE ONE LIS CNT USE SCRATCHPAD
OF MINUEND TWO LR O,A REGISTER 0 AS A COUNTER
COM COMPLEMENT THREE DCI BUFC SAVE THE ANSWER BUFFER
AS 10 ADD HU TO ACCUMULATOR FOUR LR a,DC STARTING ADDRESS IN a
LR 10,A STORE ANSWER BACK FIVE DCI BUFA SAVE THE SOURCE BUFFER
SIX XDC ADDRESSES IN DCO
AND DCl
10.2.2 Multibyte Binary or Decimal Addition and
Subtraction SEVEN DCI BUFB
Subroutine MADO, in any of the forms and variations de- EIGHT LI H'66' LOAD IMMEDIATE H'66'
scribed in Section 7, performs multibyte binary addition. LR 2,A AND SAVE FOR LATER USE
LIS 1 INITIALLY SET CARRY TO 1
LOOP LR 8,A SCRATCHPAD BYTE 8 USED
To perform multibyte binary subtraction make changes as TO SAVE CARRY
follows. (Refer to the program version in Section 7.2.2): LM LOAD SUBTRAHEND INTO
ACCUMULATOR
Replace COM
ELEV XDC ADDRESS MINUEND
EIGHT COM INITIALLY CLEAR THE AMD ADD MINUEND
CARRY BIT LR J,W SAVE STATUS
LR J,W AS 8 ADD PRIOR BYTE'S CARRY
LOOP LM ASD 2 DECIMAL CORRECT BY
LR W,J ADDING H'66'
NINE LNK NNTN BNC TWTY+l TEST IF DECIMAL CORRECT
CREATES A CARRY
with: TWTY LR J,W !F IT DOES, SAVE CARRY
THRT XDC READDRESS AUGEND
EIGHT LI H'FF' INITIALLY SET THE CARRY BUFFER
1M'"
"'41 v BiT BY LOADiNG H'FF iNTO
A, THEN INCREMENTING FRTN LR H,DC SAVE AUGEND ADDRESS
LR J,W SAVE STATUS TO FORCE IN H
TWOS COMPLEMENT FFTN LR DC,a LOAD ANSWER BUFFER
LOOP LM LOAD NEXT BYTE ADDRESS
COM COMPLEMENT THE SXTN ST STORE THE ANSWER
ACCUMULATOR SVTN LR a,DC SAVE ANSWER BUFFER
LR W,J RESTORE STATUS ADDRESS IN a
NINE LNK ADD CARRY, IF PRESENT EGTN LR DC,H MOVE AUGEND ADDRESS
BACK TO H
LIS 2 LOAD CARRY FROM AMD
NS 9 OR ASD AND WITH SAVED
To perform multibyte decimal addition, referring again to the STATUS IN J
multibyte addition program as described in Section 7.2.2, SR SAVE IN SCRATCHPAD
replace BYTE 1
TWTl OS 0 DECREMENT COUNTER
BNZ LOOP RETURN FOR MORE
TWEL AM ADD CORRESPONDING
ADDEND BYTE 10.3 MULTIPLICATION
There are a number of possible multiplication routines.
with:
Consider first the binary multiplication of two 8-bit, positive
TWEL AI H'66' PRIME AUGEND FOR numbers (in scratch pad bytes 0 and 1) to give a 16-bit prod-
DECIMAL ADDITION duct in scratchpad bytes 7 (high) and 6 (low). The following
AMD ADD ADDEND DECIMAL program performs the required multiplication:
10-3
*BINARY MULTIPLY SUBROUTINE TABX+80 81 8283848586878889 8A 8B 8C 80 8E 8F
·SCRATCH REG 1 CONTAINS MULTIPLIER holds: 00 08 16 24 32 40 48 56 64 72 Not Used
~SCRATCH REG 2 CO;~TA;NS MULT!PL!C.A.ND
*SCRATCH REGS 6 AND 7 CONTAIN PRODUCT (SR7=MSB) TABX+90 91 9293949596979899 9A 9B 9C 90 9E 9F
BMPY LIS 8 INITIALIZE COUNTER TO 8 holds: 00 09 1827364554637281 Not Used
LR 5,A
LIS 0 ZERO PRODUCT
LR 6,A
All numbers above are hexadecimal. Suppose TABX is equated
LR 7,A
to H'2000'; then byte H'2008' contains H'OO'; byte H'2024'
BMPl LR A,6 SHIFT PARTIAL
contains H '08'; byte H'2094' contains H'36'; etc.
AS 6 PRODUCT LEFT 1
LR 6,A
LR A,7
The table lookup proceeds as follows:
LNK
AS 7
LR 7,A LR A,O ISOLATE MULTIPLIER
LR A,1 SHIFT MULTIPLIER SL 4 LOW ORDER DIGIT
AS 1 LEFT 1, BY ADD SR 4
1,A IF CARRY IF SET LR 2,A STORE IN BYTE 2
LR
LR A,1 LOAD MULTIPLICAND
BNC BMP2 ADD MULTIPLICAND TO
SL 4 ISOLATE LOW ORDER DIGIT
PRODUCT
AS 2 ADD MULTIPLIER LOW
LR A,2 ADD
MULTIPLICAND ORDER DIGIT X16
AS 6
6,A TO DCI TABX LOAD TABLE BASE
LR
A,7 PRODUCT ADDRESS
LR
LR H,DC SAVE BASE FOR FURTHER
LNK
USE
LR 7A
BMP2 OS 5 DECREMENT COUNT ADe ADD ACCUMULATOR INDEX
LM LOAD PRODUCT FROM
BNZ BMP1 NOT FINI, REPEAT
TABLE
LR 6,A STORE IN LOW ORDER
BYTE OF ANSWER
The above program occupies 26 bytes and executes in a maxi- LR A,O LOAD MULTIPLIER
mum of 373 1J,S. Contrast this with the program in Section SR 4 ISOLATE HIGH ORDER DIGIT
9.3.3 which occupies just 12 bytes, but executes in between LR 3,A SAVE IN BYTE 3
201J,s and 1800.5 1J,S. LR A,1 LOAD MULTIPLICAND
SR 4 ISOLATE HIGH ORDER DIGIT
Very fast decimal multiplication can be achieved using table SL 4
lookups. Consider a 2-digit decimal number in scratchpad AS 3 ADD MULTIPLIER HIGH
byte 0, multiplied by a 2-digit decimal number in scratchpad ORDER DIGIT
byte 1, to give a 4-digit answer in scratchpad bytes 7 (high) LR DC,H LOAD TABLE BASE
and 6 (low). The routine uses 100 bytes of ROM, to hold the ADDRESS
following table: ADC ADD ACCUMULATOR INDEX
LM LOAD PRODUCT FROM
TABX+OO 01 020304 0506070809 OA OB OC 00 OE OF TABLE
holds: 00 00 00 00 00 00 00 00 00 00 Not Used LR 7,A STORE IN HIGH ORDER BYTE
OF ANSWER
TABX+ 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 10 1E 1F LR A,1 LOAD LOW ORDER DIGIT OF
holds: 00 01 02 03 04 05 06 07 08 09 Not Used SL 4 MULTIPLICAND
AS 3 ADD HIGH ORDER DIGIT OF
TABX+20 21 222324252627 28 29 2A 2B 2C 20 2E 2F MULTIPLIER
holds: 00 02 04 0608 1012 14 16 18 Not Used LR DC,H OBTAIN PRODUCT
ADC
TABX+30 31 3233343536373839 3A 3B 3C 3D 3E 3F LM
holds: 00 03 06 09 12 15 1821 2427 Not Used LR 3,A SAVE IN BYTE 3
SL 4 ADD LOW ORDER DIGIT TO
TABX+40 41 424344 45 46 47 4849 4A 4B 4C 40 4E 4F AI H'66'
holds: 00 04 08 12 16 20 24 28 32 36 Not Used ASD 6 HIGH ORDER DIGIT OF
BYTE 6
TABX+50 51 52 53 54 55 56 57 58 59 5A 5B 5C 50 5E 5F LR J,W
holds: 00 05 10 15 20 25 30 35 40 45 Not Used LR 6,A
LR A,3 ISOLATE HIGH ORDER DIGIT
TABX+60 61 62 63 6465 66 67 68 69 6A 6B 6C 60 6E 6F SR 4 OF PRODUCT IN LOW
holds: 00 06 1 2 18 24 30 36 42 48 54 Not Used ORDER POSITION
LR VV,J
TABX+70 71 72 73 74757677 78 79 7A 7B 7C 70 7E 7F LNK OF ACCUMULATOR. ADD
holds: 0007 14 21 28 35 42 49 56 63 Not Used LINK
10 I!
AI H'66' LR W,J
ASD 7 ADD HIGH ORDER BYTE OF LNK OF ACCUMULATOR.
ANSWER ADD LINK
LR 7,A RESTORE HIGH ORDER BYTE AI H'66'
OF ANSWER ASD 7 ADD HIGH ORDER BYTE
LR A,' LOAD HIGH ORDER DIGIT OF ANSWER
SR 4 OF MULTIPLICAND LR 7,A RESTORE HIGH ORDER
SL 4 BYTE OF ANSWER
AS 2 ADD LOW ORDER DIGIT OF
MULTIPLIER More compact versions of this program could be written, but
LR DC,H OBTAIN PRODUCT they would take longer to execute.
ADC
LM SAVE IN BYTE 3 10.4 DIVISION
LR 3,A Division of positive numbers can be performed by a program
SL 4 ADD LOW ORDER DIGIT TO using successive subtraction as follows:
AI H'66'
ASD 6 HIGH ORDER DIGIT OF ') Zero the answer
BYTE 6 2) Subtract the divisor from the dividend
LR J,W 3) Test for a negative result
LR 6,A 4) For a positive result, increment the answer and return
LR A,3 ISOLATE HIGH ORDER DIGIT to 2
SR 4 OF PRODUCT iN LOW ORDER 5) For a negative result, the division is finished. Add the
POSITION divisor to the dividend to obtain remainder.
10-5
APPENDIX A - BINARY NUMBER SYSTEM
The binary number system is a system of counting which The octal number system includes the following digits:
utilizes the digits 1 and 0 to represent numeric quantities.
The binary digits, referred to as BITs, are arranged in a se- 0, 1, 2, 3, 4, 5, 6, 7.
quence of decreasing significance based upon powers of two.
Each bit is numbered. By convention, the most significant Binary numbers are transposed into octal numbers byarrang-
bit is on the left, and the least significant bit is on the right. ing the bits into groups of three as illustrated below:
For example, consider the binary number: 101001 Binary number
Binary number o 1 1 0 0 1 101 001
-..--..-
Bit number 5 4 3 2 1 0
Power of base two 2 5 24 2 3 22 21 20 5 Octal number
Significance 32 16 8 4 2 1
The Indirect Scratchpad Address Register (lSAR) uses two
As in any number system, the quantity represented by a bi- octal digits to address 64 scratch pad registers.
nary number is calculated by multiplying each digit by its
significance, then summing products. Octal numbers are written within quotation marks preceded
by an 0 as follows:
The binary number example is evaluated as follows:
0'27',0'3',0'3270'
Quantity = 0*25+1 *24+1 *23+0*22+0*21+1 *20
= 0 + 16+8+0+0+1 Table A-1 illustrates the relationship between binary, decimal,
= 25 hexadecimal and octal numbers.
Binary numbers may be used to represent any real number
positive or negative. BINARY DECIMAL HEXADECIMAL OCTAL
0000 o o o
Non-integer numbers are represented in the same binary 000 1 1 1 1
format shown above except that the significance of the bits 001 0 2 2 2
changes. To indicate the correct interpretation of a binary o0 1 1 3 3 I 3
number, a "binary point" (which is analogous to a decimal o1 00 I 4 4 4
point in the decimal number system) is inserted. Consider o1 0 1 5 5 5
the binary number below: o1 1 0 6 6 6
o1 1 1 7 7 7
Binary number 011001.1 1 000 8 8 10
Bit number 6543210 100 1 9 9 11
Power of base two 2 5 24 2 3 22 21 20 2_1 101 0 10 A 12
Significance 32 16 8 4 2 1 1h 1 0 1 1 11 B 13
1 1 0 0 12 C 14
The number is evaiuated as foiiows: 1 1 0 1 13 D 15
1 1 1 0 14 E 16
Quantity = 0*25+1 *24+1 *23+0*22+0*21+1 *20+1 *2_1 1 1 1 1 15 F 17
= 0 + 16 + 8 + 0 + 0 + 0 + .5
= 25.5 Table A-1. Binary, Decimal, Hexadecimal and Octal Numbers
The bits of a binary number may be grouped in fours and trans-
posed into the hexadecimal number system which includes THE BYTE
the following digits: The Fairchild F8 microprocessor is an 8-bit device, which
means that data is handled in eight binary digit (or one byte)
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. units. An 8-bit byte may represent 256 (2 8 ) possible permu-
tations of eight digits.
The following example illustrates the procedure:
When referencing the 8-bit byte, this manual has established
the following conventions.
10011100 Binary number
The bits are numbered from right to left with numbers 0
----
10011100
9 A Hexadecimal number
through 7. The most significant bit is on the left; the least
significant bit is on the right.
Bit Number 7 6 543 2 1 0
In this manual, hexadecimal numbers are written within quo- I I I IIIIII
tation marks and preceded by an H. Consider the example:
H'27', H'AE10', H'F'
t
Most significant bit
t
Least significant bit
A-1
An 8-bit byte may represent an instruction object code, an bit of the next (higher order) byte as follows:
ASCII code or a data word.
H'13E2' 000 1 001 11100010
An 8-bit data word may be interpreted as a signed binary +H'4747' o 1 000 1 1 1 o 1 000 1 1 1
number with a value of from 127 to -128 as illustrated in H'5B29' o 1 0 1 1 0 1 0/1 0010100 1
Table A-2. 1
o 1 0 1 011
It will become clear after reading the sections which follow
on binary arithmetic, that the signed binary number system Binary Number Subtraction
is a natural fallout of two's complement subtraction. Subtracting a binary number is the same as adding the two's
complement of the number.
BINARY DECIMAL HEXADECIMAL
10000000 -128 80 The two's complement of a number is generated by comple-
10000001 -127 81 menting the number (replacing 0 with 1 and 1 with 0) and
10000010 -126 82 adding one to the complement. Here is an example:
- -
H'3C' 0 0 1 1 1 1 0 0
- -
one's complement 1 1 0 0 0 0 1 1
- -
11111110 -2 FE 1
11111111 -1 two's complement 1 0 0 0 1 0 0
FF
OOOOOOOO 0 0
00000001 1 1 Observe that negative numbers in Table A-2 are the two's
2 2 complement of their positive equivalents. In this fashion, an
00000010
8-bit number can contain sign and value information for
- -
numbers between 128 and -127.
- -
- -
01111101 +125 70 When adding signed binary numbers, care must be taken to
01111110 +126 7E I indicate when the result exceeds the boundaries of the two's'
complement notation.
01111111 +127 7F
I
Table A-2. Signed Binary Numeric Interpretations To exempiify the need for such indicators, consider some
simple examples using the set of 3-bit signed binarynumbers
from 3 to-4.
Binary Number Addition
Addition of binary numbers is accomplished by following Signed Binary Numbers Decimal
three rules. 011 3
010 2
1) 1 bit 001 1
+ 1 bit 000 o
( ) bit + a carry bit to the next significant bit 111 -1
110 -2
2) bit 101 -3
+ 0 bit 100 -4
1 bit
Any number greater than 3 or less than -4 is outside the
3) Obit boundaries of the set of 3-bit signed binary numbers.
+ 0 bit
( ) bit The addition of two numbers within this set may result in a
number which is not defined as part of the set.
Consider the addition of two positive 8-bit binary numbers:
Consider the addition of two numbers with like signs:
Bit Number 7 6 543 2 1 0
H'93' 10010011 1) Bit No. 210 2) Bit No. 210
+H'A8' 10101 000 2 010 3 011
~
H'3B' 00111011 + 1 001 + 1 001
3 011 4 /100
Carry Bit no carry carry
A carry out of bit 7 has occurred as a result of the addition. 3) Bit No. 210 4) Bit No. 210
The carry bit is set to indicate that the results of the addition
-3 101 -3 101
cannot be represented in the existing 8-bits. However, if the -1 111 -2 110
carry bit represents the next higher significant bit, the results -4 1.-100 -5 1. . 011
are valid. ~
two carries carry
In a multiple byte addition, the carry bit from the most signif- In example 1, no carry out of the two high order bits occured.
icant bit position of a byte is added to the least significant The result is defined and valid.
A-2
In example 2, carry out from the bit which precedes the sign Division of binary numbers may be accomplished by repetitive
bit (carry out from bit 2) occurred. The result is undefined subtraction of one operand from another, or by an operation
and therefore invalid. similar to long hand division:
In example 3, a carry from bit 2 and 3 occurred. The result 7 111
is defined and valid. 3)21 11) 10101
11
In example 4, a carry from the sign bit occurred. The result 100
is undefined and invalid. 11
11
The explanation of the four examples illustrates the rules 11
which govern the error indication mechanism in the Fairchild
--0
F8 microprocessor. If the addition of two 8-bit numbers causes
a result which is outside the boundary defined for 8-bit signed
binary numbers, (illustrated in Table A-l ), an overflow status
COMPUTER LOGIC
bit is set.
Assembly language instructions exist which perform logical
The overflow status bit is defined as the EXCLUSIVE-OR of the operations on operands. Three such logical operations are
carry out of bit 6 and the carry out of bit 7. (EXCLUSIVE-OR is described below (logical-OR, AND, and EXCLUSIVE-OR).
defined later in this appendix.)
The logical-OR operation is illustrated for the two operands
I and J with the statement:
Consider binary number subtraction, (the addition of a binary
number to a two's complement number). If I or J equals 1, then the result is 1. Otherwise, the result
1) Bit No. 7 6 5 432 1 0 is zero.
H'52' o 1 0 1 001 0 The symbol used to indicate the logical-OR operation is the
two's complement 10101 1 1 0
sign (V). Consider the logical-OR of two binary numbers:
H'34' 001 101 0 0
-H'52' 10101 1 1 0 A V B = C (read A "or" B equals C)
-H'18' @] 11100010
A 11010
two's complement
H'18' 000 1 1 000 B 01100
C 11110
2) Bit No. 7 6 5 432 1 0
H'2A' 0010101 0 The logical AND operation is illustrated for the two operands
two's complement 11010110 I and J with the following statement:
H'B6' o1 10 1 0 If both I and J are 1, then the result is 1. Otherwise, the
-H'2A' 1 0 1 0 1 0 result is zero.
H'8A' OJ 000 1 100
The symbol used for the logical AND operation is (f\).
In exampie i, the subtrahend is larger than the minuend,
indicating a negative answer. In unsigned binary number Consider the logical AND of two binary numbers:
arithmetic, a negative result is indicated by no carry out of
the most significant bit and is in two's complement form. A 1\ B = C (read A "and" B equals C)
There is no overflow because there is no carry out of either
bit 6 or bit 7. A 11010
B 01100
In example 2, the subtrahend is smaller than the minuend C 01000
indicating a positive answer. In unsigned binary arithmetic,
a positive result is indicated by a carry from the most signif- The logical EXCLUSIVE-OR operation is illustrated for the op-
icant bit position and is in straight binary form. There is no erands I and J with the following statement:
overflow because there is a carry out of both bit 6 and bit 7.
If both I and J equal 1 or both I and J equal 0, the result is
zero, otherwise the result is 1.
Multiplication of binary numbers may be performed in two
ways: repetitive addition or in the fashion illustrated below,
The symbol used to indicate the logical EXCLUSIVE-OR
which is similar to the long hand method for multiplying
operation is a circled sign ( G) ).
decimal numbers:
Decimal Binary Consider the logical EXCLUSIVE-OR of two binary numbers:
91 1011011
x 5 1 0 1 A G) B = C (read A "EXCLUSIVE-OR" with B equals C)
455 1011011
0000000 A 11010
1 O. 1 1 0 1 1 B 01100
1 1 1 000 1 1 1 C 10110
A-3
APPENDIX B - ASCII CODES
GRAPHIC OR ASCII GRAPHIC OR ASCII GRAPHIC OR ASCII
CONTROL (HEXADECIMAL) CONTROL (HEXADECIMAL) CONTROL (HEXADECIMAL)
NULL 00 ACK 7C 1 31
SOM 01 Alt. Mode 7D 2 32
EOA 02 Rubout 7F 3 33
EOM 03 I 21 4 34
EaT 04 22 5 35
WRU 05 # 23 6 36
RU 06 $ 24 7 37
BELL 07 % 25 8 ...
..,8
FE 08 & 26 9 39
H. Tab
Line Feed
09
OA I I 27
28
I I A
B
41
42
V.Tab OB 29 C 43
Form OC * 2A o 44
Return 00 + 2B E 45
SO OE 2C F 46
SI OF 20 G 47
DCa 10 2E H 48
X-On 11 / 2F I 49
Tape Aux. On 12 3A J 4A
X-Off 13 3B K 4B
Tape Aux. Off 14 < 3C L 4C
Error 15 = 3D M 40
Sync 16 > 3F N 4E
LEM 17 ? 3F a 4F
SO 18 [ 5B p 50
S1 19 5C Q 51
S2
S3
S4
1A
1B
. 1C
"- ]
t
50
5E
5F
R
S
T
52
53
54
S5 10 @ 40 U 55
S6 1E blank 20 V 56
S7 1F 0 30 W 57
X 58
y 59
Z 5A
8-1
APPENDIX C - CqNVERSION TABLES/TIMER COUNTS
POWE RS 0 F TWO
1 0 1.0
2 1 0.5
4 2 0.25
8 3 0.125
16 4 0.062 5
32 5 0.031 25
64 6 0.015 625
128 7 0.007 812 5
256 8 0.003 906 25
512 9 0.001 953 i25
1 024 10 0.000 976 562 5
2 048 11 0.000 488 281 25
4 096 12 0.000 244 140 625
8 192 13 0.000 122 070 312 5
16 384 14 0.000 061 035 156 25
32 768 15 0.000 030 517 578 125
65 536 16 0.000 015 258 789 062 5
131 072 17 0.000 007 629 394 531 25
262 144 18 0.000 003 814 697 265 625
524 288 19 0.000 001 907 348 632 812 5
1 048 576 20 0.000 000 953 674 316 406 25
2 097 152 21 0.000 000 476 837 158 203 125
4 194 304 22 0.000 000 238 418 579 101 562 5
8 388 608 23 0.000 000 119 209 289 550 781 25
16 777 216 24 0.000 000 059 604 644 775 390 625
33 554 432 25 0.000 000 029 802 322 387 695 312 5
67 108 864 26 0.000 000 014 901 161 193 847 656 25
134 217 728 27 0.000 000 007 450 580 596 923 828 125
268 435 456 28 0.000 000 003 725 290 298 461 914 062 5
536 870 912 29 0.000 000 001 862 645 149 230 957 031 25
1 073 741 824 30 0.000 000 000 931 322 574 615 478 515 625
2 147 483 648 31 0.000 000 000 465 661 287 307 739 257 812 5
4 294 967 296 32 0.000 000 000 232 830 643 653 869 628 906 25
8 589 934 592 33 0.000 000 000 116 415 321 826 934 814 453 125
17 179 869 184 34 0.000 000 000 058 207 660 913 467 407 226 562 5
34 359 738 368 35 0.000 000 000 029 ;03 830 456 733 703 613 281 25
68 719 476 736 36 0.000 000 000 014 551 915 228 366 851 806 640 625
137 438 953 472 37 0.000 000 000007 275 957 614 183 425 903 320 312 5
274 877 906 944 38 0.000 000 000 003 637 978 807 091 712 951 660 156 25
549 755 813 888 39 0.000 000 000 001 818 989 403 545 856 475 830 078 125
1 099 511 627 776 40 0.000 000 000 000 909 494 701 772 928 237 915 039 062 5
2 199 023 255 552 41 0.000 000 000 000 454 747 350 886 464 118 957 519 531 25
4 398 046 511 104 42 0.000 000 000 000 227 373 675 443 232 059 478 759 765 625
8 796 093 022 208 43 0.000 000 000 000 113 686 837 721 616 029 739 379 882 812 5
17 592 186 044 416 44 0.000 000 000 000 056 843 418 860 808 014 869 689 941 406 25
35 184 372 088 832 45 0.000 000 000 000 028 421 709 430 404 007 434 844 970 703 125
70 368 744 177 664 46 0.000 000 000 000 014 210 854 715 202 003 717 422 485 351 562 5
140 737 488 355 328 47 0.000 000 000 000 007 105 427 357 601 001 858 711 242 675 781 25
281 474 976 710 656 48 0.000 000 000 000 003 552 713 678 800 500 929 355 621 337 890 625
562 949 953 421 312 49 0.000 000 000 000 001 776 356 839 400 250 464 677 810 668 945 312 5
1 125 899 906 842 624 50 0.000 000 000 000 000 888 178 419 700 125 232 338 905 334 472 656 25
2 251 799 813 685 248 51 0.000 000 000 000 000 444 089 209 850 062 616 169 452 667 236 328 125
4 503 599 627 370 496 52 0.000 000 000 000 000 222 044 604 925 031 308 084 726 333 618 164 062 5
9 007 199 254 740 992 53 0.000 000 000 000 000 111 022 302 462 515 654 042 363 166 809 082 031 25
18 014 398 509 481 984 54 0.000 000 000 000 000 055 511 151 231 257 827 021 181 583 404 541 015 625
36 028 797 018 963 968 55 0.000 000 000 000 000 027 755 575 615 628 913 510 590 791 702 270 507 812 5
72 057 594 037 927 936 56 0.000 000 000 000 000 013 877 787 807 814 456 755 295 395 851 135 253 906 25
144 115 188 075 855 872 57 0.000 000 000 000 000 006 938 893 903 907 228 377 647 697 925 567 676 950 125
288 230 376 151 711 744 58 0.000 000 000 000 000 003 469 446 951 953 614 188 823 848 962 783 813 476 562 5
576 460 752 303 423 488 59 0.000 000 000 000 000 001 734 723 475 976 807 094 411 924 481 391 906 738 281 25
1 152 921 504 606 846 976 60 0.000 000 000 000 000 000 867 361 737 988 403 547 205 962 240 695 953 369 140 625
2 305 843 009 213 693 952 61 0.000 000 000 000 000 000 433 680 868 994 201 773 602 981 120 347 976 684 570 312 5
4 611 686 018 427 387 904 62 0.000 000 000 000 000 000 216 840 434 497 100 886 801 490 560 173 988 342 285 156 25
9 223 372 036 854 775 808 63 0.000 000 000 000 000 000 108 420 217 248 550 443 400 745 280 086 994 171 142 578 125
C-l
TABLE OF POWERS OF SIXTEEN 10
16
n
n 16- n
1 o 0.10000 00000 00000 00000 x 10
16 1 0.62500 00000 00000 00000 X 10- 1
256 2 0.39062 50000 00000 00000 X 10-2
4 096 3 0.24414 06250 00000 00000 X 10- 3
65 536 4 0.15258 78906 25000 00000 x 10-4
1 048 576 5 0.95367 43164 06250 00000 x 10-6
16 777 216 6 0.59604 64477 53906 25000 x 10-7
268 435 456 7 0.37252 90298 46191 40625 x 10-8
4 294 967 296 8 0.23283 06436 53869 62891 x 10-9
68 719 476 736 9 0.14551 91 522 83668 51807 x 10- 10
099 511 627 776 10 0.90949 47017 72928 23792 x 10- 12
17 592 186 044 416 11 0.56843 41886 08080 14870 x 10- 13
281 474 976 710 656 12 0.35527 13678 80050 09294 x 10- M
4 503 599 627 370 496 13 0.22204 46049, 25031 30808 x 10- 15
72 057 594 037 927 936 14 0.13877 78780 78144 56755 x 10- 16
152 921 504 606 846 976 15 0.86736 17379 88403 54721 x 10- 18
TABLE OF POWERS OF 10 16
n
o 1.0000 0000 0000 0000
A 1 0.1999 9999 9999 999A
64 2 0.28F5 C28F 5C28 F5C3 X 16- 1
3E8 3 0.4189 374B C6A7 EF9E X 16- 2
2710 4 0.680B 8BAC 71 DC B296 X 16-3
1 86 AD 5 0.A7C5 AC47 1B47 8423 X 16-4
F 4240 6 0.10C6 F7 AD B5ED 8D37 X 16-4
98 9680 7 0.lA07 F29A BCAF 4858 X 16-5
5F5 El00 8 0.2AF3 10C4 6118 73BF X 16-6
3B9A CAOO 9 0.44B8 2FAO 9B5A 52CC X 16-7
2 540B E400 10 0.60F3 7F67 SEF6 EAOF x 16-8
17 4876 E800 11 O.AFEB FFOB CB24 AAFF x 16-9
E8 04A5 1000 12 0.1197 9981 20EA 1119 x 16-9
918 4E72 AOOO 13 0.lC25 C268 4976 81C2 x 16- 10
5AF3 107 A 4000 14 0.2009 3700 4257 3604 x 16- 11
3 807 E A4C6 8000 15 0.480E BE7B 9058 5660 x 16- 12
23 8652 6FC1 0000 16 0.734A CA5F 6226 FOAE x 16- 13
163 4578 508/\ 0000 17 0.8877 AA.32 36.A4 R44~ x 16 -14
OED B6B3 A764 0000 18 0.1272 5001 0243 ABA1 x 16- i4
8AC7 2304 89E8 0000 19 0.1083 C94F B602 AC35 x 16 -15
c-?
HEXADECIMAL-DECIMAL INTEGER CONVERSION
The table below provides for direct conversions between hexadecimal integers in the range O-FFF and decimal integers in the
range OA095. For conversion of larger integers, the table values may be added to the following figures:
Hexadecimal Decimal. Hexadecimal Decimal
01 000 4096 20000 131 072
02000 8 192 30000 196608
03000 12288 40000 262 144
04000 16384 50000 327680
05000 20480 60000 393 216
06000 24576 70000 458752
07000 28672 80000 524288
08000 32768 90000 589824
09000 36864 AOOOO 655360
OAOOO 40960 80000 720896
08000 45056 CO 000 786432
OC 000 49 152 DO 000 851 968
00000 53248 EO 000 917504
OE 000 57344 FO 000 983040
OF 000 61 440 100000 1 048576
10000 65536 200000 2097 152
11 000 69632 300000 3 145 728
12000 73728 400000 4 194304
13000 77824 500000 5242880
14000 81 920 600000 6291 456
15000 86016 700000 7340032
16000 90 112 800000 8388608
17000 94208 900000 9437 184
18 000 98304 AOO 000 10485760
19000 102400 800000 11 534336
lA 000 106496 COO 000 12582912
18000 110592 000000 13631 488
1C 000 114688 EOO 000 14680064
10000 118 784 FOO 000 15728640
1E 000 122880 1 000000 16777216
1F 000 126976 2000000 33554 432
0 1 2 3 4 5 6 7 8 9 A 8 C 0 E F
000 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015
010 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031
020 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047
030 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063
040 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079
050 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0092 0093 0094 0095
060 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111
070 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127
080 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143
090 0144 0145 0146 0147 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159
OAO 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175
080 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191
OCO 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207
000 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223
OEO 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239
OFO 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 0250 0251 0252 0253 0254 0255
C-3
HEXADECIMAL·DECIMAL INTEGER CONVERSION (Cont'd)
In 2 3 4 5 6 7 8 9 A 8 C 0 E F I
'-1 -1n-n---+ll-nO -22'.::.....7~~2~--0-25-7-0-2.::..5-8-0-2-59--0-_2-6-0-0-')-61--02-6-2-0-2-63--0-26-4-0-2-6-5-0-2-66--02-6-7--0-268 0269
.... 0270 0271 I
ii' ~ ~~ 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 0283 0284 0285 0286 0287
120 0288 0289 0290 0291 0292 0293 0294 0295 0296 0297 0298 0299 0300 0301 0302 0303
130 0304 0305 0306 0307 0308 0309 0310 0311 0312 0313 0314 031 5 0316 0317 0318 0319
140 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 0331 0331 0333 0334 0335
150 0336 0337 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 0351
160 0352 0353 0354 0355 0356 0357 0358 0359 0360 0361 0362 0363 0364 0365 0366 0367
170 0368 0369 0370 0371 0372 0373 0374 0375 0376 0377 0378 0379 0380 0381 0382 0383
I 180 0384 0385 0386 0387 0388 0389 0390 0391 0392 0393 0394 0395 0396 0397 0398 0399
190 0400 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 0413 0414 0415
1 AO 04 16 0417 04 18 0419 0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 0430 0431
180 0432 0433 0434 0435 0436 0437 0438 0439 0440 0441 0442 0443 0444 0445 0446 0447
1CO 0448 0449 0450 0451 0452 0453 0454 0455 0456 0457 0458 0459 0460 0461 0462 0463
1DO 0464 0465 0466 0467 0468 0469 0470 0471 0472 0473 0474 0475 0476 0477 0478 0479
1EO 0480 0481 0482 0483 0484 0485 0486 0487 0488 0489 0490 0491 0492 0493 0494 0495
1 FO 0496 0497 0498 0499 0500 0501 0502 0503 0504 0505 0506 0507 0508 0509 0510 0511
200 0512 0513 0514 0515 0516 0517 0518 0519 0520 0521 0522 0523 0524 0525 0526 0527
210 0528 0529 0530 0531 0532 0533 0534 0535 0536 0537 0538 0539 0540 0541 0542 0543
220 0544 0545 0546 0547 0548 0549 0550 0551 0552 0553 0554 0555 0556 0557 0558 0559
230 0560 0561 0562 0563 0564 0565 0566 0567 0568 0569 0570 0571 0572 0573 0574 0575
240 0576 0577 0578 0579 0580 0581 0582 0583 0584 0585 0586 0587 0588 0589 0590 0591
250 0592 0593 0594 0595 0596 0597 0598 0599 0600 060 i 0602 0603 0604 0605 0606 0607 I
260 0608 0609 0610 0611 0612 0613 0614 0615 0616 0617 0618 0619 0620 0621 0622 0623
270 0624 0625 0626 0627 0628 0629 0630 0631 0632 0633 0634 0635 0636 0637 0638 0639
280 I 0640 0641 0642 0643 0644 0645 0646 0647 0648 0649 0650 0651 0652 0653 0654 0655
290 0656 0657 0658 0659 0660 0661 0662 0663 0664 0665 0666 0667 0668 0669 0670 0671 I
2AO 0672 0673 0674 0675 0676 0677 0678 0679 0680 0681 0682 0683 0684 0685 0686 0687
280 0688 0689 0690 0691 0692 0693 0694 0695 0696 0697 0698 0699 0700 0701 0702 0703
1
2CO I 0704 0705 0706 0707 0708 0709 0710 0711 0712 0713 0714 0715 0716 0717 0718 0719
I
200 0720 0721 0722 0723 0724 0725 0726 0727 0728 0729 0730 0731 0732 0733 0734 0735
2EO 0736 0737 0738 0739 0740 0741 0742 0743 0744 0745 0746 0747 0748 0749 0750 0751
2FO 0752 0753 0754 0755 0756 0757 0758 0759 0760 0761 0762 0763 0764 0765 0766 0767
300 0768 0769 0770 0771 0772 0773 0774 0775 0776 0777 0778 0779 0780 0781 0782 0783
310 0784 0785 0786 0787 0788 0789 0790 0791 0792 0793 0794 0795 0796 0797 0798 0799
320 0800 0301 0802 0803 0804 0805 0806 0807 0808 0809 0810 0811 081 2 0813 0814 081 5
I 330 0816 0817 0818 0819 0820 0821 0822 0823 0824 0825 0826 0827 0828 0829 0830 0831
1340 0832 0833 0834 0835 0836 0837 0838 0839 0840 0841 0842 0843 0844 0845 0846 0847
350 0848 0849 0850 0851 0852 0853 0854 0855 0856 0857 0858 0859 0860 0861 0862 0863
I
1
360 0864 0865 0866 0867 0868 0869 0870 0871 0872 0873 0874 0875 0876 0877 0878 0879
·370 0880 0881 0882 0883 0884 0885 0886 0887 0888 0889 0890 0891 0892 0893 0894 0895
II 380
390
0896
0212
0897 0898
0913 0914
0899
0915
0900
0916
0901
0917
0902
0918
0903
0919
0904
0920
0905
0921
0906
0922
0907
0923
0908
0924
0909
0925
0910 0911
0926 0927
3AO 0928 0929 0930 0931 0932 0933 0934 0935 0936 0937 0938 0939 0940 0941 0942 0943
380 0944 0945 0946 094 7 0948 0949 0950 0951 0952 0953 0954 0955 0956 0957 0958 0959
1
I 3CO 0960 0961 0962 0963 0964 0965 0966 096 7 0968 0969 0970 0971 0972 0973 0974 0975
300 0976 I 0977 0978 0979 0980 0981 0982 0983 0984 0985 0986 0987 0988 0989 0990 0991 1
1 3 EO I 0992 0993 0994 0995 0996 0997 0998 0999 1000 1001 1002 1003 1004 1005 1006 1007
1 3FO I 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 J
HEXADECIMAL-DECIMAL INTEGER CONVERSION (Cont'd)
0 1 2 3 4 5 6 7 8 9 A B C D E F
400 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
410 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
420 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071
430 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087
440 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
450 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
460 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135
470 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151
480 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167
490 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183
4AO 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199
4BO 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215
Jlf'n
"'T\JV 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231
4DO 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 12471
4EO 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263
4FO 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279
500 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295
510 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311
520 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327
530 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343
540 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359
550 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375
560 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391
570 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 I
580 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423
590 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439
5AO 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455
5BO 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471
5CO 1 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 14871
1 5DO 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503
5EO 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519
5FO 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535
600 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551
610 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567
620 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583
630 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599
640 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615
650 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631
660 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647
670 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663
680 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679
690 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695
6AO 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711
6BO 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727
6eo 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743
600 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759
6EO 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775
6FO 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791
c-s
HEXADECIMAL-DEC!MAL INTEGER CONVERSION (Coot'd)
I
"700
I 0
2 3
i795
4
i796 i797
5 6
i79S
7
i799
8
i800
9
1801 1802
A B
1803 1804
C
1805
D E F
1806 1807 1
I
1793 1794
I -r1n
iaGS iaiG 1n11 .. n .. " 101'1 1n1A .. n .....
1816 iai7 1818 1819 1820 1821 1822 1823
, ;~~ 1825 1826
1011
1827
101£
1828 1829
IUI-.) 101 ...
1830 1831
1010
1832 1833 1834 1835 1836 1837 1838 1839 1
I 730- - 1841 1842 1843 1&44
- - - - 1845 1846 1847
-- 1848 1849 1850 185 1I 1852 185'1v
I - 1854 1a55'
I
740 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871
750 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1'885 1886 1887
760 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903
770 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919
780 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935
790 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951
7AO 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967
7BO 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983
7CO 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
700 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
7EO 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031
7FO 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047
800 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063
810 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079
820 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 1
830 2096 2097 2098 2099 2100 210i 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 I
I
840 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 21271
850 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143
1860 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159
87(\ 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 1
I
880 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 I
I 890 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207\
1 8 AO 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 1
8BO 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239
1
8CO 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 22551
800 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 I
8EO 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287
8FO 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303
900 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 1
910 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335
920 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351
930 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367
1
940 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383
950 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399
960 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415
970 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 I
980 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447
990 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463
9AO 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479
980 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495
9CO 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511
900 2512 I 2513 2514 2515 2516 2517
2532 2533
2518
2534
2519
2535
2520 2521 2522 2523 2524 2525 2526 2527
9EO 2528 2529 2530 2531 2536 2537 2538 2539 2540 2541 2542 2543
9FO I 2544 2545 ?54fi 2547 2548 2549 2550 2551 2552 2553 ..,.,..,
...'H:C:A 2555 2557
",r..-r."1'"
£:J:JU 2558 "5--
C-6
HEXADECIMAL-DECIMAL INTEGER CONVERSION (Cont'd)
0 1 2 3 4 5 6 7 8 9 A B C D E F
AOO 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575
Al0 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591
A20 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607
A30 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623
A40 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639
A50 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655
A60 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671
A70 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687
A80 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703
A90 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719
AAO 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735
ABO 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751
ACO 2752 2753 2754 2755 2756 2757 2758 2759 2760 4761 2762 2763 2764 2765 2766 2767
ADO 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783
AEO 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799
AFO 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815
BOO 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831
Bl0 2832 2833 2834 2835 2836 2837 283B 2839 2840 2841 2842 2843 2844 2845 2846 2847
B20 2848 2849 2850 3851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863
B30 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879
B40 2880 2881 2882 2883 2884 2885 2866 2887 2888 2889 2890 2891 2892 2893 2894 2895
B50 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911
860 . 2912 2913 '101t::'
I 2918
')01.11
L.v."" ')011::
L"I~ £;;:IIU 2917 2919 2920 2921 2922 2923 2924 2925 2926 2927
B70 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943
B80 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959
B90 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975
BAO 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991
B80 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007
BCO 13008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023
1BDO 3024 3025 3026 3027 3028 3029 ")0')0
vVvV
'l0'l1
')V')I 3032 3033 3034 3035 3036 3037 3038 3039
BEO 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055
BFO 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071
COO 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087
Cl0 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103
C20 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119
C30 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135
C40 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151
C50 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167
C60 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183
C70 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199
COO 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215
C90 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231
CAO 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247
CBO 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263
CCO 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279
COO 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295
CEO 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311
CFO 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327
e-7
HEXADECIMAL-DECIMAL INTEGER CONVERSION (Cont'd)
! 0 2 3
-nn-n-+I-~-~?-~-~-~-?-9-3-33-0-3-3-3-1--33-3-2
4 5
3333 3334 3335
6 7 8 9 A B C 0 E F I
I;;~ -,."..-- 3336 3337 3338 3339 3340 3341 3342 33431
r-I
...-
-:-.- ..,.:..
3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359
020 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375
030 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391
040 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407
050 3408 3409 3410 3411 3412 3413 3414 3415 3416 2417 3418 3419 3420 3421 3422 3423
060 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439
070 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455
080 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471
090 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487
OAO 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503
OBO 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519
OCO 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535
CCO 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551
OEO 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567
OFO 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583
EOO 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599
I El0 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615
I E20 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631
I E30 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647
i
I E40 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663
I E50 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679
E60 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695
E70 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711
i E80 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727
I E90 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743
I EAO 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759
lEBO 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775
I
I ECO 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791
EOO 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807
EEO 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823
EFO 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839
I FOO 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855
I FlO
F20
3856
3872
3857
3873
3858
3874
3859
3875
3860
3876
3861 3862 3863
3877 3878 3879
3864 3865 3866 3867
3880 3881 3882 3883
3868
3884
3869 3870 3871
3885 3886 3887
, F30 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903
c·
F40 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919
F50 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935
F60 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951
F70 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967
I
I F80 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983
I
I F90 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 I
I FAO
FBO
4000
4016
4001
4017
4002 4003
4018 4019
4004
4020
4005 4006 4007
4021 4022 4023
4008 4009 4010
4024 4025 4026
4011
4027
4012
4028
4013
4029
4014
4030
4015
4031 1
I FCO 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047
FOO 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063
FEO I 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079
I FFO I 4080 4081 4082 4083 4084 4085 4086 ",noo
'"tvuu 'l090 4091 409? 4093 4094 4095 I
i
C-8
TIMER COUNTS
CONTENTS COUNTS CONTENTS COUNTS CONTENTS COUNTS CONTENTS COUNTS
OF TO OF TO OF TO OF TO
COUNTER INTERRUPT COUNTER INTERRUPT COUNTER INTERRUPT COUNTER INTERRUPT
FE 254 40 189 02 124 9F 59
FO 253 9A 188 A5 123 3D 58
FB 252 34 187 4B 122 7C 57
F7 251 69 186 96 121 F8 56
EE 250 03 185 20 120 F1 55
DC 249 A7 184 5B 119 E2 54
B8 248 4F 183 B7 118 C5 53
71 247 9E 182 6E 117 8A 52
E3 246 3C 181 DO 116 15 51
C7 245 78 180 BA 115 2A 50
8E 244 FO 179 75 114 55 49
10 243 EO 178 EB 113 AA 48
3B 242 C1 177 06 112 54 47
"7a
IV
,.., A 1
£"+1 82 176 AD 111 A8 46
ED 240 04 175 5A 110 50 45
OA 239 09 174 85 109 AO 44
B4 238 12 173 6A 108 41 43
68 237 24 172 05 107 83 42
01 236 48 171 AB 106 06 41
A3 235 90 170 56 105 00 40
47 234 21 169 AC 104 1A 39
8F 233 42 168 58 103 35 38
1F 232 85 167 B1 102 6B 37
3F 231 OA 166 62 101 07 36
7E 230 14 165 C4 100 AF 35
FC 229 28 164 88 99 5E 34
F9 228 51 163 11 98 BO 33
F3 227 A2 162 ")")
"-"-
('\""'7
;:II 7B 32
E6 226 45 161 44 96 F6 31
CD 225 8B 160 89 95 EC 30
9B 224 17 159 13 94 08 29
36 223 2E 158 26 93 BO 28
60 222 50 157 4C 92 60 27
DB 221 BB 156 98 91 CO 26
B6 220 77 155 30 90 80 25
6C 219 EF 154 61 89 00 24
09 218 DE 153 C2 88 C1 23
B2 217 BC 152 84 87 03 22
64 216 79 151 03 86 07 21
C8 215 F2 150 10 85 OF 20
91 214 E4 149 20 84 1E 19
23 213 C9 148 40 83 3D 18
46 212 93 147 81 82 7A 17
80 211 27 146 02 81 F4 16
1B 210 4E 145 05 80 E8 15
37 209 9C 144 OB 79 DO 14
6F 208 38 143 16 78 A1 13
OF 207 70 142 2C 77 43 12
BE 206 E1 141 59 76 87 11
70 205 C3 140 B3 75 OE 10
FA 204 86 139 66 74 1C 9
F5 203 OC 138 CC 73 39 8
EA 202 18 137 99 72 72 7
04 201 31 136 32 71 E5 6
A9 200 63 135 65 70 CB 5
52 199 C6 134 CA 69 97 4
A4 198 8C 133 95 68 2F 3
49 197 19 132 2B 67 5F 2
92 196 33 313 57 66 BF 1
25 195 67 130 AE 65 7F 0
4A 194 CE 129 5C 64 FE 254
94 193 90 128 B9 63
29 192 3A 127 73 62
53 191 74 126 E7 61
A6 190 E9 125 CF 60
C-9
APPENDIX D - INSTRUCTION SUMMARY
ACCUMULATOR GROUP INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT INTERRUPT 1) DMA
2
SLOTS )
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE
SR 1 12 SHIFT RIGHT ONE 0 1/0 0 1
SR 4 14 SHIFT RIGHT ONE 0 1/0 0 1
SL 1 13 SHIFT LEFT ONE 0 1/0 0 1/0
SL 4 15 SHIFT LEFT FOUR 0 1/0 0 1/0
COM 18 ACC (ACC) <±) 0 1/0 0 1/0
H'FF'
LNK 19 ACC (ACC) + CB 1/0 1/0 1/0 1/0 1 1
INC lF ACC (ACC) + 1 1/0 1/0 1/0 1/0 1 1
LIS 7i ACC H'i' 1 1
CLR 70 ACC H'OQ' 1 1 1
LI jj 20 ACC H'jj' 2.5 2 2
ii
NI ii 21 ACC (ACC) H'ii' 0 1/0 0 1/0 2.5 2 2
ji
01 jj 22 ACC (ACC) V H'jj' 0 1/0 0 1/0 2.5 2 2
ii
XI ii 23 ACC (ACC) <±) H'ii' 0 1/0 0 1/0 2.5 2 2
ii
AI ii 24 ACC (ACC) + H'ii' 1/0 .1/0 1/0 1/0 2.5 2 2
ii (Binary Add)
CI ii 25 H'ii' + (ACC)+l 1/0 1/0 1/0 1/0 2.5 2 2
ii
1) An interrupt request cannot be acknowledged until an instruction without interrupt privilege has completed execution.
2) This number of bytes can be transferred via DMA during the instruction's execution.
SCRATCHPAD REGISTER INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT iNTERRUPT 1) DMA
2
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE SLOTS )
LR y," GENERAL LOAD
REGISTER FORMAT
ALLOWABLE OPER-
ANDS LISTED BELOW
A,r* 4r ACC (r)
A,KU 00 ACC (r12)
A,KL 01 ACC (r13)
A,QU 02 ACC (r14)
A,QL 03 ACC (r15)
r,A 5r r (ACC)
KU,A 04 r12 (ACC)
KL,A 05 r13 (ACC)
QU,A 06 r14 (ACC)
OL,A 07 r15 (ACC) 1
AS Cr ACC (ACC)+(rXBinary) 1/0 1/0 1/0 1/0 1 1
ASD Dr ACC (ACC)+(r) 1/0 1/0 1/0 1/0 2 2
(Decimal)
NS Fr ACC (ACC) (r) 0 1/0 0 1/0 1
XS Er ACC (ACC) <±) (r) 0 1/0 0 1/0 1
OS 3r r (r)+H 'FF'(Decrement) 1/01/0 1/0 1/0 1.5
* Operand r formats are: Direct Addressing Indirect Addressing
o through 11 (Decimal Form) S or 12
H'O' through H'B' (hexadecimal form) I or 13
o or 14
0-1
DATA COUNTER INSTRUCTIONS
SVTESOF
OP OPER- OBJECT STATUS B!TS OBJECT INTERRUPT •. DMA ... ,
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE ., SLOTS'"
LR a,DC OE r14 (DCU) ; r15 (DCl) 4 1 3
lR H,DC 11 rl0 (DCU) ; rll (DCl) 4 1 3
lR DC,a OF DCU (r14) ; DCl (r15) 4 1 3
lR DC,H 10 DCU (rl0); DCl (rl1) 4 1 3
ADC 8E DC (DC) + (ACC) 2.5 1 2
DCI iiii 2A DC H'iiii' 6 3 5
ii
ii
XDC 2C DC
-
...-
DCl
[Memory Interface
2 2
Circuit Only]
INDIRECT SCRATCHPAD ADDRESS REGISTER INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT INTERRUPT 1) DMA
2
SLOTS )
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE
lR A,IS OA ACC (ISAR)
lR ISA OB ISAR (~CC)
LlSU a 01100a* ISARU a
LlSL a 01101 a* ISARl a
* a is 3 bits
MEMORY REFERENCE INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT INTERRUPT 1) DMA
2
SLOTS )
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE
lM 16 ACe ((DC)) 2.5 2
ST 17 (DC) (ACC) 2.5 1
AM 88 ACC (ACC)+((DC)) I/O I/O I/O I/O 2.5 2
(Binary)
AMD 89 ACC (ACC)+((DC)) I/O I/O I/O I/O 2.5 2
(Decimal)
NM 8A ACC (ACC) ((DC)) 0 I/O 0 I/O 2.5 2
OM 8B ACC (ACC) ((DC)) 0 I/O 0 I/O 2.5 2
XM 8C ACC (ACC) (±) 0 I/O 0 I/O 2.5 2
((DC))
CM 80 ((DC)) + (ACC) + 1) I/O I/O I/O I/O 2.5 2
STATUS REGISTER INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT INTERRUPT 1) DMA
2
CODE AND(S; CODE fUr-..ICTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE SLOTS )
lR W,J 10 W (r9) 2 Yes* 2
W4 W3 W2 Wl Wo
I
liNT OVF I ZERO I CARRY ISIGN I
(Privileged Instruction)*
LR J,W lE r9 (W)
* As a result of a privileged instruction execution, a request for interrupt service is not acknowledged by the CPU until a
subsequent non-privileged instruction is executed.
MISCELLANEOUS INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT INTERRUPT DMA
2
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SiGN CYCLES CODE PR!V!LEGE 1) SLOTS )
NOP 2B NO OPERATION
D-2
PROGRAM COUNTER INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT INTERRUPT 1) DMA
2
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE SLOTS )
lR K,P 08 r12 (PC1U); r13 (PC 1l ) 4 3
lR P,K 09 PC1U (r12) ; PC 1l (r13) 4 3
lR PO,Q 00 PCOU (r14); PCOl (r15) 4 3
PK OC PCOU (r12); PCOl (r13) 4 Yes* 3
and PC1 (PCO)
Privileged Instruction*
PI aaaa** 28 . PC1 (PCO) ; PCO H'aaaa' 6.5 3 Yes* 5
ii
ii Privileged Instruction*
POP 1C PCO (pC 1) 2 Yes* 2
Privileged Instruction*
BRANCH INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT INTERRUPT 1) DMA
2
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE SLOTS )
BR aa 90 PCO ((PCO)+1) + H'aa' 3.5 2 3
aa
JMP aaaa 2 29 PCO H'aaaa' 5.5 3 Yes 1 4
aa
aa Privileged Instruction*
BT t,aa 4 8t 4 PCO ((PCo)+ H'aa' 3.53 2 ')
oJ
aa if any test IS true or
PCO (PCo)+ 2 if no test is tiue 3.0
STATUS BIT TESTS
22 21 2°
I I
ZERO CARRY SIGN I I
BP aa 81 PCO ((PCO)+1)+ H'aa' 3.5 2 3
if SIGN=1
aa PCO (PCO)+ 2 if SIGN=O 3.0
BC aa 82 PCO ((PCO)+1)+ H'aa' if CARRY=1 3.5 2 3
aa peO (pCoj+ 2 if CARRY=O 3.0
BZ aa 84 PCO ((PCO)+1) H'aa' if ZERO=1 3.5 2 3
aa PCO (PCO)+ 2 if ZERO=O 3.0
BM aa 91 PCO ((PCO)+1)+ H'aa' if SIGN=O 3.5 2 3
aa PCO (PCO)+ 2 if SIGN=1 3.0
BNC aa 92 PCO ((PCO)+1)+ H'aa' if CARRY=O 3.5 2 3
aa PCO (PCO)+ 2 if CARRY=1 3.0
BNZ aa 94 PCO ((PCO)+1)+ H'aa' If ZERO:::O 3.5
aa PCO (PCO)+ 2 if ZERO=1 3.0
BF t 5,aa 9t 5 PCO ((PCO)+1)+ H'aa' 3.5 2 2 3
aa if selected status bits are all "0"
PCO (PCO)+2 if any status bit is 1 3.0
TEST CONDITIONS
23 22 21 2°
IOVF I ZERO ICARRYISIGNI
BNO aa 98 PCO ((PCO)+1)+ H'aa' if OVF=O 3.52 2 3
aa PCO (PCO)+ 2 if OVF=1 3.0
BRZ aa 8F PCO ((PCO)+1)+ H'aa' if ISARl7 2.52 2 2
aa PCO (PCO)+ 2 if ISAR=7 2.0
1. As a result of a privileged instruction execution, a request for interrupt service is not acknowledged by the CPU until a
subsequent non-privileged instruction is executed.
2. The contents of the accumulator are destroyed.
3. 3,5 cycles if branch is taken. 3.0 cycles if branch is not taken.
4. t is only 3 bits
5. t is four bits
6. 2.5 cycles if branch is taken. 2.0 cycles if branch is not taken.
n_':l
INTERRUPT CONTROL INSTRUCTIONS
8YTESOF
OP I"\D IC~T
"'...,~ ... ""'. STATUS BITS OBJECT INTERRUPT,\ SOLO~-IA.;;::2)
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE ., ~
01 1A DiSABLE INTERRUPT 2 2
EI 1B ENABLE INTERRUPT YES* 2
Privileged Instruction*
INPUT /OUTPUT INSTRUCTIONS
BYTES OF
OP OPER- OBJECT STATUS BITS OBJECT INTERRUPT 1) DMA
2
CODE AND(S) CODE FUNCTION OVF ZERO CARRY SIGN CYCLES CODE PRIVILEGE SLOTS )
INS a Aa ACC (INPUT PORT a) 0 1/0 0 1/0 4** 3
Input Ports 00 to OF only
IN aa 26 ACC (INPUT PORT aa) 0 1/0 0 1/0 4 2 3
aa Input Ports 04 through FF only
OUTS a Ba OUTPUT PORT a (ACC) 4** YES** 3
Output Ports 00 to OF only
OUT aa 27 OUTPUT PORT aa (ACC) 4 2 YES* 3
aa Output Ports 04 through FF only
* As a result of a privileged instruction execution, a request for interrupt service is not acknowledged by the CPU until a
subsequent non-privileged instruction is executed,
** 2 cycles when 1/0 port address is "0" or "1",