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


Data Structures | |
| struct | CallbackList |
| List of callback pointers. More... | |
Enumerations | |
| enum | CallbackType { REGISTER_CHANGE, MEMORY_CHANGE, ERROR_MESSAGE, READ_INPUT, OUTPUT_AVAILABLE, INTERPRETER_RESET, PROGRAM_START, PROGRAM_END, LINE_INTERPRETED } |
| Type of callback. More... | |
Functions | |
| void | pasm_initUi () |
| Initialize the user interface system. | |
| void | pasm_setCallbackData (void *data) |
| Set data that will be used as one of the arguments when a callback GUI function is called. | |
| ErrorCode | pasm_registerCallback (CallbackType type, void(*callBack)(void *)) |
| Register a callback function with the library. | |
| void | pasm_performCallback (CallbackType type) |
| Perform a simple callback function of the GUI. | |
| void | pasm_performMemoryCallback (uint32_t address, int32_t value) |
| Notify the GUI that a memory address has changed through a callback function of the GUI. | |
| void | pasm_performOutputCallback (int32_t value) |
| Notify the GUI that there is output available through a callback function of the GUI. | |
| void | pasm_performLineCallback (uint32_t address) |
| Notify the GUI that a certain instruction has been interpreted through a callback function of the GUI. | |
| void | pasm_error (ErrorCode errorCode) |
| Notify the GUI that an error has occured through a callback function of the GUI. | |
| void | pasm_readInput () |
| Request input from the GUI through a callback function of the GUI. | |
| void | pasm_setInput (int32_t input) |
| Set the input value of the assembler. | |
The user interface system is the glue between the PASM library and the actual graphical user interface frontend.
| enum CallbackType |
Type of callback.
These are the possible callbacks that a frontend can register.
| REGISTER_CHANGE | Register has changed. |
| MEMORY_CHANGE | Memory has changed. |
| ERROR_MESSAGE | Error has occured. |
| READ_INPUT | Input is required. |
| OUTPUT_AVAILABLE | Output is available. |
| INTERPRETER_RESET | Interpreter has been reset. |
| PROGRAM_START | Program has started in the pseudo-assembler. |
| PROGRAM_END | Program has ended in the pseudo-assembler. |
| LINE_INTERPRETED | A certain instruction has been interpreted. |
| void pasm_error | ( | ErrorCode | errorCode | ) |
Notify the GUI that an error has occured through a callback function of the GUI.
| errorCode | An error code (NO_ERROR if no error occured) |
| void pasm_performCallback | ( | CallbackType | type | ) |
Perform a simple callback function of the GUI.
You use this to actually notify the GUI frontend. To notify the GUI about a changed memory address or to notify the GUI that there is output available or that a certain instruction has been interpreted or that an error has occured, you will need to use other functions.
| type | Type of callback |
| void pasm_performLineCallback | ( | uint32_t | address | ) |
Notify the GUI that a certain instruction has been interpreted through a callback function of the GUI.
| address | Virtual address of the instruction that has been interpreted |
| void pasm_performMemoryCallback | ( | uint32_t | address, | |
| int32_t | value | |||
| ) |
Notify the GUI that a memory address has changed through a callback function of the GUI.
| address | Virtual address that has changed | |
| value | New value in the virtual address |
| void pasm_performOutputCallback | ( | int32_t | value | ) |
Notify the GUI that there is output available through a callback function of the GUI.
| value | Outputted value |
| void pasm_readInput | ( | ) |
Request input from the GUI through a callback function of the GUI.
The GUI has to call pasm_setInput() to actually set the input value.
| ErrorCode pasm_registerCallback | ( | CallbackType | type, | |
| void(*)(void *) | callBack | |||
| ) |
Register a callback function with the library.
| type | Type of callback | |
| callBack | The callback function |
| void pasm_setCallbackData | ( | void * | data | ) |
Set data that will be used as one of the arguments when a callback GUI function is called.
| data | The data that will be used as one of the arguments. This is useful in some special cases, for example when you are writing a C++ based frontend; you could write static callback functions and to interact with the main object/window you could provide that object as a parameter. |
| void pasm_setInput | ( | int32_t | input | ) |
Set the input value of the assembler.
Usually this function is called from the GUI when input is required.
| input | Inputted value |
1.5.6