Mp Session 4
Mp Session 4
ldwio ldwio and stwio instructions load and store 32-bit data words from/to
stwio peripherals without caching and buffering. Access cycles for ldwio and
stwio instructions are guaranteed to occur in instruction order and are
never suppressed.
ldb ldb, ldbu, ldh and ldhu load a byte or half-word from memory to a
ldbu register. ldb and ldh sign-extend the value to 32 bits, and ldbu and ldhu zero-extend
stb the value to 32 bits.stb and sth store byte and half-word values, respectively.
ldh Memory accesses can be cached or buffered to improve performance. To transfer data
ldhu to I/O peripherals, use the io versions of the instructions, described in the following
sth table cell.
ldbio
ldbuio These operations load/store byte and half-word data from/to
stbio
ldhio
peripherals without caching or buffering.
ldhuio
sthio
The data processing instructions operate on data held in general-purpose registers. Of the two
source operands, one is always a register. The other has two basic forms:
•An immediate value
•A register value, optionally shifted.
If the operand is a shifted register the shift amount can have an immediate value or the value of
another register. Four types of shift can be specified. Most data processing instructions can
perform a shift followed by a logical or arithmetic operation.
Multiply instructions come in two classes:
•Normal, 32-bit result
•Long, 64-bit result variants.
Both types of multiply instruction can optionally perform an accumulate operation.
Data processing instructions to manipulate data within the registers.
MUL multiply Rd = Rm * Rs
The UMLAL instruction interprets the values from Rn and Rm as unsigned integers. It multiplies these integers,
and adds the 64-bit result to the 64-bit unsigned integer contained in RdHi and RdLo.
The SMULL instruction interprets the values from Rn and Rm as two's complement signed integers. It multiplies
these integers and places the least significant 32 bits of the result in RdLo, and the most significant 32 bits of the
result in RdHi.
The SMLAL instruction interprets the values from Rn and Rm as two's complement signed integers. It multiplies
these integers, and adds the 64-bit result to the 64-bit signed integer contained in RdHi and RdLo.
Comparison Instructions –
These instructions are used to compare or test a register with a 32-bit value. They update the
cpsr flag bits according to the result, but do not affect other registers. After the bits have been
set, the information can then be used to change program flow by using conditional execution.
Syntax – <instruction>{<cond>} Rn, N
TEQ test for quality of two 32 – bit values flags set as a result of Rn ^ N
PRE
r5 = 5 ; register value
r7 = 8 ; register value
MOV r7, r5 ;let r7 = r5
POST
r5 = 5 ; data in the register after moving
the r5 data into r7
r7 = 5 ; output after move operation