Adsense

Data transfer instrutions with in the processor of ARM cortex M0+

 Moving Data within the Processor

Instruction MOV
Function Move register into register

Syntax (UAL) MOV <Rd>, <Rm>
Syntax (pre-UAL) MOV <Rd>, <Rm>
CPY <Rd>, <Rm>
Note Rm and Rn can be high or low registers.
CPY is a pre-UAL synonym for MOV (register).

Instruction MOVS/ADDS
Function Move register into register

Syntax (UAL) MOVS <Rd>, <Rm>
ADDS <Rd>, <Rm>, #0
Syntax (pre-UAL) MOVS <Rd>, <Rm>
Note Rm and Rn are both low registers.
APSR.Z, APSR.N, and APSR.C (for ADDS) update.

Instruction MOV
Function Move immediate data (sign extended) into register

Syntax (UAL) MOVS <Rd>, #immed8
Syntax (pre-UAL) MOV <Rd>, #immed8
Note Immediate data range 0 to รพ255.
APSR.Z and APSR.N update.

Instruction MRS
Function Move Special Register into register

Syntax MRS <Rd>, <SpecialReg>
Note Example:
MRS R0, CONTROL ; Read CONTROL register into R0
MRS R9, PRIMASK ; Read PRIMASK register into R9
MRS R3, XPSR ; Read xPSR register into R3 

Instruction MSR
Function Move register into Special Register

Syntax MSR <SpecialReg>, <Rd>
Note Example:
MSR CONTROL, R0 ; Write R0 into CONTROL register
MSR PRIMASK, R9 ; Write R9 into PRIMASK register

No comments:

Post a Comment

Write a ARM cortex M0+ assembly language code based on arithmatc and logical instructions.

 Problem 1: Implement following code conversions to convert binary no 0x89ABCDEF(32-bits) into a) BCD (64-bits)   b) Gray (32-bits) Problem...