Kevin Sooter - Computer-Architecture#202
Open
kevin-sooter wants to merge 12 commits into
Open
Conversation
codejoncode
reviewed
Mar 4, 2019
codejoncode
left a comment
There was a problem hiding this comment.
It wasn't needed today but maybe needed down the road add a flag to your cpu struct unsigned char FL;
codejoncode
reviewed
Mar 5, 2019
codejoncode
left a comment
There was a problem hiding this comment.
Kevin you should be updating cpu->ram we don't need data anymore.
codejoncode
reviewed
Mar 5, 2019
codejoncode
left a comment
There was a problem hiding this comment.
Looks Good Kevin getting MUL to work nicely.
codejoncode
reviewed
Mar 7, 2019
There was a problem hiding this comment.
// True if this instruction might set the PC
`int instruction_set_pc = (IR >> 4) & 1;`
//Above^^^^^^^^^^^should before the while loop
// increase PC after the switch
if (!instruction_set_pc) {
cpu->PC += ((IR >> 6) & 0x3) + 1;
}
//this is because the first 2 bits to the left of the instruction will tell you how many operands
this will prevent you from having to use two switch statements.
codejoncode
reviewed
Mar 7, 2019
codejoncode
reviewed
Mar 7, 2019
codejoncode
reviewed
Mar 7, 2019
codejoncode
reviewed
Mar 7, 2019
codejoncode
left a comment
There was a problem hiding this comment.
FILE *fptr;
if ((fptr = fopen(argv[1], "r")) == NULL)
{
printf("No such file.\n");
exit(1);
}
fclose(fptr);
No need for this to be in the main loop this should be in your cpu_load function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.