Skip to content
New issue

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

Should we have a jump register? #19

Closed
freesurfer-rge opened this issue Oct 11, 2022 · 0 comments · Fixed by #23
Closed

Should we have a jump register? #19

freesurfer-rge opened this issue Oct 11, 2022 · 0 comments · Fixed by #23
Assignees

Comments

@freesurfer-rge
Copy link
Owner

Should the ProgramCounter acquire a 16-bit jump register, along with instructions:

  • JSR which would copy the current PC to the jump register, and copy A and B bus to the PC (and inhibit increment)
  • RET which would copy the jump register to the PC (and not inhibit increment)
  • LOADJUMP0/LOADJUMP1 which would put the low/high byte of the jump register onto C bus (for saving in Register C)
  • STOREJUMP which would copy A and B bus to the jump register

These would eliminate the LOADPC command, which is the only one to write to Register B.... and complicates the RegisterFile implementation. Since the jump register wouldn't be continually changing, it is safe to have separate load instructions for the low and high bytes.

@freesurfer-rge freesurfer-rge self-assigned this Oct 11, 2022
freesurfer-rge added a commit that referenced this issue Oct 14, 2022
After some thought, it feels better to have a dedicated Jump register built into the program counter. This helps deal with the design having 8-bit registers but using 16-bit addressing, which had lead to needing the instruction to copy the PC to be able to write to *two* registers. It was the only instruction which needed to do so, and complicated the register file. Having a jump register avoids this, since it is safe to copy the low and high bytes with separate instructions. I believe that this compensates for the extra instructions now in the Program Counter.

Closes #19
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 a pull request may close this issue.

1 participant