News:

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

Main Menu

64-bit Assemblers

Started by shankle, July 31, 2012, 02:03:09 AM

Previous topic - Next topic

shankle

What Assemblers besides GoAsm can handle 64-bit code?
Thanks for any help.

dedndave


shankle

Hi Dave,
I thought JwAsm was in limbo.
GoAsm can't seem to handle the printer functions.

Gunner

NASM and FASM both handle 64bit code.
~Rob

Gunther

Quote from: shankle on July 31, 2012, 02:03:09 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
You have to know the facts before you can distort them.

satpro

GoAsm handles printer functions just fine.

CodeDog

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

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

#8
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)

japheth

Quote from: CodeDog 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:

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

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

My first fasm program:

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

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

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

My second FASM program. Using a modal dialog created in ResEd.


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

Quote from: CodeDog 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.

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.