jsmolka / gba-tests

A collection of Game Boy Advance tests.
MIT License
101 stars 9 forks source link

Is MOV r0, r0 expected in thumb arithmetic.asm #11

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hey,

In https://github.com/jsmolka/gba-tests/blob/master/thumb/arithmetic.asm, on line 128, is the (trivial?) instruction "mov r0, r0" instruction expected ?

Is the instruction a typo i.e., should it be "mov r0, 0" (or something like it) to make more sense in the context of the test ?

Thanks, Revanth

jsmolka commented 1 year ago

It's just a way to set r0 to 0xFFFF'FFFF.

mov     r0, 0  ; r0 = 0
mvn     r0, r0  ; r0 = ~r0

Then we add 1, wich causes an overflow and sets the carry.

ghost commented 1 year ago

Thanks for the explanation @jsmolka.

ghost commented 1 year ago

Hi @jsmolka ,

Just FYI - I've added an acknowledgement and link to your repo from my project here. ZAP Project Link

See Section 5 in the README.

Thanks, Revanth