??? 04/12/04 16:02 Read: times |
#68374 - RE: Assembly works but C... Responding to: ???'s previous message |
The most visible difference between the two is that the
assembly version uses a function which is (presumably) tuned to the system speed to give an accurate delay, and the C version issues a fixed number of NOPs independent of the CPU speed. My guess is that the LongDelay isn't "Long" enough to be detected by whatever's connected to P0/1. I.e. either 1) The compiler is optimizing out the NOPs (unlikely but easy to check) or 2) Your instruction clock is so fast that the NOPs plus the loop arithmetic doesn't add up to a detectable delay. (E.g. with a 0.5us instruction cycle this is maybe one-eighth of a second, which is probably not detectable e.g. by eye on an LED.) You might want to peek at the assembly code that the compiler is generating. Does your C library have a (tuned) delay function? |
Topic | Author | Date |
Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
STARTUP.A51 | 01/01/70 00:00 | |
RE: STARTUP.A51 | 01/01/70 00:00 | |
RE: STARTUP.A51 | 01/01/70 00:00 | |
Stand Still... | 01/01/70 00:00 | |
RE: Stand Still... | 01/01/70 00:00 | |
RE: STARTUP.A51 | 01/01/70 00:00 | |
RE: STARTUP.A51 | 01/01/70 00:00 | |
function for LCD in C... | 01/01/70 00:00 | |
RE: function for LCD in C...![]() | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 | |
RE: Assembly works but C... | 01/01/70 00:00 |