The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: johnsa on January 27, 2009, 09:19:46 AM

Title: Update on moving to 64bit asm coding
Post by: johnsa on January 27, 2009, 09:19:46 AM
Hey all,

Was wondering if there had been any movement yet towards 64bit in terms of the MASM package etc. I realize ML64 has been around for a while, but obviously we'd all need updated inc files etc. I'm thinking of starting to move to 64bit asm coding soonish but I'm not prepared to sacrifice all the libs/inc's and comfort features I have at present...IE: Id still want to use sockets lib, dx and any other api i feel like without having to build the inc files myself.

John
Title: Re: Update on moving to 64bit asm coding
Post by: sinsi on January 27, 2009, 09:56:36 AM
Since 32-bit programs work just as well in 64-bit windows there won't be a great shift to 64-bit programming (my opinion...).
The thing with ml64 is the licence terms - I can't remember reading them so I don't know but I've heard it's only for drivers?

jdoe has his azimut project which has 64-bit stuff I think http://pages.videotron.com/jdoe, and there's always fasm (that's what I'm using at the moment).
Title: Re: Update on moving to 64bit asm coding
Post by: johnsa on January 27, 2009, 10:18:59 AM
I'd mainly use it for commercial work under my MSDN license anyway, so I'm not so concerned about the terms, I don't think there is any restriction that it's only allowed for drivers?
I'm mainly keen on just having access to extra registers, don't really need 64bit integers often tbh...
Title: Re: Update on moving to 64bit asm coding
Post by: sinsi on January 27, 2009, 10:26:04 AM
Once you work out the calling convention it's not too bad, although the best usage of registers can be a bit confusing ("sub rax,rax" vs "sub eax,eax").
Another good thing is that you don't have to worry about the cpu being 386/486, you can assume SSE2 (I think).
Title: Re: Update on moving to 64bit asm coding
Post by: hutch-- on February 01, 2009, 04:32:33 AM
John,

Although I have not bothered in that area Pelle's POASM apparently handles 64 bit assembler code correctly and uses relatively standard Microsoft/Intel notation so it may be a good choice if you want to play in 64 bit.
Title: Re: Update on moving to 64bit asm coding
Post by: sinsi on February 01, 2009, 05:24:09 AM
FASM is pretty good for 64-bit anything, has an invoke macro (terrible, but works) and incs.
Title: Re: Update on moving to 64bit asm coding
Post by: BlackVortex on February 01, 2009, 07:09:43 AM
Quote from: sinsi on February 01, 2009, 05:24:09 AM
FASM is pretty good for 64-bit anything, has an invoke macro (terrible, but works)
You should work in marketing   :green
Title: Re: Update on moving to 64bit asm coding
Post by: GregL on February 01, 2009, 09:45:03 PM
GoASM does 64-bit too. There are some tutorials here Writing 64-bit programs (http://www.jorgon.freeserve.co.uk/GoasmHelp/64bits.htm).

As soon as I get a new hard drive and Windows 7 Beta 64-bit installed, I'm gonna have a go at it.

Title: Re: Update on moving to 64bit asm coding
Post by: sinsi on February 04, 2009, 06:19:43 AM
Quote from: BlackVortex on February 01, 2009, 07:09:43 AM
Quote from: sinsi on February 01, 2009, 05:24:09 AM
FASM is pretty good for 64-bit anything, has an invoke macro (terrible, but works)
You should work in marketing   :green
I hate macros at the best of times (as I've said in many a thread) but this is littered with

  sub rsp,params*8
  call win_api_thing
  add rsp,params*8
  sub rsp,params*8
  call other_winapi_thing
  add rsp,params*8

With the calling convention for win64 there's not really an 'elegant' solution for invoke (probably why ml64 doesn't have it). Thankfully, I write my code with 'push' and 'call' so I'm used to it  :bdg

With all those registers available, what brain-dead moron decided on rcx/rdx/r8/r9 (and only them)? ::)