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)
Hello everybody,
Running into a strange issue trying to compile SDCC with the msys2
environment.
I've successfully downloaded gputils from source and compiled:
$ gcc -v
gcc version 6.3.0 (Rev2, Built by MSYS2 project)
$ gpasm -v
> 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,(
>
> 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.