The 8237 DMA controller is capable of making transfers from RAM to RAM, from I/O to RAM, and from RAM to I/O device.
You must take into account that you will only able to copy up to 64KB of data. If you want to copy more than 64KB, you will need more than one transfer operation.
Assuming you are using the same environment that a IBM PC has, and you are able to set the segment address of the destination memory in a separate latch, you will need to:
Normalize your destination address segment:offset so that offset is lower than 16.
Normalization is carried this way (DIV is integer division, MOD is modulus):
normalized_segment = segment + offset DIV 16
normalized_offset = offset MOD 16
Load the segment value into the high order bits latch belonging to the channel you want to use (the page address register)
- Load the offset address into the Start Address Register of the DMA channel you want to use.
- Continue with DMA setup (transfer length, mode, interrupt on EOC, etc)