L
L
LoliDeveloper2020-08-07 11:11:43
assembler
LoliDeveloper, 2020-08-07 11:11:43

Is NASM Assembler better than MASM?

Wrote a program that prints "Hello" in NASM and MASM assemblers.
As a result, a program written in NASM weighs 2KB, and in MASM 2.5KB.

Can we say that NASM is better than MASM?

MASM:

include C:\masm32\include\masm32rt.inc

.code
start:

print "Hello"

exit

end start


NASM:
NULL EQU  0
STD_OUTPUT_HANDLE EQU -11

extern [email protected]
extern [email protected]
extern [email protected]

global Start

section .data

  Message db "Hello", 0Dh, 0Ah
  MessageLength EQU $-Message
  
section .bss

  StandartHandle resd 1
  Written resd 1
  
section .text

  Start:
    push STD_OUTPUT_HANDLE
    call [email protected]
    mov dword [StandartHandle], EAX
    
    push NULL
    push Written
    push MessageLength
    push Message
    push dword [StandartHandle]
    call [email protected]
    
    push NULL
    call [email protected]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2020-08-07
@LoliDeveloper

Is NASM better than MASM?

If less is best for you, then yes.

I
Igor Prokofiev, 2020-08-07
@Debil1488

Apparently, the linker packed it that way.
Nothing wrong with that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question