Advertisement
Guest User

Untitled

a guest
May 28th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; r0 - state
  2. start:
  3.     mov r0, 0
  4. wait:
  5.     jb p1.1, maybe_n
  6.     jb p2.1, maybe_d
  7. maybe_n:
  8.     lcall delay
  9.     jb p1.1, n
  10.     jmp wait
  11. maybe_d:
  12.     lcall delay
  13.     jb p2.1, d
  14.     jmp wait
  15. d:
  16.     inc r0
  17. n:
  18.     inc r0
  19.     mov a, r0
  20.     sub a, 3
  21.     jnc done
  22.     jmp wait
  23. done:
  24.     ; open door here
  25.     jmp start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement