ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 42
ST20-C1
Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
1.ST20-C1.pdf
(205 pages)
- Current page: 42 of 205
- Download datasheet (842Kb)
4.5 Forming addresses
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
where S
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.
If an access is required to the following array element
then the code to evaluate the subscript is
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
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.
42/205
int A [ S
A [ e
e
ldc S
ldc S
. . .
ldc S
ld x;
ldc 2; mul; ld y; add;
ldc 3; mul; ld z; add;
int Array[ 2 ][ 2 ][ 3 ];
i
1
( i = 1..n ) are the dimensions, then one way of arranging this in memory is to
;
1
Figure 4.1 A possible method of storing an array of integers
2
3
n
] . . . [ e
; mul; e
; mul; e
; mul; e
1
] . . . [ S
2
3
n
n
; add;
; add;
; add;
]
n
];
Increasing
addresses
memory
Array[0][1][0]
Array[1][1][2]
Array[1][1][1]
Array[1][1][0]
Array[1][0][2]
Array[1][0][1]
Array[1][0][0]
Array[0][1][2]
Array[0][1][1]
Array[0][0][2]
Array[0][0][1]
Array[0][0][0]
Contiguous
locations for
words in
memory
space
Related parts for ST20-C1
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
ST20 software development and debugging tools
Manufacturer:
STMICROELECTRONICS [STMicroelectronics]
Datasheet:
Part Number:
Description:
C++ preprocessor for ST20 and T4/T8 transputers
Manufacturer:
STMICROELECTRONICS [STMicroelectronics]
Datasheet:
Part Number:
Description:
PC PARALLEL PORT TO JTAG INTERFACE
Manufacturer:
STMICROELECTRONICS [STMicroelectronics]
Datasheet:
Part Number:
Description:
PC PARALLEL PORT TO OS-LINK INTERFACE
Manufacturer:
STMICROELECTRONICS [STMicroelectronics]
Datasheet:
Part Number:
Description:
Gps Processor
Manufacturer:
STMicroelectronics
Datasheet:
Part Number:
Description:
Gps Processor
Manufacturer:
STMicroelectronics
Datasheet:
Part Number:
Description:
THYRISTORS
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
ADJUSTABLE INVERTING NEGATIVE OUTPUT CURRENT MODE PWM REGULATORS
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
0.25A SCRs
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
0.8A SCRs
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
Smartcard MCU With 4 additional I/0
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
SERIAL 2K (256 x 8) EEPROM
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
Search -----> STP10NB50FP
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
Search ---> STP12NB30
Manufacturer:
ST Microelectronics
Datasheet:
Part Number:
Description:
Search -----> STP13NK50Z
Manufacturer:
ST Microelectronics
Datasheet: