News:

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

Main Menu

OPTION STACKBASE also broken in x64

Started by aw27, March 21, 2017, 07:58:08 PM

Previous topic - Next topic

aw27

Quote from: johnsa on March 22, 2017, 01:16:42 AM
.. PS. The constant attitude and being antagonistic doesn't not go down well with me.

I noticed you are doing your best. If I had not hopes on you I would have already left for better. Be patient.  :t

BTW, I gave you an example where
option frame:auto
option win64:11
option stackbase:rsp

does not work.

johnsa

Yep, got it.. that uses xmm6 is throwing it out.
We'll get this fixed today along with the ESP stackbase issue.

What we'll do is put everything so-far into a 2.22 beta release and share a link, then we can all re-test these issues as we go.

aw27

Quote from: johnsa on March 22, 2017, 01:28:44 AM
What we'll do is put everything so-far into a 2.22 beta release and share a link, then we can all re-test these issues as we go.

Excellent idea!  :t

habran

aw27, your 64 bit example is a mirror of your programming skills. If you don't use FRAME it is your responsibility to align the stack and allocate shadow space for parameters. So, here is fixed your program which now does what it was suppose to do:
Quote
option casemap:none
option frame:auto
OPTION STACKBASE:RSP
option win64:11

getSum proto dest:ptr, src:ptr, val1 : qword, val2:qword
sub1   proto dest:ptr, src:ptr, val1 : qword, val2:qword

.data

avar dq 40
bvar dq 50

.code

start:
       sub rsp, 8+32             ;8 to align stack, 32 = 4*8 for shadow space
       invoke getSum, ADDR avar, ADDR bvar, 20, 30
       add rsp,8+32
       ret
     
sub1 proc private dest:ptr, src:ptr, val1 : qword, val2:qword
   mov dest, rcx
   mov src, rdx
   mov val1, r8
   mov val2, r9
   mov rax, qword ptr [rdx]
   add rax, val1
   add rax, val2
   mov qword ptr [rcx], rax

   ret
sub1 endp

getSum proc public FRAME uses xmm6 dest:ptr, src:ptr, val1 : qword, val2:qword
   INVOKE sub1, dest, rdx, r8, r9
   ret
getSum endp

end start
Cod-Father

aw27

Quote from: habran on March 22, 2017, 08:21:20 AM
aw27, your 64 bit example is a mirror of your programming skills.

Habran, after all this time you have still not figured out that this is to be compiled as an object file to be called from a high level language. And insist on the same argument over and over insulting the intelligence of the others in the meantime.  :lol:
I will tell you a secret, high-level languages know very well how to align the stack before a call, you try to do the same.

habran

Hi level languages do know but you have no idea whatsoever!
If someone is insulting intelligence here, I can assure it is not me!
If you don't like Hjwasm why don't you use ml64?
Cod-Father

habran

Hi level language called your asm source with stack misaligned to 8 but next is your responsibility to provide shadow space and align the stack before you call some function and restore the stack on exit because you did not use FRAME!
I'll not waste my time in the future with such an arrogant amateur and ungrateful individuals like you.   
Cod-Father

habran

If I could I would ban you for using HJWasm!
Cod-Father

aw27

Quote from: habran on March 22, 2017, 08:50:08 AM
Hi level languages do know but you have no idea whatsoever!
If someone is insulting intelligence here, I can assure it is not me!
If you don't like Hjwasm why don't you use ml64?

I have not seen any evidence so far that you know how to program. You are just unable to cope with any issue.  :badgrin:


habran

However, I have seen evidence that you have no f***en idea!
Cod-Father

aw27

Quote from: habran on March 22, 2017, 08:58:21 AM
Hi level language called your asm source with stack misaligned to 8 but next is your responsibility to provide shadow space

I will not waste more time, you are in another universe. :badgrin:

aw27

Quote from: habran on March 22, 2017, 09:00:43 AM
If I could I would ban you for using HJWasm!
I am trying to help make HJWASM better, so far it is still more unreliable than JWASM.

habran

Cod-Father

aw27


hutch--

John,

> Basically... I'd really like to discontinue ALL of the other options..

Just do it, it will save you a mountain of grief and reduce the number of complaints by the illiterate. I made this decision early with ML64 and provide 2 options, a stack frame that write the appropriate registers to the shadow space and the rest of the arguments to the correct stack addresses and for the brave or those who actually know what they are doing, no stack frame at all.

Anything much in between is a complicate mess full of potential mistakes, un-necessary clutter and a documentation nightmare. Free of the crappy end it allows you to concentrate on the things that make the assembler better.