Re: [cc65] Optimizing code fails

Date view Thread view Subject view

From: Ullrich von Bassewitz (
Date: 2003-11-22 03:18:32

There seem to be quite a few people up late in the night for coding :-)

On Sat, Nov 22, 2003 at 03:08:09AM +0100, Benjamin Bahnsen wrote:
> I tried to speed up my code by using the -O option when compiling and
> linking with cl65, but the resulting program doesn't work anymore. The program
> always crashes. I found out that it has something to do with my interrupts
> (which only consist of assembler code). If i turn interrupts off, my program
> works fine and much faster than without the -O option.
> Why doesn't the optimization work if interrupts are turned on?

Sorry, but this can have many reasons, and you didn't give enough information
for a really helpful answer.

For one, it may be a compiler problem. Second, it can be a timing problem.
Unoptimized code is a lot slower, which may give problems depending on your
code. Third, it may be a problem with the data exchange between your interrupt
handler and the main program. And fourth, it may be something else:-)

I've written at least one C program with a non trivial interrupt handler in
assembler, and it works without problems with -Oirs. So I don't think it's a
general problem with interrupt handlers and C code.



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-11-22 03:18:45 CET