MSP430之instruction之MOV

MOV[.W]      Move source to destination
MOV.B      Move source to destination

Syntax     MOV   src,dst  or       MOV.W  src,dst
        MOV.B src,dst

Operation   src −> dst

Description

  The source operand is moved to the destination.The source operand is not affected. The previous contents of the destination are lost.

Status Bits   Status bits are not affected.

Mode Bits   OSCOFF, CPUOFF, and GIE are not affected.

Example   The contents of table EDE (word data) are copied to table TOM. The length of the tables must be 020h locations.

1        MOV #EDE,R10         ; Prepare pointer
2        MOV #020h,R9         ; Prepare counter
3 Loop    MOV @R10+,TOM−EDE−2(R10)  ; Use pointer in R10 for both tables
4          DEC R9             ; Decrement counter
5         JNZ Loop           ; Counter ≠ 0, continue copying
6       ......             ; Copying completed
7       ......
8       ......

Example   The contents of table EDE (byte data) are copied to table TOM. The length of the tables should be 020h locations

 1         MOV #EDE,R10           ; Prepare pointer
 2         MOV #020h,R9           ; Prepare counter
 3 Loop    MOV.B @R10+,TOM−EDE−1(R10) ; Use pointer in R10 for
 4                                    ; both tables
 5         DEC R9              ; Decrement counter
 6         JNZ Loop             ; Counter ≠ 0, continue
 7                               ; copying
 8         ......                ; Copying completed
 9         ......
10         ......                                        
时间: 2024-10-04 19:04:43

MSP430之instruction之MOV的相关文章

MSP430之instruction之Indirect Autoincrement Mode

Assembler Code Content of ROMMOV @R10+,0(R11)   MOV @R10+,0(R11) Length: One or two words Operation: Move the contents of the source address (contents of R10) to the destination address (contents of R11). Register R10 is incremented by 1 for a byte o

MSP430之instruction之JUMP

JMP  Jump unconditionally Syntax   JMP  label Operation PC + 2 × offset −> PC Description The 10-bit signed offset contained in the instruction LSBs is added to the program counter. Status Bits Status bits are not affected. Hint: This one-word instru

MSP430之instruction之CMP

CMP[.W]  Compare source and destinationCMP.B  Compare source and destination Syntax  CMP src,dst or CMP.W src,dst CMP.B  src,dst Operation dst + .NOT.src + 1 or (dst − src) Description The source operand is subtracted from the destination operand. Th

ARMv8 Linux内核异常处理过程分析

NOTE:为了方便大家阅读,制作了PDF版文档.下载请猛戳这里 老样子,为了赚点积分下载其它人的文件,下载以上资料须要资源分2分. 假设没有积分请留言全部文档,留下邮箱就可以. 看了Linaro提供的开源ARMv8 Linux内核源代码,发现ARMv8异常处理与ARMv7及之前的架构有所不同,简单分析. LinaroARMv8工程:http://www.linaro.org/engineering/engineering-projects/armv8 1.1 Linux内核异常处理相关文件 Li

PatentTips - Safe general purpose virtual machine computing system

BACKGROUND OF THE INVENTION The present invention relates to virtual machine implementations, and in particular to a safe general purpose virtual machine that generates optimized virtual machine computer programs that are executable in a general purp

openMSP430之instruction

Byte and word issues 1 Appending “.b” to an instruction makes it a byte operation. A byte instruction with a register destination clears the high 8 bits of the register to 0. Thus, the following would clear the top byte of the register, leaving the l

msp430知识

IO口 数字输入/输出端口有下列特性:□ 每个输入/输出位都可以独立编程.□ 允许任意组合输入.输出.□ P1 和 P2 所有 8 个位都可以分别设置为中断.□ 可以独立操作输入和输出数据寄存器.□ 可以分别设置上拉或下拉电阻. 在介绍这四个I/O口时提到了一个“上拉电阻”那么上拉电阻又是一个什么东东呢?他起什么作用呢?都说了是电阻那当然就是一个电阻啦,当作为输入时,上拉电阻将其电位拉高,若输入为低电平则可提供电流源;所以如果P0口如果作为输入时,处在高阻抗状态,只有外接一个上拉电阻才能有效.

为什么X86汇编中的mov指令不支持内存到内存的寻址?

在X86汇编中,MOV [0012H], [0016H]这种指令是不允许的,至少得有一个操作数是寄存器.当然,这种问题在用高级语言的时候看不到,感觉好像基本上都是从内存到内存啊,为毛到了汇编就不行了???这个问题在stack overflow有个解释不错: The answer involves a fuller understanding of RAM. Simply stated, RAM can only be in two states, read mode or write mode.

汇编中中括号[]作用以及lea和mov指令的区别

现在总结一下:其中牵扯到lea指令,mov指令,[] 一.lea指令:对于寄存器来说:第二个操作数是寄存器必须要加[],不然报错,这里lea就是取[寄存器]的值,如:mov eax,2lea ebx,[eax];执行后ebx=2mov ebx,eax;等同于上句lea ebx,eax;编译器报错: error A2070: invalid instruction operands 对于变量来说加不加[]都是一样的效果,都是取变量的地址,相当于指针如:num dword 2lea ebx,numl