Merge pull request 'fix makefile error, fix valgrind error.' (#8) from fix_readme into main
Reviewed-on: https://external.feng-arch.cn:35127/fengqi/lc4_asm_disassembling/pulls/8
This commit is contained in:
commit
5d468dd922
@ -115,19 +115,13 @@ void print_list_f(row_of_memory *head, FILE *output) {
|
||||
if (head == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(output, "%-20s %-20s %-20s %s\n", "<label>", "<address>", "<contents>", "<assembly>");
|
||||
row_of_memory *current = head;
|
||||
while (current != NULL) {
|
||||
char address_str[20];
|
||||
char contents_str[20];
|
||||
sprintf(address_str, "%04X", current->address);
|
||||
sprintf(contents_str, "%04X", current->contents);
|
||||
fprintf(output, "%-20s %-20s %-20s %s\n",
|
||||
current->label ? current->label : "",
|
||||
address_str,
|
||||
contents_str,
|
||||
current->assembly ? current->assembly : "");
|
||||
fprintf(output, "%s\n",current->assembly ? current->assembly : "");
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user