View Single Post
Old 11 September 2019, 21:25   #27
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 441
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 online now  
 
Page generated in 0.04082 seconds with 11 queries