News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

problems using SSE instructions

Started by RuiLoureiro, July 03, 2014, 09:24:47 PM

Previous topic - Next topic

RuiLoureiro

Hi

I tried this little test

;include \masm32\include\masm32rt.inc

.686P
.xmm
.mmx
      .model flat, stdcall                      ; 32 bit memory model
      option casemap :none                      ; case sensitive

;     include files
;     ~~~~~~~~~~~~~
      include \masm32\include\windows.inc       ; main windows include file
      include \masm32\include\masm32.inc        ; masm32 library include

    ; -------------------------
    ; Windows API include files
    ; -------------------------
      include \masm32\include\gdi32.inc
      include \masm32\include\user32.inc
      include \masm32\include\kernel32.inc
      include \masm32\include\Comctl32.inc
      include \masm32\include\comdlg32.inc
      include \masm32\include\shell32.inc
      include \masm32\include\oleaut32.inc
      include \masm32\include\ole32.inc
      include \masm32\include\msvcrt.inc

      include \masm32\include\dialogs.inc       ; macro file for dialogs
      include \masm32\macros\macros.asm         ; masm32 macro file

;     libraries
;     ~~~~~~~~~
      includelib \masm32\lib\masm32.lib         ; masm32 static library

    ; ------------------------------------------
    ; import libraries for Windows API functions
    ; ------------------------------------------
      includelib \masm32\lib\gdi32.lib
      includelib \masm32\lib\user32.lib
      includelib \masm32\lib\kernel32.lib
      includelib \masm32\lib\Comctl32.lib
      includelib \masm32\lib\comdlg32.lib
      includelib \masm32\lib\shell32.lib
      includelib \masm32\lib\oleaut32.lib
      includelib \masm32\lib\ole32.lib


; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
.data
value           db ?

                dd 16
stringA16       db "This string here",0
; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
.code
start:
; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
                mov         esi, offset stringA16
                movups      xmm0, [esi]             ; <<<--- line 58
;--------------------------------------------------------------------------
                inkey " ********** END I ********** "
                exit
; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start


but i got this error.
How to solve it ?
Quote
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\...\SSEtest.asm
C:\...\SSEtest.asm(58) : error A2085: instruction or register not accepted in current CPU mode
_
Assembly Error
Prima qualquer tecla para continuar . . .

peter_asm


RuiLoureiro

Quote from: peter_asm on July 03, 2014, 09:32:25 PM
take out the .mmx directive
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\...\SSEtest.asm
C:\...\SSEtest.asm(58) : error A2006: undefined symbol : xmm0   <<<------
_
Assembly Error
Prima qualquer tecla para continuar . . .

jj2007

For ML 6.14 ... 10.0
Only JWasm needs the bold .686

include \masm32\include\masm32rt.inc
.686
.xmm

.code

start:   MsgBox 0, "Hello World", "Hi", MB_OK
   exit
   movups      xmm0, [esi]
end start

dedndave

i thought the .MMX had to go before the .XMM

RuiLoureiro

Quote from: dedndave on July 04, 2014, 12:57:33 AM
i thought the .MMX had to go before the .XMM
even with

           .686
           .mmx
           .xmm

i got undefined symbol :xmm0.

Has this something to do with Microsoft (R) Macro Assembler Version 6.14.8444 ?

dedndave

ohhhhhhhhhh
you are using masm version 6.14   :P

RuiLoureiro

Quote from: dedndave on July 04, 2014, 01:02:01 AM
ohhhhhhhhhh
you are using masm version 6.14   :P
Where to get the new one, Dave ?

dedndave

you can find 6.15 easily

http://win32assembly.programminghorizon.com/download.html

or you can d/l one of the visual studio express editions and extract the binaries
sent you a PM, Rui   :t

RuiLoureiro


jj2007


RuiLoureiro

Quote from: jj2007 on July 04, 2014, 01:40:23 AM
Quote from: jj2007 on July 03, 2014, 10:29:01 PM
For ML 6.14 ... 10.0

Do you occasionally read my posts?
occasionally, Jochen !
                The problem here is with ML 6.14 like Dave said before
               and i will try to solve it.

Gunther

Hi Rui,

Quote from: RuiLoureiro on July 04, 2014, 02:15:06 AM
                The problem here is with ML 6.14 like Dave said before
               and i will try to solve it.

I had the same problem. Version 6.14.8444 comes with the current MASM32 package. That's the tricky thing.

Gunther
You have to know the facts before you can distort them.

jj2007

Quote from: RuiLoureiro on July 04, 2014, 02:15:06 AM
                The problem here is with ML 6.14 like Dave said before
               and i will try to solve it.

There is no problem with 6.14, it will assemble your code
- either if you follow my scheme above (masm32rt.inc)
- or, if you insist to list the includes explicitly:

.686P
.model flat, stdcall                      ; 32 bit memory model
option casemap :none                      ; case sensitive
.xmm

The exact order is important. And don't forget the msvcrt.lib, which is of course included in the standard masm32rt.inc solution.

RuiLoureiro

Hi Jochen,
                It seems i am doing what you say correctly.
                The problem is this:
                I am not able to assemble this instruction
               movups      xmm1, [esi+edx*8]                              
               I GET: instruction or register not accepted in current CPU mode.
                I dont know why.
:icon14: