At 15.02 2012.06.05, you wrote:
>My thought first too but then I looked in the assembler examples in the MPLAB
>C32 Suite which indeed does include ".h" files.
Yes, there are A LOT of defines in the ASM sources of PIC32.
PS: for example, take a look at the assembly source crt0.S
It #include <p32xxxx.h> (but that # is a comment for the assembler!!) then uses
e.g. register k0 and _CP0_STATUS (just to name two) which without p32xxxx.h will
generate errors (k0 doesn't exist natively for the assembler, it's either $k0 or
$26, and _CP0_STATUS either, it's a macro that expands to $11,0).
So in order to use the assembly sources for the PIC32 you see around, or even
crt0.S, p32xxxx.h must be really included.. yes I now see it's a C source, this
is really puzzling. :(
However, are you able to assemble lines of code like this? (not in C inline asm,
but in a separed asm source file that you like with your other C object files):
mfc0 k0,_CP0_STATUS
if you do, then p32xxxx.h has been someway included, else the only syntax that
works for the assembler would be either:
mfc0 $k0,$11,0
or
mfc0 $26,$11,0
that's "native" (i.e. without defines or macros) MIPS32 assembly. ;)
NOTE: SREGs are linked as memory locations, they are not part of the include's.
With kind regards,
Mario
{Quote hidden}>
>/Ruben
>
>> At first it seemed that you were using C, but now it is clear that you
>> are using assembly.
>>
>> The files with extension ".h" are intended for the C language, the
>> assembler will not understand them.
>>
>>
>> Isaac
>>
>>
>>
>> Em 5/6/2012 08:24, Electron escreveu:
>> > PS: it appears that:
>> >
>> > #include <p32xxxx.h>
>> >
>> > is not even included, as # is used for comments (!).. but if I open the
>> p32xxxx.h
>> > file with a text editor I can see that is full of such #include's
>.. this is
>> puzzling:
>> > different assembler is in use, options, or what?
>> >
>> > Thanks,
>> > Mario
>> >
>> >
>> >> Hello,
>> >> I've tried as:
>> >>
>> >> #include <p32xxxx.h>
>> >>
>> >> and
>> >>
>> >> #include "p32xxxx.h"
>> >>
>> >> and
>> >>
>> >> .include <p32xxxx.h>
>> >>
>> >> and
>> >>
>> >> .include "p32xxxx.h"
>> >>
>> >> but it doesn't include it.. it includes it only if I use the full path
>> >> and use / instead of \ (I'm on a Windows machine), but then it fails
>> >> on the sub-includes of course.
>> >>
>> >> I've Set The Language Tool Locations, default search path for
>> >> Assembler Include, where p32xxxx.h is physically located ( in my
>> >> system it is C:\Utility\Coding\MPLab\MPLAB C32 Suite\pic32mx\include )
>> >> with and without a trailing ; but it doesn't include it. :(
>> >>
>> >> What can I do more?
>> >>
>> >> Thanks,
>> >> Mario
>>
>> --