Advertisement
Guest User

Untitled

a guest
May 28th, 2017
54
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. n:
  16.     inc r0
  17.     jmp check
  18. d:
  19.     inc r0
  20.     inc r0
  21. check:
  22.     mov a, r0
  23.     sub a, 3
  24.     jnc done
  25.     jmp wait
  26. done:
  27.     ; open door here
  28.     jmp start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement