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...

In regard to SkyDrive security levels, a setting of ________ means that your friends on Windows Live, except for those for whom you have restricted access, can either view or modify it depending on the option you choose

A) me B) friends C) my friends and their friends D) some friends

Computer Science & Information Technology

Which of the following involves using various tools to find vulnerabilities in a system?

a. Port scanning b. Port blocking c. Enumeration d. Vulnerability assessment

Computer Science & Information Technology