I am trying to figure out what does this ARM assembly line does:
RSB r1, r2, r3, LSL #1
I am referring to RSB description from keil page but this example does not quite fit: http://www.keil.com/support/man/docs/armasm/armasm_dom1361289891932.htm I would appreciate all help.
The MLA instruction multiplies the values from Rn and Rm , adds the value from Ra , and places the least significant 32 bits of the result in Rd . The MLS instruction multiplies the values from Rn and Rm , subtracts the result from the value from Ra , and places the least significant 32 bits of the final result in Rd .
A model-specific register (MSR) is any of various control registers in the x86 instruction set used for debugging, program execution tracing, computer performance monitoring, and toggling certain CPU features.
Load Register Halfword (immediate) calculates an address from a base register value and an immediate offset, loads a halfword from memory, zero-extends it to form a 32-bit word, and writes it to a register. It can use offset, post-indexed, or pre-indexed addressing.
STR instructions store a register value into memory. The memory address to load from or store to is at an offset from the register Rn . The offset is specified by the register Rm and can be shifted left by up to 3 bits using LSL . The value to load or store can be a byte, halfword, or word.
The RSB instruction is a Reverse SuBtract without carry.
The documentation indicates the syntax:
RSB{S}{cond} {Rd}, Rn, Operand2
The following usage can then be explained:
RSB r1, r2, r3, LSL #1
r3, LSL #1
is Operand2 → r3 register logical left-shifted by 1 bit So the operation uses r1, r2 and r3 registers as follows: r1 = (r3 << 1) - r2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With