Author Topic: OPTION STACKBASE also broken in x64  (Read 8198 times)

AW

  • Member
  • *****
  • Posts: 2550
  • Let's Make ASM Great Again!
Re: OPTION STACKBASE also broken in x64
« Reply #15 on: March 22, 2017, 01:26:43 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

  • Member
  • ****
  • Posts: 799
    • Uasm
Re: OPTION STACKBASE also broken in x64
« Reply #16 on: March 22, 2017, 01:28:44 AM »
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.

AW

  • Member
  • *****
  • Posts: 2550
  • Let's Make ASM Great Again!
Re: OPTION STACKBASE also broken in x64
« Reply #17 on: March 22, 2017, 04:16:30 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

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: OPTION STACKBASE also broken in x64
« Reply #18 on: March 22, 2017, 08:21:20 AM »
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

AW

  • Member
  • *****
  • Posts: 2550
  • Let's Make ASM Great Again!
Re: OPTION STACKBASE also broken in x64
« Reply #19 on: March 22, 2017, 08:28:49 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

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: OPTION STACKBASE also broken in x64
« Reply #20 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?
Cod-Father

habran

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: OPTION STACKBASE also broken in x64
« Reply #21 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 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

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: OPTION STACKBASE also broken in x64
« Reply #22 on: March 22, 2017, 09:00:43 AM »
If I could I would ban you for using HJWasm!
Cod-Father

AW

  • Member
  • *****
  • Posts: 2550
  • Let's Make ASM Great Again!
Re: OPTION STACKBASE also broken in x64
« Reply #23 on: March 22, 2017, 09:01:04 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

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: OPTION STACKBASE also broken in x64
« Reply #24 on: March 22, 2017, 09:06:23 AM »
However, I have seen evidence that you have no f***en idea!
Cod-Father

AW

  • Member
  • *****
  • Posts: 2550
  • Let's Make ASM Great Again!
Re: OPTION STACKBASE also broken in x64
« Reply #25 on: March 22, 2017, 09:08:02 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:

AW

  • Member
  • *****
  • Posts: 2550
  • Let's Make ASM Great Again!
Re: OPTION STACKBASE also broken in x64
« Reply #26 on: March 22, 2017, 09:10:06 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

  • Member
  • *****
  • Posts: 1220
    • uasm
Re: OPTION STACKBASE also broken in x64
« Reply #27 on: March 22, 2017, 09:12:51 AM »
Hasta la vista babe :badgrin:
Cod-Father

AW

  • Member
  • *****
  • Posts: 2550
  • Let's Make ASM Great Again!
Re: OPTION STACKBASE also broken in x64
« Reply #28 on: March 22, 2017, 09:46:21 AM »
Hasta la vista babe :badgrin:
You should moderate whatever you are sniffing  :badgrin:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6958
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: OPTION STACKBASE also broken in x64
« Reply #29 on: March 22, 2017, 12:16:03 PM »
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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: