News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Paddd instruction

Started by gelatine1, December 22, 2016, 09:05:53 AM

Previous topic - Next topic

gelatine1

Hi, I'm back from a long time and I'm trying to learn how to use packed instructions. I'm trying out the PADDD instruction (http://x86.renejeschke.de/html/file_module_x86_id_226.html).

I'm using the follwing code:


.686p
.MODEL  Flat,StdCall
OPTION  CaseMap:None
.MMX
.XMM

include \masm32\include\masm32rt.inc

.data
begin db 00h,00h,00h,01h
incr db 00h,00h,00h,01h

.code
start:
paddd dword ptr[begin],dword ptr[incr]

lea esi,begin
printf("result0: %d\n", byte ptr [esi])
printf("result1: %d\n", byte ptr [esi+1])
printf("result2: %d\n", byte ptr [esi+2])
printf("result3: %d\n", byte ptr [esi+3])

    exit

end start


Right away I am getting the follow error:
"Error A2085: instruction or register not accepted in current CPU mode"

I searched online and I found some answers saying I should add the xmm and mmx and use .686p. But I am using those so why am I not able to assemble my code ? What should I do to fix this ?

I use the following commands to assemble my code:
Quote
ml /c /coff /Cp  test.asm
Link   /SUBSYSTEM:CONSOLE /LIBPATH:c:\masm32\lib test.obj

Thanks in advance