Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2026-02

Invalid combination of opcode and operands

6 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adriaan van Os

The following error message seeems to be new for fpc-3.3.1 (using -RIntel)

....

@Remainder_1:
MOV Length,EBX
AND Length,1
JZ @TheEnd
MOVSS xmm2,[SourceBuffer] <--- Asm: [movss xmmreg2,mem64] invalid combination of opcode and operands
MINSS xmm0,xmm2
MAXSS xmm1,xmm2

Has anything changed here ?

Regards,

Adriaan van Os

Reply by email

Marco van de Voort
to Adriaan van Os

Op 23-2-2026 om 16:35 schreef Adriaan van Os via fpc-pascal:

Show quoted text 18 lines
The following error message seeems to be new for fpc-3.3.1 (using -RIntel) ....     @Remainder_1:      MOV   Length,EBX      AND   Length,1      JZ    @TheEnd      MOVSS xmm2,[SourceBuffer] <--- Asm: [movss xmmreg2,mem64] invalid combination of opcode and operands      MINSS xmm0,xmm2      MAXSS xmm1,xmm2 Has anything changed here ?

Disclaimer:  I don't known 100% how OS X handles the analogue, so assuming windows for a moment.

Was this code meant for 64-bit or 32-bit, and are you running it on the same architecture where you originally tested/used it?

This because the sourcebuffer seems to indicate [mem64], which sounds like target 64-bit intel, which might expect a rip relative addressing like

MOVSS xmm2,[rip+SourceBuffer]

But if the code was originally 32-bit the original expression would have been valid.

Reply by email

Adriaan van Os
to Marco van de Voort
Marco van de Voort wrote 22 lines
Op 23-2-2026 om 16:35 schreef Adriaan van Os via fpc-pascal: > > The following error message seeems to be new for fpc-3.3.1 (using > -RIntel) > > .... > > @Remainder_1: > MOV Length,EBX > AND Length,1 > JZ @TheEnd > MOVSS xmm2,[SourceBuffer] <--- Asm: [movss xmmreg2,mem64] invalid > combination of opcode and operands > MINSS xmm0,xmm2 > MAXSS xmm1,xmm2 > > > Has anything changed here ? > Disclaimer: I don't known 100% how OS X handles the analogue, so assuming windows for a moment.

This is on macOS indeed, originally for Windows only, later ported to macOS. Strangely, the code still has MS_ABI_Default in the code. I were told, this was needed for 32-bit x86.

Show quoted text 11 lines
Was this code meant for 64-bit or 32-bit, and are you running it on the same architecture where you originally tested/used it? This because the sourcebuffer seems to indicate [mem64], which sounds like target 64-bit intel, which might expect a rip relative addressing like MOVSS xmm2,[rip+SourceBuffer] But if the code was originally 32-bit the original expression would have been valid.

The code was originally for 32-bit x86, yes but 32-bit is no longer built now.

An older FPC compiler accepts the assembly (but I am not trying to say that the asm is correct ...)

Regards,

Adriaan van Os

Reply by email

Adriaan van Os
to Marco van de Voort: Op 23-2-2026 om 16:35 schreef Adriaan van Os via fpc-pascal: Disclaimer:  I don't known…
Marco van de Voort wrote 11 lines
Was this code meant for 64-bit or 32-bit, and are you running it on the same architecture where you originally tested/used it? This because the sourcebuffer seems to indicate [mem64], which sounds like target 64-bit intel, which might expect a rip relative addressing like MOVSS xmm2,[rip+SourceBuffer] But if the code was originally 32-bit the original expression would have been valid.

I should add that SourceBuffer is an argument to a function, so I assume it to be a full address, not an offset.

procedure MyProc( SourceBuffer: Pointer....);

Regards,

Adriaan van Os

Reply by email

Marco van de Voort
to Adriaan van Os

Op 23-2-2026 om 17:40 schreef Adriaan van Os via fpc-pascal:

Show quoted text 6 lines
I should add that SourceBuffer is an argument to a function, so I assume it to be a full address, not an offset. procedure MyProc( SourceBuffer: Pointer....);

Try adding the "rip+". Most 64-bit OSes don't use 64-bit immediate values because they are huge to encode.

Most use RIP relative addressing,.

Reply by email

Adriaan van Os
to Marco van de Voort
Marco van de Voort wrote 12 lines
Op 23-2-2026 om 17:40 schreef Adriaan van Os via fpc-pascal: > > I should add that SourceBuffer is an argument to a function, so I > assume it to be a full address, not an offset. > > procedure MyProc( SourceBuffer: Pointer....); > Try adding the "rip+". Most 64-bit OSes don't use 64-bit immediate values because they are huge to encode. Most use RIP relative addressing,.

Same error:

MOVSS xmm2,[rip+SourceBuffer] <--- Asm: [movss xmmreg2,mem64] invalid combination of opcode and operands

Regards,

Adriaan van Os

Reply by email