News:

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

MMX MessageLoop

Started by ic2, February 18, 2007, 08:16:18 PM

Previous topic - Next topic

ic2

Hello Votex

May i ask you another question?  I am studying LingosLoop but before i go to far i always want to make sure POASM can handle whatever i try and if it don't work I have no problem coming down to a step or two and use regular registers or whatever it takes to keep aside with POASM and MASM no matter what.

Below are the errors i receive when i tried to assemble lingo's MMX MessageLoop using POASM.  I don't know how to repair either error but the ** MMX **  error really worries me.

Can they be resolved and if so, could you tell me how and why especially about the ** MMX ** error ? 
I'm using the POASM Window Include file and I been trying to modify the wc structure to see what i can come up with.  I attached the file below.  Seb and I only added a few things to it that MASM has no problem  assembling.


C:\messloop_lingo1.asm(13): error: Invalid use of '.mmx'.
C:\messloop_lingo1.asm(111): error: Invalid use of 'wc'.
C:\messloop_lingo1.asm(112): error: Invalid use of 'wc'.
C:\messloop_lingo1.asm(116): error: Invalid use of 'wc'.

There has been an error while assembling this project.

Press any key to continue . . .

http://www.masm32.com/board/index.php?PHPSESSID=4e9f1eb8397e9418a468f9e2b74698ec&topic=6729.0

[attachment deleted by admin]

Vortex

ic2,

I am not sure how to use the MMX stuff with Poasm, it looks like that the assembler does not accept the statement .mmx

Concerning the WNDCLASSEX structure, you should try this :

mov edx,OFFSET wc
mov WNDCLASSEX.hIcon[edx], eax
mov WNDCLASSEX.hIconSm[edx], eax


ic2, try to use Hutch's testbed for Poasm.

ic2

Thanks Vortex,

I forgot you that there was a special way of dealing with structures with  POASM.  Anyway, could you or hutch contact  PellesC and find out if MMX, SSE is supported and how to get to it. 

I know he may not respond to me, I been waiting for an response to an question since last May ... and still waiting.

Testbed no longer exist ... Page not found
The page you are looking for might have been removed,  had its name changed, or is temporarily unavailable.


Vortex

Hi ic2,

I checked the help file coming with Pelles IDE, I couldn't find there any reference to the statement .mmx Would you try the .686 statement? Maybe, this one can enable the usage of mmx instructions.

ic2

I tried the .386 statement and MASM has problems with Alignment.  So I comment out the alignment directives and the MMX file assembles with no farther problems.  This is wonderful provide there is a way to do basic Alignments of 4

MASM .386 alignment errors::::

error A2189: Invalid combination with segment alignment : 8
error A2189: Invalid combination with segment alignment : 8
error A2189: Invalid combination with segment alignment : 16


Using the .486 statement MASM will assemble the MMX file with absolutely no errors.  So .486 and higher for MASM can be the most  recommended when using MMX.

You can't remove the .MMX statment than even MASM will not work.
.386 - .686 statements will not work for POASM at all... are their others available.

I know nothing of how assemblers are written but maybe MMX is not even implemented in POASM and if it is maybe we have to use some kind of c statement reducing my files to 99.9999% Pure Asm ...

Don't mean to drag this on but there must to be a solution somewhere.  If MASM can assemble MMX files with the ancient .386 statement how could this be missed when POASM was written.  So it must be in there somewhere and i always use MASM Version 6.14.84444 to assemble all of my files and i always double back to make sure POASM can assemble it too.  I don't want to give that up. I been doing it from the day POASM hit the Forum.

Maybe there no need to answer because only Pelle know for sure and he really seem to lost interest in ASM.  If you ever read this thread.  Drop the MMX statement needed or Drop the source in the hands of the most dedicated ASM person in the world here at this Forum.  You already know all respect will be due to you only by that person and his dedicated ASM follower ...

Anyway, the best to you and Thanks for the Great Ride enhancing our knowledge of ASM even tho you may not have realized it.

Hope this is not  D - END

MichaelW

The necessary information is in the Pelles C for Windows help, under Command line tools->POASM macro assembler->Assembler directives. For POASM (or at least the most recent version) and MMX, you need to specify at least .P2 for the processor directive. I didn't test this, but I think it likely that .P3 will enable MMX and SSE, and .P4 MMX, SSE, and SSE2.
eschew obfuscation

ic2

Thank MichaelW
I will be reading the help files.  So it does do everything i need it to do.  Now i have my finally MMX related question.   How would you step over code not needed like we do with .cmp but up in the statement department. My .cmp don't work.  It must be a difference way to do things in that area.


This don't work among other things i tried.

.686
.model flat,stdcall
option casemap:none

cmp eax, P2
jne not_P2
.P2
jmp continue

not_P2:
cmp eax, P3
jne not_P3
.P3
jmp continue

not_P3:
cmp eax, P4
.P4
jne do_MMX


do_MMX:
.mmx


continue:


MichaelW

I'm not sure what you are expecting the code to do. Were you perhaps thinking that you could query the assembler to determine what processor it is running on, and decide which processor directive to use on that basis? The assembler actually "knows" nothing of the processor it is running on. The processor directives are used primarily to enable different processor-specific instruction sets, and it is up to the programmer to determine which instruction set to use. MASM provides the predefined symbol @Cpu that can be used to test the current processor type, as set by the last processor directive, but AFAIK POASM provides nothing similar. Also, .mmx is apparently not supported by POASM.
eschew obfuscation

ic2

Yes, POASM do support MMX and maybe all the rest.  It's like you said... . use p2 p3 or p4 Provided these are mmx registers im using and it also works for Lingo's Messageloop .  I think the statement has been mis-placed for years and everyone know MASM will allow things the other assembler will not.

Let me know if this is correct after you test it ...... It works on my P2 and P3 machines running  95 thru XP.


.686
.model flat,stdcall
option casemap:none
.P2.......MMX also.................. it goes here for sure


.686
.P2.......MMX also.................. not here,  only for masm
.model flat,stdcall
option casemap:none


also i have see what i am wanting to do a few years back somewhere.  I don't think it was POASM related but whoever was doing had a run of code nearly like mine right up in that area look for the same thing i tried.  So i'm sure it is possible just don't know how and can't find it anymore.
.


[attachment deleted by admin]

MichaelW

I meant that the .mmx directive is not supported.

After I substituted a POASM-compatible windows.inc, your code assembles and links OK, and when run it returns 24, 36, and 48. BTW, the .686 is unnecessary, as .P2 enables the instructions for all of the previous processors (Pentium Pro, Pentium, 486, etc).
eschew obfuscation

ic2

QuoteMASM provides the predefined symbol((( @Cpu )))that can be used to test the current processor type, as set by the last processor directive, but AFAIK POASM provides nothing similar.

If we can detect what MASM do and POASM don't maybe we can jump to:

Maybe something could come out of this with some modification...

ifndef __POASM__
assume fs:nothing
endif

No Need to Reply.  Just trying to come up with some ideas.

QuoteI meant that the .mmx directive is not supported.

I should have known BETTER, I never seen you miss anything especially by that much anyway.

Again, Thanks for getting to the bottom of it all.  It saved me from taking a long break from ASM ... 4 months Max :)