Reputation:
I read here, that the overflow flag might also be set in certain cases. Trying out the following sample of code :-
.global main
.func main
main:
mov r0, #4026531839
mov r1, #-1
sub r0, r0, r1
os is_set
mov r0, #17
bx lr
is_set:
mov r0, #71
bx lr
I got an error message that said the following :-
carryflagsub.s: Assembler messages:
carryflagsub.s:8: Error: bad instruction `os is_set'
Isn't os
the instruction used to test if the overflow flag is set?
Upvotes: 0
Views: 343
Reputation: 1260
There is no os
instruction in ARM instruction set. However, to test if the overflow flag is set you can use conditional execution of instructions, like that.
bvs is_set
You can learn about conditional execution in ARM reference manual.
Upvotes: 2
Reputation: 15501
By os
I assume you mean vs
.
If you want to branch on the vs
condition, the instruction is bvs
.
Upvotes: 0