Why does the ARM provide a reverse subtract instruction RSB r0,r1,r2, that implements [r0] = [r2] ? [r1], when the normal subtraction instruction SUB r0,r2,r1, will do exactly the same job?

What will be an ideal response?


In principle, you don’t need a reverse subtract and most other processors don’t provide it. However, it is useful with literal operands. SUB r0,r1,#4 is a typical subtraction with a literal that allows you to calculate [r0] = [r1] ? 4. However, RSB r0,r1,#4 lets you calculate r0 = 4 ? [r1]. This saves you an instruction swapping the literal round.

You can also use RSB to negate a number; for example RSB r0,r0,#0 calculates [r0] = 0 ? [r0] = ?[r0].

Moreover, because ARM has a shifter in only one operand path, the reverse subtraction makes it possible to shift either operand. For example, SUB r0,r1,LSL #2 and RSB r1,r0,LSL#2.

Computer Science & Information Technology

You might also like to view...

SIIT defines a type of IPv6 address that can be formatted as ::ffff:0:0:0/96 or ::ffff:0:a.b.c.d., in which a.b.c.d is the IPv4 address notation. What is this address called?

A. unique hybrid address B. transition address C. domain address D. IPv4 translated address

Computer Science & Information Technology

The effects added to a presentation are listed on the ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

What type of dedicated cryptographic processor that provides protection for cryptographic keys?

A. SSL/TLS accelerator B. media gateway C. SSL decryptor D. hardware security module

Computer Science & Information Technology

What is the purpose of the Windows Defender program?

A) To provide firewall features B) To detect spyware C) To provide antivirus protection D) To detect when the machine has been compromised by an intruder

Computer Science & Information Technology