Ad
  • Default User Avatar

    Was this ever resolved? I'm getting the exact same thing.

  • Default User Avatar

    I know it's a bit late, but in this case the instruction (jnz a -2) has the code go to "inc a" n-times until (a==0), so a increments n-times and b decrements n-times also. :)

  • Default User Avatar

    With {"mov a -10","mov b a","inc a","dec b","jnz a -2"} both my code and my mental arithmetic get 'b' as '-11' but the test sample says it should be '-20'.

    Surely b is moved to the initial value of 'a' (which is -10), and then decremented by 1 (to bring it to the value of '-11') as 'dec b' (which decreases the regiser by 1) is the only other command in the array that changes the value of b. Have I overlooked something?

    Cheers!