Advertisement
Guest User

Untitled

a guest
May 15th, 2018
93
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. Creato
  17. 14:52
  18. Aggiungi una descrizione
  19. I visualizzatori possono scaricare
  20. ;;**************************************************************
  21. ;* This stationery serves as the framework for a *
  22. ;* user application. For a more comprehensive program that *
  23. ;* demonstrates the more advanced functionality of this *
  24. ;* processor, please see the demonstration applications *
  25. ;* located in the examples subdirectory of the *
  26. ;* Freescale CodeWarrior for the HC12 Program directory *
  27. ;**************************************************************
  28. ; Include derivative-specific definitions
  29.            INCLUDE 'derivative.inc'
  30. ; export symbols
  31.            XDEF Entry, _Startup, main
  32. ; we use export 'Entry' as symbol. This allows us to
  33. ; reference 'Entry' either in the linker .prm file
  34. ; or from C/C++ later on
  35. ; code section
  36.  
  37. MyCode:     SECTION
  38. main:
  39. _Startup:
  40. Entry:
  41.          
  42. start:      LDAA #$F0 ; load the DDRT register initialization value (bits 7 to 4 at ‘1’) in A
  43.            STAA DDRT ; write the content of A to the DDRT register
  44.            STAA PTT ; turn off the 4 LEDsDDRT (writing ‘1’)
  45.            LDX #1000
  46.            
  47. loop_X:     CPX #0
  48.            BEQ xor_A
  49.            DEX
  50.            BRA loop_X
  51.            
  52. loop_Y:     LDY #1000
  53.            CPY #0
  54.            BEQ done_Y
  55.            DEY
  56.            BRA loop_Y
  57.            
  58. done_Y:     JMP loop_X
  59.  
  60. xor_A:      EORA #$F0
  61.            JMP ppt_A
  62.          
  63. ppt_A:      STAA PTT ; turn off the 4 LEDsDDRT (writing ‘1’)
  64.            LDX #1000
  65.            JMP loop_X
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement