We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I find that running ppc outputs noise after the register values.
Enter a command: ppc Current Address: 16 Offset: 0 Address Word: 000000000000000000000000000000000000spotIè9♦[ò Instruction: 000000000000000000ram FiKè9♠Zò Multiplier Quoticent: 000000000000000000000000000000000000spotⁿè8░[ò Accumulator: 00000000000000000000000000000000000000R=Lè9☺[ò Accumulator Int: 0 Multiplier Qotient: 0 Combined Int: 0
Adding length limitations to the string format codes fixed this issue on my system. It appears the strings are not null terminated.
void print_pc(struct program_counter pc) { printf("Current Address: %d\n", pc.current_address); printf("Offset: %d\n", pc.offset); char* address_word = malloc(WORD_SIZE); byte_value_to_string(pc.address_word, address_word, WORD_SIZE); printf("Address Word: %.*s\n", WORD_SIZE, address_word); char* instruction_string = malloc(INSTRUCTION_SIZE); byte_value_to_string(pc.instruction, instruction_string, INSTRUCTION_SIZE); printf("Instruction: %.*s\n", INSTRUCTION_SIZE, instruction_string); byte_value_to_string(pc.multiplier_quotient, address_word, WORD_SIZE); printf("Multiplier Quoticent: %.*s\n", WORD_SIZE, address_word); char* accumulator_string = (char*) malloc(ACCUMULATOR_SIZE); byte_value_to_string(pc.accumulator, accumulator_string, ACCUMULATOR_SIZE); printf("Accumulator: %.*s\n", ACCUMULATOR_SIZE, accumulator_string); printf("Accumulator Int: %lld\n",signed_byte_value(pc.accumulator,ACCUMULATOR_SIZE)); printf("Multiplier Qotient: %lld\n",signed_byte_value(pc.multiplier_quotient, MULTIPLIER_QUOTIENT_SIZE)); printf("Combined Int: %lld\n\n",compute_multiplier_accumulator(&pc)); free(address_word); free(instruction_string); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I find that running ppc outputs noise after the register values.
Adding length limitations to the string format codes fixed this issue on my system. It appears the strings are not null terminated.
The text was updated successfully, but these errors were encountered: