MICROPROCESSORS Dr. Hugh Blanton ENTC 4337. TMS320C6x INSTRUCTION SET.

Slides:



Advertisements
Similar presentations
Details.L and.S units TMS320C6000 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004.
Advertisements

Lecture 6 Programming the TMS320C6x Family of DSPs.
MSP430 Teaching Materials
SPARC Architecture & Assembly Language
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
TMS320C6000 Architectural Overview.  Describe C6000 CPU architecture.  Introduce some basic instructions.  Describe the C6000 memory map.  Provide.
1 COMS 361 Computer Organization Title: Instructions Date: 9/28/2004 Lecture Number: 10.
Execution of an instruction
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
What is an instruction set?
9/29: Lecture Topics Memory –Addressing (naming) –Address space sizing Data transfer instructions –load/store on arrays on arrays with variable indices.
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
UNDERSTANDING ASSEMBLY LANGUAGE.
Chapter 2 Software Tools and Assembly Language Syntax.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
Module 10 Adapted By and Prepared James Tan © 2001.
Dr. José M. Reyes Álamo 1.  The 80x86 memory addressing modes provide flexible access to memory, allowing you to easily access ◦ Variables ◦ Arrays ◦
1/2002JNM1 Basic Elements of Assembly Language Integer Constants –If no radix is given, the integer is assumed to be decimal. Int 21h  Int 21 –A hexadecimal.
Chapter 3 Elements of Assembly Language. 3.1 Assembly Language Statements.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
1 Copyright © 2011, Elsevier Inc. All rights Reserved. Appendix A Authors: John Hennessy & David Patterson.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Homework Problems 1. M1 runs the program P in 1.4 * 9 * ns or ns M2 runs the program P in 1.6*9800*10ns or ns Hence M2 is faster by.
The Arrival of the 64bit CPUs - Itanium1 นายชนินท์วงษ์ใหญ่รหัส นายสุนัยสุขเอนกรหัส
Introduction to 8086 Assembly Language Assembly Language Programming University of Akron Dr. Tim Margush.
Overview of Assembly Language Chapter 4 S. Dandamudi.
Execution of an instruction
ajay patil 1 TMS320C6000 Assembly Language and its Rules Assignment One of the simplest operations in C is to assign a constant to a variable: One.
Computer Architecture and Organization
Overview of Super-Harvard Architecture (SHARC) Daniel GlickDaniel Glick – May 15, 2002 for V (Dewar)
Computer Architecture EKT 422
Lecture 04: Instruction Set Principles Kai Bu
Addressing Modes1 Addressing modes are concerned with how the CPU accesses the operands used by its instructions.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
What is a program? A sequence of steps
Group # 3 Jorge Chavez Henry Diaz Janty Ghazi German Montenegro.
Addressing Modes. Register Addressing Immediate Addressing Base Addressing Indexed Addressing PC-Relative Addressing.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures.
Addressing Modes in Microprocessors
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
Assembly Language Ms. V.Anitha AP/CSE SCT
The Cortex-M3/m4 Embedded Systems: Cortex-M3/M4 Instruction Sets
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
8051 Addressing Modes The way, using which the data source or destination addresses are specified in the instruction mnemonic for moving the data, is.
Microcomputer Programming
Details .L and .S units TMS320C6000.
Assembly Lang. – Intel 8086 Addressing modes – 1
Computer Organization and Assembly Language (COAL)
SCHOOL OF ELECTRONICS ENGINEERING Electronics and Communication
CSC 3210 Computer Organization and Programming
MICROPROCESSORS Dr. Hugh Blanton ENTC 4337.
Symbolic Instruction and Addressing
ECEG-3202 Computer Architecture and Organization
Introduction to Micro Controllers & Embedded System Design
Chapter 9 Instruction Sets: Characteristics and Functions
Computer Instructions
ECEG-3202 Computer Architecture and Organization
Assembler Directives end label end of program, label is entry point
Chapter 6 –Symbolic Instruction and Addressing
Review In last lecture, done with unsigned and signed number representation. Introduced how to represent real numbers in float format.
Computer Organization and Assembly Language
Instruction execution and ALU
Introduction to 8086 Assembly Language
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

MICROPROCESSORS Dr. Hugh Blanton ENTC 4337

TMS320C6x INSTRUCTION SET

Dr. Blanton - ENTC Lab 2 3 Assembly Code Format An assembly code format is represented by the field Label || [ ] Instruction Unit Operands ;comments

Dr. Blanton - ENTC Lab 2 4 A label, if present, represents a specific address or memory location that contains an instruction or data. The label must be in the first column. The parallel bars (||) are there if the instruction is being executed in parallel with the previous instruction. The subsequent field ([]) is optional to make the associated instruction conditional. Five of the registers—Al, A2, B0, B1, and B2—are available to use as conditional registers. For example, [A2] specifies that the associated instruction executes if A2 is not zero. On the other hand, with [!A2], the associated instruction executes if A2 is zero. All C6x instructions can be made conditional with the registers Al, A2, B0, B1, and B2 by determining when the conditional register is zero.

Dr. Blanton - ENTC Lab 2 5 The subsequent field ([]) is optional to make the associated instruction conditional. Five of the registers—Al, A2, B0, B1, and B2—are available to use as conditional registers. For example, [A2] specifies that the associated instruction executes if A2 is not zero. On the other hand, with [!A2], the associated instruction executes if A2 is zero. All C6x instructions can be made conditional with the registers Al, A2, B0, B1, and B2 by determining when the conditional register is zero.

Dr. Blanton - ENTC Lab 2 6 The instruction field can be either an assembler directive or a mnemonic. An assembler directive is a command for the assembler. For example,.word value reserves 32 bits in memory and fill with the specified value. A mnemonic is an actual instruction that executes at run time. The instruction (mnemonic or assembler directive) cannot start in column 1.

Dr. Blanton - ENTC Lab 2 7 The Unit field, which can be one of the eight CPU units, is optional. Comments starting in column 1 can begin with either an asterisk or a semicolon, whereas comments starting in any other columns must begin with a semicolon.

Types of Instructions

Dr. Blanton - ENTC Lab 2 9 The following illustrates some of the syntax of assembly code. It is optional to specify the eight functional units, although this can be useful during debugging and for code efficiency and optimization.

Dr. Blanton - ENTC Lab Add/Subtract/Multiply a.The instruction ADD.L1 A3,A7,A7 ;add A3 +A7 —.A7 (accum inA7) adds the values in registers A3 and A7 and places the result in register A7. The unit. L1 is optional. If the destination or result is in B7, the unit would he.L2.

Dr. Blanton - ENTC Lab 2 11 b.The instruction SUB.S1 A1,1,A1 ;subtract 1 from A1 subtracts 1 from A1 to decrement it, using the.S unit.

Dr. Blanton - ENTC Lab 2 12 c.The parallel instructions MPY.M2 A7,B7,B6 ;multiply 16 LSBs of A7,B7 → B6 || MPYH.Ml A7,B7,A6 ;multiply 16 MSBs of A7,B7 → A6 multiplies the lower or least significant 16 bits (LSBs) of both A7 and B7 and places the product in B6, in parallel (concurrently within the same execution packet) with a second instruction that multiplies the higher or most significant 16 bits (MSBs) of A7 and B7 and places the result in A6.

Dr. Blanton - ENTC Lab 2 13 In this fashion, two multiply/accumulate operations can be executed within a single instruction cycle. This can be used to decompose a sum of products into two sets of sum of products: one set using the lower 16 bits to operate on the first, third, fifth..., number, and another set using the higher 16 bits to operate on the second, fourth, sixth,... number. Note that the parallel symbol is not in column 1.

Dr. Blanton - ENTC Lab Load/Store a.The instruction LDH.D2 *B2++,B7 ;load (B2)→B7. increment B2 ||LDH.D1 *A2++,A7 ;load (A2)→A7,increment A2 loads into B7 the half-word (16 bits) whose address in memory is specified/pointed by B2. Then register B2 is incremented (postincremented) to point at the next-higher memory address.

Dr. Blanton - ENTC Lab 2 15 In parallel is another indirect addressing mode instruction to load into A7 the content in memory. whose address is specified by A2. Then A2 is incremented to point at the next-higher memory address. The instruction LDW loads a 32-bit word. Two paths using.Dl and.D2 allow for the loading of data from memory to registers A and B using the instruction LDW. The double-word load floating-point instruction LDDW on the C6711 can simultaneously load two 32-bit registers into side A and two 32-bit registers into side B.

Dr. Blanton - ENTC Lab 2 16 b.The instruction STW.D2 Al,*+A4[20] ;store A1→(A4) offset by 20 stores the 32-bit word A1 into memory whose address is specified by A4 offset by 20 words (32 bits) or 80 bytes. The address register A4 is preincremented with offset, but it is not modified (two plus signs are used if A4 is to be modified).

Dr. Blanton - ENTC Lab Branch/Move. The following code segment illustrates branching and data transfer. Loop MVK.S1 x,A4 ;move 16LSBs of x address→A4 MVKH.S1 x,A4 ;move 16MSBs of x address→A4. SUB.S1 A1,1,A1 ;decrement A1 [Al] B.S2 Loop;branch to Loop if A1 # 0 NOP 5 ;five no-operation instructions STW.D1 A3,*A7 ;store A3 into (A7)

Dr. Blanton - ENTC Lab 2 18 The first instruction moves the lower 16 bits (LSBs) of address x into register A4. The second instruction moves the higher 16 bits (MSBs) of address x into A4, which now contains the full 32-bit address of x. One must use the instructions MVK/MVXH in order to get a 32-bit constant into a register. Register Al is used as a loop counter. After it is decremented with the SUB instruction, it is tested for a conditional branch. Execution branches to the label or address loop if Al is not zero. If Al =0, execution continues and data in register A3 are stored in memory whose address is specified (pointed) by A7.

ASSEMBLER DIRECTIVES

Dr. Blanton - ENTC Lab 2 20 An assembler directive is a message for the assembler (not the compiler) and is not an instruction. It is resolved during the assembling process and does not occupy memory space as an instruction does. It does not produce executable code. Addresses of different sections can be specified with assembler directives. For example, the assembler directive.sect “my_buffer” defines a section of code or data named my_buffer. The directives text and data indicate a section for text and data, respectively. Other assembler directives, such as ref and def, are used for undefined and defined symbols, respectively.

Dr. Blanton - ENTC Lab 2 21 The assembler creates several sections indicated by directives such as text for code and bss for global and static variables.

Dr. Blanton - ENTC Lab 2 22 Other commonly used assembler directives are: 1..short: to initialize a 16-bit integer. 2.. int: to initialize a 32-bit integer (also.word or.long). The compiler treats a long data value as 40 hits, whereas the C6x assembler treats it as 32 bits. 3.float: to initialize a 32-bit IEEE single-precision constant. 4..double: to initialize a 64-bit IEEE double-precision constant.

Dr. Blanton - ENTC Lab 2 23 Initialized values are specified by using the assembler directives.byte,.short, or. int. Initialized variables are specified using the directive.usect, which creates an uninitialized section (like the. bss section), whereas the directive sect creates an initialized section. For example,. usect “variable”, 128, 2 designates an unitialized section named variable, the section size in bytes, and the data alignment in bytes, respectively.