.global _memcpy_dma .global _memcpy_xce3 _memcpy_dma: .cproc s1, s2, wc * MVKL 0x01840040, A3 ; address of the DMA1 primary control register * MVKH 0x01840040, A3 MVKL 0x01840004, A3 ; address of the DMA2 primary control register MVKH 0x01840004, A3 MVKL 0x00040008, A1 MVKH 0x00040008, A1 STW A1, *+A3[2] ; secondary control register STW s1, *+A3[6] ; destination address (1st argument) STW s2, *+A3[4] ; source address (2nd argument) STW wc, *+A3[8] ; word count (3rd argument) MVK 0x11, A1 STW A1, *A3 ; trigger the transfer wait: LDW *A3, A1 EXTU A1, 28, 30, A1 NOP 5 [A1] B wait .return .endproc _memcpy_xce3: .cproc s2, wc MVKL 0x01840004, A3 ; address of the DMA2 primary control register MVKH 0x01840004, A3 MVKL 0x00040008, A1 MVKH 0x00040008, A1 STW A1, *+A3[2] ; secondary control register MVKL 0x70000000, A1 ; destination address = XCE3 MVKH 0x70000000, A1 STW A1, *+A3[6] ; destination address STW s2, *+A3[4] ; source address (1st argument) STW wc, *+A3[8] ; word count (2nd argument) MVK 0x11, A1 STW A1, *A3 ; trigger the transfer wait: LDW *A3, A1 EXTU A1, 28, 30, A1 NOP 5 [A1] B wait .return .endproc