What, if anything, is the difference between these two instructions?
subs r2, r2, #(32)
subs r2, r2, #32
What are the parentheses () for?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Actually, those are parentheses, not brackets.
There is no difference between:
and
I suspect the
(32)used to be something like(32 - 8)or something that was interesting / meaningful / necessary at the time, then the “- 8” was removed but the parentheses were simply kept since they do no harm.For the sake of completeness, even though it’s not what you asked & you probably already know it:
The code
with “brackets” (register indirect) loads
r0with the value whose address is stored inr1— in other words, ifr1holds 1000,r0will be loaded from MEM[1000]