Question: Write two functions in C . FILE * open fillychar' flle namels This function reads in a obj fle. For example, the file content: CA

Write two functions in C.
FILE* open fillychar' flle namels
This function reads in a obj fle. For example, the file content:
CA DE 0000000 C 9000 D1409200940A2500 OC OC 650048017200102114 BF OF F8
C.870000000449454954
Then, write function:
int parse_fle (FuL' my_obj_flie, row_of_memory"t memoryl.
The first LC-4 instruction in the 12-word body is: 9000.
next line: C38700000004494E4954 is a label, so:
REFERENCE BELOW:
In a .OBJ flie, there are 3 header "types" = COOE, DATA SYMBOL
Code: 3-word header (XCADE, caddress, (no), n-word body comprising the instructions.
Symbol 3-word header (xC387, caddress), en>), n-character body comprising the symbol string.
Note, each character in the flie is 1 byse. There is no null terminatoe. Each symbol is its own section
You can vie the cede os furstions below directly.
typedef struct row_of_memory_struct if
short unsigned int address :
char ' label:
Whart unsigned int contents:
char' assembly:
struct row_of_memory_struct "next :
row_of_memory :
int add_to_list (how_of_memory"t head, short uneigned int address, short uneigned int contents):
row_of_memory" search_address (row_of_memory* head, short unoigned int addrest):
row_ol_memory" search_opcode frow_of _memory" head, short unsigned int opcodel'
void print_list (how_ot_memory" head?
int delete list frow of memory" head:
Write two functions in C . FILE * open fillychar'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!