Solved

can't compile pentium 3 commands

Posted on 2002-04-17
21
751 Views
Last Modified: 2007-11-27
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
0
Comment
Question by:benutzername
  • 7
  • 5
  • 3
  • +3
21 Comments
 
LVL 11

Expert Comment

by:dimitry
ID: 6950916
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

0
 

Author Comment

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

pinsrw  mm1,[esi],1

still doesn't seem to work..
0
 
LVL 11

Expert Comment

by:dimitry
ID: 6953102
Then try MMX directive:
.MMX
(mm1 is MMX technology register)
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:benutzername
ID: 6953677
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
0
 
LVL 11

Expert Comment

by:dimitry
ID: 6957590
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)
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6959274
The inline assembler in DevStudio.NET recognizes the later opcodes and registers.  VC++ 6.0 does not.

-- Dan
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6979398
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.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://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.
http://www.experts-exchange.com/questions/Q.20145834.html
http://www.experts-exchange.com/questions/Q.20167190.html
http://www.experts-exchange.com/questions/Q.20278083.html
http://www.experts-exchange.com/questions/Q.20280788.html
http://www.experts-exchange.com/questions/Q.20290657.html
http://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
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://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
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 7045883
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)
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 7045900
Actually, you can't remove "option casemap:none" if you use MASM32.
So you should use the second option:
pinsrw MM1, [esi], 1
              ^|_________uppercase
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7046931
Please return here and finalize this.  Experts have been very helpful to you and feedback is ALWAYS appreciated.
Thanks,
Moondancer - EE Moderator
0
 

Author Comment

by:benutzername
ID: 7046949
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
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 7050131
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.
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 7050250
OK, I have tested with TASM, it seems doesn't support the new SSE instruction.
0
 

Author Comment

by:benutzername
ID: 7051068
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
0
 

Author Comment

by:benutzername
ID: 7051079
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


0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 7060950
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.
0
 
LVL 8

Accepted Solution

by:
fl0yd earned 200 total points
ID: 7119355
Well, Dan Rollins, having published a book on intel assembly language, doesn't know any better than telling you that VS6 wouldn't support sse/sse2-instructions? That's wrong of course. All you need to do is download the Processor Pack from this link:
http://msdn.microsoft.com/vstudio/downloads/ppack/default.asp
This will get you going -- I would recommend using Visual c++ as your developing platform for two reasons:
* you can focus on assembly language where it's really useful and don't have to worry about getting an entire asm-application running
* it provides you with a great IDE for debugging.

Hope this helps,
.f
0
 

Author Comment

by:benutzername
ID: 7119829
hey, thats great! you really earn the points :)
0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7119893
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...
0
 

Author Comment

by:benutzername
ID: 7119896
you earn them anyway :)

thx a lot
0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7119900
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 :)
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to check what program libraries are trying to opened  a .exe program ??? 5 1,063
Assembly doubt on logical or operations 3 322
Wondows Handles 4 406
BufBomb Firecracker 4 2,144
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Learn how the use of a bunch of disparate tools requiring a lot of manual attention led to a series of unfortunate backup events for one company.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question