ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 10

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
2.2 Instruction definitions
represent addresses, signed or unsigned integers. Generally the arithmetic in signed.
In some cases it is clear from the context (e.g. from the operators used) whether a
particular object represents a signed or unsigned number. A subscripted label is
added (e.g. Areg
2.2.5
The memory is represented by arrays of each data type. These are indexed by a value
representing a byte address. Access to the three data types is represented in the
instruction descriptions in the following way:
For all of these, the state of the machine referenced is that before the instruction if the
function is used without a prime (e.g. word[ address ]), and that after the instruction if
the function is used with a prime (e.g. word [ address ]).
For example, writing a value given by an expression, expr , to the word in memory at
address addr is represented by:
and reading a word from a memory location is achieved by:
Writing to memory in any of these ways will update the contents of memory, and these
updates will be consistently visible to the other representations of the memory. For
example, writing a byte at address 0 will modify the least significant byte of the word at
address 0.
Data alignment
Generally, word and half word data items have restrictions on their alignment in
memory. Byte values can be accessed at any byte address, i.e. they are byte aligned.
16-bit objects can only be accessed at even byte addresses, i.e. the least significant
bit of the address must be 0. 32-bit objects must be word aligned, i.e. the 2 least
significant bits of the address must be zero.
Address calculation
An address identifies a par ticular byte in memory. Addresses are frequently calculated
from a base address and an offset. For different instructions the offset may be given in
units of bytes or words depending on the data type being accessed. In order to
calculate the address of the data, a word offset must be converted to a byte offset
before being added to the base address. This is done by multiplying the offset by the
number of bytes per word, i.e. 4.
As there are many accesses to memory at word offsets, a shorthand notation is used
to represent the calculation of a word address. The notation register @ x is used to
10/205
Representing memory
byte[ address ]references a byte in memory at the given address
sixteen[ address ]references a 16-bit half word in memory
word[ address ]references a 32-bit word in memory
word [ addr ]
register
unsigned
word[ addr ]
) to clarify where necessary.
expr

Related parts for ST20-C1