Implementing built-in functions for I/O
Mohamed Shafi
shafitvm@gmail.com
Mon Apr 28 09:53:00 GMT 2008
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
More information about the Gcc
mailing list