News:

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

problem with cvtdq2ps

Started by ninjarider, July 25, 2007, 09:13:25 PM

Previous topic - Next topic

ninjarider

been reading the intel manuals and i shoul dbe able to load an mmx register with 4 dword values and convert all the values over to singal precision float. for some reason it keeps giving me errors. i use the syntax of cvtdq2ps xmm0, h0/ cvtdq2ps xmm0, xmm1 both produce an error saying something about invalid operand xmm. if i use the cvtdq2ps h0, h1. i get a syntax error.

whats the isue with cvtdq2ps. dont have the right book infornt of me to see if i spelled it correctly.


{modified}
.model small
.486p
.stack 200h

.xmm
.code

Start:
not sure if that helps any but yeah.

{modified}
for somereason i was thinking of the wrong opcode. i was having issues with cvtdq2ps

Ian_B

Quote from: ninjarider on July 25, 2007, 09:13:25 PM
.486p

...

.xmm

Shouldn't it be .586 or .686 if you want to use XMM instructions?  ::)

hutch--

You are also in trouble with the following,


.model small             ; 16 bit dos small memory model
.486p
.stack 200h              ; PE files set the stack in the linker.


For the memory model there is only one to use in win32, FLAT. Set the stack size with the linker if you need to.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

ninjarider

well its a program that im writing for a boot secotor of a floppy and i was wanting to test some stuff with. as far as having to have the .586 or the .686 to use xmm instructions. it will let me load xmm registers and will let me do any logical oparation with let me use other cvt??2?? functions and do math with it and convert back but wont let me use that one cvt function

Tedd

.686
.xmm
.model flat, stdcall
option casemap:none
include windows.inc
include kernel32.inc
includelib kernel32.lib

.data
h0      QWORD ?

.code
start:
    cvtpi2ps XMM0,XMM1

    cvtpi2ps XMM0,QWORD PTR h0

    cvtpi2ps XMM0,[eax]             ;implicit qword ptr

    ;cvtpi2ps h0,QWORD PTR XMM0     ;*** invalid instruction form

    invoke ExitProcess, NULL
end start
No snowflake in an avalanche feels responsible.

ninjarider

 :red
i got home and checked my code and realized that my post was wrong. the cvtpi2ps is working properly. the one im having issues with is CVTDQ2PS and the CVTPS2DQ.

Tedd

.686
.xmm
.model flat, stdcall
option casemap:none
include windows.inc
include kernel32.inc
includelib kernel32.lib

;***************************************************************************************************

DQWORD struct
    dw1 DWORD ?
    dw2 DWORD ?
DQWORD ends

;***************************************************************************************************

.data?
h0      DQWORD <?>

.code
start:
    cvtdq2ps XMM0,XMM1
    cvtps2dq XMM0,XMM1

    cvtdq2ps XMM0,h0
    cvtps2dq XMM0,h0

    cvtdq2ps XMM0,[eax]
    cvtps2dq XMM0,[eax]

    ;cvtdq2ps h0,XMM0        ;*** invalid
    ;cvtps2dq h0,XMM0        ;*** unvalid

    invoke ExitProcess, NULL
end start
No snowflake in an avalanche feels responsible.


ninjarider

did use the includes, but im still getting error a20008 xmm when using any of those instructions

MichaelW

If you try to assemble Tedd's most recent code with ML 6.14, you should get 6 repetitions of:

...error A2008: syntax error : xmm

This problem can be corrected by using 6.15 or later.


eschew obfuscation

ninjarider

im using the latest 1 that i could find on the site that i know of. i will find out which version i have. i believe its 8.

and not to sound ignorant but were exactly do i find version. make sure i look in the right spot

MichaelW

It's displayed when you assemble (unless you use the /nologo option). This is for the 6.14 that comes with MASM32:

Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.
eschew obfuscation

ninjarider


Ian_B

IIRC there were a number of annoying idiosyncrasies (OK, bugs  ::)) reported by people with versions 7 and 8, which weren't amply compensated by new features. For most of us, the 6.15 release, which adds the MMX instruction set, is stable and works well. I believe there's a licensing issue with it, which is why Hutch only bundles 6.14 with MASM32, but it is possible to find 6.15 fairly easily if you scout around on the net. (Hint, Iczelion's website is a wonderful ASM resource  :U)

IanB

ninjarider

when i get around to it i might just try and use the intel manuals to figure out what its suppose to be. that or ask someone for them