gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: Interfacing w/assembler in SDCC on PIC?
From: Greg Hill
Date: Thu, 25 Sep 2003 08:48:53 -0600 (MDT)

A specific problem I've come across (I don't think it's been fixed yet) is
that "goto <label>" doesn't work. The label gets stripped out by some
earlier pass in the compiler, and then gpasm complains because it can't
find the label. I think goto's in general aren't working quite how we'd
like for them to..

The work-around I use is to put my delay loops like the one you have
written into a separate (.asm) file. Then I use "global <fn_name>" in the
.asm file, and an external function declaration (extern fn_name(char
one_param)) in the .c file. Compile the .c into a .o, assemble the .asm
into a .o, and then gplink them together to get a .hex. (at least, if I
remember correctly.)

Greg


On Thu, 25 Sep 2003, Scott Dattalo wrote:

<snip>

> However, be aware that inlined assembly code is not handled very well.

gnupic@linuxhacker.org