Advertisement
TheFastFish

nesasm

Jan 12th, 2015
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     ;reset controller port 1 (address $4016) by storing #$1000
  2.     ;remember that loads and stores are done one byte at a time
  3.     lda #$10
  4.     sta $4016
  5.     lda #$00
  6.     sta $4016
  7.     ;read button states, in order
  8.     ;A, B, Start, Select, Up, Down, Left, Right
  9.     ;jump to corresponding subroutine if button is pressed
  10.     lda $4016
  11.     and #1
  12.     beq @ASkp
  13.     jsr Pad1_A
  14.     @ASkp:
  15.     lda $4016
  16.     and #1
  17.     bne BSkp
  18.     lda $4016
  19.     and #1
  20.     bne StartSkp
  21.     lda $4016
  22.     and #1
  23.     bne SelectSkp
  24.     lda $4016
  25.     and #1
  26.     bne UpSkp
  27.     lda $4016
  28.     and #1
  29.     bne DownSkp
  30.     lda $4016
  31.     and #1
  32.     bne LeftSkp
  33.     lda $4016
  34.     and #1
  35.     bne RightSkp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement