• Nie Znaleziono Wyników

ADDRESS TRANSLATION

W dokumencie AM95C60 (Stron 38-46)

ADDRESSING MODES AND SCALING

S.2 ADDRESS TRANSLATION

The following sections describe how the SOAP is the X dimension. Stack entries and instructions in display memory are examples. The user is respon-sible for making certain the low order four address bits resolve to zeroes. If not, strange things may happen with no warning or notification.

Scale factors will be mentioned frequently in this section. The scale factors are specified using the instruction "Set Scale Factor". In general, scaling is independent for the two dimensions (X and V).

For each dimension, scaling will take place for every addressing mode (except absolute and indirect) unless the scale factor for that dimension was set to O. If the scale factor for a dimension was set to 0, then scaling will not occur for that dimen-sion. In any case, scaling is never performed for absolute or indirect addressing.

When the multiply takes place, the Am95CSO produces a 29-bit real number as shown in Figure 5-2. There is a 14-bit integer part and a 15-bit frac-tional part. By integer part we mean that a change of value of 1 will change the address by one pixel.

The Am95CSO does not make any assumptions about the position of radix points in either the address field or the scale factor.

One may assume the presence of radix points anywhere one wishes as long as there are a total of 15 bits of fraction. Two especially useful combi-nations are shown in Figure 5-3. The first com-bination assumes an integer address field and a fractional scale factor. The second combination assumes a fractional address field and a mostly integer scale factor (there is a single bit of fraction).

In the case where we assume an integer address

WORD1 ~ __ A~M __ +-_______________________ ~_dX __________________ ~

WORD2 0

I

0 Y/dY

~~--~---~

on85A 5-·1

Figure 5-1 Standard Operand Address Pair

5.2.1 Absolute Addressing Mode

When Absolute Addressing is specified, the 14-bit address field is taken as the effective address in the range -8192, +8191 regardless of the scale factors. The Fractional Error is unchanged. See Figure 5-4.

In Absolute Addressing mode, higher V values will be lower on the screen. The origin is at the upper-left corner of display memory. This is shown in Figure 5-4.

5.2.2 Viewport Addressing Mode

When Viewport Addressing mode is specified and the scale factor was set to some value other than 0, then the address field is multiplied by the scale factor producing a 29-bit real number. The Viewport Location (taken as an integer) is added to the integer part. The sum is taken as the effective address in the range -8192, +8191. The fractional part is stored as the new Fractional Error. While this address mode can modify the Fractional Error, it does not use it. See Figure 5-6. When the truncation takes place, the pixel is displaced UP on the screen. This is away from the viewport location; that is perhaps not what one might have expected.

In Viewport Addressing, with or without scaling, positive V values will appear above the viewport location: This is shown in Figures 5-5 and 5-6.

5.2.3 Relative Addressing Mode

When Relative Addressing mode is specified and the scale factor was set to 0, the 14-bit address field is taken as an integer to which is added the Current Pen Position. The sum is the effective address in the range -8192, +8191. The Fractional Error is unchanged. See Figure 5-7.

When Relative Addressing mode is specified and the scale factor was set to some value other than 0,

then the address field is multiplied by the scale factor producing a 29-bit real number. The Current Pen Position is added to the integer part and the Fractional Error is added to the fractional part (possibly causing a carry into the integer part). The integer part of the result is the effective address in the range -8192, +8191. The fractional part is stored as the new Fractional Error. This is the only addressing mode which actually uses the Fractional Error. See Figure 5-8. When the truncation takes place, the pixel is displaced UP on the screen. This is away from the Current Pen Position; that is perhaps not what one might have expected.

In Relative Addressing, with or without scaling, positive V addresses will appear above the Current Pen Position. This is shown in Figures 5-7 and 5-8.

5.2.4 Indirect Addressing Mode

When Indirect Addressing mode is specified, the address fields are taken as an integer address of a standard operand address pair. The pair is at X,V and X,V + 1 of bit plane O. The four low order bits of the X address field must be O.

Two words assumed to be a standard operand address pair (see Figure 5-9) are fetched from the indicated locations in display memory. It is eval-uated in the normal manner. It may specify any addressing mode including indirect.

5.2.5 Round-off Errors

The purpose of maintaining the Fractional Error is to prevent the accumulation of errors when using a series of relative addresses. The Fractional Error resulting from each operand address evaluation is added into the fractional part of the real number resulting from the next scaling operation. The fractional part resulting from that operation is stored as the new Fractional Error for the next address calculation.

In Viewport Addressing mode with scaling the Fractional Error is not added into the real number resulting from the scaling operation. However, the fractional part is still stored as the new Fractional Error.

r - 14 ---1 r- 15 ----1

ADDRESS FIELD SCALE FACTOR

r-14----~·1·4---15----~'

I 07785A 5-2

Figure 5-2 Scaling Multiply

ADDRESS FIELD

EFFECTIVEADDRESS

1

0,0

• I

y

I

-X~.

07785A 5-4

ADDRESS FIELD

I I

• •

SCALE FACTOR ADDRESS FIELD SCALE FACTOR

• •

07785A 5·3

Figure 5-3 Example of Binary Point Assignments

OLD FRACTIONAL ERROR

NEW FRACTIONAL ERROR

N,N

Figure 5-4 Absolute Addressing

ADDRESS FIELD

I

I

VIEWPORT LOCATION

I

.) .

c±)

1 I

OLD FRACTIONAL ERROR

NEW FRACTIONAL ERROR

+

EFFECTIVE ADDRESS

0,0

f---,

y

!

!- X--J

VIEWPORT

N,N

onS5A 5-6 Figure 5-5 Viewport Addressing Without Scaling

07785A 5-6

ADDRESS FIELD

I

I VIEWPORT LOCATION I

) .

ED 1

i

SCALE FACTOR

EFFECTIVEADDRESS NEW FRACTIONAL ERROR

0,0

f---1

Y·Sy :

I !

.~·Sx~

VIEWPORT

N,N

I

Figure 5-6 Viewport Addressing With Scaling

ADDRESS FIELD

I

CURRENT PEN POSITON

!) •

CB 1 I

~

EFFECTIVEADDRESS

0,0

f---r

y

I

I

I

:

.--X~

CPP

OLD FRACTIONAL ERROR NEW FRACTIONAL ERROR

+

N,N

Figure 5-7 Relative Addressing Without Scaling

5-6

07785A 5-7

ADD RESS FI ELD SCALE FACTOR

I !

I

CURRENT PEN POSTION

I

! .

rJ !

~

OLD FAACTLL

ERROR:

CARRY

~t+'t

PROPAGATION

'-.:.SJ

01

EFFECTIVEADDRESS NEW FRACTIONAL ERROR 0,0

f···T

Y·Sy + FEy

!

I !

-~·Sx+FEx~

CPP

N,N 07785A 5-9

Figure 5·8 Relative Addressing With Scaling

x,

Y

--+f

AM

I

X/dx

07785A 5-10 X,Y+1

--.f

00

I

Y/dy

Figure 5-9 Indirect Addressing

CHAPTER 6

W dokumencie AM95C60 (Stron 38-46)

Powiązane dokumenty