Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7976479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:55:12+00:00 2026-06-04T08:55:12+00:00

I have some sample source code for OpenGL, I wanted to compile a 64bit

  • 0

I have some sample source code for OpenGL, I wanted to compile a 64bit version (using Delphi XE2) but there’s some ASM code which fails to compile, and I know nothing about ASM. Here’s the code below, and I put the two error messages on the lines which fail…

// Copy a pixel from source to dest and Swap the RGB color values
procedure CopySwapPixel(const Source, Destination: Pointer);
asm
  push ebx //[DCC Error]: E2116 Invalid combination of opcode and operands
  mov bl,[eax+0]
  mov bh,[eax+1]
  mov [edx+2],bl
  mov [edx+1],bh
  mov bl,[eax+2]
  mov bh,[eax+3]
  mov [edx+0],bl
  mov [edx+3],bh
  pop ebx //[DCC Error]: E2116 Invalid combination of opcode and operands
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:55:13+00:00Added an answer on June 4, 2026 at 8:55 am

    This procedure swaps ABGR byte order to ARGB and vice versa.
    In 32bit this code should do all the job:

    mov ecx, [eax]  //ABGR from src
    bswap ecx       //RGBA  
    ror ecx, 8      //ARGB 
    mov [edx], ecx  //to dest
    

    The correct code for X64 is

    mov ecx, [rcx]  //ABGR from src
    bswap ecx       //RGBA  
    ror ecx, 8      //ARGB 
    mov [rdx], ecx  //to dest
    

    Yet another option – make pure Pascal version, which changes order of bytes in array representation: 0123 to 2103 (swap 0th and 2th bytes).

    procedure Swp(const Source, Destination: Pointer);
    var
      s, d: PByteArray;
    begin
      s := PByteArray(Source);
      d := PByteArray(Destination);
      d[0] := s[2];
      d[1] := s[1];
      d[2] := s[0];
      d[3] := s[3];
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a few properties that I'm using in some sample code I'm
Trying to get comfortable with jQuery and I have encountered some sample code that
I have the following String Sample however in some occurences there may be one
I am starting study java2me. But I have some source study about it like
Suppose I have this database table (some sample code below) that stores the relationship
Any suggestions for some sample source code for an iPhone application that shows Edit/Delete/Add
Can anybody give me some sample source code showing how to connect to a
I have written some sample program and DLL to learn the concept of DLL
I have a small program that's supposed to sample some value from a device
<p title=The test paragraph>This is a sample of some <b>HTML you might<br>have</b> in your

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.