Skip to content

Instantly share code, notes, and snippets.

@nothings
Last active August 28, 2018 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nothings/e0319993bbf3e5be6943eeca9d00e613 to your computer and use it in GitHub Desktop.
Save nothings/e0319993bbf3e5be6943eeca9d00e613 to your computer and use it in GitHub Desktop.
instruction = cccccccc t xx r bb i aaa
8-bit registers A,B,C,T
8-bit program counter X
input I
output O
1-bit register F
; constant
C <- -128..127
; temp
T <- A
T <- T
; program counter
X <- C
X <- X+1
X <- F ? C : X+1
X <- A
; 2nd operand
B <- A
B <- B
B <- C
B <- I
; IO output
O <- A
O <-
; accumulator
A <- A
A <- B
A <- T
A <- -A
A <- A+B
A <- F ? B : A
A <- A, F <- A<B
A <- A, F <- A==B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment