Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here: BRSET PortM, $04, Here ; Poll for button press
- LDAB COUNT ;Load counter value into ACCB
- LDAA #$09 ;Compare COUNT to 9
- CBA ;Compare B (COUNT) to A (9)
- BEQ NINE ;Branch to NINE if Equal
- LDAB COUNT ;Load Count into ACCB
- LDX #Table
- ABX ;Add B to X to offset pointer. Solution in X
- LDAA $00, X ;Store new address' value into ACCA
- STAA PortT ;Move solution into PortT's address
- BSET PortM, $02 ;Enable Right latch
- NOP ;Waste time
- NOP ;Waste time
- BCLR PortM, $02 ;Disable Right latch
- LDAB COUNT ;Load COUNT into B
- INCB ;
- STAB COUNT ;Incriment COUNT upon completed iteration
- JSR Delay
- JMP Here
- ;First lets take care of updating the left latch
- NINE: LDX #Table
- LDAB COUNT2 ;Load value of COUNT2 into ACCB
- INCB ;Incriment value of COUNT2
- STAB COUNT2
- ABX ;Add B to X to offset pointer. Solution in X
- LDAA $00,X ;Store new address' value into ACCA
- STAA PortT ;Move solution into PortT's Address
- BSET PortM, $01 ;Enable Left latch
- NOP ;Waste time
- NOP ;Waste time
- BCLR PortM, $01 ;Disable right latch
- LDAA #$3F ;Load binary sequence for ZERO into A
- STAA PortT ;Store into PortT's address
- BSET PortM, $02 ;Enable right latch
- NOP
- NOP
- BCLR PortM, $02 ;Disable right latch
- ;Now lets take care of updating the right latch, which we assume is 9 at this point
- LDAA #$3F ;Load bit sequence for ZERO into ACCA
- STAA PortT ;Store it into Port T's address
- BSET PortM, $02 ;Enable Right latch
- NOP ;Waste time
- NOP ;Waste time
- BCLR PortM, $02 ;Disable Right latch
- JSR Delay
- ;So now we should have both displays updated but we need to reset COUNT because it's at 9
- LDAA #$00
- STAA COUNT ;Reset the loop counter
- JMP Here
Add Comment
Please, Sign In to add comment