ASMotor
ASMotor is a portable and generic assembler engine and development system written in ANSI C99 and licensed under the GNU Public License v3. The package consists of the assembler, the librarian and the linker. It can be used as either a cross or native development system.
The assembler syntax is based on the Motorola style macro language.
Currently supported CPUs are the 680x0 family, 6502, MIPS32, Z80, Game Boy, DCPU-16, CHIP-8/SCHIP and the RC811 CPU core.
ASMotor is the spiritual successor to RGBDS, which was a fairly popular development package for the Game Boy. ASMotor is written by the original RGBDS author.
Installing
Building from source
Windows
A script (install.sh
) is included that will install the compiled binaries into the %USERPROFILE%\bin directory. This path should be added to your $PATH for easier use. This script will also accept the destination root (for instance %USERPROFILE\\bin
). The installation directory should be added to your path variable.
To build from source, cmake must be installed. Installing cmake with Chocolatey using command choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
is suggested. A C compiler that cmake can find must also be installed. Visual Studio Community edition is suggested.
Then, using PowerShell, run the following commands:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
install.ps1
Linux and macOS
A script (install.sh
) is included that will install the compiled binaries into the $HOME/bin directory. This path should be added to your $PATH for easier use. This script will also accept the destination root (for instance /usr/local
).
For even easier installation, provided you have the necessary prerequisites, git
and cmake
, installed, the latest version of ASMotor can be installed using
curl https://raw.githubusercontent.com/asmotor/asmotor/master/bootstrap.sh | sh
If you want to install it globally, you can supply the installation prefix as a parameter:
curl https://raw.githubusercontent.com/asmotor/asmotor/master/bootstrap.sh | sh -s /usr/local
To install git
and cmake
, it is suggested you use your distribution's package manager. For macOS, use brew or MacPorts.
Editing code
A VSCode extension that enables syntax highlighting is also available at https://marketplace.visualstudio.com/items?itemName=ASMotor.asmotor-syntax
Further reading
Dive into the documentation to learn more about:
- Introduction, goals and background
- Invoking the assembler and basic syntax
- Symbols and labels
- Control structures like
INCLUDE
,MACRO
's and conditional assembling. - Expressions and how they're built
- Printing diagnostic messages, warnings and errors
- Organising code into sections. How to define data.
- The linker