Author Topic: 64-bit Assemblers  (Read 25698 times)

shankle

  • Member
  • ****
  • Posts: 857
64-bit Assemblers
« on: July 31, 2012, 02:03:09 AM »
What Assemblers besides GoAsm can handle 64-bit code?
Thanks for any help.

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: 64-bit Assemblers
« Reply #1 on: July 31, 2012, 02:08:50 AM »
JwAsm
ML64 (microsoft)

shankle

  • Member
  • ****
  • Posts: 857
Re: 64-bit Assemblers
« Reply #2 on: July 31, 2012, 02:21:50 AM »
Hi Dave,
I thought JwAsm was in limbo.
GoAsm can't seem to handle the printer functions.

Gunner

  • Regular Member
  • *
  • Posts: 48
    • Gunners Software
Re: 64-bit Assemblers
« Reply #3 on: July 31, 2012, 07:00:32 AM »
NASM and FASM both handle 64bit code.
~Rob

Gunther

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: 64-bit Assemblers
« Reply #4 on: July 31, 2012, 07:10:36 AM »
What Assemblers besides GoAsm can handle 64-bit code?
Thanks for any help.

yasm is another alternative. It's nearly nasm compatible, but completely re-written.

Gunther
Get your facts first, and then you can distort them.

satpro

  • Member
  • **
  • Posts: 116
Re: 64-bit Assemblers
« Reply #5 on: July 31, 2012, 12:51:45 PM »
GoAsm handles printer functions just fine.

CodeDog

  • Guest
Re: 64-bit Assemblers
« Reply #6 on: September 13, 2012, 08:31:21 AM »
I've coded nasm under dos decades ago. I'm not sure I like it that much. I don't know if I want to use Fasm, anyone have experience using fasm?

If I grab Fasm will I be able to get any help from this forum or do I need to go to fasm's own forums?

sinsi

  • Guest
Re: 64-bit Assemblers
« Reply #7 on: September 13, 2012, 12:40:15 PM »
FASM is pretty good, does 16/32/64 bit (linux too).

>If I grab Fasm will I be able to get any help from this forum or do I need to go to fasm's own forums?
board.flatassembler.net

CodeDog

  • Guest
Re: 64-bit Assemblers
« Reply #8 on: September 13, 2012, 02:01:58 PM »
I downloaded fasm and compiled a hello world program. It went through several passes to lower the size of the executable. It went down to 1.5 kilobytes automatically. Thats cool  :eusa_dance:

Extremely nice and clean include files. No mess at all, even grouped. Btw which of the extra 64 bit registers are to be preserved in windows?

It supports all sse instruction sets to sse 4, including avx and also crc32 and rdrand. The last one is a random generator on the cpu that comes with the newest ivy bridge, I have an ivy bridge cpu here now and it supports this instruction. I have not tried RdRand yet, it's cool that we no longer need software random algorithms (or at least not when people upgrade to ivy bridge or later)
« Last Edit: September 13, 2012, 05:41:21 PM by CodeDog »

japheth

  • Guest
Re: 64-bit Assemblers
« Reply #9 on: September 13, 2012, 06:03:32 PM »
I downloaded fasm and compiled a hello world program. It went through several passes to lower the size of the executable. It went down to 1.5 kilobytes automatically. Thats cool  :eusa_dance:

Well, Masm (including the 64-bit variant) assembles in ONE pass, so it hasn't to "lower" the size at all. Isn't that ultra-cool?

But I agree, FASM is by far the best assembler of the "NASM family" - because it has a powerful macro language and remembers the type of data items. Hence this snippet
Code: [Select]
m08 db 0
m16 dw 0

add [m08],1
add [m16],2

is no problem for FASM, while NASM and companions are helpless ( NASM's inability to remember the type was once introduced as a feature, and there were - and still are -- a few people who buy this "marketing gag" ).

CodeDog

  • Guest
Re: 64-bit Assemblers
« Reply #10 on: September 13, 2012, 06:23:00 PM »
My first fasm program:

Code: [Select]
format PE GUI 4.0
entry start

include 'win32a.inc'

section '.text' code readable executable

  start:
        invoke MessageBox,0,message,caption,MB_OK or MB_ICONINFORMATION
        invoke  ExitProcess,0

section '.data' data readable writeable

        caption db 'Hi',0
        message db 'This is a salute from Fasm to the Masm32 community...',0

section '.idata' import data readable writeable

        library kernel,'KERNEL32.DLL',\
                user,'USER32.DLL'

        import kernel,\
               ExitProcess,'ExitProcess'

        import user,\
               MessageBox,'MessageBoxA'

CodeDog

  • Guest
Re: 64-bit Assemblers
« Reply #11 on: September 13, 2012, 06:28:47 PM »
japhet, I don't know if this is possible with masm, but you can put resources directly in the source code and it will compile it for you.

Another thing I like is the easy way to export functions from a dll without a definition file. You just put it directly in the source code.
I have no idea if this is possible with masm as well, I normally use definition files.

CodeDog

  • Guest
Re: 64-bit Assemblers
« Reply #12 on: September 14, 2012, 06:19:38 AM »
Fasm seems to come without a general purpose library like the masm32 library. I know about FasmLib, but it is very limited and is 32 bit only, is slow in speed. I Wonder what hutch will say if I convert the masm32 library to fasm and call it Fasm32. Would he become mad?  :dazzled:

CodeDog

  • Guest
Re: 64-bit Assemblers
« Reply #13 on: September 14, 2012, 12:26:14 PM »
My second FASM program. Using a modal dialog created in ResEd.

Code: [Select]
format PE GUI 4.0
entry start

include "win32a.inc"

section '.text' code readable executable

  start:
        invoke GetModuleHandle,0
        mov [hInstance],eax
        invoke DialogBoxParam,eax,1000,0,DlgProc,0
        invoke  ExitProcess,0

proc DlgProc hwnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
     cmp [uMsg],WM_CLOSE
     je .close

     ; return false to give internal dialog handler the call to handle message
     xor eax, eax
     ret

.close:
     invoke EndDialog,[hwnd],0
     mov eax, TRUE
     ret

endp

section '.res' resource from '1.res' data readable

section '.data' data readable writeable
        hInstance dd 0

section '.idata' import data readable writeable

        library kernel,'KERNEL32.DLL',\
                user,'USER32.DLL'

        import kernel,\
               ExitProcess,'ExitProcess',\
               GetModuleHandle,'GetModuleHandleA'

        import user,\
               DialogBoxParam,'DialogBoxParamA',\
               EndDialog,'EndDialog'

  :eusa_snooty:

japheth

  • Guest
Re: 64-bit Assemblers
« Reply #14 on: September 14, 2012, 05:40:52 PM »
japhet, I don't know if this is possible with masm, but you can put resources directly in the source code and it will compile it for you.

Great! However, it's slightly exaggerated to call it "compile", because .RES files are already "compiled" resource files.

Quote
Another thing I like is the easy way to export functions from a dll without a definition file. You just put it directly in the source code. I have no idea if this is possible with masm as well, I normally use definition files.

There's the EXPORT attribute that you can use for PROC. But there are some restrictions...

Perhaps it's better to switch to FASM ... I guess you have opened my eyes ...

However, I'm afraid the discussion has become a bit off-topic now ... it once was about 64-bit assemblers.