|
From: Greg H. <gr...@hi...> - 2003-05-20 17:26:16
|
I'm trying to get some inline assembly into a C file (it's a semi-precise
time delay loop). Here's my sdcc version:
SDCC : mcs51/gbz80/z80/avr/ds390/pic14/pic16/TININative/xa51/ds400 2.3.5
(May 18 2003) (UNIX)
It seems that the '$' character I've used in my label in the inline asm is
confusing the peephole optimizer. (I used the numeric label with $ at the
end because it's suggested in the current sdccman.pdf). Here's the output
I get:
gregh: ~/projects> sdcc -mpic14 -pp16f628 second.c
Processor: p16f628
Error while parsing peep rules (check peeph.def)
Line: goto 00001$
Token: '$'
and here's the code for the function with the inline asm:
void delay500us(unsigned char count) {
for(; count > 0; count--) {
_asm
movlw 0xA6
movwf _delay
00001$:
decfsz _delay,f
goto 00001$
_endasm;
}
}
I've also tried using _00001:, _00001$:, and letter-only labels instead.
All of these get eaten by the compiler, I guess, so then I get an
assembler error that the goto has a label but that the label hasn't been
defined anywhere.
Can anybody suggest how I should format my labels so that they'll slip
past the peephole optimizer and also get left in the resulting .p/.asm
file?
Thanks,
Greg Hill
|