Consider the following snippet:
// override getchar from stdlib
int
getchar(void)
{
__asm
l1:in a,(I8251_STATUS)// get status
and #I8251_S_RXRDY // check RxRDY bit
jp z,l1// not ready, loop
in a,(I8251_DATA)
>
> Maybe you can tell us what warning you get that you want to get rid of?
I am sorry about.
i8251.c:28: warning 59: function 'getchar' must return value
>
> That being said, when the complete function is written in asm you probably
> want to use the __naked keyword to suppress the red tape.