Please help me before I go over to the Dark side. I have done assembly years ago on older 8 and 16 bit micros and want to do it in Win32. I want to do a simple endless NOP loop win32 console app but it wont load. I get an access violation on my Win2000 PC 0xc00000005. What do you have to do to get a simple console app to create an initial console window? Do I have to set up my own stack for the primary thread or is that done for me ?
Posted on 2001-10-29 07:31:09 by kmbrad1963
If you use /subsystem:console , I think a console should be allocated
for you automatically. Otherwise, use "invoke AllocConsole" to get

Theres a few weird things about your source. You have "end", but
no entrypoint? Do you link this with libc or something else? Or do
you get a linker warning/error about no entrypoint defined? Interesting,
I do "ml /c /coff test.asm" followed by "link /subsystem:console test.obj".
No warnings or errors. And nothing happens when I run it (which
is because it has no kernel32 import).

Ok, reworked it a bit :). I believe the reason why the linker doesn't
b0rk about no entrypoint is that it has a few default ones (like mainCRTStartup).
I usually define it myself by "END entrypoint", but that's up to you.
Here's working code...

ml /c /coff test.asm
link /subsystem:console test.obj
Posted on 2001-10-29 08:12:14 by f0dder

If you have not got a copy of MASM32 yet, download it as it has all of these very basic techniques in the example code.

There are some prebuilt modules in the MASM32 library for handling basic console output and this will help you get going in 32 bit assembler.

Posted on 2001-10-29 14:52:40 by hutch--