Advertisement
heavenriver

ExEsame5.asm

Jun 16th, 2012
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Sia DMAC1 una periferica del processore PD32 che trasferisce dati dalla memoria ad una porta di uscita. Il DMAC1 è programmato dal processore a fronte di una interruzione che avviene da un TIMER programmabile dal processore stesso. Il DMAC1 una volta programmato deve trasferire 64 long word.
  2. ;Progettare:
  3. ;1) il SCA del DMAC1;
  4. ;2) l’interfaccia del TIMER;
  5. ;3) il software per gestire l’interruzione specificata.
  6.  
  7. org 400h
  8. dmac1 equ 0h             ;Transfers 64 L of data from memory to external port
  9. wc equ 2h                ;DMAC's WC
  10. timer equ 3h             ;Interrupts DMAC when transfer is due
  11. code
  12. jsr init
  13. seti
  14. main: jmp main           ;Loops until interrupt
  15. halt
  16. init: push R0            ;Initializes devices
  17. start timer
  18. movl #10, R0
  19. outl timer, R0           ;Timer is set to interrupt every 10 ms (arbitrary value, not specified in task)
  20. setim timer
  21. ret
  22. driver 0, 700h           ;DMAC driver
  23. clear dmac1
  24. rti
  25. driver 3, 900h           ;Timer driver
  26. push R0
  27. movl #64, R0
  28. outl wc, R0              ;Sets word counter to 64
  29. start dmac1
  30. setim dmac1
  31. clear timer
  32. pop R0
  33. rti
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement