Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » SDCC
  • » [Sdcc-user] passing mcs51 sfr to function and store to it [RSS Feed]

#1 Dec. 14, 2010 18:20:54

z.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] passing mcs51 sfr to function and store to it


Hi All,

Is there any method to passing an sfr addres to a function?
And I need to store sfr address to a struct like this:

typedef struct {
uint8_t cursorX;
uint8_t cursorY;
unsigned char *buffer;
uint8_t cols;
uint8_t rows;
uint8_t cursorState;
__sfr dataPort;
__sfr controlPort;
} Display;

How can I do these?

--
thx,
----------------------------------
Zoltan Zidarics programmer
PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary
E-Mail: za***@*ili.pmmf.hu
----------------------------------




Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#2 Dec. 14, 2010 22:59:48

Maarten B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] passing mcs51 sfr to function and store to it


Hi,

This is impossible. The sfr's are not indirectly
accessable on almost all mcs51 compatible derivatives.

Maarten

> Hi All,
>
> Is there any method to passing an sfr addres to a function?
> And I need to store sfr address to a struct like this:
>
> typedef struct {
> uint8_t cursorX;
> uint8_t cursorY;
> unsigned char *buffer;
> uint8_t cols;
> uint8_t rows;
> uint8_t cursorState;
> __sfr dataPort;
> __sfr controlPort;
> } Display;
>
> How can I do these?
>
> --
> thx,
> ----------------------------------
> Zoltan Zidarics programmer
> PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary
> E-Mail: za***@*ili.pmmf.hu
> ----------------------------------
>
>
>
>
> Sdcc-user mailing list
> Sdcc-u***@*ists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/sdcc-user>




Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#3 Dec. 15, 2010 07:47:56

z.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] passing mcs51 sfr to function and store to it


hi Marteen,

thx, for response. I get a code slice athttp://www.mail-archive.com/sdcc-u***@*ists.sourceforge.net/msg00639.htmlIt is very ugly code, but maybe usable.

12/14/2010 11:57 PM keltezéssel, Maarten Brock írta:
> Hi,
>
> This is impossible. The sfr's are not indirectly
> accessable on almost all mcs51 compatible derivatives.
>
> Maarten
>
>> Hi All,
>>
>> Is there any method to passing an sfr addres to a function?
>> And I need to store sfr address to a struct like this:
>>
>> typedef struct {
>> uint8_t cursorX;
>> uint8_t cursorY;
>> unsigned char *buffer;
>> uint8_t cols;
>> uint8_t rows;
>> uint8_t cursorState;
>> __sfr dataPort;
>> __sfr controlPort;
>> } Display;
>>
>> How can I do these?
>>

--
thx,
----------------------------------
Zoltan Zidarics programmer
PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary
E-Mail: za***@*ili.pmmf.hu
----------------------------------




Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

  • Root
  • » SDCC
  • » [Sdcc-user] passing mcs51 sfr to function and store to it [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support