News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how do i write optimized asm code? can i enable flags?

Started by oversight, November 02, 2005, 06:41:46 PM

Previous topic - Next topic

oversight

Hi,


i want to know how i can add Hyperthreading,mmx,3dnow support in my code.
For example:

.486
.fpu ;
.model huge

;comment: module 2 be linked in with c++

.code


proc enable_htr
; dont know how to do this


endp enable_htr


end

Where can i see a EXAMPLE about Hyperthreading ,mmx enabled .asm code?
I have looked but its so damm complicated in those texts from intel.

not something you can start easy with.  :(



AeroASM

Hyperthreading is invisible to programs.
For MMX, SSE, SSE2 use the .mmx and .xmm directives.

But why not put your mmx and sse in inline asm in your C++?

hutch--

oversight,

What you want to do is no big deal as long as you can write the C EXTERN prototypes for the procedures you want to write. As expected you must match the calling convention used in the ASM module with your prototype but you can still use either STDCALL or C calling convention. You will have to learn to write the asm code though.

Aero,

Later C compiler design excludes inline asm so its not a habit worth picking up. Apparently 64 bit C from Microsoft will not support inline asm at all. The problem is that hand coded assembler inline in C code messes up the internal code optimisation so it is better to write a seperate module and link it into the C/C++ program.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php