These types of instructions are not allowed in .cproc or .proc topic regions:
- The stack pointer (register B15) can be read, but cannot be written to.
Instructions that write to B15 are not allowed in .proc or .cproc regions. Stack
space can be allocated by the assembly optimizer in .proc or .cproc regions to
store temporary values. To allocate this storage area, the stack pointer is
decremented on entry to the region and incremented on exit from the region.
Since the stack pointer can change value on entry to the region, the assembly
optimizer does not allow code that changes the stack pointer register.
- Indirect branches are not allowed in a .proc or .cproc region so that the .proc or .cproc region exit protocols cannot be bypassed. Here is an example of an indirect branch:
B B4<= illegal
- Direct branches to labels not defined in the .proc or .cproc region are not allowed so that the .proc or .cproc region exit protocols cannot be bypassed. Here is an example of a direct branch outside of a .proc region:
.proc
...
B outside = illegal
.endproc
outside:
- Direct branches to the label associated with a .proc directive are not allowed. If you require a branch back to the start of the linear assembly function, then use the .call directive. Here is an example of a direct branch to the label of a .proc directive:
_func: .proc
...
B _func <= illegal
...
.endproc
- An .if/.endif loop must be entirely inside or outside of a proc or .cproc region. It is not allowed to have part of an .if/.endif loop inside of a .proc or .cproc region and the other part of the .if/.endif loop outside of the .proc or .cproc region. Here are two examples of legal .if/.endif loops. The first loop is outside a .cproc region, the second loop is inside a .proc region:
.if
.cproc
...
.endproc
.endif
.proc
.if
...
.endif
.endproc
These illegal example .if/.endif loops are partly inside and partly outside .cproc or .proc regions:
.if
.cproc
.endif
.endproc
.proc
.if
...
.else
.endproc
.endif
- The following assembly instructions cannot be used from linear assembly:
- EFI
- SPLOOP, SPLOOPD and SPLOOPW and all other loop-buffer related instructions
- ADDKSP and DP-relative addressing