This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Implementing built-in functions for I/O


Hello all,

I/O instructions are different from other instructions because there
isn't any way to recognize them as i/o patterns,
I guess in AVR this is possible because AVR has memory mapped i/o. So
its is possible to write something like

PORTA = 0xff

But i couldn't find out much about other targets.
For the particular target that i am porting i was able to implement
'in' instructions using builtins. So it is possible to do

short k = __IN(PORTC);

My question is will it be possible to implement the same for OUT
instruction also. When implemented as a builtin it is not
possible to do something like

short k;

__OUT(port no) = k;

So hoe can i do that.

Is inline assembly the only solution?

Thanks for your time.

Regards,
Shafi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]