Skip to content

Luis Martinez#205

Open
luiscmartinez wants to merge 10 commits into
bloominstituteoftechnology:masterfrom
luiscmartinez:master
Open

Luis Martinez#205
luiscmartinez wants to merge 10 commits into
bloominstituteoftechnology:masterfrom
luiscmartinez:master

Conversation

@luiscmartinez
Copy link
Copy Markdown

No description provided.

Comment thread ls8/cpu.c Outdated
{
case HLT:
running = 0;
break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job with these breaks as they're necessary in any switch statements, in C or JavaScript or otherwise.

Comment thread ls8/cpu.c
break;
case LDI:
cpu->registers[operandA] = operandB;
cpu->pc += 3;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

Comment thread ls8/cpu.c
break;
case PRN:
printf("%d\n", cpu->registers[operandA]);
cpu->pc += 2;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually you might come across a way to increase the PC using the instruction number itself (hint: this uses bit shifting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants