Skip to content

luis#215

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

luis#215
luiscmartinez wants to merge 2 commits into
bloominstituteoftechnology:masterfrom
luiscmartinez:master

Conversation

@luiscmartinez
Copy link
Copy Markdown

No description provided.

Comment thread ls8/cpu.c

case ALU_ADD:
cpu->reg[regA] += cpu->reg[regB];
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.

These look good. What other operations could you add to the ALU?

Comment thread ls8/cpu.c
break;

case POP:
cpu->reg[operandA] = cpu_ram_read(cpu, cpu->reg[7]++);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like that you're using cpu_ram_read() and cpu_ram_write() for PUSH and POP, I think this is the more proper way of doing this. I just assigned the values directly.

Comment thread ls8/cpu.c
case RET:
cpu->PC = cpu_ram_read(cpu, cpu->reg[7]++);
break;
case CMP:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is actually an ALU operation. You can move it there if you want to. When looking at the operation codes, the third bit from the left is 1 if it is an ALU operation.

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