DSP Core Instruction Set

A.1.3 Data Representation in Memory for the Examples

For the examples in this appendix, the convention for the representation of data in memory is to show the same order in memory as is in the source register for a write. For example, a 32-bit write from a register containing $12345678 to address $100 will be shown as: ($100) = $12345678. The exact order of multi-byte operands in memory depends on the endian mode, and is described in Section 2.4.1, “SC140 Endian Support,” on page 2-56.

A.1.4 Encoding Notation

The instruction encoding is defined for each instruction under Instruction Formats and Opcodes and Instruction Fields. Each instruction field may not be contiguous in the opcode, but the order of the bits in each field is consistent from the opcode to the definition of the field. For example, in the MOVE.B instruction, the encoding for the opcode is

 

15

 

 

 

 

 

8

7

0

MOVE.B (a16),DR

 

 

 

 

 

 

 

 

 

0

0

0

1 H

H

H

H

A A A 0

1 1 1 0

 

1

0

0

A A

A

A

A

A A A A A A A A

 

 

 

 

 

 

 

 

 

 

The order of bits for a16 (AAA---A) is the MSB in the first bit at the left-most position in word 1. The LSB is the right-most position in word 2. If written out fully, the encoding would be:

 

15

 

 

 

 

8

7

 

 

 

 

 

 

0

MOVE.B (a16),DR

 

 

 

 

 

 

 

 

 

 

 

 

0

0

0

1 H H

H

H

A15 A14 A13

0

1

1

1

0

 

1

0

0

A12 A11 A10

A9

A8

A7

A6

A5

A4

A3

A2

A1

A0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A more complicated example is for BSR, where two fields are intermixed. The order for each field is maintained, monotonically decreasing from left to right.

BSR >label

0

0

1

0 a 0 1 1

A

A

A

1 1 a a a

 

1

0

0

A A A A A

A

A

A

A A A A a

 

 

 

 

 

 

 

 

 

The definition for the field is:

displacement

aaaaaAAAAAAAAAAAAAAA0

20-bit signed PC relative displacement

(>label)

 

 

If the field was written out in the encoding table, it would appear as follows:

BSR >label

0

0

1

0

a20

0

1

1

A15

A14

A13

1

1

a19

a18

a17

 

1

0

0

A12

A11

A10

A9

A8

A7

A6

A5

A4

A3

A2

A1

a16

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A-6

SC140 DSP Core Reference Manual

Page 320
Image 320
Freescale Semiconductor SC140 specifications Data Representation in Memory for the Examples, Encoding Notation