Easy Code - Visual Assembler

Visual assembly Integrated Development Environment

Available in 32-bit / 64-bit version

Version 2.1 (revision 2)


Versions 2.00.0.0012 and later also include a 64-bit version of Easy Code. If you are running a 64-bit Windows system, you will be able to run the "EasyCode64.exe" file (located at the "\EasyCode\Bin" folder). Both, 32-bit ("EasyCode.exe") and 64-bit ("EasyCode64.exe") versions use the same files, so you can work with any of them without having to make a single change.

If you have any doubt while reading this help file, and for a better understanding, please see the various examples included with this IDE in the "\EasyCode\Examples" folder, specially designed for didactic purposes.

INTRODUCTION

Easy Code 2 is the evolution of version 1 (fully compatible) specially designed for building 64-bit Windows applications and supporting ASMC, FASM, GOASM, JWASM, UASM-HJWASM, MASM and POASM assemblers, both 32-bit/64-bit versions.

Easy Code 2 is an application that requires Windows XP and later systems to work in, so they do not run on any Windows version previous to XP. Windows XP, VISTA, 7 and 8 were the foundation of this IDE, but it also operates fine on any operating system released afterwards (Windows 8.1, 10).

IMPORTANT: Easy Code 2 ALWAYS works in Unicode mode for supporting all languages. However, since some assemblers only accept ANSI text, the text of all windows and/or modules might be sent to the compiler converted to ANSI or not, depending on the Text encoding option in the Settings section. This format allows to make Unicode applications in a quick and easy way (please see the ANSI / Unicode applications topic). In both modes, ANSI or Unicode, the code editor and all names and files related to projects (names and files for projects, resources, windows and controls) are always saved as UNICODE text. For that reason, projects made with version 1 need to be converted to version 2 format and, once converted, they cannot be loaded with version 1. That is why EC asks for confirmation before the conversion.

SPECIAL THANKS

Héctor A. Medina Without his excellent and big help, Easy Code 2 would not have been possible.
Brandon B. Stewart For testing/evaluating Easy Code 2 in-depth, reporting some bugs, and making some corrections in the English language file.
Steve Hutchinson For testing/evaluating Easy Code 2.
Wayne Radburn For testing/evaluating Easy Code 2 and making some corrections in the English help file.
Jason Jiang For translating the language file to Chinese (both, traditional and simplified).
C0dr4cK For translating the language file to Turkish.


SOME IMPORTANT CHANGES

There are some important changes in the 64-bit Masm compiler (ml64.exe) that must be taken into account:

In order to solve the second point, my good friend Héctor A. Medina has developed the equivalent ECInvoke directive for 64-bit Masm projects. ECInvoke is a little piece of art, it is EC built-in, and works perfectly well. No register is overwrriten and it takes care for the Rsp register to be always 16-byte aligned, avoiding unpleasant crashes. ECInvoke is also available for 64-bit AsmC, JWasm, UAsm and PoAsm assemblers, but it is better to keep using their own Invoke when possible. For more information, please see Using ECInvoke.

The third point does not allow you to make a near call inside a procedure as you could make in 32-bit programming (Call / Retn). To solve this, once again Héctor A. Medina has developed two Easy Code built-in pseudo-opcodes, CallR and RetR, which work like Call and Retn respectively. For more information, please see the CallR / RetR topic.

GoAsm Unicode projects behave slightly different than they did in Easy Code 1, that is, they work like Masm Unicode projects. If they have the This project will run in Unicode mode (Windows NT or later) option checked, in the Project Properties, they will dynamically switch to ANSI when running on Windows 95/98/ME. For more information, please see the ANSI / Unicode applications topic.

Easy Code 1 called the
FindChar and FindCharRev methods with a CHAR (Byte) for ANSI projects and WCHAR (Word) for Unicode projects as the second parameter. Now they both must be called with a DWord parameter for 32-bit projects and a QWord parameter for 64-bit projects. You should take that into account, specially when converting projects from Easy Code 1, because passing a wrong type as the second parameter will make the method to have a wrong return address and the calling application will probably chrash.

The Text and TextAddr macros always returned ANSI text in Easy Code 1. Now, like TextStr, they return ANSI or Unicode text depending on whether the This project will run in Unicode mode option, in the Project Properties, is checked or not. You should use these two macros as they work now for new projects created with Easy Code 2, but if you imported an Easy Code 1 project and that change can seriously affect its behaviour, just check the Enable compatibility with Easy Code 1.x macros option, in the Project Properties, and the Text and TextAddr macros will behave as they did in Easy Code 1. If the imported project was not Unicode, or it did not use any of these two macros, this option has no effect and it is better to leave it unchecked.

REMARKS:The Enable compatibility with Easy Code 1.x macros option is only available for 32-bit MASM projects in order to make Text and TextAddr to work like they did in Easy Code 1. This option only makes sense for 32-bit MASM Unicode projects imported from versions previous to Easy Code 2.0. New projects created with Easy Code 2 should ignore this option and leave it unchecked.


ABOUT WINDOWS 8.1 / WINDOWS 10

When you copy files or install programs to most folders in the system drive C: under these two versions of Windows, when you restart your machine Windows will change the permissions on these folders to where the user cannot normally write to them. For instance, after you unzip the EC program if you copy the EasyCode folder to C:\EasyCode and then restart your machine, Windows 8.1/10 changes the write permissions on this folder as well as all subfolders and files within. This is just part of the enhanced security measures for these two operating systems, however, poses an obstacle for programs writing data to configuration files and other types of document files. According to this, it is highly recommended that you have at least two drives (or one drive with two partitions) and use the second drive (D:, F:, G:, or any other letter you assigned to it) to copy the EasyCode folder. On the other hand, the folder where you save your projects SHOULD NOT BE in drive C: either.

However, if you still want to use drive C:, or you do not have any other drive, you can set the “EasyCode.exe” properties to “Run As Administrator”, or move the "EasyCode" folder to “C:\Users\<YourUserName>\AppData\EasyCode”, where all applications have write permissions, and modify the configuration files according to the new path.

On the other hand, setting the 128-bit encryption in your group policy may cause some 64-bit executables not to be able to run and Easy Code to be closed. If you are having problems running the 64-bit executables related to building projects (compiler, linker and resource and library compilers for all used assemblers), set the properties for all the affected executables to run as administrator. Please read the FAQSAndTips.txt file in the EasyCode folder.


SUPPORTED ASSEMBLERS

This section is a little guide for you to know the tools needed for each supported assembler. Of course you do not need to have all of them if you do not want to, but at least you should have the tools for the assembler(s) you want to to work with. All paths shown below are referred to the root of drive C:\ for simplicity, but you should use any other drive or path, even a pendrive (I have all those tools in the root of drive G:\). As said before, using the system drive C: IS NOT recommended, specially on Window 8.1 and Windows 10, because of the permissions restriction.


ASMC

C:\ASMC         (download the AsmC package)


FASM

C:\FASM         (download the Flat assembler for Windows)


GOASM

C:\GOASM      (download the ECGo.zip package)


JWASM

C:\JWASM      (download the JWasm.zip package)


UASM    (JWASM folder is recommended)

C:\JWASM      (32-bit/64-bit versions available here)


MASM32

C:\MASM32    (download the MASM32 SDK version 10 or later)


MASM64

C:\MASM64    (available with Microsoft Visual Studio)


POASM

C:\POASM      (download PellesC 32-bit)


POASM64

C:\POASM64   (download PellesC 64-bit)


IMPORTANT REMARKS

After unzipping the asmc package the asmc-master folder will have been created. Please rename it to AsmC and take into account that the bin subfolder is the only one needed for Easy Code, so you can delete all other subfolders if you like.

After unzipping the ECGo.zip package the GoAsm folder will have been created. Please immediately download the GoAsm Headers and place them in the Include subfolder (inside the GoAsm folder created by unzipping the ECGo.zip package). Otherwise, Easy Code will not be able to build GoAsm projects.

After downloading and installing the Microsoft Visual Studio, create a folder named MASM64 and copy all necessary files related to the 64-bit MASM assembler (ml64.exe, link.exe, lib.exe, rc.exe and their dependencies).

After downloading and installing PellesC 32-bit in a 32-bit system, create a new folder named POASM and copy all the content from the C:\Program Files\PellesC\Bin folder to it.

After downloading and installing PellesC 64-bit in a 64-bit system, create a new folder named POASM64 and copy all the content from the C:\Program Files\PellesC\Bin folder to it.

After downloading UASM (both, 32-bit/64-bit versions), I would recommend to place them in the JWASM folder since there are other needed resources in there, like jwlink.exe, but of course you can create a specific folder for UASM if you like. On the other hand, Easy Code 2.01.0.0002 and later versions also include specific configuration files for UASM, both 32-bit and 64-bit, so if you place uasm32.exe and uasm64.exe in the JWASM folder, your UASM configuration files can be a copy of the JWASM ones, just by replacing jwasm.exe with uasm32.exe (in UAsm.cfg) or uasm64.exe (in UAsm64.cfg).

For 32-bit applications, GOASM uses the Go tools and the GoAsm Headers, all of them in the GoAsm folder created with ECGo.zip. ASMC, JWASM, UASM, MASM and POASM use the include and library files from MASM32 (C:\MASM32) and FASM uses their own include and equate files (C:\FASM\INCLUDE) plus some include files from the \EasyCode\Include\Fasm folder, specially programmed for FASM. Besides, FASM needs the MASM32 SDK to be installed in order to be able to build 32-bit visual projects (the MASM32 SDK ".lib" files are required).

For 64-bit applications, FASM and GOASM use the same files that they use for 32-bit (with some differences for FASM), while ASMC, JWASM, UASM, MASM and POASM use the include and library files from the \EasyCode\Include\Masm\x64 and \EasyCode\Lib\x64 folders, specially programmed for 64-bit applications.

Easy Code is distributed with some configuration files, one for each supported assembler. Those files (located at the EasyCode\Config folder) have the extension "ori" and are a reference for the corresponding assembler to be configured properly. However, each assembler needs a configuration file with a "cfg" extension in order to work properly, but when you download Easy Code 2 there is no ".cfg" file. All those ".cfg" files will be created when Easy Code starts for the first time and they will be located at the EasyCode\Config folder. For more information, please see the Settings section.

If your current version of Easy Code 2 is previous to 2.00.0.0007 (December 2, 2015), please follow the instructions of the Fasm.txt file, in the EasyCode folder.

FASM does not have its own linker and visual projects need the Easy Code visual library to be linked. So, for Easy Code to be able to build visual projects with FASM, the Microsoft linker, link.exe, is used instead (ONLY for FASM visual projects). If you want to build visual projects with FASM (all examples are visual projects), you have to download and install the MASM32 SDK (for 32-bit visual projects) and MASM64 (for 64-bit visual projects).

According to the documentation, jwlink.exe (JWasm) and linkw.exe (AsmC) seem not to be able to build WINNT drivers (*.sys), so the Microsoft linker, link.exe, is used instead (ONLY for JWasm / UASM / AsmC driver projects).

The wrc.exe resource compiler coming with JWasm may not work fine for some projects (i.e. 64-bit drivers linked with link.exe). If so, try to add the -zm switch to its command line, or just use the Microsoft rc.exe resource compiler.

The dzrc.exe and iddc.exe resource compilers coming with AsmC seem not to be able to build the resource file .res needed for Easy Code, so the Microsoft rc.exe compiler is used instead. This resource compiler is the one specified in the AsmC default configuration files (AsmC.ori and AsmC64.ori).

WARNING: The MASM32 SDK currently available (masm32v11r) has some errors in the kernel32 and kernel32p files which make the linker (link.exe) to fail. To solve this problem, please download this file and follow the instructions in the Readme.txt file.


SETTINGS

This is the most important part of the initial set up in order to avoid problems and make Easy Code to work fine for all supported assemblers. Setting the right paths and command line options for each assembler, linker and resource and library compilers, takes some time and requires to be careful.

Now please run the EasyCode.exe file (located in the EasyCode\Bin folder), or use the icon on the desktop if you chose to create one during the setup process. Then go to the Tools-->Settings menu and click this link in order to start the Easy Code configuration.


64-BIT PROGRAMMING

Easy Code is distributed with some include and library files (located at \EasyCode\Include\Masm\x64 and \EasyCode\Lib\x64 folders, respectively) specially made for programming 64-bit ASMC, JWASM, UASM, MASM and POASM applications (FASM and GOASM use other files). Those files are enough for building most applications, however some more especific applications might need other include and library files. If so, I will appreciate your contribution. Please write the necessary include file, send it to me and I will generate the corresponding library file so that they both can be distributed in next versions of Easy Code. That way we can all improve the Easy Code capabilities. Thank you very much.

Programming 64-bit applications is not an easy task and requires to know how 64-bit Windows operating systems work. In order to have a very basic idea, please see the Programming 64-bit applications topic.



WRITING CODE WITH EASY CODE

For Easy Code to be able to manage procedures, constants and variables properly, and so avoidng erros when building projects, please take into account the considerations explained in this link.


STARTING EASY CODE

If you run Easy Code with no project name in its command line, it will prompt you with a dialog box of choices to creating a new project. A parameter command line without an extension of ".ecp", ".ecw", ".ecr" or ".asm" is also considered void and you will also be prompted to create a new project. Here is an example of the dialog box for new projects:

Eight options are available for the type of the code project:

Visual executable file (exe)
Classic executable file (exe)
Classic Dynamic Link Library (dll)
Classic Static Library (lib)
Classic console application (exe)
Classic COFF object file (obj)
Classic NT driver (sys)
Classic NT service (exe)

Easy Code has two main modes, "Visual Project" mode and "Classic Project" mode. The classic project mode is the traditional build all levels, where the coder is expected to construct the whole project and the resulting code will be manually configured to work when compiled and linked as in most other IDE's. The visual project mode is where Easy Code becomes in a realm of its own. Visual mode allows you to create windows resources on the fly, then code that resource as a function and later tie the resources together to form a quick and easy powerful application.

The Classic COFF object file project type is useful for generating an object file, from one or more modules, which can then be linked to other projects. This option avoids having to build static libraries (.lib) if you do not like to, and it just generates a .obj file (in COFF format) even if there are several modules in the project. The generated object file will have the name of the project plus the .obj extension.

On creating a new project, you must specify what coding mode you require. "Dynamic Link Libraries", "Static Libraries", "console applications", "object files", "drivers" and "services" are naturally considered classic project types. When you choose an "Executable" type project, you have the option of the project either in traditional IDE coding mode (classic) or Easy Code's visual mode.

If you wish to use Windows Common controls and/or the RichEdit control, mark the corresponding check box and their .inc and .lib files will be added to the project by Easy Code (only for Common controls). On the other hand, checking/unchecking those boxes will cause the corresponding buttons to be shown/hidden in the tool box.

The Manifest check box (only available for Visual Executable file, Classic Executable file and Classic dynamic link library projects) specifies whether a manifest file has to be created and included so that the new common controls can be used in Windows XP and later systems (see Enabling XP themes). If this option is checked when creating the project, the name of the manifest file will be shown inside the "Manifest" node of the Project Explorer, so that it can be edited in the Easy Code environment. Please read the Including a Manifest in the project topic carefully.

The Easy Code macros check box, in the Project Properties, specifies whether the macros coming with Easy Code (in Macros subfolder) have to be included in the project or not.


ADDING FILES TO PROJECTS

It is recommended not to use the Include, #Include, IncludeLib or #DynamicLinkFile directives in the source code for adding files to projects. Instead, all files needed for a project should be added using the corresponding options in the Project menu. Other files, include (*.inc), header (*.h) or library (*.lib), not being any of the default files used by the assembler or linker, should be copied to the project folder and then added by using the Project-->Add files menu option.


SUB-TOPICS

Configuring Easy Code
Writing code properly
Building NT services
Building NT drivers
Specific settings files (INI files)

Visual Projects (Easy Code Power Mode)
Classic Projects (Classical IDE Style)
Project Properties

Configuring Option win64:n

Handling exceptions (Only Visual Project Type)

Configuring other help files

Accessing to the Windows 'WinMain' function (Only Visual Project Type)

Thread object (Only Visual Project Type)

Adding tooltips to visual projects

Multilanguage support
Language files (how to make them)

ANSI / Unicode applications (Only Visual Project Type)

Including a Manifest in the project (Only Exe Project Type)

Enabling XP themes (All Project Type)

OwnerDraw property (Only Visual Project Type)

Conditional assembly (All Project Type)

Processing idle time (Only Visual Project Type)

Control objects
Object Properties (Only Visual Project Type)
Getting and Setting properties (Only Visual Project Type)
Customizing objects (Only Visual Project Type)

Resources - Resource Editor (All Project Type)
Importing resource files (All Project Type)
Application icon (All Project Type)

Easy Code Editor
Menu Editor (All Project Type)

App Object (Only Visual Project Type)

Easy Code Macros (All Project Type)

Easy Code Methods (Only Visual Project Type)
Easy Code Constants (Only Visual Project Type)


Easy Code is absolutely free. Enjoy it and make good your skills and assemble great applications. Please report any bugs and issues you find with this IDE. When reporting IDE problems try to explain the way they appeared or happened so that repair can be done at the best possible delay. I will be glad to reply personally to bug reports using email.


TECHNICAL SUPPORT

For any request, technical support or bug report, please contact one of the email addresses specified below. Thank you.

assembly@easycode.cat
rsala@easycode.cat

http://www.easycode.cat

Copyright © 2004-2017 Ramon Sala
Contributor: Héctor A. Medina

The Easy Code 32-bit application has been developed using the MASM32 SDK v11 (Microsoft 32-bit Macro Assembler)

The Easy Code 64-bit application was developed using the JWASM compiler
Versions 2.01.0.0001 and later have been developed using the UASM64 compiler.