Page 1 of 1

When is overflow flag set for SUB instruction?

Posted: Wed Jun 25, 2025 9:00 pm
by Fredrik
It seems that in the provided code example the ov flag is set when the result of a SUB instruction is negative or am I wrong?

/* compare with low_thr; wake up if value < low_thr */
move r3, low_thr
ld r3, r3, 0
sub r3, r0, r3
jump wake_up, ov


https://github.com/espressif/esp-idf/bl ... /ulp/adc.S