Address Generation
5-26
5.7.6
Sorting
The following procedure is used to locate transfers in memory by ordinal loca-
tion within a frame (i.e., the first transfer of the first frame followed by the first
transfer of the second frame):
-
ELEMENT INDEX is set to F
×
S.
-
FRAME INDEX is set to –(((E – 1)
×
F) – 1)
×
S
where:
E = Initial value of ELEMENT COUNT (the number of elements
per frame) initial value of the ELEMENT COUNT RELOAD
F = Initial value of FRAME COUNT (the total number of frames)
S = Element size in bytes
Consider a transfer with three frames (F = 3) of four halfword elements
each (E = 4, S = 2). This corresponds to ELEMENT INDEX = 3
×
2 = 6 and
FRAME INDEX = –(((4 – 1)
×
3) – 1)
×
2 = FFF0h. Assume that the source
address is not modified and the destination increments starting at
8000 0000h. Table 5–7 shows the data in the order in which it is trans-
ferred, and Table 5–8 shows how the data appears in memory after trans-
fers are finished.
Table 5–7. Sorting Example in Order of DMA Transfers
Frame
Element
Address (Hex)
Postadjustment
0
0
8000 0000
+6
0
1
8000 0006
+6
0
2
8000 000C
+6
0
3
8000 0012
–16
1
0
8000 0002
+6
1
1
8000 0008
+6
1
2
8000 000E
+6
1
3
8000 0014
–16
2
0
8000 0004
+6
2
1
8000 000A
+6
2
2
8000 0010
+6
2
3
8000 0016
–16