Re: [cc65] discarded if statement

From: Ullrich von Bassewitz <>
Date: 2004-08-09 12:49:26
On Sat, Aug 07, 2004 at 01:13:44AM +0200, gerhard wrote:
> I don't code this stuff for the contribution only, but as
> i experiment with some things they just come up. ;)

Please do not send binaries to the list! Contributions should go to me in
private mail, not to the list.

> As you see, i used the %o specifier in the inline assembler.
> In line 75 i have to add 3 to the stack position of the variable,
> because the is a pushax before, and ldaxysp needs the stack
> offset+1.

> If you compile c programs, the pushs and pops will be tracked
> automatically. Is this possible for the inline assembler too, so that
> you don't have to count the pushs and pops by yourself?

No, because it is not possible for the compiler to do that. Assume this code:
        asm ("L1:");
        asm ("jsr pushax");
        asm ("dec %v", foo);
        asm ("bne L1");

How should the compiler be able to know the current stack offset? 



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Aug 9 12:49:30 2004

This archive was generated by hypermail 2.1.8 : 2004-08-09 12:49:39 CEST