<< Chapter < Page Chapter >> Page >

Then, the first address of the reserved 128 bytes is at the word boundary in memory, that is the 2 LSBs of the address (inbinary) are 0. Similarly, for half-word alignment, you should have .align directive to do this. For example, if you have

1 .align 2 2 buffer .space 1283 ...

The .include directive is used to read the source lines from another file. If you have

1 .include ``other.asm''

will input the lines in other.asm at this location. This is useful when working with multiple files.Instead of making a project having multiple files, you can simply include these different files in one file.

Other assembler directives include .end , etc. You will learn about the macro directives .macro, .endm later.

How do you write comments in your assembly program? Anything that follows ; is considered as a comment and ignored by the assembler. For example,

1 ; this is a comment 2 ADD .L1 A1,A2,A3 ;add a1 and a2

Assigning functional units

Each instruction has particular functional units that can execute it. For a complete list of the instructions that can beexecuted in each functional unit, see Table 3-2 in the instruction set manual. Note that some instructions can beexecuted by several different functional units.

shows how data and addresses can be transfered between the registers, functionalunits and the external memory. If you observe carefully, the destination path (marked as dst ) going out of the .L1, .S1, .M1 and D1 units are connected to the register file A.

This means that any instruction with one of the A registers as destination (the result of operation is stored in one ofA registers) should be executed in one of these 4 functional units.
For the same reason, if the instructions have B registers as destination, the .L2, .S2, .M2 and D2 units should be used.

Therefore if you know the instruction and the destination register, you should be able to assign the functional unit toit.

(Functional units): List all the functional units you can assign to each of these instructions:

  • ADD .?? A0,A1,A2
  • B .?? A1
  • MVKL .?? 000023feh, B0
  • LDW .?? *A10, A3

Intentionally left blank.

If you look at again, each functional unit must receive one of the source data from thecorresponding register file.For example, look at the following assembly instruction:

1 ADD .L1 A0,B0,A1

The .L1 unit gets data from A0 (this is natural) and B0 (this is not) and stores the result in A1 (this is a must). The data path through which the content of B0 is conveyed to the .L1 unit is called 1X cross path . When this happens, we add x to the functional unit to designate the cross path:

1 ADD .L1x A0,B0,A1

Similarly the data path from register file B to the .M2, .S2 and .L2 units are called 2X cross path.

(Cross path): List all the functional units that can be assigned to each of the instruction:

  • ADD .??? B0,A1,B2
  • MPY .??? A1,B2,A4

Intentionally left blank.

In fact, when you write an assembly program, you can omit the functional unit assignment altogether. The assembler figuresout the available functional units and properly assigns them. However, manually assigned functional units help you to figureout where the actual execution takes place and how the data move around between register files and functional units. Thisis particularly useful when you put multiple instructions in parallel. We will learn about the parallel instructions lateron.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Finite impulse response. OpenStax CNX. Feb 16, 2004 Download for free at http://cnx.org/content/col10226/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Finite impulse response' conversation and receive update notifications?

Ask