vector file

Started by John Lai February 28, 2004
Hello all,

I am a beginner and using chassaing's book. The kit I am using is C6711.
I appreciate if I can have feedback on a few basis questions:

Q1/ all interrupt driven programs must have a *.asm (eg. vector.asm file).
ie. If the program use polling, I don't really need *.asm file? I didn't copy
the *.asm file on a sample program and it works. That's why I ask.

Q2/ in chap1 of the above book, there is a sample vector file "vectors_11.asm"
I listed only the lines that I don't understand

.ref _c_int11; ISR used in C program
.ref _c_int00; entry address
.sect "vectors"; section for vectors
RESET_RST: mvkl .S2 _c_int00,B0 ;lower 16 bits->B0
mvkh .S2 _c_int00,B0 ;upper 16 bits->B0

The first line say I am going to use interrupt 11. For program using interrupt
other than interrupt 11, we just add another similar line. Judging from this
vectors_11.asm file, if needs does arise, can I use all the interrupt resources
INT4 to INT15 in 6711dsk?

The second line indicates the program entry address. Must all program starts at
this address?
I reference Table 3.1: Memory Map Summary. The first line of the table say:
Address Range(Hex) Size(Bytes) Description of Memory Block
0000 0000--0000 FFFF 64K Internal RAM(L2)

Does this answer my question--starting address always maps to the first 64K of
the Internal RAM?

What does the third line
.sec "vectors"

for the 4th line, we are mapping the address into the lower & upper 16 bits. Is
this the way to optimize the execution of the program? Ie. does it
automatically load all instructions into upper and lower bytes?
Does it mean 6711 is a 16 bit processor? I thought it is a 32 bit thing.

Thanks in advance,

Hi John,

          You are asking a lot of pointed (and good!) questions for a beginer! Anyways you will get a lot of wonderful and appropriate answers for all your questions from the experts...ill just a few things you really dint ask!

>.ref         _c_int11;      ISR used in C program

>.ref         _c_int00;      entry address

the .ref definitions here are similar to the C *extern* declaration...i.e you are saying here that you are *refering* to two symbols called C_int11 and C_int00 (possibly both the reference are for *branching to those interrupts at different points) which have been *defined* elsewhere(c_int11 shd be defined in your main C file and C_int00 definition is present in rts.lib)

>.sect      "vectors";      section for vectors

Vectors is a table usually referring to your interrupt vector table used for *keeping* a look-up for all the interrupt addresess that you are using in your program and the rest are all filled with nops. Note that vectors is not a *section* per-se, it is just a table, a name for a table which the system expects for interrupt driven programs.This table must go into the lowest address of the system.

>RESET_RST:  mvkl         .S2      _c_int00,B0   ;lower 16 bits->B0

>                  mvkh        .S2      _c_int00,B0   ;upper 16 bits->B0

C6x is a 32-bit machine.You are right abt that.But mvk can move only 16-bits! so you always use a pair of mvk's when you want to create pointers(because c6x is a 32 bit machine!).Note down that you should not do mvkh followed by mvkl for pointer creation.Or, on second thoughts,try and see, you shd get wrong results!

But, hey chassaing's book does explain all this!

Hope this helps!



Post Classifieds on MSN classifieds. Buy and Sell on MSN Classifieds.