TUTORIALS and SAMPLES for GoAsm and the "Go" Tools

Started by jorgon, May 12, 2007, 04:22:53 PM

Previous topic - Next topic

jorgon


"GO" TUTORIALS and SAMPLE CODE

This list is an attempt to keep track of the growing number and extent of tutorials and sample code for the "Go" tools, available either as downloadable files, or as forum threads.
If I have missed out any significant work or if you would like your work to be added to this list, please let me know.


These tutorials are from:
users and supporters of the "Go" tools
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 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 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.



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 this link 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:
[li]Bare Bones skeleton - a simple window with a menu and help/about dialog box.[/li]
[li]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.[/li]
[li]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.[/li]
[li]See also Wayne's xlatHinc which converts a Windows "h" file to an "inc" file for use with the "Go" tools.[/li]




Donkey's stable
Edgar Hansen has written a lot of sample code for GoAsm for example:-

[li]IContextMenu, an implementation of the IContextMenu shell extension (a COM server application).[/li]
[li]Windows Explorer, which makes extensive use of the GUI and COM.[/li]
[li]Update Manager, an automated software updates solution.[/li]
[li]Macros to use VKim's debug with RadASM.[/li]
[li]A large collection of code libraries which work with GoAsm, all with source code.[/li]
[li]Font menu (custom drawn menu demo).[/li]
[li]Listview control with clipboard functionality and sorting.[/li]
[li]Animated icons in a toolbar control.[/li]
[li]How to use a toolbar with menus example.[/li]
[li]How to use a vertical toolbar menu.[/li]
[li]How to extract version information from an application.[/li]
[li]How to draw ownerdraw buttons.[/li]
[li]How to draw ownerdraw combo box.[/li]
[li]Dialog with a custom caption.[/li]
[li]How to overlay icons over other icons.[/li]
[li]How to put hyperlinks in a dialog or a window.[/li]
[li]Graceful exit with exception handling.[/li]
[li]How to implement a drag listbox.[/li]
[li]How to add colours and icons to a status bar.[/li]
[li]How to store an icon file directly in your data or const section and load the icons it contains by index.[/li]
[li]How to calculate the speed your CPU is running at.[/li]
[li]How to extract information from a desktop listview, and check for a NT compatible version of Windows using the FS override.[/li]




Vortex has kindly provided this sample code:-

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




Bracx's web page
Brian Algeri has published his GoAsm projects which include:-

[li]Window, menu and about dialog box.[/li]
[li]pdcurses console test. [/li]
[li]Object system test.[/li]
[li]How to make DOS programs (not Windows programs) using GoAsm and GoLink.[/li]
[li]Using GoAsm to make various flat memory DOS programs using interrupts to interface with the outside world.[/li]




AsmGges Assembleur Compilateur 32 bits page
Gges has a page in French with full source code for various projects:-

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




Basic windows program with GoAsm in Portuguese



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



Bill Aitken's excellent tutorials for using GoAsm and the Easy Code Visual IDE (by Ramon Sala)



Here is some of the sample code in the GoAsm Assembler and Tools forum (in the MASM forum)
[li]Using the WebBrowser control (COM) by Jeremy Gordon[/li]
[li]Using GDI+ (GDI plus) by Jeremy Gordon[/li]
[li]Putting the system in standby mode by Donkey[/li]
[li]Obtaining system privileges by various[/li]
[li]Basic window procedure by various[/li]
[li]Using VerifyVersionInfo by Donkey[/li]
[li]Understanding the SDK and converting API specifications to GoAsm by Jeremy Gordon[/li]
[li]CreateFile, ReadFile, and WriteFile by Brian Warburton[/li]
[li]Using Most Recently Used (MRU) lists by Donkey[/li]
[li]Translation into GoAsm of the demo for Scintilla, a custom control lexer that can be used to create IDEs by Donkey[/li]
[li]Translation into GoAsm of how to enumerate audio codecs from MSDN by Donkey[/li]
[li]Sample code for the Windows picker control by Donkey[/li]
[li]Message box using a customised button by Vortex[/li]
[li]Registering file extensions in Windows by Donkey[/li]
[li]Pseudo-random number generator (Mersenne Twister) by Donkey[/li]
[li]Example of using ODBC in a program used to examine Jet databases by Donkey[/li]
[li]Loading a file and reading it line by line by various[/li]





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

[li]Converting a string to a number in 64-bits by Gerard[/li]
[li]Using the COM interface IActiveDesktop by Donkey[/li]
[li]Creating a black and white image from a 32-bit DIB section by Donkey[/li]
[li]Image edge detection routine by Donkey[/li]
[li]Writing words directly to the desktop by Donkey[/li]
[li]Using CreateIconFromResource by Donkey[/li]
[li]Creating a combobox within a listview by Donkey[/li]
[li]Using PrintDlgEx by Donkey[/li]




Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

doesnmtsmaem

thanks for all documents you post
all is very good

OzzY

Thanks for the resources and for the great assembler and linker!
I'll have great time learning all these and using GoASM!

Thank you

master_ref

:U thank you so much..    :cheekygreen:  i do know sky has another sky  :cheekygreen:

hide2may

to me, as a newbie asm learner, there is a big gap between the 'hello world' program and the rest of others.
it is hard to follow for the learning curve rises so sharply.
a more systematic tutorial is appreciated.
just my two cents^^

Gian

Hi,
I have an i7 intel and use a lot the instruction popcnt.
When in the x86 mode it works perfect, even when using it by encoding (F3 0F B8 C0 for popcnt al,eax)
However the a.m. instruction does not work properly when eax is replaced with rax.
Also I do not understand what the expression is rex.w, I found this by googling on the internet for popcnt x64.
I would be glad to receive a solution or at least a hint.

Rockoon

The links in the post should be updated for the new domain name.
When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

Shooter

Quote from: Rockoon on July 01, 2010, 04:54:23 PM
The links in the post should be updated for the new domain name.

IS there a new domain name? Where can I find it?
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

Dogim

Quote from: Shooter on December 01, 2010, 03:16:37 PM
Quote from: Rockoon on July 01, 2010, 04:54:23 PM
The links in the post should be updated for the new domain name.

IS there a new domain name? Where can I find it?
http://www.godevtool.com I think its temporally down.

frktons

Quote from: Dogim on December 01, 2010, 07:00:32 PM
Quote from: Shooter on December 01, 2010, 03:16:37 PM
Quote from: Rockoon on July 01, 2010, 04:54:23 PM
The links in the post should be updated for the new domain name.

IS there a new domain name? Where can I find it?
http://www.godevtool.com I think its temporally down.

Now it seems alive again  :bg
Mind is like a parachute. You know what to do in order to use it :-)

jorgon

At last I've updated the links, but the following are still broken:-

Bracx's web page
AsmGges web page
Numaboa

does anyone know where these have gone?
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

TmX

Quote from: jorgon on January 23, 2011, 10:38:42 PM
At last I've updated the links, but the following are still broken:-

Bracx's web page
AsmGges web page
Numaboa

does anyone know where these have gone?

AsmGges link is still working properly

awooley

I am hoping to convert some of my old x86 assembly programs into 64 bit versions.  I am using GoAsm assembler and linker and hoping to find some more demo scripts.  This looks like the place for me. Thanks, awooley