helloworld.exe only giving output on commmand line sometimes

Viewed 56

Recently started learning 86 assembly and made a basic helloworld.exe but when I run it through cmd there's no output. I did get an output from it once though and I didn't change any code. It also assembled and linked fine so I'm not sure why nothing happens when I run it.

cmd image

1

Here's the code just in case I messed up:

.386
.model flat, stdcall
option casemap :none

include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib

.data
 message db "HelloWorld!", 0

.code 
main:
 invoke StdOut, addr message
 invoke ExitProcess, 0
end main 
1 Answers

Thank you Michael Petch, not sure how to mark you comment as the answer (first time using stack overflow), the default linker on Masm32 was the issue, using /SUBSYSTEM:CONSOLE as the linker through command line fixed the issue.

Related