#include "errorcodes.h"
#include "helper.h"
#include "opcodes.h"
#include <stdint.h>


Data Structures | |
| struct | Register |
| Register of the pseudo-assembler. More... | |
| struct | stackElement |
| An element in the call stack. More... | |
| struct | CallStack |
| The call stack. More... | |
Typedefs | |
| typedef struct stackElement | StackElement |
| An element in the call stack. | |
Enumerations | |
| enum | JumpMode { JUMP_TO_ADDRESS, JUMP_TO_LINE } |
| The jump mode to use. More... | |
Functions | |
| void | pasm_init () |
| Initialize the PASM library. | |
| void | pasm_free () |
| Free all allocated memory that is still dynamically allocated by the PASM library. | |
| void | pasm_reset () |
| Reset the PASM library. | |
| void | pasm_setJumpMode (JumpMode mode) |
| Set the jump mode. | |
| Register | pasm_getRegister () |
| Get the state of the register. | |
| ErrorCode | pasm_interpretInstruction (Instruction instruction) |
| Interpret a pseudo-assembler instruction. | |
| ErrorCode | pasm_compileProgram (const char *program, uint32_t size) |
| Compile a pseudo-assembler program. | |
| void | pasm_step () |
| Interpret the next instruction. | |
| void | pasm_runProgram () |
| Run the whole pseudo-assembler program at once. | |
| void | pasm_stopProgram () |
| Stop the current pseudo-assembler program. | |
The interpreter is the core of the library. It is mainly used to initialize the library and to start, run and stop pseudo-assembler programs.
| typedef struct stackElement StackElement |
An element in the call stack.
| enum JumpMode |
| ErrorCode pasm_compileProgram | ( | const char * | program, | |
| uint32_t | size | |||
| ) |
Compile a pseudo-assembler program.
| program | The program to compile. Each instruction needs to be on a seperate line. Newlines must be used to seperate the lines. | |
| size | The number of instructions (or lines) of the pseudo-assembler program. |
| void pasm_free | ( | ) |
Free all allocated memory that is still dynamically allocated by the PASM library.
| Register pasm_getRegister | ( | ) |
Get the state of the register.
| void pasm_init | ( | ) |
Initialize the PASM library.
| ErrorCode pasm_interpretInstruction | ( | Instruction | instruction | ) |
Interpret a pseudo-assembler instruction.
| instruction | Instruction to interpret |
| void pasm_reset | ( | ) |
Reset the PASM library.
All resources will be freed and the GUI will be sent the INTERPRETER_RESET signal.
| void pasm_runProgram | ( | ) |
Run the whole pseudo-assembler program at once.
If you want to step through the program step by step, consider using the pasm_step() function.
| void pasm_setJumpMode | ( | JumpMode | mode | ) |
Set the jump mode.
| mode | Jump mode |
| void pasm_step | ( | ) |
Interpret the next instruction.
If you want to run the whole pseudo-assembler program at once, consider using the pasm_runProgram() function.
1.5.6