Page 2 of 2

Posted: Sun Jun 10, 2012 1:34 am
by sega16
Yep that is what it was I put a moveq #0,d0 before the draw line function and the mul worked.

Posted: Sun Jun 10, 2012 4:15 am
by Chilly Willy
sega16 wrote:Yep that is what it was I put a moveq #0,d0 before the draw line function and the mul worked.
Ah - isn't strange how some of the SMALLEST THINGS can make a program act weird?

Posted: Sun Jun 10, 2012 5:12 am
by sega16
I agree it can be strange and this is especially true for asm. When programming in high level languages this does not happen as much as far as I am aware because the programer does not manipulate registers.

Posted: Sun Jun 10, 2012 5:48 pm
by Chilly Willy
True, but you can get other issues that compilers now generate warnings for, like this case:

Code: Select all

    int x;
    while (something)
    {
        if (whatever)
            x = whatever = 0;
        x += 1;
        something = check_something();
    }
The code assumes that whatever is set coming into the loop or else x has an undefined value to start. That will generate a warning in gcc, but still compile as the compiler cannot tell the state of whatever at that point.