Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

ST20-C1 Datasheet(PDF) 42 Page - STMicroelectronics

Part # ST20-C1
Description  Instruction Set Reference Manual
PDF  205 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

ST20-C1 Datasheet(HTML) 42 Page - STMicroelectronics

Back Button ST20-C1 Datasheet HTML 38Page - STMicroelectronics ST20-C1 Datasheet HTML 39Page - STMicroelectronics ST20-C1 Datasheet HTML 40Page - STMicroelectronics ST20-C1 Datasheet HTML 41Page - STMicroelectronics ST20-C1 Datasheet HTML 42Page - STMicroelectronics ST20-C1 Datasheet HTML 43Page - STMicroelectronics ST20-C1 Datasheet HTML 44Page - STMicroelectronics ST20-C1 Datasheet HTML 45Page - STMicroelectronics ST20-C1 Datasheet HTML 46Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 42 / 205 page
background image
4.5 Forming addresses
42/205
®
Access to a component of an array can be split into two sections; first the address of
the component must be constructed, and then the transfer of data to or from that
component must be performed.
Evaluating a subscript
Array subscripts can be evaluated efficiently using the
smul or mul instruction. If array
A has been declared by
int
A[S1] .. . [Sn];
where
Si (i = 1..n) are the dimensions, then one way of arranging this in memory is to
have all elements of the array in a contiguous block. For the purposes of this section,
suppose that the elements in the last dimension are stored adjacently; otherwise
change the order of the dimension subscripts. For example Figure 4.1 shows the
elements of a particular three dimensional array (Array) stored in this way.
Figure 4.1 A possible method of storing an array of integers
If an access is required to the following array element
A[e1] ... [en]
then the code to evaluate the subscript is
e1;
ldc S2; mul; e2; add;
ldc S3; mul; e3; add;
.. .
ldc Sn; mul; en; add;
For example to evaluate the subscript for element Array[x][y][z], (where Array
is declared as in Figure 4.1) the code sequence is
ld x;
ldc 2; mul; ld y; add;
ldc 3; mul; ld z; add;
If x is 1, y is 0 and z is 2, then this evaluates to 8, which as can be seen from Figure
4.1, is the correct offset from the base of the array.
Array[1][1][1]
Array[1][1][0]
Array[1][1][2]
Array[1][0][1]
Array[1][0][0]
Array[1][0][2]
Array[0][1][1]
Array[0][1][0]
Array[0][1][2]
Array[0][0][1]
Array[0][0][0]
Array[0][0][2]
int Array[
2][2][3];
Increasing
memory
addresses
Contiguous
locations for
words in
memory
space



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com