[英]Full register access meaning
I am working on the MSP430 microcontroller and was going through its architecture. 我正在研究MSP430微控制器,并正在研究其体系结构。 In the user guide, under its features tab, there is a statement like this - " Full register access including program counter (PC), status register (SR), and stack pointer (SP) ".
在用户指南的“功能”选项卡下,有这样一条语句:“ 包括程序计数器(PC),状态寄存器(SR)和堆栈指针(SP)在内的完全寄存器访问 ”。 I was under the impression that the CPU always has access to all the registers irrespective of the architecture.
我给人的印象是,CPU始终可以访问所有寄存器,而与体系结构无关。
My understanding of the statement may be wrong. 我对声明的理解可能是错误的。 Can anyone explain me what it means exactly?
谁能解释我的确切含义?
As per the wikipedia page : 根据Wikipedia页面 :
The processor contains 16 16-bit registers, of which 4 are dedicated to special purposes: R0 is the program counter, R1 is the stack pointer, R2 is the status register, and R3 is a special register called the constant generator, providing access to 6 commonly used constant values without requiring an additional operand.
处理器包含16个16位寄存器,其中4个专用于特殊目的:R0是程序计数器,R1是堆栈指针,R2是状态寄存器,R3是称为常量发生器的特殊寄存器,可用于访问6个常用常数值,不需要其他操作数。 R3 always reads as 0 and writes to it are ignored.
R3始终读为0,并忽略写入。 R4 through R15 are available for general use.
R4至R15可供一般使用。
In other words, "full access" in this case means not just using jmp
-type instructions to be able to jump to a new location, but also allowing something like xor r0, #1234
to directly (and probably fatally) modify the program counter. 换句话说,在这种情况下,“完全访问”意味着不仅使用
jmp
-type指令能够跳转到新位置,而且还允许诸如xor r0, #1234
类的东西直接(并且可能致命地)修改程序计数器。 。
Ditto for the other special registers, except R3
, the constant generator and the only one of the four not mentioned in your quote. 除
R3
之外,其他特殊寄存器也同上,常量生成器以及报价中未提及的四个中的唯一一个。 While all the instructions could operate on that register, it ignores writes and generates various fixed values on read ( -1..2
, use of R2
can also give you 4
and 8
) depending on the addressing mode used. 尽管所有指令都可以在该寄存器上操作 ,但它会忽略写入操作 ,并在读取时生成各种固定值(
-1..2
,使用R2
还可以为您提供4
和8
),具体取决于所使用的寻址模式。
That may seem a little strange but it's not the strangest I've ever seen. 这似乎有些奇怪,但这并不是我见过的最奇怪的。 For that, you would have to investigate the RCA1802A CPU which, like the MPS430 had "general purpose" registers for specific functions but you could actually choose at run time which should be the program counter or stack pointer.
为此,您必须研究RCA1802A CPU,它与MPS430一样具有用于特定功能的“通用”寄存器,但实际上您可以在运行时选择应该是程序计数器还是堆栈指针。 It actually had no
call
or ret
instructions, instead it used a standard call and return technique (SCRT) to emulate it. 它实际上没有任何
call
或ret
指令,而是使用标准调用和返回技术(SCRT)效仿。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.