Guest User

Untitled

a guest
Jun 19th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Here:   BRSET PortM, $04, Here ; Poll for button press
  2.     LDAB    COUNT       ;Load counter value into ACCB
  3.     LDAA    #$09        ;Compare COUNT to 9
  4.     CBA             ;Compare B (COUNT) to A (9)
  5.      BEQ    NINE        ;Branch to NINE if Equal
  6.     LDAB    COUNT       ;Load Count into ACCB
  7.     LDX #Table
  8.     ABX             ;Add B to X to offset pointer. Solution in X
  9.     LDAA    $00, X      ;Store new address' value into ACCA
  10.     STAA    PortT       ;Move solution into PortT's address
  11.     BSET    PortM, $02  ;Enable Right latch
  12.     NOP             ;Waste time
  13.     NOP             ;Waste time
  14.     BCLR    PortM, $02  ;Disable Right latch
  15.     LDAB    COUNT       ;Load COUNT into B
  16.     INCB                ;
  17.     STAB    COUNT       ;Incriment COUNT upon completed iteration
  18.          
  19.     JSR Delay
  20.     JMP Here
  21.          
  22.     ;First lets take care of updating the left latch
  23. NINE:   LDX     #Table
  24.     LDAB    COUNT2      ;Load value of COUNT2 into ACCB
  25.     INCB                ;Incriment value of COUNT2
  26.     STAB    COUNT2
  27.     ABX                 ;Add B to X to offset pointer. Solution in X
  28.     LDAA    $00,X       ;Store new address' value into ACCA
  29.     STAA    PortT       ;Move solution into PortT's Address
  30.     BSET    PortM, $01  ;Enable Left latch
  31.     NOP                 ;Waste time
  32.     NOP                 ;Waste time
  33.     BCLR    PortM, $01  ;Disable right latch
  34.     LDAA    #$3F        ;Load binary sequence for ZERO into A
  35.     STAA    PortT       ;Store into PortT's address
  36.     BSET    PortM, $02  ;Enable right latch
  37.     NOP
  38.     NOP
  39.     BCLR    PortM, $02 ;Disable right latch
  40.            
  41.     ;Now lets take care of updating the right latch, which we assume is 9 at this point
  42.     LDAA    #$3F        ;Load bit sequence for ZERO into ACCA
  43.     STAA    PortT       ;Store it into Port T's address
  44.     BSET    PortM, $02  ;Enable Right latch
  45.     NOP                 ;Waste time
  46.     NOP                 ;Waste time
  47.     BCLR    PortM, $02  ;Disable Right latch
  48.     JSR     Delay
  49.            
  50.     ;So now we should have both displays updated but we need to reset COUNT because it's at 9
  51.     LDAA    #$00
  52.     STAA    COUNT       ;Reset the loop counter
  53.     JMP     Here
Add Comment
Please, Sign In to add comment