Module csx64::asm[][src]

Everything pertaining to the creation of CSX64 shared object files, object files, and executables.

Modules

binary_set

Utilities for auto-overlapping binary sets.

caseless
expr

Everything needed to handle expression trees.

Structs

AsmError
ObjectFile
Predefines

The symbols to introduce to the assembler prior to parsing any source.

Enums

AsmErrorKind

The kinds of errors that can occur during assembly. These are meant to be specific enough to have customized, detailed error messages.

BadAddress

The types of errors associated with failed address parsing, but for which we know the argument was intended to be an address.

HoleType
IllegalPatchReason
LinkError
Size

Functions

assemble

Attempts to assemble the asm source file into an ObjectFile. It is not required that asm be an actual file - it can just be in memory. asm_name is the effective name of the source file (the assembly program can access its own file name). It is recommended that asm_name be meaningful, as it is might be used by the asm program to construct error messages, but this is not required.

link

Attempts to link one or more (named) object files into an executable. The first object file, objs[0] is known as the “start file”. The start file’s text segment (starting at the beginning) is the first thing to execute upon running the resulting executable. For very basic programs this is fine, but using a higher-level framework might require setup prior to running the “main” logic. Typically, this is denoted by a generic symbol such as “start” (hence, start file). If entry_point is Some((from, to)), the linker will perform a renaming operation for identifiers in the start file (only). For example, a typical C-like program would use Some(("start", "main")) - any occurence of start would be replaced by main.

stdlib

Gets a copy of the C-style standard library object files for use in CSX64 asm programs. Notably, this includes the start file which is required by the linker to use entry points. The standard library includes tools such as malloc, free, printf, etc.