Skip to content

Commit

Permalink
Added info
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng-alvin committed Nov 12, 2023
1 parent 9ef20f7 commit 5e89180
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
46 changes: 46 additions & 0 deletions include/info.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include "null.h"
#include <stdint.h>

/**
* @author cheng-alvin
* @since v0.0.1
*
* Code-generation mode for the assembler module code, can
* be used as a indicator for the assembler code generator
* to generate code.
*/

typedef enum {
REAL,
PROTECTED,
LONG,
} mode_t;

/**
* @author cheng-alvin
* @since v0.0.1
*
* The info_t struct is used to store the information of the
* assembler module, including the program mode and the buffer
* that stores the generated assembler code.
*
* @see `mode_t` for more information about the program mode
* enum.
*
* TODO Revise docs for struct?
*/

typedef struct {
mode_t program_mode;
uint8_t *buffer;
} info_t;

/**
* @author cheng-alvin
* @since v0.0.1
*
* The variable declaration used to store the information of
* the assembler module.
*/

extern info_t __jas_info__;
6 changes: 6 additions & 0 deletions src/info.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "info.h"

info_t __jas_info__ = {
.program_mode = REAL,
.buffer = NULL,
};

0 comments on commit 5e89180

Please sign in to comment.