Link to home
Start Free TrialLog in
Avatar of benutzername
benutzername

asked on

can't compile pentium 3 commands

when i try to compile pentium 3 commands like PINSRW, my assembler (MASM 6.14.8444) tells me
-----------------------------------
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

 Assembling: E:\masm32\EXAMPLEX\DDPLASMA.asm
E:\masm32\EXAMPLEX\DDPLASMA.asm(137) : error A2085: instruction or register not accepted in current CPU mode
E:\masm32\EXAMPLEX\DDPLASMA.asm(138) : error A2085: instruction or register not accepted in current CPU mode
-----------------------------------

the assembler seems to know the instruction, since he tells me, that i'm in the wrong cpu mode...

which cpu mode do i have to set for p3-ssl commands ?

thx,

Ben Utzer
Avatar of dimitry
dimitry

You need to use next directives:
  .686
  .XMM
  .model flat, C

  .code
;; Internet Streaming SIMD Extension opcodes

  end

 Or you can simply insert into your code hex values of the commands in immediate data representation like:

dd 0FC40E01h   ; pinsrw  mm1,[esi],1

 Command representation can be found at:
http://www.tbcnet.com/~clive/katmai.html

Avatar of benutzername

ASKER

hmm... different, but now i got an "undefined symbol: mm1" error at

pinsrw  mm1,[esi],1

still doesn't seem to work..
Then try MMX directive:
.MMX
(mm1 is MMX technology register)
still the same error message.

the thing is: i can use mmx registers in vc++ inline assembler, but not when using masm32 directly.

the other way round, masm32 understands ssl commands now (since i'm using the .686 directive) but doesn't compile mmx registers :P

so what compilers do you guys use ? or does no one use these ssl commands and mmx registers ?

best regards

Ben Utzer
I used MASM 6.14.8444 and next code was compiled properly:
----------------------------------------------------
.686
.xmm
.model flat, C

.code
;; Internet Streaming SIMD Extension opcodes
pinsrw mm1, [esi], 1

end
-----------------------------------------------------
If you want to try MASM 6.14 take a look at:
http://www.davidparker.com/assembly.html
 or
http://www.ccit.edu.tw/~hsu/courses/assembly/masm.htm
 (but here you'll need to update it to MASM 6.14)
Avatar of DanRollins
The inline assembler in DevStudio.NET recognizes the later opcodes and registers.  VC++ 6.0 does not.

-- Dan
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
https://www.experts-exchange.com/questions/Q.20145834.html
https://www.experts-exchange.com/questions/Q.20167190.html
https://www.experts-exchange.com/questions/Q.20278083.html
https://www.experts-exchange.com/questions/Q.20280788.html
https://www.experts-exchange.com/questions/Q.20290657.html
https://www.experts-exchange.com/questions/Q.20292336.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed in the link below
https://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
benutzername:
You got an "undefined symbol: mm1" error, that maybe because you have included "option casemap:none" in you asm file.
You can remove this line or change to use
pinsrw MM1, [esi], 1
        ^|_________uppercase

Good Luck:O)
Actually, you can't remove "option casemap:none" if you use MASM32.
So you should use the second option:
pinsrw MM1, [esi], 1
              ^|_________uppercase
Please return here and finalize this.  Experts have been very helpful to you and feedback is ALWAYS appreciated.
Thanks,
Moondancer - EE Moderator
I just tried both

__asm {
  pinsrw mm1, [esi], 1
}

and

__asm {
  pinsrw MM1, [esi], 1;
}

with borland c++ builder 5, but both generated an

[Tasm Error] Unit1.asm(87): Illegal instruction

...

does somebody have a working example where these commands are used ? maybe one has to initialize the prozessor first or whatever...i don't know.

thx a lot

ben utzer
Sorry for my later reply.

Your original question is about MASM and VC, but now change to use BC and TASM, which assembler you really want to use???:O(
I don't know how to resolve it under BC/TASM,maybe it depends on the setting of BC(just guess)...

benutzername:
IMHO,I think we only answer the origial question,and this is a new question...
There are lots of assemblers that you can use, but it's impossible for us to answer all the new questions under on topic...

Have a good day.
OK, I have tested with TASM, it seems doesn't support the new SSE instruction.
I don't care which assembler to use as long as the solution works.

I accept solutions for TASM and MASM and VC++ and BC inline assembler.

I just need any piece of working code that uses these instructions so I can learn how to use them and transfer this knowledge to my problem.

thanx a lot

ben utzer
I just tried

pinsrw MM1, [esi], 1

under vc++ inline assember - doesn't work as well:

E:\cpp\test\Main.cpp(20) : fatal error C1601: unsupported inline assembly opcode


Hi benutzername,
1. I think the inline assember of VC(6.0) not support the newest SSE instruction.
2. I think the TASM/BC also does not support the newest SSE instruction.
3. The MASM do support this type of instruction.Maybe there are also other assembler which can support it, but I don't know.
4. So, I think there two methods you can do.
a. Use following code if you want to use inline assember in VC,
_asm
   {
      _emit 0x0F
      _emit 0xC4
      _emit 0x0E
      _emit 0x01
   }
But I don't think this is a good method.
b. I recommend you to isolate your SSE code to a separate ASM file, and use MASM to compile it, then link with your VC code.

Good Luck.
ASKER CERTIFIED SOLUTION
Avatar of fl0yd
fl0yd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hey, thats great! you really earn the points :)
didn't do it for the points, though. just needed to comment on dan rollins' post's quality - the last time he was up to date was probably more than 15 years ago when he published his book. that's at least what he calls it...
you earn them anyway :)

thx a lot
I forgot to mention that MASM 6.15 is also included -- you probably found out already anyway. Have fun with it. I'm sure you will :)