One of those many ASM Gems, you need - or not.
In this case, you see an example how to deal with ASM and BYREF Parameter.
' inverts the color BYREF
' May not work if the colour includes Alpha-channels, because the whole number is been inverted.
'
' invertiert variable mit farbwert (Komplemtärfarbe durch invertierung (NOT) Rückgabe BYREF
SUB X_HP(BYREF rgbColor AS LONG)
!mov eax,rgbColor ' eax hat 24-bit farbe
!mov ecx,[eax] ' get Value from BYREF
!not ecx ' Farbe invertieren
!mov ebx,rgbColor
!mov [ebx],ecx
END SUB
In DisASM things look like expected.
4023CA 8B4508 MOV EAX, DWORD PTR [EBP+08]
4023CD 8B08 MOV ECX, DWORD PTR [EAX]
4023CF F7D1 NOT ECX
4023D1 8B5D08 MOV EBX, DWORD PTR [EBP+08]
4023D4 890B MOV DWORD PTR [EBX], ECX
4023D6 8D65F4 LEA ESP, DWORD PTR [EBP-0C]
4023D9 5F POP EDI
4023DA 5E POP ESI
4023DB 5B POP EBX
4023DC 5D POP EBP
4023DD C20400 RET NEAR 0004
Here is another one, which returns the colours in RGB.
' returns INVERSE Colour from 24-bit in RGB Parts
'
SUB X_HN(BYVAL rgbColor AS LONG,BYREF Red AS BYTE,BYREF Green AS BYTE,BYREF Blue AS BYTE)
!mov eax,rgbColor ' eax hat 24-bit farbe
!not eax ' Farbe invertieren
!mov rgbColor,eax
!mov eax,rgbColor
!mov ebx,Red
!mov [ebx],al
!shr eax,8
!mov ebx,Green
!mov [ebx],al
!shr eax,8
!mov ebx,Blue
!mov [ebx],al
END SUB