Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > Programming and Hacking > Development

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 6th November 2019, 10:43   #1  |  Link
Registered User
Join Date: Jan 2007
Posts: 42
How do I move inline assembly to external file?

I'm currently recompiling virtualdub plugins and need to move the inline assembly code to an external asm file but I dont know how to call it in the cpp.

As an example, here's a very simple bit of inline code:

void LUT_iSSE (Pixel32 *dst,int *LUT,int psize)
	__asm {
		mov     edi, [dst]
		mov     esi, [LUT]
		mov     ecx, [psize]

		align     16
		GLoop:      mov     eax, [edi]
				xor ebx, ebx
				mov     edx, eax
				mov     bl, ah
				and     edx, 0xff0000
				and eax, 0xff
				shr     edx, 16
				movd    mm0, [esi + eax * 4 + (512 * 4)]
				prefetchnta[edi + 512]
				por     mm0, [esi + ebx * 4 + (256 * 4)]
				por     mm0, [esi + edx * 4]
				movd[edi], mm0
				add     edi, 4
				dec     ecx
				jnz     GLoop
Can someone post what I would put there instead and what the asm file should have in it or point me in the right direction online? I'm guessing Extern "C" is involved somewhere!

Greatly appreciated!
bassquake is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 04:53.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.