TMS32010_Users_Guide_1985 TMS32010 Users Guide 1985

User Manual: TMS32010_Users_Guide_1985

Open the PDF directly: View PDF PDF.
Page Count: 438

DownloadTMS32010_Users_Guide_1985 TMS32010 Users Guide 1985
Open PDF In BrowserView PDF
S32010
User's Guide

",
TEXAS

NSTRUMENTS

TMS32010
User's Guide
Digital Signal Processor Products

."

TEXAS

INSTRUMENTS

IMPORTANT NOTICE
Texas Instruments (TI) reserves the right to make changes in the
devices or the device specifications identified in this publication
without notice. TI advises its customers to obtain the latest version
of device specifications to verify, before placing orders, that the
information being relied upon by the customer is current.
TI warrants performance of its semiconductor products, including SNJ
and SMJ, devices, to current specifications in accordance with TI's
standard warranty. Testing and other quality control techniques are
utilized to the extent TI deems such testing necessary to support this
warranty. Unless mandated by government requirements, specific
testing of all parameters of each device is not necessarily performed.
In the absence of written agreement to the contrary, TI assumes no
liability for TI applications assistance, customer's product design, or
infringement of patents or copyrights of third parties by or arising from
use of semiconductor devices described herein. Nor does TI warrant
or represent that any license, either express or implied, is granted
under any patent right, copyright, or other intellectual property right
of TI covering or relating to any combination, machine, or process in
which such semiconductor device might be or are used.

Copyright © 1985, Texas Instruments Incorporated

INTRODUCTION

ARCHITECTURE

INSTRUCTIONS

METHODOLOGY FOR APPLICATION DEVELOPMENT

PROCESSOR RESOURCE MANAGEMENT

INPUT/OUTPUT DESIGN TECHNIQUES

MACRO LANGUAGE INSTRUCTIONS

DIGITAL SIGNAL PROCESSING

TMS32010 DATA SHEET

SMJ32010 DATA SHEET

DEVELOPMENT SUPPORT/PART ORDER INFORMATION

TMS32020 DATA SHEET

TABLE OF CONTENTS
SECTION

PAGE

1.

INTRODUCTION............................................................
1 . 1 General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
1.2 Typical Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Key Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
1.4 How To Use the TMS32010 Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
1.4.1 Glossary of Basic TMS32010 Hardware Terms ..........................
1 .4.2 References.....................................................

1-1
1-1
1-1
1-2
1-2
1-4
1-6

2.

ARCHITECTURE............................................................
2.1
Architectural Overview .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2. 1. 1 Harvard Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.2 Arithmetic Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1 AlU..........................................................
2.2.1.1
Overflow Mode (DVM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.2.2 Accumulator....................................................
2.2.2.1
Accumulator Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.2.3 Multiplier.......................................................
2.2.4 Shifters........................................................
2.2.4.1
Barrel Shifter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.2.4.2 Parallel Shifter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.3 Data Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.3. 1 Data Memory Addressing ..........................................
2.3.1.1
Indirect Addressing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.3.1.2 Direct Addressing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.3.1.3 Immediate Addressing .....................................
2.4 Registers.............................................................
2.4.1 Auxiliary Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
2.4.2 Auxiliary Register Pointer ...........................................
2.5 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5.1
Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5.1.1
Microcomputer Mode ......................................
2.5. 1.2 Microprocessor Mode ......................................
2.5.2 Using External Program Memory ., ...................................
2.6 Program Counter and Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.1
Program Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.2 Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.2.1
Stack Overflow ..........................................
2.7 Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7. 1 Saving Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.8 Input/Output Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.8.1
IN and OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.8.2 Table Read (TBlR) and Table Write (TBlW) .............................
2.8.3 Address Bus Decoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.9 BID Pin ...............................................................
2.10 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.11 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-12 Clock/Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.13 Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.14 Interrupt and BIO System Design ...........................................

2-1
2-1
2-3
2-3
2-4
2-4
2-4
2-5
2-5
2-5
2-6
2-7
2-7
2-7
2-8
2-8
2-9
2-9
2-9
2-10
2-10
2-11
2-11
2-11
2-12
2-13
2-13
2-13
2-14
2-14
2-15
2-15
2-15
2-17
2-18
2-18
2-18
2-19
2-20
2-21
2-24

iii

3.

INSTRUCTIONS .....................................................................
3. 1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.2 Addressing Modes. ....... ........ .... ... .... .. ..... ....... . . .. .... . .. .. .. ... ....
3.2.1 Direct Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.2.2 Indirect Addressing Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.2.3 Immediate Addressing Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.3
Instruction Addressing Format ............ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.3.1 Direct Addressing Format. . . .. . . . . . .. .. . . .... . . . . .. .. . . . . . . . . . . . .. . . . . . . . ..
3.3.2 Indirect Addressing Format. . . . . . . . . ... . . .... . . . . .. .. . . . . . . . . . . . .. .. . . . . . ..
3.3.3 Immediate Addressing Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.3.4 Examples of Opcode Format. .... ... ...... ..... .. . .. .. .. .. ... .. .. .. .. . . . ....
3.4
Instruction Set .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.4.1 Symbols and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.4.2 Instruction Set Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.4.3 Instruction Descriptions.. . . . . . . . . . . ... . . . ... . . . . .. .. . . .. . . . .. .. .. .. . . . . . ..

3-1
3-1
3-1
3-1
3-1
3-2
3-2
3-2
3-2
3-2
3-3
3-3
3-3
3-5
3-8

4.

METHODOLOGY FOR APPLICATION DEVELOPMENT ..................... ' ............. . 4-1
Outline of Development Process .................................................. . 4-1
4.1
4.2
Description of Development Facilities .............................................. . 4-2
4.2.1 TMS32010 Evaluation Module ............................................ . 4-2
4.2.2 XDS/320 Macro Assembler/Linker ........................................ . 4-2
4.2.3 XDS/320 Simulator ...................................................... . 4-3
4.2.4 XDS /320 Emu lator ...................................................... . 4-4
4.3 Application Development Process Example ......................................... . 4-4
4.3.1 System Specification ..................................................... . 4-4
4.3.2 System Design .......................................................... . 4-5
4.3.3 Code Development ...................................................... . 4-5
4.3.3.1
Discrete-Time Filter Flowchart .................................... . 4-5
4.3.3.2 FORTRAN Program ............................................. . 4-6
4.3.3.3 Assembly Language Program Using Relocatable Code ............... . 4-6
4.3.3.4 Assembly Language Program Using Absolute Code ................. . 4-13

5.

PROCESSOR RESOURCE MANAGEMENT ............................................. .
5.1
FundamentalOperations ........................................................ .
5.1.1 Bit Manipulation ......................................................... .
5.1.2 Data Shift .............................................................. .
5.1.3 Fixed-Point Arithmetic ... " ............................................... .
5. 1.3.1 Multiplication .................................................. .
5. 1 .3.2 Addition ....................................................... .
5.1.3.3 Division ....................................................... .
5.1.4 Subroutines ............................................................ .
5.1.5 Computed GO TOs ....................................................... .
5.2
Addressing and Loop Control with Auxiliary Registers ............................... .
5.2.1 Auxiliary Register Indirect Addressing ...................................... .
5.2.2 Loop Counter ........................................................... .
5.2.3 Combination of Operational Modes ........................................ .
5.3
Multiplication and Convolution ................................................... .
5.3.1 Pipelined Multiplications .................................................. .
5.3.2 Moving Data ............................................................ .
5.3.3 Product Register ......................................................... .
5.4
Memory Considerations of Harvard Architecture .................................... .
5.4.1 Moving Constants into Data Memory ....................................... .
5.4.2 Data Memory Expansion .................................................. .
5.4.3 Program Memory Expansion .............................................. .

iv

5-1
5-1
5-1
5-1
5-2
5-3
5-5
5-5
5-11
5-12
5-13
5-13
5-13
5-14
5-14
5-14
5-15
5-16
5-16
5-16
5-17
5-18

6.

INPUT/OUTPUT DESIGN TECHNIQUES. . . . .. .. . . .. .. . . . .. .. . .. .. . .... .. . . .. . . . . . .. . . . . .
6.1
Peripheral Device Types.. .. .. .. ... . . .. .. .. ... . . .. .. ....... . .... .. . . .. . . . . . .. .. . . .
6.1.1 Registers .............. ~. . . . .. .. .. . . . . . . . .. .... . .. . .... .. . . .. . . . . . .. . . . . .
6.1.2 FIFOs......................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.3 Extended Memory Interface. . . .. .. . . .. . .. . . .. .. . . . .. . .... . . . . .. . . . . . .. . . . . .
6.2 Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2.1 Software Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2.2 Hardware Methods .......................................................

6-1
6-1
6-1
6-2
6-2
6-3
6-3
6-4

7.

MACRO LANGUAGE EXTENSiONS..................................................... 7-1
7. 1 Conventions Used in Macro Descriptions ........................................... 7-1
7.2 Macro Set Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
7.3 Macro Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
7.4 Structured Programming Macros .................................................. 7-148
7.5 Utility Subroutines ............................................................... 7-151

8.

DIGITAL SIGNAL PROCESSING ....................................................... .
8.1
A-to-D and D-to-A Conversion ................................................... .
8. 1 . 1 Sample Analysis ......................................................... .
8.1.2 Sample Quantization ..................................................... .
8.2 Basic Theory of Discrete Signals and Systems ...................................... .
8.2.1 Linear Systems .......................................................... .
8.2.2 Fourier Transform Representations ......................................... .
8.3 Design and Implementation of Digital Filters ........................................ .
8.3.1 Digital Filter Structures ................................................... .
8.3.2 Digital Filter Design ...................................................... .
8.4 Quantization Effects ............................................................ .
8.5 Spectrum Analysis .............................................................. .
8.5.1 Discrete Fourier Transform (DFT) .......................................... .
8.5.2 Fast Fourier Transform (FFT) .............................................. .
8.5.3 Uses of the DFT and FFT ................................................. .
8.5.4 Autoregressive Model .................................................... .
8.6 Potential DSP Applications for the TMS32010 ..................................... .
8.6.1 Speech and Audio Processing ............................................. .
8.6.2 Communications ........................................................ .
8.7 References .................................................................... .

8-1
8-1
8-2
8-5
8-6
8-6
8-7
8-9
8-9
8-13
8-18
8-19
8-19
8-20
8-20
8-23
8-24
8-24
8-26
8-28

v

LIST OF APPENDICES
APPENDIX
A
B
C
D

TMS32010
SMJ32010
TMS32010
TMS32020

PAGE
Digital Signal
Digital Signal
Development
Digital Signal

Processor Data Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Processor Data Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Support and Part Order Information . . . . . . . . . . . . . . . . . . . . . . ..
Processor Data Sheet .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..

A-1
8-1
C-1
D-1

LIST OF ILLUSTRATIONS
FIGURE

PAGE

2-1
2-2
2-3
2-4
2-5
2-6
2-7
2-8
2-9
2-10
2-11
2-12
2-13
2-14
2-1 5
2-16
2-17

Block Diagram of the TMS320M 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Harvard Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Indirect Addressing Autoincrement/Decrement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-9
TMS320 Family Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
External Program Memory Expansion Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
TMS32010 Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Status Word as Stored by SST Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
External Device Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Input/Output Instruction Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Table Read and Table Write Instruction Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Simplified Interrupt Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Interrupt Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19
Reset Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Internal Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
External Frequency Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
TMS3201 0 Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
Interrupt and BIO Hardware Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24

4-1
4-2

Flowchart of Typical Application Development ...... . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Flowchart of Filter Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..

5-1
5-2
5-3

Division Routine I Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 5-7
Division Routine II Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 5-9
Techniques for Expanding Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18

6-1
6-2
6-3

Communication Between Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Typical Analog System Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
TMS32010 Extended Memory Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 6-3

8-1
8-2
8-3
8-4
8-5
8-6
8-7
8-8
8-9
8-10

Block Diagram of Digital Signal Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8-1
Analog-to-Digital Conversion Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8-2
Two Cosine Waves Sampled with Period T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8-3
Frequency Components of Three Cosine Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8-3
D-to-A Conversion Using a Zero-Order Hold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
An Eight-Level (Three-Bit) Quantizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8-5
Quantization as Additive Noise. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8-6
Fourier Transform Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8-8
Direct Forms I and II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10
Cascade Structure for N = 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 2

vi

4-1
4-5

8-11
8-12
8-13
8-14
8-15
8-16
8-17
8-18

Fourth-Order Elliptic Digital Filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Frequency Response of FIR Lowpass Filter ............... . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Impulse Response of Equiripple Lowpass Filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
A Discrete Convolution Using the FFT .................................................
Estimation of Fourier Transform of an Analog Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Short-Time Fourier Analysis of a Doppler Radar Signal .......... . . . . . . . . . . . . . . . . . . . . . . . ..
Spectrum Estimation for Speech Signals ...............................................
Block Diagram of a Digital Modem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..

8-14
8-17
8-18
8-21
8-22
8-22
8-24
8-27

LIST OF TABLES
TABLE

PAGE

1-1

TMS32010 Hardware Terminology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1-5

2-1
2-2
2-3
2-4

Accumu lator Results ................................................................ 2-4
Accumulator Test Conditions. . . . . .. . . . . .. . . . . . . . . . .. . . .. . . . . . .. .. . . . . .. .. . . .. . . . . . . .. 2-5
Program Memory for the TMS320 Family .............................................. 2-11
TMS32010 Pin Descriptions .......................................................... 2-21

3-1
3-2

Instruction Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Instruction Set Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..

3-4
3-5

4-1

Filter Specifications .................................................................

4-4

7 -1
7-2

Macro Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Macro Set Summary ................................................... , .. ...... .. ..

7-2
7-4

vii

viii

FOREWORD
Digital Signal Processing (DSP) is concerned with the representation of signals (and the information that
they contain) by sequences of numbers, and the transformation or processing of such signal
representations by numerical computation procedures.
Since the late 1950's, scientists and engineers in research labs have been touting the virtues of digital signal
processing, but practical considerations have prevented widespread application. Now, with the availability
of integrated circuits, such as Texas Instruments' TMS320, digital signal processing is leaving the
laboratory and entering the world of application. The reasons for this are numerous and compelling.
Perhaps the most important reason is that extremely sophisticated signal processing functions can be
implemented using digital techniques. Indeed, many of the important DSP techniques are difficult or
impossible to implement using analog (continuous-time) methods. It is almost equally important that VLSI
technology is best suited to the implementation of digital systems, which are inherently more reliable, more
compact, and less sensitive to environmental conditions and component aging than analog systems.
Another advantage of the discrete-time approach is the possibility of time sharing a single processing unit
among a number of different signal processing functions. This is particularly efficient and cost effective in
large systems having many input and output channels. Indeed, until recently, digital processing was only
cost effective where it could be applied in large systems. Now, however, with VLSI techniques, low-cost
processors such as the TMS32010 are available and a wealth of opportunities exist for the application of
DSP techniques.
The potential applications will be found in any area where signals arise as representations of information. In
many cases, the signals represent information about the state of some physical system (including human
beings). Often, the objective in processing the signal is to prepare the signal for digital transmission to a
remote location or for digital storage of the information for later reference. On the other hand, the signal
may be processed to remove distortions introduced by transducers, the signal generation environment, or
by a transmission system. Still another important class of applications arises when information is
automatically extracted from the signal so as to control another system or to infer something about the
properties of the system which generated the signal. Some of the more important areas where the above
types of processing are of interest include speech communication, geophysical exploration,
instrumentation for chemical analysis, image processing for television, audio recording and reproduction,
biomedical instrumentation, acoustical noise measurements, sonar, radar, automatic testing of systems,
and consumer electronics.
In areas such as speech communication research and geophysical exploration, digital signal processing
techniques already have been widely applied using general-purpose digital computers. In other areas,
eConomic factors or processing speed have had limited applications up to recent times. Now, however,
these limitations are subsiding rapidly and digital signal processing will soon be widely used in all the above
mentioned areas and many more.

Ronald W. Schafer
Russell M. Mersereau
Thomas P. Barnwell, III
Atlanta Signal Processors, Inc.
and
Georgia Institute of Technology
School of Electrical Engineering

ix

x

I

INTRODUCTION

1.

INTRODUCTION

1.1

GENERAL DESCRIPTION
The TMS32010 is the first member of the new TMS320 digital signal processing family, designed to
support a wide range of high-speed or numeric-intensive applications. This 16/32-bit single-chip
microcomputer combines the flexibility of a high-speed controller with the numerical capability of
an array processor, thereby offering an inexpensive alternative to multichip bit-slice processors.
The TMS320 family contains the first MOS microcomputers capable of executing five million
instructions per second. This high throughput is the result of the comprehensive, efficient, and
easily programmed instruction set and of the highly pipelined architecture. Special instructions have
been incorporated to speed the execution of digital signal processing (DSP) algorithms.
Development support is available for a variety of host computers. This includes a macro assembler,
linker, simulator, emulator, and evaluation module.

1.2 TYPICAL APPLICATIONS
The TMS320 family's unique versatility and power give the design engineer a new approach to a
variety of complicated applications. In addition, these digital signal processors are capable of
providing the multiple functions often required for a single application. For example, the TMS320
family can enable an industrial robot to synthesize and recognize speech, sense objects with radar
or optical intelligence, and perform mechanical operations through digital servo loop computations.
Some typical applications of the TMS320 family are listed below.

SIGNAL PROCESSING

TELECOMMUNICATIONS

IMAGE PROCESSING

•

Digital filtering

•

Adaptive equalizers

•

Pattern recognition

•

Correlation

•

JL/A law conversion

•

Image enhancement

•

Hilbert transforms

•

Time generators

•

Image compression

•
•

Windowing
Fast Fourier transforms

•

High-speed modems

•

Homomorphic processing

•

Multiple-bit-rate modems

•

Radar and sonar processing

•

Adaptive fiJtering

•

Amplitude, frequency, and phase

•

Waveform generation

•

Speech processing

•

Data encryption

•

Servo links

•

Radar and sonar processing

•

Data scrambling

•

Position and rate control

•

Electronic counter measures

•

Digital filtering

•

Motor control

•

Seismic processing

•

Data compression

•

Missile guidance

•

Spread-spectrum communications

•

Remote feedback control

•

Robotics

INSTRUMENTA TlON

modulation/demodulation

NUMERIC PROCESSING

HIGH-SPEED CONTROL

SPEECH PROCESSING

•

Spectrum analysis

•

Fast multiply/divide

•

Speech analysis

•

Digital filtering

•

Double-precision operations

•

Speech synthesis

•

Phase-locked loops

•

Fast scaling

•

Speech recognition

•
•

Averaging
Arbitrary waveform generation

•

Non-linear function

•

Voice store and forward

•

Transient analysis

computation

•

Vocoders

(i.e., sin x, eX)

•

Speaker authentification

1-1

I

1.3

KEY FEATURES
With an excellent combination of features, the TMS320 family of high-peformance digital signal
processors is a cost-effective alternative to custom VLSI devices and bit-slice systems.
• 200-ns instruction cycle
• 2SS-byte on-chip data RAM
• Microprocessor version - TMS3201 0

I

• Microcomputer version - TMS320M10 -

(3K-byte on-chip program ROM)

• External program memory expansion to a total of SK bytes at full speed
• 16-bit instruction/data word
• 32-bit ALU/accumulator
• 16 x 16-bit multiply in 200 ns
• 0 to 15-bit barrel shifter
• Eight input and eight output channels
• 16-bit bidirectional data bus with 40-megabits-per-second transfer rate
• Interrupt with full context save
• Signed two's complement fixed-point arithmetic
• 2.7-micron NMOS technology
• Single 5- V supply
• 40-pin DIP
The TMS320M10 and the TMS32010 are exactly the same with one exception: the TMS320M10
contains an on-chip masked ROM while the TMS32010 utilizes off-chip program memory.
NOTE
Throughout this document, TMS32010 will refer to both the TMS32010 and the
TM S320 M 10 except where otherwise indicated.

1.4

HOW TO USE THE TMS32010 MANUAL
It is the intent in the design of this user's guide that it be an effective reference book that provides
information for both the hardware and the software engineer about the TMS32010 digital signal
processor, its architecture, instruction set, electrical specifications, interface methods, and
applications.

1-2

(mnemonic)

(mnemonic)

(title of instruction)

Addressing:
Operands:
Operation:
Encoding:

15

14

13

12

11

10

9

8

7

6

5

4

3

I

a

2

Description:
Words:
Cycles:
Example:
BEFORE INSTRUCTION

31

a

AFTER INSTRUCTION

31

a

In the architecture section (Section 2), the design of the device and its hardware features are
described. The instruction section (Section 3) explains individual instructions in detail. The
following format is used for the instruction descriptions in Section 3.4.3 to provide ease of reading
and application.
Section 4 on methodology for application development describes the tools, such as an emulator or
evaluation module, that are available for developing an individual system and gives an example of
TMS32010 software development. In the processor resource management section (Section 5), the
engineer finds a description of the common algorithms or practices to be used for any application.
He becomes familiar with interface techniques in the input/output design techniques section
(Section 6).
The set of macros in the macro language extensions section (Section 7) aids the engineer in
programming and in providing templates for further software development. Another special format
is used for the macro descriptions in Section 7.2. Each macro instruction is named, followed by a
summary table. A flowchart serves to clarify the macro source which is given. Examples of macro
use are also presented. This macro description format is as follows:

1-3

(mnemonic)
TITLE:

(macro)

NAME:

(mnemonic)

(mnemonic)

(title of macro)

OBJECTIVE:

I

ALGORITHM:
CALLING
SEQUENCE:
ENTRY
CONDITIONS:
EXIT
CONDITIONS:
PROGRAM
MEMORY
REQUIRED:

(#words)

DATA
MEMORY
REQUIRED:

STACK
REQUIRED:

(# levels)

EXECUTION
(# cycles)
TIME:

(#words)

FLOWCHART:
SOURCE:
EXAMPLE 1:
EXAMPLE 2:

Section 8 on digital signal processing contains an overview of signal processing theory, algorithms,
and potential applications. The TMS32010 data sheet appears as Appendix A and the SMJ32010
data sheet as Appendix B. Data descriptions of the evaluation module, macro assembler/linker,
simulator, and emulator are presented in Appendix C.

1.4.1

Glossary of Basjc TMS32010 Hardware Terms
Table 1-1 lists in alphabetical order the TMS3201 0 basic hardware units, the symbol for the unit (if
any), and the function of that particular unit.

1-4

TABLE 1-1 - TMS32010 HARDWARE TERMINOLOGY

UNIT

SYMBOL

FUNCTION

Accumulator

ACC

32-bit accumulator

Arithmetic Logic Unit

ALU

Two-port 32-bit arithmetic logic unit

Auxiliary Registers

ARO, AR1

Two 16-bit registers for indirect addressing of data
memory and loop counting control. Nine LSBs of each
register are configured as bidirectional counters

Auxiliary Register Pointer

ARP

Single-bit register
auxiliary register

Data Bus

D Bus

16-bit bus routing data from random access memory

Data Memory Page Pointer

DP

containing

address

of

current

Single-bit register containing page address of data RAM
(1 page
128 words)

=

144 X 16 bit word on-chip random access memory
containing data

Data RAM

Interrupt Flag Register

INTF

Single-bit flag register that indicates an interrupt
request has occurred (is pending)

Interrupt Mode Register

INTM

Single-bit mode register that masks the interrupt flag
16 X 16-bit parallel hardware multiplier

Multiplier
Overflow Flag Register

Overflow Mode Register

P Register
Program Bus
Program Counter

I

OV

Single-bit flag register that indicates an overflow in
arithmetic operations

OVM

Single-bit mode register that defines a saturated or
unsaturated mode in arithmetic operations

P

32-bit register containing product of multiply operations

P Bus

16-bit bus routing instructions from program memory

PC

12-bit register containing address of program memory

Program ROM

1 536 X 1 6-bit word read only memory containing program code (TMS320M 10 only)

Shifter

Two shifters: one is a variable 0-15-bit left-shift barrel
shifter that moves data from the RAM into the ALU.
The other shifter acts on the accumulator when it is
being stored in data RAM; it can left-shift by 0, 1, or 4
bits.

Stack

4 X 12-bit registers for saving program counter contents
in subroutine and interrupt calls

T Register

T

16-bit register containing multiplicand during multiply
operations

1-5

1.4.2

References

The following list of references, including textbooks, contains useful information regarding
functions, operations, and applications of digital processing. These books, in turn, list other
references to many useful technical papers.

Andrews, H.C., Hunt, B. R., DIGITAL IMAGE RESTORATION. Englewood Cliffs, N.J.:
Prentice-Hall, Inc., 1977 .

I

Brigham, E. Oran, THE FAST FOURIER TRANSFORM. Englewood Cliffs, N.J.: Prentice-Hall,
Inc., 1974.
Hamming, R.W., DIGITAL FILTERS. Englewood Cliffs, N.J.: Prentice-Hall, Inc., 1977.
Morris, L. Robert, DIGITAL SIGNAL PROCESSING SOFTWARE. Ottawa, Canada: Carleton
University, 1983.
Oppenheim, Alan V. (Editor), APPLICATIONS OF DIGITAL SIGNAL PROCESSING.
Englewood Cliffs, N.J.: Prentice-Hall, Inc., 1978.
Oppenheim, Alan V., Schafer, R.W., DIGITAL SIGNAL PROCESSING. Englewood Cliffs,
N.J.: Prentice-Hall, Inc., 1975.
Rabiner, Lawrence R., Gold, Bernard, THEORY AND APPLICATION OF DIGITAL SIGNAL
PROCESSING. Englewood Cliffs, N.J.: Prentice-Hall, Inc., 1975.
Rabiner, Lawrence R., Schafer, R.W., DIGITAL PROCESSING OF SPEECH SIGNALS.
Englewood Cliffs, N.J.: Prentice-Hall, Inc., 1978.

1-6

I

ARCHITECTURE

2.

ARCHITECTURE
The TMS320 family utilizes a modified Harvard architecture for speed and flexibility (see Figure 2-1).
In a strict Harvard architecture, program and data memory lie in two separate spaces, permitting a
full overlap of the instruction fetch and execution. The TMS320 family's modification of the Harvard
architecture allows transfers between program and data spaces, thereby increasing the flexibility of
the device. This modification permits coefficients stored in program memory to be read into the
RAM, eliminating the need for a separate coefficient ROM. It also makes available immediate
instructions and subroutines based on computed values.
The TMS32010 utilizes hardware to implement functions that other processors typically perform in
software. For example, the TMS3201 0 contains a hardware multiplier to perform a multiplication in
a single 200-ns cycle. There is also a hardware barrel shifter for shifting data on its way into the
ALU. Finally, extra hardware has been included so that the auxiliary registers, which provide
indirect data RAM addresses, can be configured in an autoincrement/ decrement mode for singlecycle manipulation of data tables. This hardware-intensive approach gives the design engineer the
type of power previously unavailable on a single chip.

2.1

ARCHITECTURAL OVERVIEW
The TMS32010 microcomputers combine the following elements onto a single chip:
•

Volatile 144 x 16-word read/write data memory

•

Non-volatile 1536 X 16-word program memory (TMS320M10 only)

•

Double-precision 32-bit ALU/accumulator

•

Fast 200-ns multiplier

•

Barrel shifter for shifting data memory words into the ALU

•

Shifter that shifts the accumulator into the data RAM

•

16-bit data bus for fetching instruction words from off-chip at full speed

•

4 X 12-bit stack that allows context switching

•

Autoincrementing/decrementing registers for indirect data addressing and loop counting

•

Single-vectored interrupt

•

On-chip oscillator

This section provides a description of these elements. The generic term JTMS3201 0' is used to refer
collectively to the TMS32010 and TMS320M10.

2-1

I

z

~

~

=>

.....J

0

U

~

.....J

X

U

WE
DEN
MEN
BIO

I

MC/MP
INT
RS

N

X

+++

....

---.......

j6

~ 12 LSB

a:

..-

UJ
.....J
.....J

....

-...

~

0
a:

\

,12

0

u

......

I

'~16

PC (12)

INSTRUCTION

...

)'12

-

A ll-AO/
PA2-PAO

MUX

T

I

~

z

..

4~

t ~,

~r

fx -....

w

a:

Cl
Cl

STACK
4 x 12

....

(j)
CJ)

<{

PROGRAM
ROM
(1536 x 16)

I~
............

3

D15-DO

PROGRAM BUS

/

/
4~

~16

~ r 16

16

,

ARO (16) :
ARP .....- - + - - -........---11----1
ARl (16) I

~.

,V

,

T(16)
16

SHIFTER
(0-15)

I

./8

MULTIPLIER

,

P(32)

~

7 32

ADDRESS
DATA RAM
(144 x 16)
N OTE:

ACC
ARP
ARO
AR1
DP
PC
P
T

=
=
=
=
=
=
=
=

,

DATA

Accumulator

I

'\

+

~
32

r

I

/

ALU (32)

"I" 32

32

,~

Auxiliary register pointer
Auxiliary register 0

ACC (32)

Auxiliary register 1
Data page pointer

32

Program counter
P Register

~

+

if'
16

T Register

I
DATA BUS

FIGURE 2-1 -

/32

SHIFTER (0. 1, 4)
16

/

2-2

~ 32

~r

BLOCK DIAGRAM OF THE TMS320M10

,V

16.

~

2.1.1

Harvard Architecture
The TMS320 10 utilizes a modified Harvard architecture in which program memory and data memory
lie in two separate spaces. This permits a full overlap of instruction fetch and execution.
Program memory can lie both on-chip (in the form of the 1536 X 16-word ROM) and off-chip. The
maximum amount of program memory that can be directly addressed is 4K X 16-bit words.
Instructions in off-chip program memory are executed at full speed. Fast memories with access
times of under 100 ns are required.
Data memory is the 144 X 16-bit on-chip data RAM. Instruction operands are fetched from this
RAM; no instruction operands can be directly fetched from off-chip. However, data can be written
into the data RAM from a peripheral by using the IN instruction or read from program memory by
using the TBlR (table read) instruction. The OUT instruction will write a word from the data RAM
to a peripheral, while a TB lW instruction will write a data RAM word to program memory
(presumably, off-chip).
Figure 2-2 outlines the overlap of the instruction prefetch and execution. On the falling edge of
ClKOUT, the program counter (PC) is loaded with the instruction (load PC2) to be prefetched while
the current instruction (execute 1) is decoded and is started to be executed. The next instruction is
then fetched (fetch 2) while the current instruction continues to execute (execute 1). Even as
another prefetch occurs (fetch 3), both the current instruction (execute 2) and the previous
instruction are still executing. This is possible because of a highly pipelined internal operation.

CLKOUT

1..__. . .

L

LOAD

PC 1
.....

•

FETCH 1

•

•LOAD

EXECUTE 1

•

PC 2
......

•

FETCH 2

••
LOAD
PC 3
........

•

EXECUTE 2

FETCH 3

•

..

EXECUTE 3
• ~--------------------~.

FIGURE 2-2 - HARVARD ARCHITECTURE

2.2 ARITHMETIC ELEMENTS
There are four basic arithmetic elements: the AlU, the accumulator, the multiplier, and the shifters.
All arithmetic operations are performed using two's complement arithmetic (see Section 5.1.3).
Most arithmetic instructions will access a word in the data RAM, either directly or indirectly, and
pass it through the barrel shifter. This shifter can left-shift a word 0 to 15 bits, depending on the
value specified by the instruction. The data word then enters the ALU where it is loaded into or
added/subtracted from the accumulator. After a result is obtained in the accumulator, it can be
stored in the data RAM. Since the accumulator is 32 bits, both halves must be stored separately. A
parallel left-shifter is present at the accumulator output to aid in scaling results as they are being
moved to the data RAM.
2-3

2.2.1

ALU
The ALU is a general-purpose arithmetic logic unit that operates with a 32-bit data word. The unit
will add, subtract, and perform logical operations. The accumulator is always the destination and
the primary operand. The result of a logical operation is shown in Table 2-1 . A data memory value is
the operand for the lower half of the accumulator (bits 15 through 0), Zero is the operand for the
upper half of the accumulator.

TABLE 2-1 - ACCUMULATOR RESULTS

FUNCTION

I

e (ACC

XOR

(zero)

AND

(zero) . (ACC bits 31-16)

OR

2.2.1.1

ACCUMULATOR RESULT
ACC BITS 15 THROUGH 0
ACC BITS 31 THROUGH 16

(zero)

+

bits 31-16)

(ACC bits 31-16)

(data memory value)

e

(ACe bits 15-0)

(data memory value) . (ACC bits 15-0)
(data memory value)

+ (ACC

bits 15-0)

Overflow Mode (OVM)
The OVM register is directly under program control, i.e., it is set by the SOVM instruction and reset
by the ROVM instruction. If an overflow occurs when set, the most positive or the most negative
representable value of the ALU will be loaded into the accumulator. Whether it is the most positive
or the most negative value is determined by the overflow sign. If an overflow occurs when reset, the
accumulator is unmodified. (See the SOVM instruction in Section 3.4.3 for further information and
an example.)
In signal processing, arithmetic overflows can create special problems. Since overflows can cause
swings between very large and very small numbers, they will often result in erratic system behavior.
The TMS3201 0 has been designed with a special overflow mode to compensate for this behavior.
When the overflow mode register (OVM) is set by the SOVM instruction (i.e., 1 -+ OVM), an
overflow will cause the largest/smallest representable value of the ALU to be loaded into the
accumulator. This models the saturation processes inherent in analog systems. When the overflow
mode register (OVM) is reset by the ROVM instructions (i.e., 0 --+ OVM), overflow results are loaded
into the accumulator without modification.
The OVM register can be stored in data memory as a single-bit register that is part of the status
register (see Section 2.7). It should not be confused with the overflow flag (OV), explained in
Section 2.2.2.1.

2.2.2

Accumulator
The accumulator stores the output from the ALU and is also often an input to the ALU. It operates
with a 32-bit word length. The accumulator is divided into a high-order word (bits 31 through 16)
and a low-order word (bits 15 through 0). Instructions are provided for storing the high and loworder accumulator words in data memory (SACH and SACL).

2-4

2.2.2.1

Accumulator Status
Accumulator overflow status can be read from the accumulator overflow flag register (OV). This
register will be set if an overflow occurs in the accumulator. Since the OV register is part of the
status register (see Section 2.7), OV status can be stored in data memory. Once the overflow flag
register is set, only the execution of the branch on overflow (BV) instruction or direct modification
of the status register can clear it. This feature permits the examination of overflow results outside of
time-critical loops.
A variety of other accumulator conditions can be tested by the branch instructions given in Table
2-2. These instructions will cause a branch to be executed if the condition is met.
TABLE 2-2 -

INSTRUCTION

Bll
BlEl
BGl
BGEl
BNl
Bl

2.2.3

I

ACCUMULATOR TEST CONDITIONS

ACCUMULATOR CONDITION TESTED

<0
~O

>0
~O

<>0
=0

Multiplier
The 16 X 16-bit parallel multiplier consists of three units: the T register, the P register, and the
multiplier array. The T register is a 16-bit register that stores the multiplicand, while the P register is
a 32-bit register that stores the product.
In order to use the multiplier, the multiplicand must first be loaded into the T register from the data
RAM by using one of the following instructions: LT, LTA, or LTD. Then the MPY (multiply) or the
MPYK (multiply immediate) instruction is executed. If the MPY instruction is used, the multiplier
value is a 16-bit number from the data RAM. If the MPYK instruction is used, the multiplier value is
a 13-bit immediate constant derived from the MPYK instruction word; this 13-bit constant is right
justified and sign extended. After execution of the MPY or MPYK instruction, the product will be
found in the P register. The product can then be added to, subtracted from, or loaded into the
accumulator by executing one of the following instructions: APAC, SPAC, LTA, LTD, or PAC.
Pipelined multiply and accumulate operations at 400-ns rates can be accomplished with the
LTAIL TO and MPY IMPYK instructions (see Section 3.4.3 for greater detail).
There is no convenient way to restore the contents of the P register without altering other registers.
For this reason, special hardware has been incorporated in the TMS32010 to inhibit an interrupt
from occurring until the instruction following the MPY or MPYK instruction has been executed.
Thus, the M PY or M PYK instruction should always be followed by instructions that combine the P
register with the accumulator: PAC, APAC, SPAC, LTA, or LTD. This is almost always done as a
logical consequence of the TMS3201 0 instruction set.

2.2.4

Shifters
There are two shifters available for manipulating data: a barrel shifter for shifting data from the data
RAM into the ALU and a parallel shifter for shifting the accumulator into the data RAM.

2-5

2.2.4.1

Barrel Shifter
The barrel shifter performs a left-shift of 0 to 15 places on all data memory words that are to be loaded into, subtracted from, or added to the accumulator by the LAC, SUB, and ADD instructions.
The barrel shifter zero-fills the low-order bits and sign-extends the 16-bit data memory word to 32
bits by what is called an arithmetic left-shift. An arithmetic left-shift means that the bits to the left of
the M S B of the data word are filled with ones if the M S B is a one or with zeros if the M S B is a zero.
This is different from a logical left-shift where the bits to the left of the MSB are always filled with
zeros. A small amount of code is required to perform an arithmetic right-shift or a logical right-shift
(see Section 5.1.2).
The following examples illustrate the barrel shifter's function:

I

EXAMPLE 1:
Data memory location 20 holds the two's complement number:

> 7EBC

The load accumulator (LAC) instruction is executed, specifying a left-shift of 4:
LAC 20,4
The accumulator would then hold the following 32-bit signed two's complement number:

31

16 15
000

Since the MSB of

7

0
E

> 7EBC is a zero,

B

C

0

the upper accumulator was zero-filled.

EXAMPLE 2:
Data memory location 30 holds the two's complement number:

> 8EBC

The LAC instruction is executed, specifying a left-shift of 8:
LAC 30,8
The accumulator would then hold the following 32-bit signed two's complement number:

F

Since the MSB of

2-6

>

o

16 15

31
F

8

E

B COO

8EBC is a one, the upper accumulator was filled with ones.

There are also instructions that perform operations with the lower half of the accumulator and a
data word without first sign-extending the data word (i.e., treating it as a 16-bit rather than a 32-bit
word). The mnemonics of these instructions typically end with an liS," indicating that signextension is suppressed (e.g., ADDS, SUBS). Along with the instructions that operate on the
upper half of the accumulator, these instructions allow the manipulation of 32-bit precision
numbers.
2.2.4.2

Parallel Shifter
The parallel shifter is activated only by the store high-order accumulator word (SACH) instruction.
This shifter left-shifts the entire 32-bit accumulator and places 16 bits into the data RAM, resulting
in a loss of the accumulator's high-order bits. This shifter can execute a shift of only 0, 1, or 4.
Shifts of 1 and 4 were chosen to be used with multiplication operations (see Section 5.1.3.1). No
right-shift is directly implemented. The following example illustrates the accumulator shifter's
function:
EXAMPLE:
The accumulator holds the 32-bit two's complement number:

31

o

16 15
A

3

4

B

7 8

C 0

The SACH instruction is executed, specifying that a left-shift of four be performed on the
high-order accumulator word before it is stored in data memory location 40:
SACH 40,4
Data memory location 40 then contains the following number:
retains> A34B78CD.

2.3

>

34B7. The accumulator still

DATA MEMORY
Data memory consists of the 144 words of 16-bit width of RAM present on-chip. All non-immediate
data operands reside within this RAM.
Sometimes it is convenient to store data operands off-chip and then read them into the on-chip
RAM as they are needed. Two means are available for doing this. First, there are the table read
(TBlR) and the table write (TBlW) instructions. The table read (TBlR) instruction can transfer
values from program memory, either on-chip ROM or off-chip PROM/RAM, to the on-chip data
RAM. The table write (TBlW) instruction transfers values from the data RAM to program memory,
presumably in the form of off-chip RAM. These instructions take three cycles to execute. The IN
and OUT instructions provide another method. The IN instruction reads data from a peripheral and
transfers it to the data RAM. With some extra hardware, the IN instruction, together with the OUT
instruction, can be used to read and write from the data RAM to large amounts of external storage
addressed as a peripheral (see Section 3.4.3). This method is faster since IN and OUT take only two
cycles to execute.

2.3.1

Data Memory Addressing
There are three forms of data memory addressing: indirect, direct, and immediate.
2-7

I

2.3.1.1

Indirect Addressing
Indirect addressing uses the lower eight bits of the auxiliary registers as the data memory address
(see Section 2.4.1). This is sufficient to address all 144 data words; no paging is necessary with
indirect addressing. The current auxiliary register is selected by the auxiliary register pointer (ARP).
In addition, the auxiliary registers can be made to autoincrement/ decrement during any given
indirect instruction. The increment/decrement occurs AFTER the current instruction is finished
executing.
Some examples of indirect addressing are given below. ARO and AR 1 are predefined assembler
constants with values of 0 and 1, respectively.
Each of the following examples should be viewed as a complete program sequence, rather than
separate isolated statements. Indirect addressing is indicated by an asterisk (*) in these examples
and in the TMS32010 assembler.

I

EXAMPLE 1:
LARP ARO

Load ARP with a zero. This sets ARO as the
current auxiliary register.
Load ARO with a 5.
Add contents of data memory location 5 to
accumulator.
Add contents of data memory location 5 to
accumulator and increment ARO. ARO now
equals 6.
Add contents of data memory location 6 to
accumulator and decrement ARO. ARO now
equals 5.
Add contents of data memory location 5 to
accumulator.

LARK ARO,5
ADD *
ADD *+

ADD *-

ADD *

EXAMPLE 2:
LARK ARO,10
LARK AR1,20
LARP 1
ADD *,O,ARO

ADD * + ,0,AR1

2.3.1.2

Load ARO with the value 10.
Load AR1 with the value 20.
Set ARP to one. This selects AR1 as the current
auxiliary register.
Add contents of data memory location 20 to
accumulator with no shift, then load ARP with
0, selecting ARO as the current auxiliary register.
Add contents of data memory location 10 to
accumulator with no shift, then increment ARO
to have value 11, and load AR P with 1, selecting
AR 1 as the cu rrent auxiliary register.

Direct Addressing
In direct addressing, seven bits of the instruction word are concatenated with the data page pointer
(DP) to form the data memory address. Thus, direct addressing uses the following paging scheme:
DP

o
1
2-8

MEMORY LOCATIONS
0 - 127
128 - 144

Usually the second page of data memory contains infrequently accessed system variables, such as
those used by the interrupt routine.
DP is part of the status register and thus can be stored in data memory (see Section 2.7).
2.3.1.3

Immediate Addressing

The TMS32010 instruction set contains special "immediate" instructions, such as MPYK, LACK,
and LARK. These instructions derive data from part of the instruction word rather than from the
data RAM.
2.4
2.4.1

REGISTERS

I

Auxiliary Registers
There are two 16-bit hardware registers, the auxiliary registers, that are not part of the 144 X 16-bit
data RAM. These auxiliary registers can be used for three functions: temporary storage, indirect
addressing of data memory, and loop control.
Indirect addressing utilizes the least significant eight bits of an auxiliary register as the data memory
address (see Section 2.3.1.1).
The branch on auxiliary register not zero (BANZ) instruction permits these registers to also be used
as loop counters. BANZ checks if an auxiliary register is zero. If not, it decrements and branches.
Thus, loops can be implemented as follows:

LOOP

LARP

ARO

LARK

ARO,5

Load ARP with 0, selecting ARO as the current auxiliary
register.
Load ARO with 5.

ADD
BANZ

*

Indirectly add data memory to accumulator.

LOOP

The above program segment adds data memory locations 5 through 0 to the accumulator.
When the auxiliary registers are autoincrementedl decremented by an indirect addressing
instruction or by BANZ, the lowest nine bits are affected, one more than the lowest eight bits used
for indirect addressing (see Figure 2-3A). This counter portion of an auxiliary register is a circular
counter, as shown in Figures 2-3B and 2-3C.

COUNTER

15

o
INDIRECT ADDRESS

FIGURE 2-3A - AUXILIARY REGISTER COUNTER

2-9

15

AR

o

8

UNAFFECTED

1 1 1 1 1 1 1 1 1

INCREMENT

AR

o

8

15

UNAFFECTED

0 0 0 0 0 0 0 0 0

FIGURE 2-38 - AUTOINCREMENT

15

I

AR

o

8

UNAFFECTED

111111111

DECREMENT
15

AR

UNAFFECTED

FIGURE 2-3C - AUTODECREMENT
FIGURE 2-3 -

INDIRECT ADDRESSING AUTOINCREMENT/DECREMENT

The upper seven bits of an auxiliary register (i.e., bits 9 through 15) are unaffected by any
autoincrement/decrement operation. This includes autoincrement of 111111111 (the lowest nine
bits go to 0) and autodecrement of 000000000 (the lowest nine bits go to 111111111 ) ; in each case,
bits 9 through 15 are unaffected.
The auxiliary registers can be saved in and loaded from the data RAM with the SAR (store auxiliary
register) and LAR (load auxiliary register) instructions. This is useful for performing context saves.
SAR and LAR transfer entire 16-bit values to and from the auxiliary registers even though indirect
addressing and loop counting utilize only a portion of the auxiliary register.
2.4.2

Auxiliary Register Pointer

The auxiliary register pointer (ARP) is a single bit which is part of the status register. It indicates
which auxiliary register is current as follows:
ARP

CURRENT AUXILIARY REGISTER

o

ARO

1

AR1

As part of the status register, the ARP can be stored in memory.

2.5

PROGRAM MEMORY
Program memory consists of up to 4K words of 16-bit width. The TMS320M1 0 has 1536 words of
on-chip ROM, while the TMS32010 is ROMless. Program memory mode of operation is controlled
by the MC/MP pin.

2-10

2.5.1

Modes of Operation

There are two modes of operation defined by the state of the MC/MP pin: the microcomputer
mode and the microprocessor mode. A one (high) level on this pin places the device in the
microcomp'uter mode, and a zero (low) level places a device in the microprocessor mode.
Table 2-3 illustrates the program memory capability of the TMS3201 0 microcomputers for each of
the two modes of operation enabled by the MC/MP pin. Figure 2-4 shows the memory map for
each setting of the MC/MP pin.
2.5.1.1

Microcomputer Mode (TMS320M10)
The microcomputer mode is defined by a one level on the MC/MP pin. Even though the
TMS320M10 has a 1536 X 16-bit on-chip ROM, only locations 0 through 1523 are available for the
user's program. Locations 1524-1535 are reserved by Texas Instruments for testing purposes. The
device architecture allows for an additional 2560 words of program memory to reside off-chip.

2.5.1.2

Microprocessor Mode (TMS320M10 and TMS32010)
The microprocessor mode is defined by a zero level on the MC/MP pin. All 4K words of memory
are external in this mode.

TABLE 2-3 -

MODEL

PROGRAM MEMORY FOR THE TMS320 FAMILY

PROGRAM
MEMORY OPTIONS

MICROCOMPUTER
MODE MEMORY
MC/MP= 1

MICROPROCESSOR
MODE MEMORY
MC/MP=O

TMS320M10

Microcomputer and
microprocessor modes

1 536 words on-chip ROM
and 2560 words of external
memory

4096 words of external
memory

TMS32010

Microprocessor mode only

Not available

4096 words of external
memory

After reset, the TMS3201 0 microcomputers will begin execution at location O. Usually a branch
instruction to the reset routine is contained in locations 0 and 1. Upon interrupt, the TMS32010
microcomputers will begin execution at location 2.

2-11

I

ADDRESS
0

MICROCOMPUTER MODE

MICROPROCESSOR MODE

MC/MP = 1

MC/MP = 0

16-BIT WORD

ADDRESS

RESET 1 ST WORD
RESET 2ND WORD

2

INTERRUPT

I

o

16-BIT WORD
RESET 1 ST WORD
RESET 2ND WORD

INTERNAL

2

INTERRUPT

MEMORY
SPACE

1523
1524

I

-1
,

EXTERNAL

INTERNAL

MEMORY

MEMORY

SPACE

SPACE

RESERVED

1535
1536

FOR TESTING

EXTERNAL
MEMORY
SPACE

,:.;

~

4095

4095

FIGURE 2-4 - TMS320 FAMILY MEMORY MAP

2.5.2

Using External Program Memory
Twelve output pins are available for addressing external memory. These pins are coded Al1 (MSB)
through AO (LSB) and contain the buffered outputs of the program counter or the I/O port address.
When an instruction is fetched from off-chip, the MEN (memory enable) strobe will be generated to
enable the external memory. The instruction word is then transferred to the TMS3201 0 by means of
the data bus. (See Section 2.8.)
When in the microcomputer mode, the TMS320M10 will internally select address locations 1535
and below from the on-chip program memory. The MEN strobe will still become active in this mode,
and the address lines A 11 through AO will still output the current value of the program counter
although the instruction word will be read from internal program memory.
Figure 2-5 gives an example of external program memory expansion. Even when executing from external memory, the TMS3201 0 performs at its full 200-ns instruction cycle. Fast memories under
100-ns access time must be used.
MEN is never active at the same time as the WE or DEN signals. In effect, MEN will go low every
clock cycle except when an I/O function is being performed by the IN, OUT, or TBLW instructions.
In these multicycle instructions, MEN goes low during the clock cycles in which WE or DEN do not
go low.

2-12

TMS32010

-

I

I

16
ADDRESS LINES

MC/MP
-WE

DATA LINES

4K X 16

,

STATIC RAM

12

ANDIOR PROM

-MEN
OUTPUT
ENABLE

CHIP
SELECT

(Only for
RAM)

~W RITE

EN ABLE

-T

I

FIGURE 2-5 - EXTERNAL PROGRAM MEMORY EXPANSION EXAMPLE

2.6

PROGRAM COUNTER AND STACK
The program counter (PC) and stack enable the user to perform branches, subroutine calls, and
interrupts, and to execute the table read (TBlR) and table write (TBlW) instructions (see Section
3.4.3).

2.6.1

Program Counter
The program counter (PC) is a 12-bit register that contains the program memory address of the next
instruction to be executed. The device reads the instruction from the program memory location
addressed by the PC and increments the PC in preparation for the next instruction prefetch. The PC
is initialized to zero by activating the reset (RS) line.
In order to permit the use of external program memory, the PC outputs are buffered to the output
pins, A 11 through AO. The PC outputs appear on the address bus during all modes of operation.
The nine MSBs (A 11 through A3) of the PC have unique outputs assigned to them, while the three
lSBs are multiplexed with the port address field, PA2 through PAO. The port address field is used
by the I/O instructions, IN and OUT.
Program memory is always addressed by the contents of the PC. The contents of the PC can be
changed by a branch instruction if the particular branch condition being tested is true. Otherwise,
the branch instruction simply increments the PC. All branches are absolute, rather than relative,
i.e., a 12-bit value derived from the branch instruction word is loaded directly into the PC in order to
accomplish the branch.

2.6.2

Stack
The stack is 12 bits wide and four layers deep. The PUSH instruction pushes the twelve lSBs of the
accumulator onto the top of stack (TOS). The POP instruction pops the TOS into the twelve lSBs
of the accumulator. Following the POP instruction, the TOS can be moved into data memory by
storing the low-order accumulator word (SACl instruction). This allows expansion of the stack into
the data RAM. From the data RAM, it can easily be copied into program RAM off-chip by using the
TBlW instruction. In this way, the stack can be expanded to very large levels.
If the XDS/320 Emulator is used, one level of the stack is reserved by the emulator, reducing the
number of available stack levels to three.

2-13

2.6.2.1

Stack Overlow
Up to four nested subroutines or interrupts can be accommodated by the device without a stack
overflow if the TB LR and TB LW instructions are not executed. Since TB LR and TB LW utilize one
level of the stack, only three nested subroutines or interrupts can be accommodated without stack
overflow occurring if TBLR or TBLW are executed. If there is a stack overflow, the deepest level of
stack will be lost. If the stack is overpopped, the value at the bottom of the stack will become
copied into higher levels until it fills the stack.
To handle subroutines and interrupts of much higher nesting levels, part of the data RAM or
external RAM can be allocated to stack management. In this case, the top of the stack (TOS) is
popped immediately at the start of a subroutine or interrupt routine and stored in RAM. At the end
of the subroutine or interrupt routine, the stack value stored in RAM is pushed back onto the TOS
before returning to the main routine.

I
2.7

STATUS REGISTER
The status register, shown in Figure 2-6, consists of five status bits. These status bits can be
individually altered through dedicated instructions. In addition, the entire status register can be
saved in data memory through the SST instruction. New values can be reloaded into the status
register using the LST instruction, with the execption of the INTM bit. The INTM bit cannot be
changed through the LST instruction. It can only be changed by the instructions, EINT and DINT
(enable, disable interrupts).

OV

OVM

INTM

ARP

DP

FIGURE 2-6 - TMS32010 STATUS REGISTER

2-14

Accumulator Oveflow Flag Register
(OV)

- Zero indicates that the accumulator has not
overflowed. One indicates that an overflow in the
accumulator has occurred. (See Section 2.2.2.1).
The BV (branch on overflow) instruction will clear
this bit and cause a branch if it is set.

Overflow Mode Bit (OVM)

- Zero means the overflow mode is disabled. One
means the overflow mode is enabled (see Section
2.2.1 .1 ). The SOVM instruction loads the OVM bit
with a one; the ROVM instruction loads the OVM bit
instruction with a zero.

Interrupt Mask Bit (INTM)

- Zero means an interrupt is enabled. One means an
interrupt is disabled. The EINT instruction loads the
INTM bit with a zero; DINT loads the INTM bit with
a one. When an interrupt is executed, the INTM
register is automatically set to one before the
interrupt service routine begins. (See Section 2.10.)
Note that the INTM bit can only be altered by
executing the EINT and DINT instructions. Unlike
the rest of the status bits, the INTM bit cannot be
loaded with a new value by the LST instruction.

2.7.1

Auxiliary Register Pointer (ARP)

- Zero selects ARO. One selects AR 1. The AR P also
can be changed by executing the MAR or LAR P
instruction, or by instructions that permit the
indirect addressing option.

Data Memory Page Pointer (DP)

- Zero selects first 128 words of data memory, i.e.,
page zero. One selects last 16 words of data
memory, i.e., page one. The DP can also be
changed by executing either the LDP or the LDPK
instruction.

Saving Status Register
The contents of the status register call be stored in data memory by executing the SST instruction.
If the SST instruction is executed using the direct addressing mode, the device automatically stores
this information on page one of data memory at the location specified by the instruction. Thus, an
SST instruction using the direct addressing mode can only specify an address less than 16, since
the second page of memory contains only 16 words. If the indirect addressing mode is selected,
then the contents of the status register may be stored in any RAM location selected by the auxiliary
register.
The SST instruction does not modify the contents of the status register. Figure 2-7 shows the
position of the status bits as they appear in the appropriate data RAM location after execution of the
SST instruction.

15

OV

14

13

OVM INTM

12

11

1

10

9

8

7

6

5

4

3

ARP

o

2

///

DP

/ / / = don't care
FIGURE 2-7 - STATUS WORD AS STORED BY SST INSTRUCTION

The LST instruction may be executed to load the status register. LST does not assume status bits
are on page one, so the DP must be set to one for the LST instruction to access status bits stored
on page one. The interrupt mask bit cannot be changed by the LST instruction. However, all other
status bits can be changed by this instruction.

2.8
2.8.1

INPUT/OUTPUT FUNCTIONS
I N and OUT
Input and output of data to and from a peripheral is accomplished by the IN and OUT instructions.
Data is transferred over the 16-bit data bus ~and from the data memory by two independent
strobes: data enable (DEN) and write enable (WE).
The bidirectional external data bus is always in a high-impedance mode, except when WE goes low.
WE will go low during the first cycle of the OUT instruction and the second cycle of the TBLW
instruction.
As shown in Figure 2-8, 128 1/0 bits are available for interfacing to peripheral devices: eight 16-bit
multiplexed input ports and eight 16-bit multiplexed output ports.

2-15

I

DATA BUS (16)

TMS32010

A2-AO /
PA2-PAO

I

PORT
ADDRESS

t------........ I DECODER
174LS138)

---t.IIIIIIIIII" III"

DEN

1 _U
0
T_2

WE

16110 BITS PER PORT

FIGURE 2-8 - EXTERNAL DEVICE INTERFACE

Execution of an IN instruction generates the DEN strobe for transferring data from a peripheral
device to the data RAM (see Figure 2-9A). The IN instruction is the only instruction for which
DEN will become active. Execution of an OUT instruction generates the WE strobe for transferring
data from the data RAM to a peripheral device (see Figure 2-9B). WE becomes active only during
the OUT instruction and the table write (TBLW) instruction. See Appendix A, the TMS3201 0 Data
Sheet, for further timing information.

DATA IN
IN INSTRUCTION

•

PREFETCH

•

.

NEXT INSTRUCTION
VALID
...--~.,.
PREFETCH

.,

DEN

FIGURE 2-9A - INPUT INSTRUCTION TIMING

2-16

.

OUT INSTRUCTION

MEN

PREFETCH

..

DATA OUT
VALID
NEXT INSTRUCTION
PREFETCH

1.._____-'

WE

FIGURE 2-9B - OUTPUT INSTRUCTION TIMING
FIGURE 2-9 - INPUT/OUTPUT INSTRUCTION TIMING

The three multiplexed LSBs of the address bus, PA2 through PAO, are used as a port address by the
IN and OUT instructions. The remaining higher order bits of the address bus, A 11 through A3, are
held at logic zero during execution of these instructions.

2.8.2

Table Read (TBlR) and Table Write (TBlW)
The TB lR and the TB lW instructions allow words to be transferred between program and data
spaces. TBlR is used to read words from on-chip program ROM or off-chip program ROM/RAM
into the data RAM. TBlW is used to write words from on-chip data RAM to off-chip program
RAM.
Execution of the TBlR instruction generates MEN strobes to read the word from program memory
(see Figure 2-1 OA). Execution of a TBlW instruction generates a WE strobe (see Figure 2-10B).
Note that the WE strobe will be generated and the appropriate data transferred even if the
TMS320M10 is in the microcomputer mode and a TBlW is performed to a program location less
than 1535.
The dummy prefetch is a prefetch of the instruction following the TBlR or TBlW instructions and
is discarded. The instruction following TBlR or TBlW is prefetched again at the end of the
execution of the TB lR or TB lW instructions.
DATA TRANSFERRED

NEXT

INSTRUCTION

DUMMY

FROM PROGRAM

INSTRUCTION

PREFETCH

PREFETCH

MEMORY

TBLR

•

PREFETCH

MEN~~________~
FIGURE 2-10A - TABLE READ INSTRUCTION TIMING
TBLW
INSTRUCTION

DUMMY

PREFETCH

PREFETCH

•

DATA

NEXT

TRANSFERRED TO

INSTRUCTION

PROGRAM MEMORY

••

PREFETCH

MENI~_________

FIGURE 2-10B - TABLE WRITE INSTRUCTION TIMING
FIGURE 2-10 - TABLE READ AND TABLE WRITE INSTRUCTION TIMING

2-17

I

2.8.3 Address Bus Decoding
Since all three interface strobes, MEN, WE, and DEN, are mutually exclusive, there are some very
important considerations for those designs that utilize external program memory. Since the OUT and
TBLW instructions use only the WE signal to indicate valid data, these instructions cannot be
distinguished from one another on the basis of the interface strobes. Unless the address bus is decoded,
execution of TBLW instructions will write data to peripherals and execution of OUT instructions will
overwrite program memory locations 0 through 7. See Section 5-4 for an example of this decoding logic.
No matter what decoding logic is used, it will not be possible to use TBLW to uniquely write to program
memory locations 0 through 7. This is because the address bus will be identical for OUT and TBLW,
and there will be no way to distinguish between the two instructions .

•

2.9

BIO PIN
The BIO pin is an external pin which supports bit test and jump operations. When a low is
present on this pin, execution of the BIOZ instruction will cause a branch to occur. This pin is sampled
every clock cycle and is not latched.
The BIO pin is useful for monitoring peripheral device status. It is especially useful as an
alternative to using an interrupt when it is necessary not to disturb time-critical loops. See Section 2.14
for BIO system design recommendations.

2.10

INTERRUPTS
The TMS3201 O's interrupt is generated either by applying a negative-going edge to the interrupt (lNT)
pin or by holding the INT pin low. A diagrammatic explanation of the TMS3201 O's internal interrupt
circuitry is presented in Figure 2-11.

RS
INTERRUPT
ACKNOWLEDGE

EINT
TMS32010
CLR
CLOCK

CLR
5V

D

Q
INTERRUPT
FLAG

Q

INTERRUPT
MODE
REGISTERt
Q
D

INT

D

a indicates

interrupts enabled.
= 1 indicates interrupts disabled.
* (j> = phase of internal clock.
=

FIGURE 2-11 - SIMPLIFIED INTERRUPT LOGIC DIAGRAM

2-18

INTERRUPT
PROCESSOR

Q
SYNC
FF

to
a

INTERNAL

---_........

INTERRUPT
ACTIVE

The Sync FF is a synchronizing flip-flop used to synchronize the external interrupt signal to the
TMS32010's internal interrupt circuitry. When interrupts are enabled, an interrupt becomes active
either due to a low voltage input on the INT pin or when a negative-edge has been latched into the
interrupt flag.
If the interrupt mode register (lNTM) is set, then an interrupt active signal to the internal interrupt
processor (liP) becomes valid. The liP begins interrupt servicing by causing a branch to location 2 in
program memory. It will delay interrupt servicing in each of the following cases:
1) Until the end of all cycles of a multicycle instruction,
2) Until the instruction following the MPY or MPYK has completed execution,

3) Until the instruction following EINT has been executed (when interrupts have been pre-I
viously disabled). This allows the RET instruction to be executed after interrupts become
enabled at the end of an interrupt routine.
When the interrupt service routine begins, the liP sends out an internal interrupt acknowledge
signal. This presets the INTM register (disabling interrupts) and clears the interrupt flag.
Figure 2-11 also shows that DINT or a hardware reset will set the INTM register, disabling
interrupts, while EINT will clear the INTM register. Interrupts will continue to be latched while they
are disabled. Note that DINT or EINT do not affect the interrupt flag.
Figure 2-12 shows the instruction sequence that occurs once an interrupt becomes active. The
dummy fetch is an instruction that is fetched but not executed. This instruction will be fetched and
executed after the interrupt routine is completed.

CLKOUT

INT

I'--__~
\,

'1 CLOCK CYCLE MIN

FETCH
INSTRUCTION N

/

FETCH
INSTRUCTION N + 1

EXECUTE N

DUMMY FETCH
INSTRUCTION N + 2

EXECUTE N+ 1

FETCH
INSTRUCTION
002

DUMMY CYCLE

EXECUTE 002

FIGURE 2-12 - INTERRUPT TIMING

See Section 2.14 for interrupt system design recommendations.
2.11

RESET
The reset function is enabled when an active low is placed on the RS pin for a minimum of five clock
cycles (see Figure 2-13). The control lines for DEN, WE, and MEN are then forced high, and the
data bus (015 through DO) is tristated. The PC and the address bus (A 11 throug!!.. AO) a~then
synchronously cleared after the next complete clock cycle from the falling edge of RS. The RS pin
also disables the interrupt, clears the interrupt flag register, and leaves the overflow mode register
unchanged. The TMS32010 can be held in the reset state indefinitely.

2-19

~.1---5

CLOCK CYCLES MIN ~

Rsl_____----'I
FIGURE 2-13 - RESET TIMING

2.12

CLOCK/OSCILLATOR
The TMS32010 can use either its internal oscillator or an external frequency source for a clock.
Use of the internal oscillator is achieved by connecting a crystal across X1 and X2/ClKIN. The
frequency of CLKOUT and the cycle time of the TMS3201 0 is one-fourth of the crystal fundamental
frequency (see Figure 2-14).

I

X1

X2/CLKIN

----lOt---...
CRYSTAL

FIGURE 2-14 - INTERNAL CLOCK

An external frequency source can be used by injecting the frequency directly into X2/ClKIN with
X1 left unconnected. If an external frequency source is used, a pull-up resistor may be necessary
(see Figure 2-15). This is because the high-level voltage of the ClKIN input must be a minimum of
2.8 V while a standard TTL gate, for example, can have a high-level output voltage as low as 2.4 v.
The size of the pull-up resistor will depend on such things as the frequency source's high-level
output voltage and current and the number of other devices the frequency source will be driving.
The resistor should be made as large as possible while still having the ClKIN input specification
met.

X2/CLKIN

+VCC

SIGNAL
GENERATOR

FIGURE 2-15 - EXTERNAL FREQUENCY SOURCE

The delay time between ClKIN and ClKOUT is not specified. This delay time can vary by as much a
one CLKOUT cycle and is very temperature dependent. Hardware designs which depend upon this
delay time should not be used.

2-20

2.13

PIN DESCRIPTIONS
Definitions of the TMS32010 pin assignments and descriptions of the function of each pin are
presented in Table 2-4. Figure 2-16 illustrates the TMS3201 0 pin assignments.

TABLE 2-4 - TMS32010 PIN DESCRIPTIONS

SIGNAL

PIN

DESCRIPTION

I/O
POWER SUPPLIES

30

Supply voltage ( + 5 V NOM)

10

Ground reference
CLOCKS

X2/CLKIN

8

IN

Crystal input pin for internal oscillator (X2). Also input pin for external oscillator (ClKIN).

X1

7

OUT

Crystal input pin for internal oscillator

CLKOUT

6

OUT

Clock output signal. The frequency of ClKOUT is one-fourth of the
oscillator input (external oscillator) or crystal frequency (internal
oscillator). Duty cycle is 50 percent.
CONTROL

WE

31

OUT

Write Enable. When active (low), WE indicates that valid output
data from the TMS3201 0 is available on the data bus. WE is only
active during the first cycle of the OUT instruction and the second
cycle of the TBlW instruction (see Section 3.4.3), MEN and DEN
will always be inactive (high) when WE is active.

32

OUT

Data Enable. When active (low), DEN indicates that the
TMS32010 is accepting data from the data bus. DEN is only active during the first cycle of the IN instruction (see Section 3.4.3).
MEN and WE will always be inactive (high) when DEN is active.

33

OUT

Memory Enable. MEN will be active low on every machine cycle
except when WE and DEN are active. MEN is a control signal
generated by the TMS3201 0 to enable instruction fetches from
program memory. MEN will be active on instructions fetched from
both'internal and external memory.

2-21

TABLE 2-4 -

SIGNAL

PIN

TMS32010 PIN DESCRIPTIONS (CONTINUED)

DESCRIPTION

I/O
INTERRUPTS

RS

-

INT

-

BIO

4

IN

Reset. When an active low is placed on the RS pin for a minimum
of five clock cycles, DEN, WE, and MEN are forced high, and the
data bus (D15 through DO) is tristated. The program counter (PC)
and the address bus (A 11 through AO) are then synchronously
cleared after the next complete clock cycle from the falling edge of
RS. RS also disables the interrupt, clears the interrupt flag register,
and leaves the overflow mode register unchanged. The TMS3201 0
can be held in the reset state indefinitely.

5

IN

Interrupt. The interrupt signal is generated by applying a negativegoing edge to the INT pin. The edge is used to latch the interrupt
flag register (lNTF) until an interrupt is granted by the device. An
active low level will also be sensed. (See Section 2.10.)

9

IN

I/O Branch Control. If BIO is active (low) upon execution of the
BIOZ instruction, the device will branch to the address specified by
the instruction (see Section 2.9).
PROGRAM MEMORY MODES

-

MC/MP

3

IN

Microcomputer/Microprocessor Mode. A high on the MC/MP pin
enables the microcomputer mode. In this mode, the user has
available 1524 words of on-chip program memory. (Program
memory locations 1 524 through 1535 are reserved.) The
microcomputer mode also allows an additional 2560 words of
program memory to reside off-chip. A Iowan the MC/MP pin
enables the microprocessor mode. In this mode, the entire
memory space is external, i.e., addresses 0 through 4095. (See
Section 2.3.1 .)
BIDIRECTIONAL DATA BUS

015
014
013
012
D11
010
09
08
07
06
05
D4
03
02
D1
00

2-22

18
17
16
15
14
13
12
11
19
20
21
22
23
24
25
26

I/O
liD
liD
liD
liD
liD
liD
liD
liD
liD
liD
liD
liD
liD
liD
liD

015 (MSB) through DO (LSB). The data bus is always in the highimpedance state except when WE is active (low).

TABLE 2-4 - TMS32010 PIN DESCRIPTIONS (CONCLUDED)

SIGNAL

PIN

DESCRIPTION

I/O

PROGRAM MEMORY ADDRESS BUS AND
PORT ADDRESS BUS
All
A10
A9
A8
A7
A6
A5
A4
A3
A2/PA2
Al/PAl
AD/PAD

27
28
29
34
35
36
37
38
39
40
1

2

OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT

Program memory A 11 (MSB) through AD (LSB) and port
addresses PA2 (MSB) through PAD (LSB). Addresses A 11
through AD are always active and never go to high impedance. During execution of the IN and OUT instructions,
pins A2 through AD carry the port addresses PA2 through
PAD.

A1/PA 1
AO/PAQ

A2/PA2
A3

MC/MP

A4
A5

RS

INT
CLKOUT
X1
X2/CLKIN
910

Vss
OS
09
010

I

A6
A7
AS
MEN
O~N

WE
vCC
A9
A10

011
012

A11

013

01

014

02

015
07

03
04

06

05

DO

FIGURE 2-16 - TMS32010 PIN ASSIGNMENTS

2-23

2.14

INTERRUPT AND 810 SYSTEM DESIGN
For systems using asynchronous inputs to the INT and BIO pins on the TMS32010, the external
hardware shown in Figure 2-17 is recommended to ensure proper execution of interrupts and the
BIOZ instruction. This hardware synchronizes the INT and BIO input signals with the rising edge
of CLKOUT on the TMS32010. The pulse width required for these input signals is tc(C), which is
one TMS32010 clock cycle, plus sufficient setup time for the flip-flop (dependent upon the flip-flop
used).

I
p

I

Q

0

1NT

SN74ALS74

r-- ~

C

TMS32010

I

+5V

CLKOUT

1
P

0

Q

810

SN74ALS74

r--

>

TMS32010

C

1

+5 V

FIGURE 2-17 -

2-24

CLKOUT

INTERRUPT AND

mo HARDWARE DESIGN

I

INSTRUCTIONS

I

3.

INSTRUCTIONS
The TMS3201 O's comprehensive instruction set supports both numeric- intensive operations, such
as signal processing, and general-purpose operations, such as high-speed control. The instruction
set, shown in Table 3-2, consists primarily of single-cycle single-word instructions, permitting execution rates of up to five million instructions per second. Only infrequently used branch and I/O
instructions are multicycle.
The TMS32010 also contains a number of instructions that shift data as part of an arithmetic operation. These all execute in a single cycle and are very useful for scaling data in parallel with other
operations.

3.1

INTRODUCTION
The instruction set contains a full set of branch instructions. Combined with the Boolean operations and shifters, these instructions permit the bit manipulation and bit test capability needed for
high-speed control operations. Double-precision operations are also supported by the instruction
set. Some examples are ADDH (add to high-order accumulator) and ADDS (add to accumulator
with sign extension suppressed), which allow easy manipulation of 32-bit numbers.
The TMS32010's hardware multiplier allows the MPY instruction to be executed in a single cycle.
The SUBC (conditional subtract for divide) instruction performs the shifting and conditional
branching necessary to implement a divide efficiently and quickly.
Two special instructions, TBLR (table read) and TBLW (table write), allow crossover between data
memory and program memory. The TB LR instruction transfers words stored in program memory to
the data RAM. This eliminates the need for a coefficient ROM separate from the program ROM,
thus permitting the user to make efficient trade-offs as to the amount of ROM dedicated to program or coefficient store. The accompanying instruction, TBLW, transfers words in internal data
RAM to an external RAM. In conjunction with TBLR, this instruction allows the use of external
RAM to expand the amount of data storage.
When a very large amount of external data must be addressed (i.e., > 4K words), TBLR and TBLW
can no longer serve as a means of expanding the data RAM. Then it becomes necessary to address
external data RAM as a peripheral by using the IN and OUT instructions; these instructions permit a
data word to be read into the on-chip RAM in only two cycles. This procedure requires a minimal
amount of external logic and permits the accessing of almost unlimited amounts of data RAM. This
is very useful for pattern recognition applications, such as speech recognition or image processing.

3.2

ADDRESSING MODES
Three main addressing modes are available with the TMS3201 0 instruction set direct, indirect, and
immediate addressing.

3.2.1

Direct Addressing Mode
In direct addressing, seven bits of the instruction word concatenated with the data page pointer
form the data memory address. This implements a paging scheme in which the first page contains
128 words and the second page contains 16 words. In a typical application, infrequently accessed
variables, such as those used when performing an interrupt service routine, are stored on the second page.

3.2.2

Indirect Addressing Mode
Indirect addressing forms the data memory address from the least significant eight bits of one of
two auxiliary registers, ARO and AR1 . The auxiliary register pointer (ARP) selects the current auxiliary register. The auxiliary registers can be automatically incremented or decremented in parallel
with the execution of any indirect instruction to permit single-cycle manipulation of data tables.
3-1

I

3.2.3.

Immediate Addressing Mode
The TMS3201 0 instruction set contains special lIimmediate" instructions. These instructions derive
data from part of the instruction word rather than from the data RAM. The constant in all immediate
instructions may refer to values supplied by an external reference symbol. Some very useful immediate instructions are multiply immediate (MPYK), load accumulator immediate (LACK), and
load auxiliary register immediate (LARK).

3.3

INSTRUCTION ADDRESSING FORMAT
The following sections describe the opcode format for the various addressing modes of the
TMS32010.

3.3.1

Direct Addressing Format
15

14

13

I

12

11

10

9

8

7

6

5

4

3

2

1

0

dma

OPCODE

Bit 7 = 0 defines direct addressing mode. The opcode is contained in bits 15 through 8. Bits 6
through 0 contain data memory address.
The 7 bits of the data memory address (dma) field can directly address up to 128 words (1 page) of
data memory. Use of the data memory page pointer is required to address the full 144 words of data
memory.
Direct addressing can be used with all instructions requiring data operands except for the immediate
operand instructions.
3.3.2.

Indirect Addressing Format
15

14

13

12

11

10

OPCODE

9

8

7

6

5

4

3

2

1

0

0 IINCIDECIARPI 0 I 0 I ARP I

Bit 7 =
defines indirect addressing mode. The opcode is contained in bits 15 through 8. Bits 6
through 0 contain indirect addressing control bits.
Bit 3 and bit 0 control the Auxiliary Register Pointer (ARP)' If bit 3 = 0, then the contents of bit 0
are loaded into the ARP after execution of the current instruction. If bit 3
1, then the contents of
the ARP remain unchanged. ARP = 0 defines the contents of ARO as a memory address. ARP =
1 defines the contents of AR1 as a memory address.

=

Bit 5 and bit 4 control the auxiliary registers. If bit 5 = 1, then ARP defines which auxiliary register is
to be incremented by 1 after execution. If bit 4 = 1, then the ARP defines which auxiliary register is
to be decremented by 1 after execution. If bit 5 and bit 4 are zero, then neither auxiliary register is inc'remented or decremented. Bits 6,2, and 1 are reserved and should always be programmed to zero.
Indirect addressing can be used with all instructions requiring data operands, except for the immediate operand instructions.
3.3.3

I mmediate Addressing Format
Included in the TMS32010's instruction set are five immediate operand instructions (LDPK, LARK,
MPYK, LACK, and LARP). In these instructions, the operand is contained within the instruction
word.

3-2

3.3.4

Examples of Opcode Format

1)

Add to accumulator the contents of memory
location 9 left-shifted 5 bits.

ADD 9,5

15

14

13

\ 0

0

0

12

11

10

0 \ 0

9

8

7

6

5

4

01\01 0 0

0

3

2

1

o

0

0

Note: Opcode of the ADD instruction is 0000 and appears in bits 15 through 12. Shift code of 5 appears in bits 11 through 8. Data memory address 9 appears in bits 6 through

o.

2)

ADD *+,8

15

14

Add to accumulator the contents of data memory address defined by
contents of current auxiliary register. This data is left-shifted 8 bits
before being added. The current auxiliary register is auto-incremented
by 1.

13

12

000

0

11

10

9

8

7

6

5

4

3

2

1

0

o

1

000

Other variations of indirect addressing are as follows:

3.4

3)

ADD *, 8

As in example 2, but with no auto-increment; opcode would be
>0888

4)

ADD * -, 8

As in example 2, except that current auxiliary register is decremented
by 1; opcode would be > 0898

5)

ADD *

+ , 8, 1

As in example 2, except that the auxiliary register pointer is loaded
with the value 1 after execution; opcode would be> 08A 1

6)

ADD *

+

As in example 2, except that the auxiliary register pointer is loaded
with the value 0 after execution; opcode would be> 08AO

,8,0

INSTRUCTION SET
The following sections include the symbols and abbreviations that are used in the instruction set
summary and in the instruction descriptions, the complete instruction set summary, and a description of each instruction.
All numbers are assumed to be decimal unless otherwise indicated. Hexidecimal numbers are
specified by the symbol II>" before the nu mber.

3.4.1.

Symbols and Abbreviations

DATn and PRGn are assumed to have the symbolic value of n. They are used to represent any symbol with the value n.

3-3

TABLE 3-1 - INSTRUCTION SYMBOLS

SYMBOL
ACC
AR
ARP
D
DATn
dma
DP
I
INTM
K
>nn
OVM
P
PA

I

PC
pma
PRGn
R
5
T
T05

X

-

II
< >
[ ]
( )

{}
<>

3-4

MEANING
Accumulator
Auxiliary register (ARO and AR 1 are predefined assembler symbols equal to 0 and 1,
respectively. )
Auxiliary register pointer
Data memory address field
Label assigned to data memory location n
Data memory address
Data page pointer
Addressing mode bit
Interrupt mode flag bit
. Immediate operand field
Indicates nn is a hexadecimal number. All others are assumed to be decimal values.
Overflow (saturation) mode flag bit
Product (P) register
Port address (PAO through PA7 are predefined assembler symbols equal to 0 through
7, respectively)
Program counter
Program memory address
Label assigned to program memory location n
1-bit operand field specifying auxiliary register
4-bit left-shift code
T register
Top of stack
3-bit accumulator left-shift field
Is assigned to
Indicates an absolute value
Items within angle brackets are defined by user.
Items within brackets are optional.
Indicates contents of"
Items within braces are alternative items; one of them must be entered.
Angle brackets back-to-back indicate "not equal".
Blanks or spaces are significant.
II

3.4.2

Instruction Set Summary
The instruction set summary in the following table consists primarily of single-cycle single-word instructions. Only infrequently used branch and 1/0 instructions are multicycle.

TABLE 3-2 -

INSTRUCTION SET SUMMARY

ACCUMULATOR INSTRUCTIONS
MNEMO!,)!IC

DESCRIPTION

OPCODE
INSTRUCTION REGISTER

NO.
NO.
CYCLES WORDS

15 14 13 12 11 10
ABS
ADD
ADDH
ADDS
AND
LAC
LACK
OR
SACH

SACL
SUB

SUBC
SUBH
SUBS

XOR
ZAC
ZALH
ZALS

Absolute value of
accumulator
Add to accumulator
with shift
Add to high-order
accumulator bits
Add to accumulator
with no sign extension
AND with accumulator
Load accumulator
with shift
Load accumulator
immediate
OR with accumulator
Store high-order
accumulator bits with
shift
Store low-order
accumulator bits
Subtract from
accumulator with
shift
Conditional subtract
(for divide)
Subtract from highorder accumulator bits
Subtract from accumulator with no sign
extension
Exclusive 0 R with
accumulator
Zero accumulator
Zero accumulator and
load high-order bits
Zero accumulator and
load low-order bits
with no sign extension

9

8

7

6

5

4

3

2

1

0

1

1

1

a

0

0

1

a

0

0

I

<

D

:>

1

1

a

1

1

1

1

1

1

a

0

0

0

~S--7

1

1

a

1

1

0

0

0

0

a

I

<

D

:>

1

1

0

1

1

0

0

0

0

1

I

<

D

:>

1
1

1
1

a

1
0

1
1

1
0

1
~

0 0 1
S -----7

I
I

<
<

D
D

:;:.

0

1

1

a

1

1

1

1

1

K

:>

1
1

1
1

0

a

1
1

1
0

1
1

1
1

1

1

0

1

0

1

0

0

1

1

a

0

0

1

1

a

1

1

1

a

1

1

1

1

:>

1

a <

0

1

0

~

X~

I
I

<
(

D
D

:>
:;:.

0

0

I

<

D

:>

1

~S~

I

<

D

:;:.

1

0

a

1

0

a

I

<

D

:>

1

1

0

0

0

1

0

I

<

D

:>

a

1

1

0

0

0

1

1

I

<

D

:>

1

0

1

1

1

1

0

0

a

I

<

D

:>

1
1

1
1

a
a

1
1

1
1

a

1

1
1

1
0

1
1

1
I

0

0

<

D

:;:.

1

1

a

1

1

0

0

1

1

a

I

<

D

:>

1

0

0

1

I

a

0

1

3-5

TABLE 3-2 - INSTRUCTION SET SUMMARY (CONTINUED)

AUXILIARY REGISTER AND DATA PAGE POINTER INSTRUCTIONS
MNEMONIC

DESCRIPTION

NO.
NO.
CYCLES WORDS

OPCODE
INSTRUCTION REGISTER
15 14 13 12 11 10

LAR
LARK
LARP

LOP
LDPK

I

MAR
SAR

Load auxiliary
register
Load auxiliary
register immediate
Load auxiliary
register pointer
immediate
Load data memory
page pointer
Load data memory
page pointer
immediate
Modify auxiliary
register and pointer
Store auxiliary
register

9

8

7

6
oE

5

4

3

2

1

0

1

1

0

0

1

1

1

0

0

R

I

1

1

0

1

1

1

0

0

0

R

oE

1

1

0

1

1

0

1

0

0

0

1

0

1

1

0

1

1

0

1

1

1

1

I

oE

1

1

0

1

1

0

1

1

1

0

0

0

1

1

0

1

1

0

1

0

0

0

I

oE

0

>

1

1

0

0

1

1

0

0

0

R

I

oE

0

>

0

0

0

~

K

~

0

0

0

:>

0
0

0

0

K

0

0

K

BRANCH INSTRUCTIONS
MNEMONIC

DESCRIPTION

NO.
NO.
CYCLES WORDS

OPCODE
INSTRUCTION REGISTER
15 14 13 12 11 10

B

BANZ

BGEZ

Branch unconditionally

2

Branch on auxiliary
register not zero

2

Branch if accumulator

2

2

2

2

~O

BGZ

BIOZ

BLEZ

Branch if accumulator
>0
Branch on BIO

=0

Branch if accumulator

2

2

2

2

2

2

~O

BLZ

BNZ

BV

BZ

CALA
CALL

RET

3-6

Branch if accumulator
<0

2

Branch if accumulator
10

2

Branch on overflow

2

2

2

2

1
0

1
0

1
0

1
0

1
0

1

1
0

1
0

0

0

1
0

1
0

1
0

1

1

0

<

1
0

1
0

1
0

1
0

<

1
0

1
0

1

0

1
0

1
0

0

1
0

1
0

1
0

1
0

1
0

1
0

1

1
0

1

1
0

1
0

1

0

1
0

1
0

1
0

1
0

0

1
0

1
0

1

1

1

0

0

<

1

1

0

9

8

3

2

1

0

1 0 0 0 0 0
BRANCH ADDRESS

0

0

0 0 0 0 0 0
BRANCH ADDRESS

0

1 0 0 0 0 0
BRANCH ADDRESS

0

<
1

0

oE

1

0

1
1

1

0
0
1

<
1

<

0
0

1
1

<
1

1

<
1

<

0

Branch if accumulator
=0

2

Call subroutine from
accumulator
Call subroutine
immediately

2

1

0

1

1

1

1

1

1

2

2

1
0

1

1
0

1
0

1

0

0

0

<

Return from subroutine

2

0

1

1

1

1

2

1

1

1

1

1

7

6

5

4

0 0 0 0 0 0
BRANCH ADDRESS
0 0 0 0 0 0
BRANCH ADDRESS
1 0 0 0 0 0
BRANCH ADDRESS

0

0
0

0

0

0

1 0 0 0 0 0
BRANCH ADDRESS

0

0
0

0

0

0

0

0

1

0
0
~

0 0 0 0 0 0
BRANCH ADDRESS
0

0

:>

0

0

0

:>

1

0

0

:>

1

1

0

--~

0

1

0

:>

1 0 0 0 0 0
BRANCH ADDRESS

0

0

--~

0

0

0

:>

0 0 0 0 0 0
BRANCH ADDRESS

0

0

>

0

1

0

>

0 0 0 0 0 0
BRANCH ADDRESS

1

0

0
0

:>
1

0

1

TABLE 3-2 - INSTRUCTION SET SUMMARY (CONCLUDED)

T REGISTER, P REGISTER, AND MULTIPLY INSTRUCTIONS
MNEMONIC

DESCRIPTION

OPCODE
INSTRUCTION REGISTER

NO.
NO.
CYCLES WORDS

15 14 13 12 11 10
APAC
LT
LTA

LTD

MPY

MPYK

PAC
SPAC

Add P register to
accumulator
Load T register
LTA combines L T and
APAC into one instruction
LTD combines LT,
APAC, and DMOV into
one instruction
Multiply with T
register; store product
in P register
Multiply T register
with immediate operand; store product in
P register
Load accumulator from
P register
Subtract P register
from accumulator

9

8

7

6

5

4

3

2

1

0

0

0

1

1

1

1

1

1

0

1

1

1

1

1

1

1

1

0

1
1

1
1

0
0

1
1

1
1

0
0

1
1

0
1

1
0

0
0

I
I

tE

D
D

:?>

<

1

1

0

1

1

0

1

0

1

1

I

tE

D

')

1

1

0

1

1

0

1

1

0

1

I

<

D

:>

1

1

1

0

0

<

1

1

0

1

1

1

1

1

1

1

1

0

0

0

1

1

1

0

1

1

0

1

1

1

1

1

1

1

1

0

0

1

0

0

0

0

3

2

1

0

0
0

0
1

1
0

0
1

0
0

0
1

:>

I

:>

K

CONTROL INSTRUCTIONS
MNEMONIC

DINT
EINT
LST
NOP
POP
PUSH
ROVM
SOVM
SST

DESCRIPTION

Disable interrupt
Enable interrupt
Load status register
No operation
Pop stack to
accumulator
Push stack from
accumulator
Reset overflow mode
Set overflow mode
Store status register

NO.
NO.
CYCLES WORDS

OPCODE
INSTRUCTION REGISTER
15 14 13 12 11 10

9

8

7

6

5

4

0
0

0

0

0

0
D
0
1

1
1
1
1
2

1
1
1
1
1

0
0
0
0
0

1
1
1
1
1

1
1
1
1
1

1
1
1
1
1

1
1
1
1
1

1
1
0
1
1

1
1
1
1
1

1
1
1
1
1

1
1
I
1
1

0
0
0
0

0

0

0
1

2

1

0

1

1

1

1

1

1

1

1

0

0

1

1

1

0

0

1
1
1

1
1
1

0
0
0

1
1
1

1
1
1

1
1
1

1
1
1

1
1

1
1
0

1

1
1
I

0
0

0

0

0
0

1
1

0
0

1
1

0
1

1

1
0

<

<

:>

:>

D

I/O AND DATA MEMORY OPERATIONS
MNEMONIC

DESCRIPTION

NO.
NO.
CYCLES WORDS

OPCODE
INSTRUCTION REGISTER
15 14 13 12 11 10

DMOV

IN
OUT
TBLR

TBLW

Copy contents of data
memory location into
next location
I nput data from port
Output data to port
Table read from
program memory to
data RAM
Table write from
data RAM to program
memory

4

9

8

7

6

0

1

I

<

D

:>

<
<

D

tE

D
D

:>
:>
:>

<:

D

')

1

1

0

1

1

0

1

0

2
2
3

1
1
1

0
0
0

1
1
1

0
0
1

0
0
0

0
1

~PA~
~PA~

0

1

1

1

I
I
I

3

I

0

1

1

1

1

1

0

1

I

5

3

2

1

0

3-7

3.4.3

I nstruction Descriptions
Each instruction in the instruction set summary is described in the following pages. The instructions
are listed in alphabetical order. An example is provided with each instruction.
Each instruction begins with an assembler syntax expression. Since the comment field which concludes the syntax is optional, it is not included in the syntax expression. A syntax example is given
below that shows the spaces that are included and required in the syntax expression, and the optional comment field along with its preceding spaces that has been omitted.

[< label>]

I

3-8

LACK

f

~spaces

[ ]
Spaces and comment
field not included
in the syntax expressions
for this section.

ABS

ABS

Absolute Value of Accumulator

Assembler Syntax:

[< label>]

Operands:

None

Operation:

If (ACC) < 0
Then - (ACC)

Encoding:

15

I

14

13

-+

ACC

12

11

0

ABS

10

9

8

7

6

5

4

1

1

1

0

0

0

3

2

1

0

0

0

0

Description: If accumulator is greater than zero, then the accumulator is unchanged by the execution of
this instruction. If the accumulator is less than zero, then the accumulator will be replaced
by its two's complement value. Note that the hexadecimal number> 80000000 is a special
case. When the overflow mode is not set, the ABS of> 80000000 is > 80000000. When in
the overflow mode, the ABS of> 80000000 is> 7FFFFFFF.
Words: 1
Cycles: 1
Example: ABS

31

BEFORE INSTRUCTION
0

ACC I> 0

0 0

0

1 2

AFTER INSTRUCTION
31

0

3 4

ACC I> 0

0

0

0

1 2 3

ACC I> F F F F F F F F

ACC I> 0

0

0

0 0 0

4

and
0

1

3-9

I

ADD
Assembler Syntax:
Direct Addressing:
Indirect Addressing:
Operands:

ADD

Add to Accumulator with Shift

ADD
ADD

[

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Create Date                     : 2013:09:04 14:28:30-08:00
Modify Date                     : 2013:09:05 01:19:02-07:00
Metadata Date                   : 2013:09:05 01:19:02-07:00
Producer                        : Adobe Acrobat 9.55 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:71d9785d-2c0b-1942-9b50-7beb5964fa25
Instance ID                     : uuid:f4711133-517e-c041-8c03-71dbef71a1b9
Page Layout                     : SinglePage
Page Mode                       : UseNone
Page Count                      : 438
EXIF Metadata provided by EXIF.tools

Navigation menu