View Single Post
Old 11 September 2019, 20:25   #27
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by nogginthenog View Post
AmigaOS ROM calls work this way via the inlines.

Code:
void MyFunc(register int d0 __asm("d0"));
Code:
MyFunc(2);
results in:

Code:
moveq #2,d0
jsr _MyFunc
Yes, but in this case they don't:

Code:
C:/Users/Me/Desktop/AmigaDevelopment/test/test.c:57:38: error: expected ';', ',' or ')' before '__asm'
for the code:

Code:
void AquireLock(register BYTE * lock __asm("a0"));
and:

Code:
    AquireLock(&tripleBufferedDisplay->displayFlippingLock);
Makes me think there's something missing, either in GCC 8.3 or in my code.

I've worked around this situation by using GCC's extended inline assembly:

Code:
    {
        register BYTE * lock asm ("a0") = &tripleBufferedDisplay->displayFlippingLock;
        asm volatile (
            "jsr    _ReleaseLock"
            :
            : "r" (lock)
        );
    }
but that's not an easily maintainable solution.
deimos is offline  
 
Page generated in 0.04951 seconds with 11 queries