News:

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

Main Menu

cant I just replace ml with uasm?

Started by daydreamer, February 06, 2020, 08:00:25 PM

Previous topic - Next topic

daydreamer

so in what way should I code this instead,so I can use movapd,well more important to be able to use addpd xmm0,compa,without error?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

nidud

#16
deleted

daydreamer

Quote from: nidud on February 09, 2020, 02:33:14 AM
The source is 64-bit (compa) and the target is 128-bit.

    movapd xmm0,xmmword ptr compa ; mov two 64-bit items from compa to xmm0
    addpd  xmm0,xmmword ptr compa

thanks it works
but isnt it also good to get habit to used xmmword type instead of several real8's or real4's?
LOADPD also would be nice to have
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

nidud

#18
deleted

daydreamer

thanks
maybe use macros like FP8(3.14) could be an option making code more readable too
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

johnsa

In UASM we have built-in structs already defined for _m128, _m256 which you can use as well.. for other asssemblers you'd have to just create those struct/unions yourself but would still be compatible.

daydreamer

thanks johnsa
for loops wont work as I want
examples,I am used to C syntax
.for(ecx:ecx<Lmaxmem:ecx++)

.for(esi:esi<maxi:esi++)
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

habran

.for(ecx=Lstartmem:ecx<Lmaxmem:ecx++)
  do something
.endfor


.for(esi=mini:esi<maxi:esi++)
  do something
.endfor

lea esi,mini
.for(:esi<maxi:esi++)
  do something
.endfor

.for(::)
  do something
  .break .if (!eax)
.endfor
Cod-Father

daydreamer

thanks Habran
so variable stepping you just use ecx+stepping,for dwords,real4s,real8s,real10's
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

habran

yes:
rcx+8
ecx+4
rsi+16
ecx--
ecx-4
you can use .continue or .break
.for loop is actually using built in .while but gives you more options to set up variables and increase or decrease counters.
You can use more vars at the same time, like:

.for (rsi=src,rdi=dest,ecx=count:ecx:rsi++,rdi++,ecx--)
   mov al,[rsi]
   mov [rdi],al
.endfor
you get this:

000000013F4851D4 48 8B 35 D5 B6 00 00 mov         rsi,qword ptr [src (013F4908B0h)] 
000000013F4851DB 48 8B 3D CE AE 00 00 mov         rdi,qword ptr [dest (013F4900B0h)] 
000000013F4851E2 8B 0D B0 63 00 00    mov         ecx,dword ptr [count (013F48B598h)] 
000000013F4851E8 EB 0C                jmp         WndProc+3Dh (013F4851F6h) 
000000013F4851EA 8A 06                mov         al,byte ptr [rsi] 
000000013F4851EC 88 07                mov         byte ptr [rdi],al 
000000013F4851EE 48 FF C6             inc         rsi 
000000013F4851F1 48 FF C7             inc         rdi 
000000013F4851F4 FF C9                dec         ecx 
000000013F4851F6 85 C9                test        ecx,ecx 
000000013F4851F8 75 F0                jne         WndProc+31h (013F4851EAh) 
Cod-Father

daydreamer

thanks,for loop has always been my favourite loop,and its even better than C version
good,because otherwise before I used bare metal version about the same as code produced by the forloop
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

jj2007

I like the Basic one-liners :tongue:
  If_ Filter$(L$(), "MACRO", 1, 4) Then For_ each esi in L$(): PrintLine esi ; list all macros in \Masm32\macros\macros.asm

daydreamer

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

habran

If you are not using CSTYLE switch don't use .break
only if you specify  CSTYLE than you need it
option SWITCHSTYLE: CSTYLE

you don't need to use:
option SWITCHSTYLE : ASMSTYLE  because it is a default, which doesn't require .break

I did not test your code but with a quick look I saw that you calculate maxi and maxj, so you don't really know what you get and you don't know if numbers are positive or negative, I would at least check what I get and make sure it doesn't overwrite memory.

I would also avoid using several LOCAL variables in one line, I have noticed that assembler get confused there
I would use instead of:     LOCAL maxi:DWORD,maxj:DWORD,istep:DWORD,jstep:DWORD
LOCAL maxi:DWORD
LOCAL maxj:DWORD
LOCAL istep:DWORD
LOCAL jstep:DWORD

it is also more readable


Cod-Father

daydreamer

#29
I have somehow wrecked it
it stopped display assembled in 2 or 3 passes in millisecond
and linker complain about maybe corrupt .obj file
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding