Skip to content

Instantly share code, notes, and snippets.

@aarcro
Created December 10, 2016 06:52
Show Gist options
  • Save aarcro/ecfaf46b8ef54f15f129f468d61a309a to your computer and use it in GitHub Desktop.
Save aarcro/ecfaf46b8ef54f15f129f468d61a309a to your computer and use it in GitHub Desktop.
More clever than fast
@0
## FASTER
@1
MOV RIGHT, DOWN
MOV UP, ACC
MOV ACC, RIGHT
MOV ACC, DOWN
@2
MOV UP, ACC
MOV ACC, DOWN
MOV ACC, LEFT
MOV ACC, RIGHT
# BROADCAST OPCODE
# THEN ADD
MOV LEFT, ACC
ADD RIGHT
MOV ACC, DOWN
@3
MOV LEFT, DOWN
MOV UP, ACC
MOV ACC, LEFT
MOV ACC, DOWN
@4
@5
START:
MOV UP, ACC
JLZ PASS
MOV UP, NIL
JMP START
PASS:
MOV UP, DOWN
@6
START:
MOV UP ACC
JEZ PASS
MOV UP, NIL
JMP START
PASS:
MOV UP, DOWN
@7
START:
MOV UP, ACC
JGZ PASS
MOV UP, NIL
JMP START
PASS:
MOV UP, DOWN
@8
MOV UP, RIGHT
@9
MOV ANY, DOWN
@10
MOV UP, LEFT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment