Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CLI ; Turn ON Interrupts
- LDAA #$FF ; Make PortT Outbound
- STAA DDRT
- STAA PortT ; store output at portT
- movb $6,PortM; set port M pin 0 as in bound, pin 1 and 2 as outbound
- movb $6,DDRM
- ; Start the program loop
- ANDA #$0F ; AND accumulator A with $0F to clear upper nibble
- LDX #Table ; Initialize Index X to beginning of the table
- INX ; increment index X by 1 to grab next address in table
- LDAA $00,X ; Get the solution from the table and put into Accum. A
- STAA PortT ; Output solution
- movb $00,PortM
- bset PortM,$02
- nop
- nop
- bclr PortM,$00
- HERE: BRSET PORTM,$01 HERE ; Branch, if PM0 is SET, to HERE
- JSR Next
- JMP HERE
- ;Delay loop for 1 sec initially
- Next
- INX
- LDAA $00,X
- STAA PortT
- movb $00,PortM
- bset PortM,$02
- nop
- nop
- bclr PortM,$00
- RTS
- ; Have the Assembler put the solution data in the look-up table
- ORG $5000 ; The look-up table is at $5000
- TABLE: DC.B $00, $7E, $30, $6D, $79 ; Define LED lighting orders
- DC.B $33, $5B, $5F, $70, $7F, $7B
- ; Define Power-On Reset Interrupt Vector
- ; AGAIN - OP CODES are at column 9
- ORG $FFFE ; $FFFE, $FFFF = Power-On Reset Int. Vector Location
- FDB Start ; Specify instruction to execute on power up
- ; End of Interrupt code
- END ; (Optional) End of source code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement