Question

Fixed; here's the fixed code (doesn't do anything and crashes, but it assembles, which is the point):

.686P
.MODEL FLAT
.CODE
_START:
    MOV al, 255
END _START

I also discovered I had to use the /c switch with ml and then link separately with /SUBSYSTEM:CONSOLE.


Just rediscovered x86 assembly and MASM32 and am getting myself reacquainted with the basics. I wrote a short, pointless program thus, to see if I could assemble anything:

.686P
.MODEL FLAT
.CODE
START:
    MOV al, 255
END

I ran ml /coff test.asm and got this output:

Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

 Assembling: test.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

"test.obj"
"/OUT:test.exe"
LINK : fatal error LNK1561: entry point must be defined

I read online that START was the name of the entry point. Have I done this wrong or this is a different problem?

Thanks in advance!

Was it helpful?

Solution

I don't have MASM, but usually the entry point is _start:, not START:.

See this MASM example program.

OTHER TIPS

That END directive is used to set the entry point: http://msdn.microsoft.com/en-us/library/wxy1fb5k(v=vs.80).aspx

So END should be END START. The entry point label can be any valid label name.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top