Am Dienstag, den 18.07.2006, 09:36 -0500 schrieb Gene Daunis:
> Thanks Jim,
> 
> I do have the extended instruction set disabled, doesn't help.

<code name="sfraccess.c">
#include <pic18fregs.h>

void foo( int b ) {
  PORTAbits.RA3 = 0;
  UEP15bits.EPCONDIS = 0;
}

void main( void ) { }
</code>

Compiling this fragment using the current svn snapshot and
sdcc -mpic16 -p18f4550 sfraccess.c

I obtain a .asm file with
;       .line   8; sfraccess.c  PORTAbits.RA3 = 0;
        BCF     _PORTAbits, 3
;       .line   9; sfraccess.c  UEP15bits.EPCONDIS = 0;
        BCF     _UEP15bits, 3

and a .hex file, which gpdasm -p18f4550 sfraccess.hex shows as
[...]
0000ea:  9680  bcf      0x80, 0x3, 0
0000ec:  967f  bcf      0x7f, 0x3, 0
[...]
which is just fine, isn't it?

This might be a... change... in gpasm (it may be a bug, it may be a
feature...).
I use gpasm-051219 beta (some daily snapshot?), probably I should update
to check more recent versions... wait a moment...
Updated to gputils-0.13.3---with bad news: gpdasm now reproduces your
results :-( Even worse, gpasm even silently (!) assembles "bcf
_UEP15bits,3,0" as "bcf _UEP15bits,3,1", though "bcf 0x7f,3,0" remains
correct.
I conclude that gputils have received updated device descriptions which
tell gpasm the the 4550 has SFRs at 0xf80--0xfff but not below.
Consequently, 0xf7f (=UEP15bits) is assumed to be accessed using
"BANKSEL 0xf; bcf 0x7f, 3, 1", only SDCC does not emit the BANKSEL...
Still this is rather an error in (recent) gputils than in sdcc.
Will you file a bug report with gputils or shall I do it?

> I can get close to fixing the problem by enabling mplab compatibility
> (--mplab-comp), but then I get "Error [113] Symbol not previously defined
> (ACCESS)". Is there a way to tell SDCC's assembler to include MicroChip's
> include file <p18f4550.inc>?

Added include <pxxx.inc> to .asm file preamble in my local tree, will
commit after the release (or should this be included?). It
compiles/assembles, but does not solve your problem (unfortunately).

Regards,
Raphael Neider



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to