Advertisement
Guest User

Untitled

a guest
May 15th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. main.asm
  2. M
  3.  
  4. Tipo
  5. Testo
  6. Dimensioni
  7. 1 kB (1.503 byte)
  8. Spazio di archiviazione
  9. 0 byteDi proprietà di un'altra persona
  10. Posizione
  11. part1.2
  12. Proprietario
  13. Matteo Castellani
  14. Modificato
  15. 14:52 da Matteo Castellani
  16. Aperto
  17. 19:23 da me
  18. Creato
  19. 14:52
  20. Aggiungi una descrizione
  21. I visualizzatori possono scaricare
  22. ;;**************************************************************
  23. ;* This stationery serves as the framework for a *
  24. ;* user application. For a more comprehensive program that *
  25. ;* demonstrates the more advanced functionality of this *
  26. ;* processor, please see the demonstration applications *
  27. ;* located in the examples subdirectory of the *
  28. ;* Freescale CodeWarrior for the HC12 Program directory *
  29. ;**************************************************************
  30. ; Include derivative-specific definitions
  31.            INCLUDE 'derivative.inc'
  32. ; export symbols
  33.            XDEF Entry, _Startup, main
  34. ; we use export 'Entry' as symbol. This allows us to
  35. ; reference 'Entry' either in the linker .prm file
  36. ; or from C/C++ later on
  37. ; code section
  38.  
  39. MyCode:     SECTION
  40. main:
  41. _Startup:
  42. Entry:
  43.          
  44. start:      LDAA #$F0 ; load the DDRT register initialization value (bits 7 to 4 at ‘1’) in A
  45.            STAA DDRT ; write the content of A to the DDRT register
  46.            STAA PTT ; turn off the 4 LEDsDDRT (writing ‘1’)
  47.            LDX #1000
  48.            
  49. loop_X:     CPX #0
  50.            BEQ xor_A
  51.            DEX
  52.            BRA loop_X
  53.            
  54. loop_Y:     LDY #1000
  55.            CPY #0
  56.            BEQ done_Y
  57.            DEY
  58.            BRA loop_Y
  59.            
  60. done_Y:     JMP loop_X
  61.  
  62. xor_A:      EORA #$F0
  63.            JMP ppt_A
  64.          
  65. ppt_A:      STAA PTT ; turn off the 4 LEDsDDRT (writing ‘1’)
  66.            LDX #1000
  67.            JMP loop_X
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement