Home > Software design >  Why is R8 being modified when using ADDS instruction?
Why is R8 being modified when using ADDS instruction?

Time:02-06

I am using ARMSIM to test out my Arm Assembly code.

I see R8 being updated for no reason.

This doesn't happen when I use the regular ADD instruction.

I understand ADDS updates the flags but why R8?

enter image description here

CodePudding user response:

Seeing as how both IRQ and FIQ are disabled, there's no reason why r8 should have changed at all. I've noticed that the carry is also set, which shouldn't happen when adding -10 to -10 but would happen if you added -10 to 0 (since this would result in crossing the FFFFFFFF-00000000 boundary.) I think the comments are right about this being a simulator bug. It would appear that the simulator executed adds r8,r8,r0 without you asking it to somehow.

  • Related