User`s guide

12–6 PALcode Violation Checker
Labels
12.3.2 Handling Computed Gotos and Subroutine Branches
Another use of labels is to specify how PVC follows a computed goto or a subroutine
branch. This information cannot be extracted statically; therefore, labels are required
for instructions such as jump to subroutine (JSR) and return from subroutine (RET).
You can also instruct PVC to ignore a certain branch to optimize your PVC run.
12.3.2.1 Computed Gotos
When creating a label for a computed goto, you need one label that designates an
origin, and one or more labels that designate a destination target. All origin and
target pairs must have the same integer between 2000 and 3999 in the <num> field.
The <destination> field of the label is used to designate a target for the goto.
For example, in the .map file, the following is a goto origin:
pvc$osf0$3000 000053BC
The following is an example of target labels for the specified origin:
pvc$osf1$3000.1 000053C0
pvc$osf2$3000.2 000053D0
pvc$osf3$3000.3 000053E0
pvc$osf4$3000.4 000053F0
pvc$osf5$3000.5 00005400
pvc$osf6$3000.6 0000540C
In the following example, register 3 (r3) can have either of two target addresses,
10$ or 20$:
jsr r0, (r3)
halt
Target addresses and code are:
10$: subq r4, r5, r7
20$: subq r4, r6, r7
ret r31, (r0)
The following are examples of the appropriate use of labels:
pvc$x$2000:
jsr r0, (r3)
pvc$x$2001.1
pvc$x$2002.1:
halt
pvc$x$2000.1:
10$: subq r4, r5, r7
pvc$x$2001:
ret r31, (r0)