The cregister Keyword

6.5.2 The cregister Keyword

The compiler extends the C/C++ language by adding the cregister keyword to allow high level language access to control registers.

When you use the cregister keyword on an object, the compiler compares the name of the object to a list of standard control registers for the C6000 (see Table 6-3). If the name matches, the compiler generates the code to reference the control register. If the
name does not match, the compiler issues an error.

==================Table 6-3. Valid Control Registers===================

Register Description

AMR Addressing mode register

CSR Control status register

DESR (C6700+ only) dMAX event status register

DETR (C6700+ only) dMAX event trigger register

DNUM (C6400+ only) DSP core number register

ECR (C6400+ only) Exception clear register

EFR (C6400+ only) Exception flag register

FADCR (C6700 only) Floating-point adder configuration register

FAUCR (C6700 only) Floating-point auxiliary configuration register

FMCR (C6700 only) Floating-point multiplier configuration register

GFPGFR (C6400 only) Galois field polynomial generator function register

GPLYA (C6400+ only) GMPY A-side polynomial register

CPLYB (C6400+ only) GMPY B-side polynomial register

ICR Interrupt clear register

IER Interrupt enable register

IERR (C6400+ only) Internal exception report register

IFR Interrupt flag register. (IFR is read only.)

ILC (C6400+ only) Inner loop count register

IRP Interrupt return pointer

ISR Interrupt set register

ISTP Interrupt service table pointer

ITSR (C6400+ only) Interrupt task state register

NRP Nonmaskable interrupt return pointer

NTSR (C6400+ only) NMI/exception task state register

REP (C6400+ only) Restricted entry point address register

RILC (C6400+ only) Reload inner loop count register

SSR (C6400+ only) Saturation status register

TSCH (C6400+ only) Time-stamp counter (high 32) register

TSCL (C6400+ only) Time-stamp counter (low 32) register

TSR (C6400+ only) Task state register

===============================================================

The cregister keyword can be used only in file scope. The cregister keyword is not allowed on any declaration within the boundaries of a function. It can only be used on objects of type integer or pointer.The cregister keyword
is not allowed on objects of any floating-point type or on any structure or union objects.

The cregister keyword does not imply that the object is volatile. If the control register being referenced is volatile (that is, can be modified by some external control), then the object must be declared with the volatile keyword also.

To use the control registers in Table 6-3, you must declare each register as follows. The c6x.h include file defines all the control registers through this syntax:

extern cregister volatile unsigned int register ;

Once you have declared the register, you can use the register name directly. See the TMS320C62x DSP CPU and Instruction Set Reference Guide, TMS320C64x/C64x+ DSP CPU and Instruction Set Reference Guide, the TMS320C67x/C67x+ DSP CPU and Instruction
Set Reference Guide, or TMS320C66x+ DSP CPU and Instruction Set Reference Guide for detailed information on the control registers.See Example 6-1 for an example that declares and uses control registers.

Example 6-1. Define and Use Control Registers

extern cregister volatile unsigned int AMR;

extern cregister volatile unsigned int CSR;

extern cregister volatile unsigned int IFR;

extern cregister volatile unsigned int ISR;

extern cregister volatile unsigned int ICR;

extern cregister volatile unsigned int IER;

extern cregister volatile unsigned int FADCR;

extern cregister volatile unsigned int FAUCR;

extern cregister volatile unsigned int FMCR;

main()

{

printf("AMR = %x\n", AMR);

}

The cregister Keyword

时间: 2024-08-16 00:45:07

The cregister Keyword的相关文章

[ES6] 03. The let keyword -- 1

var message = "Hi"; { var message = "Bye"; } console.log(message); //Bye The message inside the block still has impact on the outside. If you add function around the inside message: var message = "Hi"; function greeting(){ va

python2和python3中的关键字的区别--keyword模块

一.python3.6中的: 共33个关键字: 通过导入keyword模块,查看python所有的关键字.在ipython中: Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)]Type "copyright", "credits" or "license" for more information.

JavaScript constructors, prototypes, and the `new` keyword

Are you baffled(阻碍:使迷惑) by the new operator in JavaScript? Wonder what the difference between a function and a constructor is? Or what the heck a prototype is used for? I’m going to lay it out straight. Now, there’s been a lot of talk for a long time

java中不常见的keyword:strictfp,transient

1.strictfp, 即 strict float point (精确浮点). strictfp keyword可应用于类.接口或方法.使用 strictfp keyword声明一个方法时,该方法中全部的float和double表达式都严格遵守FP-strict的限制,符合IEEE-754规范.当对一个类或接口使用 strictfp keyword时,该类中的全部代码,包含嵌套类型中的初始设定值和代码,都将严格地进行计算.严格约束意味着全部表达式的结果都必须是 IEEE 754 算法对操作数预

飘逸的python - 不使用keyword,求和1+2+…+n

依据题意,我们不能用到if/else/for/while等keyword. --------------思考中------------ 思路: 1.用递归实现循环 2.递归的终止条件不用if怎么推断呢?  答案是字典,当中用not not n来把数字n转成bool. 上代码: def sum_(n): return n + { True:lambda:sum_(n-1), False:lambda:0 }[not not n]() print sum_(100)

[Angular] Bind async requests in your Angular template with the async pipe and the "as" keyword

Angular allows us to conveniently use the async pipe to automatically register to RxJS observables and render the result into the template once the request succeeds. This has some drawbacks, especially if we want to bind the same data in multiple par

[CareerCup] 13.5 Volatile Keyword 关键字volatile

13.5 What is the significance of the keyword "volatile" in C 这道题考察我们对于关键字volatile的理解,顾名思义,volatile有易变的易挥发的意思,在C/C++里,表示告知编译器某个变量可能会由程序外部改变,比如操作系统,硬件或者其他的线程.由于变量会由无法预期的改变,所有编译器每次都需要从内存中读取变量值.我们可以如下定义一个整型变量为volatile: int volatile x; volatile int x

csharp: Linq keyword example

/// <summary> /// http://www.dotnetperls.com/linq /// </summary> public partial class LinqForm : Form { const int _max = 1000000; /// <summary> /// Linq keyword /// </summary> public enum CheckLinq { Distinct, Union, Intersect, Exc

搜索框中“请输入搜索keyword”

$(function(){    $("#ctl00_txtKey").val("请输入搜索keyword").addClass("search")    .blur(function(){        $(this).removeClass('highligth');        if($(this).val()==""){            $("#ctl00_txtKey").val(&quo