Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/BASM    [ Add a report in this area ]  
Report #:  100184   Status: Closed
[x64] Invalid register combination error
Project:  Delphi Build #:  16.0.4276.44006
Version:    16.1 Submitted By:   Frederic Vanmol
Report Type:  Basic functionality failure Date Reported:  10/18/2011 5:34:00 AM
Severity:    Critical / Show Stopper Last Updated: 12/19/2012 7:55:32 PM
Platform:    All versions Internal Tracking #:   288262
Resolution: Fixed (Resolution Comments) Resolved in Build: : Update 4
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
When using inline asm, the compiler (64-bit Windows target) stops at the line "INC RCX" with an "Invalid register combination" error.

[DCC Error] Unit1.pas(64): E2112 Invalid register combination
Steps to Reproduce:
Add this function to a project:

procedure FPUSwap(const Source,Dest;Count:NativeInt);
asm
        MOV     RAX,Source

        // main (16 bytes)
        MOV     RCX,Count
        SHR     RCX,4
        JRCXZ   @Remainder

        @Loop:
        // read
        FILD    QWORD PTR [RAX]
        FILD    QWORD PTR [RAX+8]
        FILD    QWORD PTR [RDX]
        FILD    QWORD PTR [RDX+8]
        // write
        FISTP   QWORD PTR [RAX+8]
        FISTP   QWORD PTR [RAX]
        FISTP   QWORD PTR [RDX+8]
        FISTP   QWORD PTR [RDX]
        ADD     RAX,16
        ADD     RDX,16
        DEC     RCX
        JNZ     @Loop

        // remainder
        @Remainder:
        MOV     RCX,Count
        AND     RCX,$F
        JZ      @TheEnd

        PUSH    RBX
        ADD     RAX,RCX
        ADD     RDX,RCX
        NEG     RCX
        @LoopRemainder:
        MOV     BL,[RAX+RCX]
        MOV     BH,[RDX+RCX]
        MOV     [RDX+RCX],BL
        MOV     [RAX+RCX],BH
        INC     RCX
        JNZ     @LoopRemainder
        POP     RBX

        @TheEnd:
end;
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01