.toc 伪操作

用途

定义模块的目录。

语法

.toc

描述

.toc 伪操作定义模块的目录 (TOC) 锚点。 可以使用 .toc 伪操作范围内的 .tc 伪操作来声明 TOC 部分中的条目。 .toc 伪操作的作用域类似于 .csect 伪操作的作用域。 只要出现 .toc , TOC 就可以在整个组合件中继续。

示例

以下示例说明如何使用 .toc 伪操作:


.toc
# Create two TOC entries. The first entry, named proga, 
# is of type TC and contains the address of proga[RW] and dataA.

# The second entry, named progb, is of type TC and contains 
# the address of progb[PR] and progc[PR].

T.proga:          .tc proga[TC],proga[RW],dataA
T.progb:          .tc progb[TC],progb[PR],progc[PR]

.csect proga[RW]

# A .csect should precede any statements following a .toc/.tc 
# section which do not belong in the TOC.

.long TOC[tc0]

# The address of the TOC for this module is placed in a fullword.