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

Interrupt Handler 199 cycle solution #23

Closed
Solomute opened this issue Feb 15, 2016 · 0 comments
Closed

Interrupt Handler 199 cycle solution #23

Solomute opened this issue Feb 15, 2016 · 0 comments

Comments

@Solomute
Copy link

I save three cycles by:

  • Reordering the instructions in node 5 to ask for the inputs that will be ready first
  • Instead of combining three inputs in node 6, I combine two inputs in node 5, the other two in node 6, then I combine nodes 5 and 6 using node 9.

@0
S: MOV UP, ACC
JGZ 1
0: MOV 0, DOWN
JMP S
1: MOV 1, DOWN
2: MOV UP, ACC
JEZ 0
MOV 0, DOWN
JMP 2

@1
S: MOV UP, ACC
JGZ 1
0: MOV 0, DOWN
JMP S
1: MOV 2, DOWN
2: MOV UP, ACC
JEZ 0
MOV 0, DOWN
JMP 2

@2
S: MOV UP, ACC
JGZ 1
0: MOV 0, DOWN
JMP S
1: MOV 3, DOWN
2: MOV UP, ACC
JEZ 0
MOV 0, DOWN
JMP 2

@3
S: MOV UP, ACC
JGZ 1
0: MOV 0, DOWN
JMP S
1: MOV 4, DOWN
2: MOV UP, ACC
JEZ 0
MOV 0, DOWN
JMP 2

@4
MOV UP, RIGHT

@5
MOV UP, ACC
ADD LEFT
MOV ACC, DOWN

@6
MOV UP, ACC
ADD RIGHT
MOV ACC, DOWN

@7
MOV UP, LEFT

@8
MOV UP, RIGHT

@9
MOV UP, ACC
ADD LEFT
MOV ACC, DOWN

@10

kk4ead pushed a commit that referenced this issue Apr 17, 2016
Closes issues #21, #22, #23, #24, and #25.
@kk4ead kk4ead closed this as completed Apr 17, 2016
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

2 participants