![Texas Instruments TMS320C80 Скачать руководство пользователя страница 34](http://html.mh-extra.com/html/texas-instruments/tms320c80/tms320c80_user-manual_1094755034.webp)
Obtaining Device-Specific Information
2-4
TMS320C80 to TMS320C82 Software Compatibility User’s Guide
2.2.3 Initializing a PP’s Stack Pointer
The PP’s initialization software may need to set the SP to its initial
value at some time other than immediately after reset. This initial
value differs between the ’C80 and ’C82.
One way to initialize the SP is to load it with a PP-relative address
constant whose value is specified at link time. If the stack is to be-
gin in different locations in the ’C80 and ’C82, however, this ap-
proach requires that separately linked object modules be pro-
vided to run on the ’C80 and ’C82.
An approach that does not have this drawback is to link together
a single object code module that determines at run time whether
it is running on a ’C80 or ’C82 and then sets up the stack accord-
ingly. Typically, the software would set the SP to the same value
it would have immediately following reset. This value is
0100#7F0h on the ’C80 and to 0100#FF0h on the ’C82 (the # sign
represents the PP number).
Example 2–1 shows a four-instruction code segment, written in
PP assembly language, that sets a PP’s stack pointer and comm
registers to their initial values. The program reads the M bit in the
comm register to determine whether it is running on a ’C80 or a
’C82.
Example 2–1.Initializing a PP’s Stack Pointer and Comm registers
; Sample code for initializing a PP’s stack pointer (SP)
; and comm registers to their initial values
;
; For the ’C80, the code initializes the SP to 0100#7f0h.
; For the ’C82, the code initializes the SP to 0100#ff0h.
;
; The # symbol in the previous addresses represents the
; hexadecimal digit that is set to the PP number by the
; first instruction; the first instruction uses the
; keyword pba to specify a PP-relative parameter-RAM
; address offset.
;
;
a7 = &*(sp = pba + 0x7F0) ; initialize SP for ’C80
comm = 0 ; fix for ’C80 revs 1–3
a7 = comm & (1 \\ 8) ; is this a ’C80 or a ’C82?
sp = [nz] sp | (1 \\ 11) ; if ’C82, modify initial SP
Содержание TMS320C80
Страница 1: ...TMS320C80 to TMS320C82 Software Compatibility User s Guide 1995 Digital Signal Processing Products ...
Страница 2: ...SPRU154 Printed in U S A November 1995 M418017 9741 revision ...
Страница 8: ...vi TMS320C80 to TMS320C82 Software Compatibility User s Guide ...
Страница 16: ...xiv TMS320C80 to TMS320C82 Software Compatibility User s Guide ...
Страница 30: ...1 14 TMS320C80 to TMS320C82 Software Compatibility User s Guide ...
Страница 40: ...2 10 TMS320C80 to TMS320C82 Software Compatibility User s Guide ...
Страница 64: ...A 6 TMS320C80 to TMS320C82 Software Compatibility User s Guide ...