R.O.M.E.68000 Home
Prev. Table of Cont. Help Cont. of This Ch.

This is the R.O.M.E.68000 Manual version 0.51.
This is an experimental version.
Copyright © 1997 by G. Mezzetti; last update: January 1, 1999.


2. How Pictures Are Drawn

This chapter contains many pictures that illustrate how addressing modes work. There's a meaning attached to the way in which such pictures are drawn, that we are now going to explain.

We saw in Chapter I that pointers are always relative to themselves in the 68000 (as they are in traditional CW); it is important to learn to recognize a pointer in a diagram, since you must know that you need to add the address of the pointer to its value in order to obtain the address of the location it is pointing to. Fig. 10 shows two modes in which we are going to picture a pointer pointing to a location.

Figure 10: Representations of a pointer

In the lower part of fig. 10 a label is associated with the value of the pointer, and then that label is used in place of the pointer itself; the two notations are perfectly equivalent, and the second will be used when too many arrows would make a diagram become unclear, or when we need to associate a name to a particular value.

We are so fussy about pointers and their representation because it is important to distinguish between a pointer and an index in the addressing modes that use both of them. Consider, for instance, the ``indirect to register with index and displacement'' mode: at the outset, the effective address is the sum of the content of the base register, the content of the index register, the displacement (contained in the instruction code) and of the address of... The address of what? The address of the location containing the base register, of course, not the index one! That's why it is so important to know which one is the base and which one the index. Fig. 11 shows the notation for indexes and displacements: as you can see, it is exactly the same for both.

Figure 11: Representation of indexes and displacements

In this figure, BASE is the label associated to the base address, INDEX is the label associated to the index and DISP is the label associated to the displacement (as you probably had already guessed!). The BASE label is interpreted as a pointer (look at the arrow coming out of it), and hence the address of the location containing the value associated with it must be added to the value itself in order to obtain the base address from which the index and the displacement are computed; on the contrary, the values associated to INDEX and DISP are absolute values: they are added without their respective addresses to the previously fixed base address to obtain the final address. You can see that there is no arrow coming out of the INDEX and DISP labels, a very suggestive notation being used instead.

You will find many other combinations of pointers, indexes and displacements in the diagrams that will follow, but I hope that you will be smart enough to extrapolate the information given in this paragraph to different, but similar situations. You will find that the notation is very intuitive and self-explanatory.

We now turn to correct data items. As we have said many times, addresses are number-type data; they can be contained in the address field of an operand, or can as well be stored into the memory array as data (this is precisely the case of pointers), but in this case, as you already know, they must be encapsulated in the value field of a correct data item. The same limitation applies to any index used by an addressing mode, since indexes are number-type data too. This informal rule is stated with greatest precision in the pictures that, for each addressing mode, illustrate the computation of the effective address: each time a particular piece of information needs to be put in the value field of a correct data item, this will be emphasized by marking the location containing it with the letters ``c.d.i.'', as shown in fig. 12. In that example, the location containing the value labelled VALUE (which is, of course, a number-type datum) must be configured as a correct data item, having VALUE in its value field. If, during the computation of the effective address, it turns out that a location signed in this manual with this mark is not configured in the core as a correct data item (i.e., as an alterable data item or as a static data item), then an error is raised and the program currently being executed is killed.

Figure 12: How a location is marked that must be configured as a correct data item

There are also some situations in which an alterable data item is speciÞcally prescribed. Such locations are marked with ``a.d.i.'' instead of ``c.d.i.'', and cause a fatal error even if a static data item, instead of an alterable one, is found within them. Look at fig. 13 for an example.

Figure 13: How a location is marked that must be configured as an alterable data item

In practice, registers must always be kept in alterable data items, while other pointers need only correct data items. Anyway, simply follow the diagrams and you will never have to worry about what must go where.


Prev. Table of Cont. Help Cont. of This Ch.

Gustavo MEZZETTI  /  mezzetti@math.unipd.it