Hi,
I am using a bit of line code:
asm("breq PC+0x01\n");
but I get an undefined reference to the program counter. How do I get it to skip the next instruction ?
Hi,
I am using a bit of line code:
asm("breq PC+0x01\n");
but I get an undefined reference to the program counter. How do I get it to skip the next instruction ?
PC is "." in a real assembler ;-)
But why not use local labels?
asm("breq 1f\n"); asm("ldi r16,12\n"); asm("1: or r14,r16\n");
which generates:
asm("breq 1f\n"); 9a: 09 f0 breq .+2 ; 0x9easm("ldi r16,12\n"); 9c: 0c e0 ldi r16, 0x0C ; 12 asm("1: or r14,r16\n"); 9e: e0 2a or r14, r16
The page in the manual about local labels:
PC is "." in a real assembler
Lee
in one assembler
Do you have gas ?
But why not use local labels?
Do you have gas ?
PC is "." in a real assembler ;-)But why not use local labels?
asm("breq 1f\n"); asm("ldi r16,12\n"); asm("1: or r14,r16\n");
You aren't allowed to jump to another asm as it introduces a control flow unknown to the compiler. Nor are you allowed to trample over registers without informing the compiler.
Whilst your program may work with current versions of GCC, with future version it may not.
Whilst your program may work with current versions of GCC, with future version it may not.
You aren't allowed to jump to another asm as it introduces a control flow unknown to the compiler.
Maybe Timothy meant that the optimiser might re-order the Asm statements? I have to be honest that I've never seen this happen, but if it can this would seem to be yet another argument for using .S