简体   繁体   中英

Full register access meaning

I am working on the MSP430 microcontroller and was going through its architecture. 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) ". I was under the impression that the CPU always has access to all the registers irrespective of the architecture.

My understanding of the statement may be wrong. Can anyone explain me what it means exactly?

As per the wikipedia page :

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. R3 always reads as 0 and writes to it are ignored. R4 through R15 are available for general use.

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.

Ditto for the other special registers, except R3 , the constant generator and the only one of the four not mentioned in your quote. 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.


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. It actually had no call or ret instructions, instead it used a standard call and return technique (SCRT) to emulate it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM