- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Just looking at the assembler output from PSoC Creator for the PSoC 3. The code:
uint8 *p=0;
p++;
produces this assembler:
MOV DPTR,#p+01H
CLR A
MOV B,#01H
LCALL ?C?IILDX
A call? To increment a pointer? What's with that?
Hugo
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looking at the Map file, shows the function residing in the C51L lib file.
....\PSOC CREATOR\IMPORT\KEIL\PK51\8.16\C51\LIB\C51L.LIB (?C?IILDX)
Using the library manager to create a list of the public functions of C51L.lib, verifies this.
?C?IILDX
?C?IILDX
..and looking at the MAP file again, shows it may be some 21 bytes long:
0100009AH CODE --- ?C?IILDX
010000B0H CODE --- ?C?ISTPTR
My guess it could be some bank switching or address checking code.
You may want to direct this question directly to KEIL.
PS: the \LIB folder contains code for the Lib files, but I can't seem to match the function in question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't understand why people aren't more surprised and concerned about this? Incrementing a value is one of the most fundamental operations in any code.
Even MPLAB's basic C compiler for the PIC18 generates the expected instructions for an increment.
Are there any better compilers available for the PSoC ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sure the pointer increment isn't optimized out and the lcall belongs to this increment?
Regards,
Rolf