Skip to content

Commit

Permalink
Added internal docs for i_common (#24)
Browse files Browse the repository at this point in the history
This pull has added information for the `i_commom()` internal
encoder function for writing immidiate function. Since this function
is only used in the `enocder.c` (and is static) making the funtionality
very un-clear for callers, (also without a corrisponding header)
  • Loading branch information
cheng-alvin authored Jan 1, 2025
1 parent 1284d87 commit 5914670
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libjas/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ DEFINE_ENCODER(m) {
write_offset(mod, buf, op_arr, 0);
}

/**
* @note - Internal documentation (31th Dec 2024 - Last day of '24 🎉)
* This function will be used to write a number (aka a immediate value)
* to the buffer, which is considered a common ground for many encoder
* identities, such as `mi`, `oi` etc that also require a immediate value
* to be written to the buffer for the encoding.
*/
static void i_common(operand_t *op_arr, buffer_t *buf, instr_encode_table_t *instr_ref, enum modes mode) {
const uint8_t imm_size = op_sizeof(op_arr[1].type) / 8;
uint8_t *imm = (uint8_t *)op_arr[1].data;
Expand Down

0 comments on commit 5914670

Please sign in to comment.