justin = { main feed , music , code , askjf , pubkey };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.


Name: Ask: Human (enter yes):
[back to index] | [unreplied] | [replied] | [recent comments] | [all]

Question: Could you explain how one utilizes inline assembly? An example of creating a variable in C then using it in asm registers, etc.
Asked by Will (68.224.131.x) on February 20 2011, 8:28pm
Reply on February 20 2011, 8:42pm:
    This varies depending on compiler and architecture -- VC on x64 doesn't support inline assembly, sadly. I'll give the easiest example, which would be on VC/x86:
    int x = 0x1000;
    __asm {
      mov eax, x
      ror eax, 16
      mov x, eax
    }
    printf("%x\n",x);
    
    Very straightforward, if you know assembly (load x into eax, roll right eax 16 bits, store back to x).

Comment:
    Your Name:   -- Site Owner's Name:  (for human-verification)

    Comment:    

    
  
[back to index] | [unreplied] | [replied] | [recent comments] | [all]
Copyright 2025 Justin Frankel. | RSS