From: Piotr Fusik (P.Fusik_at_elka.pw.edu.pl)
Date: 2002-04-17 09:35:24
Signed comparisions give incorrect results, if the difference between compared numbers is >=0x8000 (for ints) or >=0x80000000 (for longs). In the attached test program, compiled with cc65 2.8.0, the condition -0x7fff < 0x7fff is FALSE. That's because, for signed integers, "less than" condition should be computed as N_flag^V_flag rather than by simply testing the N flag. I include fixed icmp and lcmp runtime functions. Fixes are also needed for optimized inline compares. BTW. cc65 -O test.c prints: The instruction at 0x0040d980 referenced memory at 0xffffffff. The memory could not be read. Bye, Piotr
This archive was generated by hypermail 2.1.3 : 2002-04-17 09:35:51 CEST