简体   繁体   English

MSP430装配说明

[英]MSP430 assembly instructions

I am trying to understand what these instructions do for the MSP 430 processor: 我试图了解这些指令对MSP 430处理器的作用:

(1) MOV.w  #0x0055,R5
(2)   BIC.w  #0xFFEE,R5
(3)   BIS.w  #0x1144,R5

I haven't been able to find much that explains the assembly instructions and would love to find out what these instructions do and what is stored in the r5 register after each instruction. 我无法找到解释汇编指令的内容,并且很想知道每条指令后这些指令的作用以及存储在r5寄存器中的内容。 Could someone explain? 有人能解释一下吗

MOV moves a value to the destination. MOV将值移动到目标。 In this case R5 will contain the value 0x0055. 在这种情况下, R5将包含值0x0055。

BIC clears bits in the destination value. BIC清除目标值中的位。 If R5 would contain 0x0055 before the instruction, it will contain the value 0x0011. 如果R5在指令之前包含0x0055,则它将包含值0x0011。 (Think of this as an inversed and instruction). (将其视为反向指令)。

BIS sets bits -- this is effectively the same as an or operation. BIS设置位 - 这实际上与一个一个操作相同。 R5 will have the value 0x1155 after this instruction. 该指令后R5的值为0x1155。

MOV.w #0x0055,R5 does the following: src → dst MOV.w #0x0055,R5执行以下操作: src → dst

BIC.w #0xFFEE,R5 does the following not.src .and. dst → dst BIC.w #0xFFEE,R5执行以下not.src .and. dst → dst not.src .and. dst → dst

BIS.w #0x1144,R5 does the following: src .or. dst → dst BIS.w #0x1144,R5执行以下操作: src .or. dst → dst src .or. dst → dst

Just look at the MSP 430 User Guide 只需查看MSP 430用户指南即可

BIS[.W] Set bits in destination BIS.B BIS [.W]设置目标BIS.B中的位
Set bits in destination 设置目标位

Syntax BIS src,dst or 语法BIS src,dst或
BIS.W src,dst BIS.B src,dst BIS.W src,dst BIS.B src,dst

Operation src .OR. 操作src .OR。 dst −> dst dst - > dst

Description The source operand and the destination operand are logically ORed. 描述源操作数和目标操作数是逻辑ORed。 The result is placed into the destination. 结果放入目的地。 The source operand is not affected. 源操作数不受影响。

Status Bits Status bits are not affected. 状态位状态位不受影响。

Mode Bits OSCOFF, CPUOFF, and GIE are not affected. 模式位OSCOFF,CPUOFF和GIE不受影响。

Example The six LSBs of the RAM word TOM are set. 示例设置RAM字TOM的六个LSB。

BIS #003Fh,TOM; BIS#003Fh,TOM; set the six LSBs in RAM location TOM 在RAM位置TOM中设置六个LSB

Example The three MSBs of RAM byte TOM are set. 示例设置RAM字节TOM的三个MSB。

BIS.B #0E0h,TOM ; BIS.B#0E0h,TOM; set the 3 MSBs in RAM location TOM 将3个MSB设置在RAM位置TOM中

Of Course: 当然:

BIC[.W] Clear bits in destination BIC.B BIC [.W]清除目标BIC.B中的位
Clear bits in destination 清除目的地中的位

Syntax BIC src,dst or 语法BIC src,dst或
BIC.W src,dst BIC.B src,dst BIC.W src,dst BIC.B src,dst

Operation .NOT.src .AND. 操作.NOT.src .AND。 dst −> dst dst - > dst

Description The inverted source operand and the destination operand are logically ANDed. 说明反向源操作数和目标操作数在逻辑上进行AND运算。 The result is placed into the destination. 结果放入目的地。 The source operand is not affected. 源操作数不受影响。

Status Bits Status bits are not affected. 状态位状态位不受影响。

Mode Bits OSCOFF, CPUOFF, and GIE are not affected. 模式位OSCOFF,CPUOFF和GIE不受影响。

Example The six MSBs of the RAM word LEO are cleared. 示例清除RAM字LEO的六个MSB。

BIC #0FC00h,LEO ; BIC#0FC00h,LEO; Clear 6 MSBs in MEM(LEO) 清除MEM中的6个MSB(LEO)

Example The five MSBs of the RAM byte LEO are cleared. 示例清除RAM字节LEO的五个MSB。

BIC.B #0F8h,LEO ; BIC.B#0F8h,LEO; Clear 5 MSBs in Ram location LEO 清除Ram位置LEO中的5个MSB

I was able to find this user guide with a related link on this very website 我能够在这个网站上找到这个用户指南以及相关链接

A piece of information missing from the existing answers is the significance of .W vs .B. 现有答案中缺少的一条信息是.W与.B的重要性。

From Section 3.4 of the MSP430F24x User Guide (SLAU144J) on page 56 it specifies, 从第56页的MSP430F24x用户指南(SLAU144J)的第3.4节开始,它指定,

B/W: 黑/白:

Byte or word operation: 字节或字操作:

0: word operation 0:字操作

1: byte operation 1:字节操作

It is worth noting that the default is that instructions operate on a word. 值得注意的是,默认情况是指令对单词进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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