Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CONTROL UNIT PRISONER'S DILEMMA AID
- PLAN:
- input 3 controls left room choice (0 is ally, 1 is betray)
- input 1 controls left room choicemade
- input 4 controls right room choice
- input 2 controls right room choicemade
- inputs 1 and 2 are put into RAM 1 and 2 respectively
- once RAM 1 & 2 AND to 1, inputs 3 and 4 are checked
- output 0 is activated when input 3 and 4 are both 0
- output 1 is activated when input 3 and 4 are both 1
- output 2 is activated when input 3 is 0 and input 4 is 1
- output 3 is activated when input 3 is 1 and input 4 is 0
- once an output is triggered, the RAM is reset and the unit should theoretically be reset
- --------------------------------------------------------------------------------------------------------------------------
- AND 0 ;reset RR (set to 0)
- IEN 0 ;enable input
- OEN 0 ;enable output
- \\NOP
- \\NOP
- \\NOP ;placeholder for JMP
- \\NOP ;nvm not needed
- LD 1 ;load left room selection into RR
- SKZ
- STO 8 ;store into RAM 1 if left choicemade = 1
- LD 2 ;load right room choicemade into RR
- SKZ
- STO 9 ;store into RAM 2 if right choicemade = 1
- LD 9 ;load in case room 2 make choice before room 1
- AND 8 ;logical AND with RR and RAM 1
- LD 0 ;find inverse of the previous AND for next step
- SKZ
- JMP 4 ;if the AND returns 1, it is converted to 0 and skips past this step
- LD 3 ;load left room choice into RR
- STO A ;store left room choice into RAM 3
- LD 4 ;load right room choice into RR
- STO B :store right room choice into RAM 4
- AND A ;RR is 1 if both rooms chose betray
- SKZ
- STO 1 ;output signal 1:1
- LD B ;load right room choice into RR
- LD 0 ;invert RR
- ANDC A;logical AND of inverse left room choice and inverse right room choice :: RR is 1 if both rooms choose ally
- SKZ
- STO 0 ;output signal 0:1
- LD B ;load right room choice into RR
- LD 0 ;invert RR
- AND A ;logical AND of inverse right room choice and left room choice :: RR is 1 if right room chooses ally and left room chooses betray
- SKZ
- STO 3 ;output signal 3:1
- LD B ;load right room choice into RR
- ANDC A;logical AND of right room choice and inverse left room choice :: RR is 1 if right room chooses betray and left room chooses ally
- SKZ
- STO 2 ;output signal 2:1
- AND 0
- STO 8
- STO 9
- STO A
- STO B ;CLEAR ALL RAM AFTER GAME OVER
- ------------------------------------------------------------------------------------------------------------------------
- COMPILED CODE: 30A0B011E08812E089193810E0C4138A148B3AE0811B104AE0801B103AE0831B4AE0823088898A8B
- WARNING: CODE IS LONGER THAN 64 CHARACTERS AAAAAAAAAAAA
- TODO: fix goon2016 release to support this lol
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement