How to create a symbol table in assembler

How do I write Hello World in assembler on Windows?

The best examples are those with fasm because fasm don't use a linker that hides the complexity of windows programming through another opaque layer of complexity.
If you are happy with that, with a program that writes in a gui window, there is an example for that in the fasm - example directory.

If you want a console program that allows redirection from standard-in and standard-out that is also possible.
There is a (helas highly non-trivial) sample program available that doesn't have a gui, and works strictly with the console, that is fasm itself. This can be diluted to focus on the essentials. (I've written a forth compiler, that's another non-gui example, but it's not trivial either).

So a program uses the following command to generate a correct executable header, usually done by adding a linker.

A section called '.idata' contains a table that helps the windows during startup to assign few names of functions to the runtimes addresses. It also contains a reference to KERNEL.DLL which is the Windows operating system.

The table format used by windows and contains names to be searched for in system files when the program starts. FASM hide some of the
Complexity Behind The CIA Keyword. So [email protected] is a fasm-label and _exitProcess is a string that is searched for by Windows.

Your program in the '.text' section. If you explain that section is readable, writable, and executable, it is the only section you need to add.

You can use all the facilities you declared .idata area. For a console you need to find _GetStdHandle, he filedescriptors for standard and standardout (with symbolic names like STD_INPUT_HANDLE the fasm is found in the include file win32a.inc).
Once you have the file descriptors you can do WriteFile and ReadFile.
All functions described are in the kernel32 documentation. You are probably aware or you wouldn't try assembler programming.

In summary: there is a table of ASCII names, the couple that windows OS.
When you start this is converted into a table of callable addresses that you can use in your program.

Shareimprove this answer Albert van der Horst