Project fasm-ant is a custom Ant task for building flat assembler
assembly files. It is designed to work like the built-in javac task, but with parameters
tailored for the flat assembler. With fasm-ant you can build a tree of source files, leaving
alone those that have not changed since the last build. Being an Ant project, fasm-ant is of
course built with Ant Maven itself.
Minimum: Java 8 and Ant 1.7.1.
Recommended: Java 11 and Ant 1.10.9.
Tested on Windows 10 and Ubuntu Linux.
Download the latest zip file from the GitHub releases page, unzip it, and copy the jar file to your Ant lib directory. That's it!
To use the fasm-ant task in your build file, you first need to define it with taskdef. Put something like this in your build file:
<taskdef name="fasm" classname="se.dykstrom.ant.fasm.Fasm"/>
Now you can use fasm-ant as any other Ant task:
<fasm srcdir="${src.dir}" destdir="${bin.dir}" includes="**/*.asm"/>
As said above, fasm-ant is designed to work like the built-in javac task. This means that many of the parameters that can be used with javac can also be used with fasm-ant. The table below lists all available fasm-ant parameters.
Attribute | Description | Required |
---|---|---|
compiler | the compiler command used to run the flat assembler (default is "fasm") | No |
destdir | the destination directory (default is same as source directory) | No |
errorproperty | the property to set (to the value "true") if compilation fails | No |
excludes | comma- or space-separated list of files (may be specified using wildcard patterns) that must be excluded; no files (except default excludes) are excluded when omitted | No |
failonerror | indicates whether compilation errors will fail the build (default is true) | No |
includes | comma- or space-separated list of files (may be specified using wildcard patterns) that must be included; all .asm files are included when omitted | No |
memory | the limit in kilobytes for the memory available to the assembler | No |
passes | the maximum allowed number of passes | No |
srcdir | the source directory | Yes |
updatedproperty | the property to set (to the value "true") if compilation has taken place and has been successful | No |
This task forms an implicit FileSet and supports most attributes of <fileset> (dir becomes srcdir) as well as the nested <include>, <exclude> and <patternset> elements.
You can specify additional command line arguments for the compiler with nested <compilerarg> elements. The <compilerarg> element has exactly one attribute.
Attribute | Description | Required |
---|---|---|
value | a single command-line argument; can contain space characters | Yes |
The following is an example of a very simple build file that uses fasm-ant.
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="example" default="build" basedir=".">
<!-- Properties -->
<property name="src.dir" value="src"/>
<property name="bin.dir" value="bin"/>
<!-- Targets -->
<target name="declare">
<taskdef name="fasm" classname="se.dykstrom.ant.fasm.Fasm"/>
</target>
<target name="build" depends="declare">
<fasm srcdir="${src.dir}" destdir="${bin.dir}" includes="**/*.asm">
<compilerarg value="-d name=value"/>
</fasm>
</target>
</project>
Note that this document only describes how to use fasm-ant. For information on how to use the flat assembler itself, please visit flatassembler.net.