|
fasmcpp
0.1
|
Contains assembly code and its bytecode and predefinitions. More...
#include <fasmcpp.h>
Public Member Functions | |
| Assembly () | |
| Constructs an empty, but valid instance. | |
| Assembly (const char *code) | |
| Constructs an instance and sets the code to be built. | |
| Assembly (const Assembly &)=delete | |
| Assembly (Assembly &&) | |
| Assembly & | operator= (const Assembly &)=delete |
| Assembly & | operator= (Assembly &&) |
| void | setAssembler (Assembler *assembler) |
| Assigns an Assembler. | |
| Assembler * | getAssembler () const |
| Returns the assigned Assembler. | |
| bool | assemble () |
| Builds the code using Flat Assembler. More... | |
| int64_t | run (bool preserveRegisters=true) const |
| const char * | getErrors () const |
| Returns a string containing any errors found during the build process. | |
| const char * | getMessages () const |
Returns user messages displayed by using the display directive. | |
| void | addPredefinition (const char *name, const char *value) |
| Adds a predefinition. More... | |
| void | addPredefinition (const char *name, const void *value) |
| Adds a pointer predefinition. More... | |
| void | clearPredefinitions () |
| Removes all previously added predefinitions. | |
| const char * | getOutput () |
| Returns a pointer to the output of the assembler. | |
| size_t | getOutputSize () |
| Returns the size of the output of the assembler. | |
Contains assembly code and its bytecode and predefinitions.
| void fasmcpp::Assembly::addPredefinition | ( | const char * | name, |
| const char * | value | ||
| ) |
Adds a predefinition.
Adding a predefinition through this method is equivalent to adding name=value to the assembly code
| name | Name of the definition (maximum length is 255 characters) |
| value | Value of the definition |
| std::invalid_argument | if name is too long |
| void fasmcpp::Assembly::addPredefinition | ( | const char * | name, |
| const void * | value | ||
| ) |
Adds a pointer predefinition.
Prefer this for defining pointers. Equivalent to addPredefinition(name, std::to_string(reinterpret_cast<uintptr_t>(value)).c_str()).
| name | Name of the definition (maximum length is 255 characters) |
| value | Value of the definition |
| std::invalid_argument | if name is too long |
| bool fasmcpp::Assembly::assemble | ( | ) |
Builds the code using Flat Assembler.
| std::invalid_argument | if there is no valid Assembler bound. See setAssembler(). |
| std::runtime_error | on x64 platforms if out of predefinitions memory. |
true if successful and false if failed. | int64_t fasmcpp::Assembly::run | ( | bool | preserveRegisters = true | ) | const |
Runs the code previously built by assemble()
| preserveRegisters | If true, fasmcpp backs up all non-volatile registers |
| std::runtime_error | if an error occurred while assembling. |
| std::logic_error | if assemble() has not been called. |
1.8.13