|
The Go tools for Windows + Assembler |
||||||||||||||||||||||
|
The "Go" Tools
|
|
||||||||||||||||||||
![]() |
If you are interested in 32-bit or 64-bit programming for Windows,
you will find everything you need here including an
Assembler,
a Resource Compiler,
Linker,
Symbolic Debugger,
and links to Integrated Development Environments (IDEs),
a Help Compiler,
Information about Windows
and Header Files (include files).
There are also
"Go" tutorials and sample code,
Third party tutorials and sample code,
a Demonstration program, and
other Links.
Also see the enhanced Unicode support in the "Go" tools
and 64-bit programming.
Windows+assembler is becoming more and more popular. Here you can use
a low level language (assembler) together with a very high level language
(the Windows API) - a perfect combination!
A
ssembler -
A free assembler (GoAsm.exe), which produces COFF object files
ready to be given to a linker to create the final executable. My aim here
has been to make an assembler with clean and obvious syntax, which is very
quick, and which always tries to produce the smallest code. GoAsm also
has some useful extensions to make programming for Windows easier. It
has enhanced support for making Unicode programs and can produce programs
for both Win32 and Win64(x64) platforms (see 64-bit programming).
View the GoAsm manual
Download GoAsm version 0.62.0.0 (with documentation 378K)
Filename: Goasm.zip SHA-256: d4f0f6e55f4435771bac9daf682ad56035f7e7aaaeba409d6ab40f71e6760926
Filename: GoAsm.exe SHA-256: 7e2073eff80448d0dec79ee23400421b2523193efcc0ad6387b9b29dc09c9156
Resource Compiler -
A free resource compiler (GoRC.exe), which produces RES files
from RC files, or OBJ files from RC or RES files, together with documentation.
View the GoRC manual
Download GoRC version 1.0.3.0 (with documentation 67K)
(this is a 32/64-bit version: see 64-bit programming)
Filename: Gorc.zip SHA-256: 908fe5fa898492e7ed5e5d814f4f43ff2a7f5d016d1d05ffe3e3bef23cfe6acf
Filename: GoRC.exe SHA-256: 96aef2e39322588f56f20fd720334055c7fe010ee358dd57e66b529078462fae
Linker -
A free linker (GoLink.exe), which takes COFF object files and a Res file and creates EXE or DLL executables able to run under Windows Win32 or Win64(x64) see 64-bit programming. This is a full featured but "reduced baggage" linker which keeps files to a minimum. You do not need Lib files to identify what functions reside in the DLLs. Instead GoLink looks inside the DLLs themselves. Used with GoAsm, this linker can report on redundant data and code in your programs. It also allows use of Unicode filenames and labels (exports and imports).
View the GoLink manual
Download GoLink version 1.0.4.6 (with documentation 49K)
Filename: Golink.zip SHA-256: f0f682c5fc55217f5b93922475910840f5dcd8467f7891df12d7856554c3d160
Filename: GoLink.exe SHA-256: 9a0fc1b5168b2c642786770ee1a779ac66e0b6afaafa8f8a2b7619a3164fe168
Debugger -
"GoBug" - A free Win32 symbolic debugger for assembler programmers, together with "Testbug" its accompanying test
program and Win32+assembler demo program. It is itself written entirely in assembler, using my assembler GoAsm and my linker GoLink.
Go to the GoBug site for more details and for free download here.
IDEs - Integrated Development Environments -
Here are some IDEs which work with the "Go" tools. Please let me know if I have
missed any:-
Easy Code for GoAsm.
The excellent visual assembler IDE for Windows written by
Ramon Sala.
Download ECGo.zip - package for use with Easy Code
containing the latest versions of the "Go" tools - 491K.
Bill Aitken's tutorials for using GoAsm and the IDE
RadAsm IDE forum
Another excellent visual assembler IDE for Windows from
Ketil Olsen.
Help Workshop -
All you need (free from Microsoft) to create the new compiled html help files
http://msdn2.microsoft.com/en-us/library/ms670169.aspx
Windows 32/64 -
The whole SDK (Software Development Kit)
can be downloaded free from Microsoft.
It's massive so make sure you
have a cheap and fast internet connection! Use the link below to get
into the Microsoft MSDN site, then click "downloads" then "SDK downloads",
then you may have to search for "Platform SDK", and then click on "Release
Date" to sort the results so you can see the latest SDK.
This sequence changes slightly as Microsoft changes its download site.
The "Windows Server 2003 R2 Platform SDK" will contain everything you need
although there are now also the Vista SDK's and an SDK for the Windows Server
2008 pre-release if you want to be very up to date.
To a limited extent you can choose what to download and what not to download.
You will need at least the "documentation" which gives details of the Windows
APIs, but it is a good idea also to download the header files.
Good luck!
Go to the Microsoft MSDN site
Header files - contain the constant values, structures
and parameters you need to know about when you call a Windows API.
Many programmers "include" them directly in their source code, so that the
constant values and structures can be referred to by name. Typically these files
have ".h" or ".inc" extensions.
There are various source for such files.
|
The recommended way is to use the header files prepared by the GoAsm Header Project from "Donkey's Stable", which are now available from here. | |
|
You can use the header files from the Windows SDK, and then use Wayne J Radburn's xlatHinc utility to convert those header files into include files for direct use by GoAsm. | |
|
You can use Bryant Keller's header files, including Windows constants, structures, procedures and some macros. They are available from here. |
GoBug manual
Testbug manual or
GoAsm manual
|
|
Beginners |
Quick start to .. writing a simple Windows program
Step-by-step guide to making simple Windows programs. For those new to programming
The basic build process and the files you use. For those new to assembly language
An introduction to the various assembler instructions (mnemonics) and what they do. For those new to Windows
A basic description of what Windows does and how it works. For those new to symbolic debugging
What debugging is and how to use it to find errors in your programs.
Simple Windows console program
Source code for a program writing "Hello World" to the console. Simple Windows GUI program
Source code for a program writing "Hello World" to a window. Simple Windows GUI program
Source code for a program writing "Hello World" to a window, but demonstrating automated stack frames, structures, INVOKE, locally scoped labels and redefinitions (macros). Simple Dialog program
Source code for a program creating a dialog, and showing various ways of writing to it.
Understand bits, binary and bytes
Understand hex numbers
Understand finite, negative, signed and two's complement numbers
Understand registers
Understand the stack - Part 1
FAQ
"When I click on the GoAsm or GoLink or GoRC icon something just flashes on the screen but nothing else happens".
|
|
Intermediate |
Some programming hints and tips
Size of code - keep it compact!
Understand flags and conditional jumps
Real-time conditional jump test (Testbug)
Real-time flag test (Testbug)
Understand reverse storage
Understand the stack - Part 2
Use of NEG and NOT
Use of BT (and variants) and BSWAP
Use of REP SCASB
Types of JMPs & CALLs to unique labels
Standardized window and dialog procedure
Optimising the loop instruction
Optimising REP STOS MOVS and STAS
Alignment of oft-called functions
Alignment of memory reads, writes and compares
Writing a 32-bit number in hex
Writing a 32-bit number in ascii
Writing a 64-bit number in ascii
Dividing a 64-bit number
Data in the code section - effect on speed
Using VirtualAlloc and HeapCreate
HeapCreate v VirtualAlloc, comparing speed
Drawing text to screen using Windows
What Dlls are and why they are useful
Dll loading, memory, stack and threads
Calling Dlls with no arguments
Calling Dlls with arguments via the stack
Dll sending data to the calling exe
Do nothing Linux program by V.Krishnakumar
|
|
Advanced |
Conditional jump branch hints
Use of IDIV
Use of IMUL
BCD coding: AAA and DAA
Using the FPU
Using the MMX registers
Using the 3DNow! instructions
Using the XMM integer instructions
Using the XMM SSE instructions
Using the XMM SSE2 instructions
SIMD floating point control
Dlls: Start-up code and run-time link
Dlls: Exporting data pointers
Dll using a function in the calling exe
Calling a Dll function by ordinal using GetProcAddress
Calling a Dll function directly by ordinal
Calling a Dll function by name-load
Testing who called Dll start-up code
Addressing arguments using ebp
Addressing arguments using esp
Addressing local data in home-made stack frames
Ways of saving return address in stack frames
Making temporary on-screen notices
Clipping - control using the device context
Clipping - control using other methods
Using different languages in resources
Different types of window procedures
Recursion in window procedures
Simulating a dialog
Making and debugging multi-threaded programs
Causing and debugging exceptions
Messages around the system
Writing 64-bit programs
Hello 64World 1
a simple 64-bit console program Hello 64World 2
a simple 64-bit windows program Hello 64World 3
switchable 32-bit or 64-bit windows program
Writing Unicode programs
Hello Unicode 1
A simple program with a Unicode UTF-8 source script, which draws Unicode
characters to the console and which demonstrates how to get the strings in the
correct format using the natural format of the source script, the STRINGS
directive and the A" and L" overrides.
Hello Unicode 2
A Unicode UTF-8 source script, which draws Unicode characters in a dialog
made using a template in data and also in a message box. It demonstrates the
use of Unicode strings in data.
Hello Unicode 3
A Unicode UTF-8 source script, which draws Unicode characters using TextOutW,
and also demonstrates Unicode/ANSI switching using the Microsoft Layer for
Unicode.
Run Time Loading
Demonstrates how to use run-time loading in large application running
on both W9x/ME and NT/2000/XP/Vista/7/8 and using both ANSI and Unicode APIs.
Demonstrations of what W9x/ME and NT/2000/XP/Vista/7/8 can do to draw non-Roman characters
Structured Exception Handling (view)
Structured Exception Handling (download 56K)
This is an analysis of Structured Exception Handling in Win32 from an assembler
viewpoint, with demo programs and source code examples. It includes
two samples. One is a simple example demonstrating both final and per-thread
handlers. The second is more complex, demonstrating exception handling in detail.
WebBrowser2 implementation (download 40K)
Windows WebBrowser2 allows you to embed an html browser in an ordinary window. The browser renders the html using Internet Explorer code and so is limited in functionality, but it does the job unless you need something fancy. WebBrowser2 uses COM interfaces with virtual tables, callbacks and strange things like VARIANTS and BSTRs, so the implementation in many platforms is obscured. This implementation in assembler seems to be the minimum code which will work, but at least it can be seen what is happening, and how it all works.
WebView2 implementation 1 (due to download blocking the exe file is not in the zip file so either you need to assemble again or you can try to download the exe separately from here). Having downloaded the files you can check their authenticity from the following information (you can create your own hash using certutil):
Filename: HelloWebView2.zip date: 11 June 2024, size: 66KB and SHA256 hash: b22027d10b54f9cae53465b3d42b0560618b377a6e07e7d6973ac68063db1db2 Filename: HelloWebView2.exe date: 11 June 2024, size: 6KB and SHA256 hash: 2f89b41a56a1cfbc54b31065854f0952ef38410052821ad82d96611c019168e4 HelloWebView2 is an update of WebBrowser2 (just above). It uses Chromium/Edge browser code called WebView2 Runtime enabling you to embed a modern browser in an ordinary window. Like WebBrowser2 above, it uses COM interfaces with virtual tables and callbacks. As usual the sample code for the various "modern" platforms is obscure and complex. But using assembler means everything can be stripped down to the bare essentials. Now we can see that the implementation of WebView2 is fairly easy. One call to the redistributable dll WebView2Loader.dll triggers everything, the memory for the interfaces is provided by the system and you complete the job within the callbacks. Here everything is done in one file of 17K with no includes!
WebView2 implementation 2 (due to download blocking the exe file is not in the zip file so either you need to assemble again or you can try to download the exe separately from here). Having downloaded the files you can check their authenticity from the following information (you can create your own hash using certutil):
Filename: CommWebView2.zip date: 11 June 2024, size: 113KB and SHA256 hash: 4fbfb50d3fbaa44276b3108d09f09c7d925656dd489a92754bb65125445c1419 Filename: CommWebView2.exe date: 11 June 2024, size: 1,039KB and SHA256 hash: 78f0b9d00037f228f88de159d6229a851890ec13f29a114e2720f211e586bba5 CommWebView2 builds on HelloWebView2.asm to show how it is possible to establish two way communication with the WebView2 browser, and use it as a rich text (html) editor. It explains the use of Navigate, NavigateToString, ExecuteScript, execCommand, and add_WebMessageReceived.
Using the FileOpenDialog interface
This is a demonstration of how the FileOpenDialog COM interface can be implemented in assembler by using the API CoCreateInstance. It is really quite simple and obvious, and using assembler avoids the various quirks arising when using other languages. When assembled and linked, this simple program shows a Windows open file dialog and displays the chosen file in a message box. The ShellItem interface (iShellItem) is used to assist in the task.
Using the FileOperation interface
This is a demonstration of how the FileOperation COM interface can be implemented in assembler by using the API CoCreateInstance. It is really quite simple and obvious, and using assembler avoids the various quirks arising when using other languages. When assembled and linked, this simple program deletes the file C:\temp\FileOpsDelete.txt (obviously the filename can be changed to suit!). The ShellItem interface (iShellItem) is used to assist in the task.
Demonstration of Windows notifications and badges
If your application needs to give notifications and attach badges to the taskbar icon, here is a demo to test what is available. This demo starts with the ubiquitous MessageBox, then offers two types of popup notification - one which slides in from the bottom right hand side using timed paint functions, and another which uses a tracked tooltip. For the badges, the demo offers Shell_NotifyIcon which puts an icon in the status area of the taskbar and shows a balloon, and the COM function SetOverlayIcon which overlays the application's taskbar icon. Finally the demo makes a good attempt at using the Windows Runtime Badge Notification interfaces to attach a badge or glyph to the taskbar icon. Unfortunately I then discovered that these interfaces do not work in an ordinary "Desktop app". But at least the sample code in the demo shows that it is possible to code Windows Runtime in assembler. Some of the tests require the setting "Get notifications from apps and other senders" to be "on". |
|
|
Debugging |
For those new to symbolic debugging
Debugging: what, when and how (GoBug)
Around GoBug
Using GoBug
Getting system and debuggee information
Testing GoBug using Testbug - various tests
View the complete GoBug manual
The "RSDS" or "DS" pdb symbol file format
|
|
|
|
Wayne J. Radburn's assembler page
Wayne was the first to publish assembler and windows skeleton code and all his examples are now in GoAsm syntax but with a MASM flavour. Here you can get:
|
please contact me if you would like your work to be added to this list
DEMONSTRATION PROGRAM
LOOP and REP Aligning code and data Using branch hints FPU v CPU @ 64 bits Addressing data in code section Various ways of writing numbers Comparing the Win32 memory APIs Comparing Win32 text APIs |
Various tests and demos using DLLs Ways to put temporary notices on screen Clipping regions in windows How to use the memory APIs How to use different language resources How to draw non-Roman characters under W9x/ME How to draw Unicode characters Different types of WndProc to use Simulating a dialog using ordinary window |
How API errors are shown Recursion in WndProcs Passing arguments on the stack Using EBP as spare register Local data and stack frames When waiting return from a call Infinite loops to break out of Debugging multi-threaded applications Breaking on various exceptions Displaying output string Watching and logging messages |
Use of IDIV Use of IMUL Use of NEG and NOT Size of code using various mnemonics Using the bit control mnemonics Use of REP SCAS and variants Use of the BCD mnemonics JMPs and CALLs to unique labels Using the Floating Point Unit Using the MMX registers Using the 3DNow! instructions Using the XMM registers SSE and SSE2 instructions SIMD floating point control Use the debugger as a hex calculator |
There are plenty of samples of asm code for Win32 in the
links!

GoAsm, GoLink and GoRC are now capable of producing 64-bit programs which can be run on X64 (x86-64) processors (such as the AMD64 and those using EM64T) running under Windows x64. The same versions of these tools work for both 32-bit or 64-bit assembly.
All the 64-bit capable versions of these tools are beta versions as follows:-
GoAsm 32/64-bit assembler (version 0.62.0.0 with documentation 378K)
GoRC 32/64-bit resource compiler (version 1.0.3.0 67K)
GoLink 32/64-bit linker (version 1.0.4.6 with documentation 49K)
Despite the differences between the 64-bit processors and their 32-bit counterparts, and between the x64 (Win64) operating system and Win32, using GoAsm to write 64-bit Windows programs is just as easy as it was in Win32.
In fact, you can readily use the same source code to create executables for both platforms if you use GoAsm's enhanced instructions ARG and INVOKE and FRAME...ENDF, and conditional assembly for data sizes and structures. Then specify /x64 in the command line to make a 64-bit object file and /x86 to make a 32-bit one. GoLink automatically senses the type of object file to make the correct executable. See writing 64-bit programs for details.
AdaptAsm is part of the GoAsm package and helps towards converting your existing 32-bit code to 64-bit code, changing registers automatically and changing PUSH/CALL combinations to ARG/INVOKE as required. It uses Leland M George's clever javascript file ApiParamCount.js which can take a Microsoft header file and create a list of the APIs and their parameter counts. You can download this file separately here. See writing 64-bit programs for details of how to use AdaptAsm in this way.
Here is some sample code:-
Hello 64World 1 a simple 64-bit console program
Hello 64World 2 a simple 64-bit windows program
Hello 64World 3 switchable 32-bit or 64-bit windows program
All bug reports would be appreciated. The tools do not yet offer full support for 64-bit structured exception handling. This is in progress but I would welcome any ideas for an appropriate syntax to use.
GoBug may eventually be revised to enable it to debug 64-bit applications.
![]() |
UNICODE |
GoAsm |
Input file formats supported:-
ANSI, Unicode UTF-8 with BOM and UTF-16LE with BOM |
|
Output:- Output to the console will be in Unicode if permitted by the system; list file and any file to receive redirected output will be in the same format as the first input file. |
||
Unicode can be used in:- filenames in include files and raw data files; filenames in input and output files via the console (command line); defined words in the command line; defined words in source or include files (equates, structs and macros); comments; data labels (permitting access to data using Unicode); code labels (permitting calls to functions using Unicode names, imports and exports to other executables); strings (see below). |
||
Declaring strings in data:- |
||
| DB "..." | - (default action) in an ANSI file, no conversion;
- in a Unicode file, put in data in UTF-16 format; |
|
| and to override the default action:- | ||
| STRINGS UNICODE | - strings always to be in UTF-16 format for the rest of the file | |
| STRINGS ANSI | - strings always to be in ANSI format for the rest of the file | |
| and irrespective of the STRINGS directive:- | ||
| DUS "....",0Dh,0Ah,0 | - declare sequence in data in UTF-16 format (string and control characters) | |
| DB L"..." | - declare string in data in UTF-16 format | |
| DW L"..." | - declare string in data in UTF-16 format | |
| DB 8"..." | - declare string in data in UTF-8 format | |
| DB A"..." | - declare string in data in ANSI format | |
Pushing pointers to null terminated strings in data:- |
||
| PUSH "....." | - (default action) in ANSI file no conversion;
- in a Unicode file, push pointer to null-terminated Unicode string in data in UTF-16 format |
|
| and to override the default action:- | ||
| STRINGS UNICODE | - push strings to be in UTF-16 format for the rest of the file | |
| STRINGS ANSI | - push strings to be in ANSI format for the rest of the file | |
| and irrespective of the STRINGS directive:- | ||
| PUSH L"....." | - push pointer to null terminated string in UTF-16 format | |
| PUSH 8"....." | - push pointer to null terminated string in UTF-8 format | |
| PUSH A"....." | - push pointer to null terminated string in ANSI format | |
Quoted immediates:- |
||
| MOV EAX,'a' | - (default action) in ANSI file no conversion
(put into EAX the character value of 'a' in the current codepage);
- in a Unicode file, put Unicode character value for "a" into EAX; |
|
| and to override the default action:- | ||
| STRINGS UNICODE | - use Unicode character values for the rest of the file | |
| STRINGS ANSI | - use ANSI character values for the rest of the file | |
| and irrespective of the STRINGS directive:- | ||
| MOV EAX,L'a' | - use Unicode character value | |
| MOV EAX,8'a' | - use UTF-8 character value | |
| MOV EAX,A'a' | - use ANSI character value | |
Switching using conditional assembly:- |
||
| Switching Unicode/ANSI APIs - various methods, aided by the double hash
Switching of the STRINGS directive Switching of Unicode or ANSI character sequences Switched type "S" to switch as B,W,D,Q or T type indicator Switched character size indicator |
||
GoRC |
Input file formats supported:-
ANSI, Unicode UTF-8 with BOM and UTF-16LE with BOM |
|
Output:- Output to the console will be in Unicode if permitted by the system; file to receive redirected output will be in the same format as the first input file. |
||
Unicode can be used in:- filenames in include files resource files (eg. icons and bitmaps) and raw data files; filenames in input and output files via the console (command line); defined words in the command line; defined words in source or include files (equates and macros); comments; resource IDs; resource types; strings (see below). |
||
Strings in version resource, stringtables, dialogs, menus, controls and user-defined resources:- |
||
| always converted to Unicode UTF-16 format if not in that format already, escape sequences allowed and number conversion carried out (see GoRC manual) | ||
Strings in RCDATA resource (raw data in resource script) |
||
| (default action) kept in the same format as the source script, escape sequences allowed and number conversion carried out (see GoRC manual) | ||
| L"....." | - string converted to UTF-16 format if not in that format already | |
GoLink |
Input commands:-
Command line in console (MS-DOS command prompt):- accepts Unicode filenames if supported by the operating system. Command files:- can be ANSI, Unicode UTF-8 with BOM and UTF-16LE with BOM |
|
Output:- Output to the console will be in Unicode if permitted by the system; file to receive redirected output will be in the same format as the first Unicode command file. If there is no Unicode command file the format depends on the operating system - see the GoLink manual. |
||
Copyright © Jeremy Gordon 1999-2025. All rights reserved.
Last update 12th July 2025