Absynt is an assembler written in scala. The name stands for something like assembler b syntax, the reader is free to fill in what the b stands for.
It currently includes an x86 assembler, with support for 8086, i386 and x64 instructions, and an ARM assembler with support for A32 instructions. Neither implements the full set of instructions.
It can output in different formats:
- Raw: a file that contains a single section, this can be used as a DOS COM file or as a legacy bootsector
- Elf: An executable containing multiple sections. This can be run from an Elf enabled OS (eg. Linux, BSD)
- InProc: Allows you to put the compiled code in-process. This allows you to call the containing functions from the JVM. This is inspired by the research in guillaumebort/scasm
The project includes the following example projects:
- Raspberry PI boot sector: A bootsector for the raspberry PI based on the example on osdev.org which prints "hello world!" to the serial console.
- An X86 boot sector: This project produces a boot sector that shows the dutch flag (red, white and blue) in mode 0x13 (VGA 320x200x256 colors). Because (MS-,PC-,Free)DOS allows direct interaction with hardware, and a com file has the same memory layout as a boot sector, this example can also be used as an executable that can be run from DOS (or dosbox).
- An 32bit X86 hello world elf executable: This project produces a 32bit x86 elf executable that uses linux int 0x80 to print hello world on stdout.
- An 64bit X86 hello world elf executable: This project produces a 64bit x86 elf executable that uses linux syscall to print hello world on stdout.
- An 64bit X86 in process add function: This project demonstrates a simple function that calculates the sum of two numbers, which is called from a scala application.