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

B2018.circ instruction IN A,(n1) [opcode DB] does not read n1 #5

Open
ReGuess opened this issue May 17, 2020 · 0 comments
Open

B2018.circ instruction IN A,(n1) [opcode DB] does not read n1 #5

ReGuess opened this issue May 17, 2020 · 0 comments

Comments

@ReGuess
Copy link

ReGuess commented May 17, 2020

As it is, this opcode uses the current value of the program counter as the port to request (meaning that its function depends on its position in the program, which it should not), instead of requesting the next byte from memory and using that value as the port to request. (It also then treats the next byte as a new opcode, which is especially problematic.)

I came up with my own solution (comparing the implementation for OUT (n1),A [opcode D3] with what was already there for DB, and making modifications until it worked like I thought it should), but had kept it to myself because I just didn't know enough to know if I was doing it right. But then I found Goran Devic's work and in particular here, and I saw that it looked similar to what I had figured out.

Originally:
00030000 00031000 00030000 00000020 88000400 00031200 00030000 00000408
88000600 88000040 00800200 00800000 00800200 00019000 88000800 88004000

My fix:
00819000 00819200 00000020 88000400 00031200 00030000 00000408 88000600
88000040 00800200 00800000 00800200 00019000 88000800 88004000 00000000

I am very new to this, and I welcome any corrections or further insight. Thank you.

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

No branches or pull requests

1 participant