Commit Graph

10 Commits

Author SHA1 Message Date
Aryadev Chavali
137a6d3b75 Cleaned up inst.c
Use (H)WORD_SIZE more, added some notes, etc
2023-10-22 20:25:17 +01:00
Aryadev Chavali
d5d37f1264 Functions which convert (h)words to and from bytes
Uses memcpy internally, so we don't need to care about endianness.
2023-10-22 20:23:23 +01:00
Aryadev Chavali
e6339b1036 Changed format of inst_print
Prints the opcode then any operands in the following brackets
2023-10-22 18:02:05 +01:00
Aryadev Chavali
ba57523f3e Implemented opcode_as_cstr for NOT,OR,AND,XOR,EQ 2023-10-21 23:54:35 +01:00
Aryadev Chavali
44a9a3ca46 Helper functions for read/write instructions from darr or FILE* 2023-10-21 23:23:37 +01:00
Aryadev Chavali
dcedb70a5c Switched from floats to halfword
Registers are now just words, with pushing from and moving to
registers with specified subtypes just pushing those types into the
word registers.  That means there are 8 word registers which can act
as 16 half word registers, which themselves can act as 64 byte
registers.
2023-10-21 22:57:43 +01:00
Aryadev Chavali
44f8c81efe Added opcode_as_cstr, opcode_type_as_cstr and inst_print
Pretty self explanatory, helps with logging.
2023-10-16 12:55:15 +01:00
Aryadev Chavali
7380dd375a Fixed bug with get_opcode_data_type
Pushed the bits one step too far.
2023-10-16 11:25:52 +01:00
Aryadev Chavali
845d864bc0 Set opcode after reading parameters in inst_read_byte 2023-10-16 11:04:43 +01:00
Aryadev Chavali
6038363d2f Added functionality to read and write instruction bytecode
Uses some bit hacks to quickly check what data type an opcode may have
by shifting down to units then casting it to a data_type_t.
Not very well tested yet, we'll need to see now.
2023-10-16 01:18:05 +01:00