Tip:
Highlight text to annotate it
X
Hello and welcome. Last time we covered ADD. This time we'll
cover a few other arthimetic operations, such as SUB and MUL.
Let's get straight to the code -- as you should know what these are.
The sub syntax is the same as add. The code:
mov r1, #255 sub r1, r1, #2
bl printf
253
Mul, however, is slightly different -- in that you can only multiply registers and not immediate
values.
mov r1, #255 mov r2, #2
mul r1, r1, r2
510
Next time we'll cover getting keyboard input. Hopefully this has been helpful.