Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;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.
- ;Progettare:
- ;1) il SCA del DMAC1;
- ;2) l’interfaccia del TIMER;
- ;3) il software per gestire l’interruzione specificata.
- org 400h
- dmac1 equ 0h ;Transfers 64 L of data from memory to external port
- wc equ 2h ;DMAC's WC
- timer equ 3h ;Interrupts DMAC when transfer is due
- code
- jsr init
- seti
- main: jmp main ;Loops until interrupt
- halt
- init: push R0 ;Initializes devices
- start timer
- movl #10, R0
- outl timer, R0 ;Timer is set to interrupt every 10 ms (arbitrary value, not specified in task)
- setim timer
- ret
- driver 0, 700h ;DMAC driver
- clear dmac1
- rti
- driver 3, 900h ;Timer driver
- push R0
- movl #64, R0
- outl wc, R0 ;Sets word counter to 64
- start dmac1
- setim dmac1
- clear timer
- pop R0
- rti
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement