Skip to content

Instantly share code, notes, and snippets.

@AaronC81
Last active November 29, 2016 12:50
Show Gist options
  • Save AaronC81/60f72606779da0e2117b19d52c7d93b0 to your computer and use it in GitHub Desktop.
Save AaronC81/60f72606779da0e2117b19d52c7d93b0 to your computer and use it in GitHub Desktop.
Fibonacci Sequence in Little Man Computer
INP
SUB one
STA counter
loop LDA twoLast
ADD oneLast
STA next
OUT
LDA oneLast
STA twoLast
LDA next
STA oneLast
LDA counter
SUB one
STA counter
BRP loop
counter DAT 5
twoLast DAT 0
oneLast DAT 1
next DAT 0
one DAT 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment