Chinaunix首页 | 论坛 | 博客
  • 博客访问: 56928
  • 博文数量: 40
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 30
  • 用 户 组: 普通用户
  • 注册时间: 2015-03-14 11:08
文章分类
文章存档

2015年(40)

我的朋友

分类: 嵌入式

2015-05-23 23:45:18

原文地址:cpsr与cpsr_c的区别 作者:jerry20000

 CPSR有4个8位区域:

标志域(F)、状态域(S)、扩展域(X)、控制域(C)

MSR - Load specified fields of the CPSR or SPSR with an immediate constant, or from the contents of a general-purpose register.

Syntax:

MSR{cond} _, #immed_8r MSR{cond} _, Rm where: cond is an optional condition code. is either CPSR or SPSR. specifies the field or fields to be moved. can be one or more of:

c control field mask byte (PSR[7:0])

x extension field mask byte (PSR[15:8])

s status field mask byte (PSR[23:16)

f flags field mask byte (PSR[31:24]).

immed_8r is an expression evaluating to a numeric constant.

The constant must correspond to an 8-bit pattern rotated by an even number of bits within a 32-bit word. Rm is the source register.

C 控制域屏蔽字节(psr[7:0])
X 扩展域屏蔽字节(psr[15:8])
S 状态域屏蔽字节(psr[23:16])
F 标志域屏蔽字节(psr[31:24])
常用于MRS或MSR指令,用于psr中的值转移到寄存器或把寄存器的内容加载到psr中.
如:

MSR CPSR_c,#0xd3;进入管理模式

阅读(381) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~