From: Guilherme N. <gui...@ig...> - 2003-12-04 16:18:26
|
Hi, I'm new to sdcc, I've used keil for some months and I'm trying to find out the main differences in writing code for each other. The first thing I noticed is that I'm not able to address a bit of a register unless I explicitly declare it. Let me make it clear: In the keil compiler if I had a sfr declared sfr P1 = 0x90; I could address it's first bit P1^0 = 0; In avcase compiler (an old vrsion in my school) I would do P1.1 = 0; I've tried both ways in sdcc, but none seem to work: sfr at 0x90 P1; P1.1 = 0; gives a parse error P1^1 seems to be like P1 XOR 1, so doesn't work for me either. Does anybody know how to do that or can you tell me if I simply can't do that? And do you know anything else I should take care of while migrating? So far the only thing I've found is that I must declare sfr and sbit in a different way. Also in keil I have to set up the chip I'm working with. I don't know if it's mandatory, but do you know how should I do it in sdcc? The chip I'm using is the Philips p89c557e4. Thank you very much for any help you can provide me. Guilherme _________________________________________________________ Voce quer um iGMail protegido contra vírus e spams? Clique aqui: http://www.igmailseguro.ig.com.br Ofertas imperdíveis! Link: http://www.americanas.com.br/ig/ |
From: Steve P. <wb...@ma...> - 2003-12-04 16:36:27
|
Guilherme, P1_1 gets you to P1.1, and likewise to other P#.# sbits. Search for it i= n the=20 sdcc header file mcs51reg.h, which is included with sdcc. Referring to t= hat=20 header has helped me with several porting issues.=20 Thanks, Steve On Thursday 04 December 2003 10:18 am, Guilherme Neuman wrote: > Hi, > > I'm new to sdcc, I've used keil for some months and I'm trying to find = out > the main differences in writing code for each other. > The first thing I noticed is that I'm not able to address a bit of a > register unless I explicitly declare it. Let me make it clear: > In the keil compiler if I had a sfr declared > sfr P1 =3D 0x90; > I could address it's first bit > P1^0 =3D 0; > In avcase compiler (an old vrsion in my school) I would do > P1.1 =3D 0; > I've tried both ways in sdcc, but none seem to work: > sfr at 0x90 P1; > P1.1 =3D 0; gives a parse error > P1^1 seems to be like P1 XOR 1, so doesn't work for me either. > > Does anybody know how to do that or can you tell me if I simply can't d= o > that? > And do you know anything else I should take care of while migrating? So= far > the only thing I've found is that I must declare sfr and sbit in a > different way. > Also in keil I have to set up the chip I'm working with. I don't know i= f > it's mandatory, but do you know how should I do it in sdcc? The chip I'= m > using is the Philips p89c557e4. > > Thank you very much for any help you can provide me. > Guilherme > > _________________________________________________________ > Voce quer um iGMail protegido contra v=EDrus e spams? > Clique aqui: http://www.igmailseguro.ig.com.br > Ofertas imperd=EDveis! Link: http://www.americanas.com.br/ig/ > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM= 's > Free Linux Tutorials. Learn everything from the bash shell to sys admi= n. > Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dclick > _______________________________________________ > Sdcc-user mailing list > Sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-user |