08-17-2009, 08:59 PM
britlion Wrote:You must use ubyte (Unsigned Byte), since byte type is signed, and in the above lines, you have an overflow:Code:dim c,b as byte
FOR c=1 TO 175
FOR b=1 TO 250
PLOT b,c
NEXT b
NEXT c
Doesn't seem to work as expected. If I make it a uinteger, it works perfectly.
ubyte 175 is -85 byte => the FOR loop is skipped. In the future, the compiler might issue an overflow warning in these cases to warn you about this.
Quote:1> Would for/next loops with byte be faster? (I'm following the principle of smaller=faster)It should be. Z80 is an 8 bit machine and the FOR is done with 8bit values when using bytes.
If you can understand Z80 ASM (I guess you do
