Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. CLI ; Turn ON Interrupts
  2. LDAA #$FF ; Make PortT Outbound
  3. STAA DDRT
  4. STAA PortT ; store output at portT
  5. movb $6,PortM; set port M pin 0 as in bound, pin 1 and 2 as outbound
  6. movb $6,DDRM
  7.  
  8.  
  9. ; Start the program loop
  10.  
  11.  
  12. ANDA #$0F ; AND accumulator A with $0F to clear upper nibble
  13. LDX #Table ; Initialize Index X to beginning of the table
  14. INX ; increment index X by 1 to grab next address in table
  15. LDAA $00,X ; Get the solution from the table and put into Accum. A
  16. STAA PortT ; Output solution
  17. movb $00,PortM
  18. bset PortM,$02
  19. nop
  20. nop
  21. bclr PortM,$00
  22. HERE: BRSET PORTM,$01 HERE ; Branch, if PM0 is SET, to HERE
  23. JSR Next
  24. JMP HERE
  25.  
  26.  
  27.  
  28. ;Delay loop for 1 sec initially
  29. Next
  30. INX
  31. LDAA $00,X
  32. STAA PortT
  33. movb $00,PortM
  34. bset PortM,$02
  35. nop
  36. nop
  37. bclr PortM,$00
  38. RTS
  39.  
  40. ; Have the Assembler put the solution data in the look-up table
  41. ORG $5000 ; The look-up table is at $5000
  42. TABLE: DC.B $00, $7E, $30, $6D, $79 ; Define LED lighting orders
  43. DC.B $33, $5B, $5F, $70, $7F, $7B
  44.  
  45. ; Define Power-On Reset Interrupt Vector
  46.  
  47. ; AGAIN - OP CODES are at column 9
  48.  
  49. ORG $FFFE ; $FFFE, $FFFF = Power-On Reset Int. Vector Location
  50. FDB Start ; Specify instruction to execute on power up
  51.  
  52. ; End of Interrupt code
  53.  
  54. END ; (Optional) End of source code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement