http://www.directdocs.com.auhttp://www.qmediate.com.auhttp://www.goprog.com
The Go tools for
Windows + Assembler
Easy Code Visual IDE
easy code logo ECGo.zip
(essential file for the IDE)
Bill Aitken's tutorials for using GoAsm and the IDE


The "Go" Tools

go logo
by Jeremy Gordon email address

"Go Tools" Forums
in the MASM forum (from May 2012)
old forum messages 2004 to May 2012
 

"Go" tools also does go logo

  logo "GoDevTool Memento" help file by Patrick Ruiz

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!


picture of tool TOOLS

go logo 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.58.0.1 (with documentation 361K)

back to top



go logo 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.0.0 (with documentation 61K) (this is a 32/64-bit version: see 64-bit programming)
back to top



go logo 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. Has full but easy-to-use support for the Microsoft Layer for Unicode, and also allows use of Unicode filenames and labels (exports and imports).
View the GoLink manual
Download GoLink version 0.28.00 (with documentation 60K)
back to top



go logo 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.
back to top


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 - the latest versions of the "Go" tools and the include files for use with Easy Code - 792K.
    Bill Aitken's tutorials for using GoAsm and the IDE
RadAsm Win32 Assembly IDE
    Another excellent visual assembler IDE for Windows from Ketil Olsen.
    You can go to Donkey's stable for Radasm, include files, macros, GoAsm samples and projects.
NaGoa Visual Assembly (using GoRC only).
back to top


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
back to top


INFORMATION about WINDOWS

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
back to top


picture of a pint HEADER FILES (include files)

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, which are available from Donkey's stable.  
  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.
  You can use the header files for use with the Easy Code IDE which can be downloaded directly from here (792K). This file also contains the latest versions of the Go tools.
You can use the header files within the RadAsm IDE. These are also directly available from the "GoAsm projects" page at Donkey's stable.



picture of a piece of cake "GO" TUTORIALS and SAMPLE CODE


These tutorials are from
the GoBug manual
the Testbug manual or
the 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.
Microsoft Layer for Unicode ("mslu") Describes what the mslu is, how it works, and how to use it with the "Go" tools.
Demonstrations of the mslu in practice
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 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.
go logo 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


Third party Tutorials and GoAsm sample code


There are several excellent guides to assembler programming and windows programming on the internet, but if these are based on source code for other assemblers or for "C", they can be confusing for the beginner who wants to use the "Go" tools. For this reason I only list here tutorials and sample code specifically written for the "Go" tools. If you want to look at the other resources you can use my links page or use the link at the bottom of the page to browse the webring.

 

 


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:

  • Bare Bones skeleton - a simple window with a menu and help/about dialog box.
  • In the Flesh - adds a view window, removeable toolbar, and status bar. It has additional file menu commands which open and close a memory mapped file.
  • Alive and Kicking - uses a split window, a treeview and view windows and a window for selecting a font. It also uses the registry to save settings.
  • See also Wayne's xlatHinc which converts a Windows "h" file to an "inc" file for use with the "Go" tools.

Donkey's stable

Edgar Hansen has written a lot of sample code for GoAsm for example:-

  • WinExplorer: a Windows Explorer, which makes extensive use of the GUI and COM.
  • Help2 Viewer: a HTML Help 2 viewer using WebBrowser2 MFC using ATL.
  • An AES encryption algorithm (Rijndael).
  • Use of ODBC to create a utility to examine JET databases.
  • IContextMenu, which is an implementation of the IContextMenu shell extension (a COM server application).
  • A simple registry browser to view the registry.
  • GoAsm version of "Using CODECs to Compress Wave Audio".
  • Extracting information from a 32/64 bit PE file and display in a dialog.
  • Listing the import and export directories from a 32 bit PE file.
  • Using DeviceIoControl to get information from a fixed disk drive.
  • How to use a tracking scroll bar.
  • Font menu (custom drawn menu demo).
  • How to draw text on a bitmap button.
  • Listview control with clipboard functionality and sorting.
  • Animated icons in a toolbar control.
  • How to use a toolbar with menus example.
  • How to use a vertical toolbar menu.
  • How to extract version information from an application.
  • How to draw ownerdraw buttons.
  • How to draw ownerdraw combo box.
  • Dialog with a custom caption.
  • How to overlay icons over other icons.
  • How to put hyperlinks in a dialog or a window.
  • Graceful exit with exception handling.
  • How to implement a drag listbox.
  • How to add colours and icons to a status bar.
  • How to store an icon file directly in your data or const section and load the icons it contains by index.
  • How to calculate the speed your CPU is running at.
  • How to extract information from a desktop listview, and check for a NT compatible version of Windows using the FS override.

Vortex has kindly provided this sample code:-

  • Simple dialog box created using a resource file VortexDlg1.zip
  • How to use INCBIN directly to import a dialog template made using res2bin into GoAsm source codeVortexIncbin1.zip
  • How to use INCBIN directly to import a dialog template from a res file into GoAsm source codeVortexIncbin2.zip

AsmGges Assembleur Compilateur 32 bits page

Gges has a page in French with full source code for various projects:-

  • Several "starter" projects including showing simple message box, windows, text, and for using keyboard, mouse, cursor, menus and buttons.
  • Examples of using treeview and listview controls.
  • Using icons, bitmaps and animated graphics.
  • Ownerdraw.
  • Examples of using edit, combobox, updown and progress bar controls.
  • Examples of trackbar and toolbar controls.
  • Examples of using the Musical Instrument Digital Interface (MIDI) and also an MP3 player.
  • Mousehook.
  • Time date and calendar display.
  • Snake game - great fun when you get bored! Demonstrates random graphics effects and playing sounds.
  • Example using DirectX in assembler ddwbmp.zip (45KB). See AsmGges website for an up to date list.

"GoDevTool Memento" by Patrick Ruiz - useful aide-memoire for the "Go" tools as a help file.

Here is some of the sample code in the MASM forum (applying from May 2012) and in the old masm forum which applied from 2004 to May 2012:-

Here is some of the sample code in the ASM Community message board

please contact me if you would like your work to be added to this list


DEMONSTRATION PROGRAM


Testbug.exe and its associated help files - this contains Win32+assembler demonstrations and samples, speed tests, and practice at debugging, particularly with the GoBug debugger.
View the Testbug manual
Download Testbug Version 1.03 (414K)
Here is what you can find in Testbug ..
Speed tests
Addressing stack in various ways
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
Use of Win32
Addressing stack in various ways
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
Example of using GoLink's Microsoft Layer for Unicode loader
Different types of WndProc to use
Simulating a dialog using ordinary window
Use of GoBug
Practice conditional jumps
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 Mnemonics
Flag demonstration
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!


go logo


64-bit programming using the "Go" tools


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.58.0.1 with documentation 361K)
GoRC 32/64-bit resource compiler (version 1.0.0.0 61K)
GoLink 32/64-bit linker (version 0.27.00 with documentation 60K)

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 will be revised to enable it to debug 64-bit applications.


picture of world UNICODE


Summary of Unicode support in the "Go" tools


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.

Microsoft Layer for Unicode (MSLU):-
Code for a simple, easy to use and effective MSLU loader is added automatically to a exe file or to a dll if you specify the /mslu command; you can change the name of Unicows.dll; you can control the MSLU error messages. See the GoLink help file for details.


Thanks and Tributes
Links

Copyright © Jeremy Gordon 1999/2013. All rights reserved.
Last update 22nd July 2013.