The commands listed in Table 4-9 perform address arithmetic.
Table 4-9 Address Arithmetic Functions|
Command |
Stack Diagram |
Description |
|---|---|---|
| aligned |
( n1 -- n1 | a-addr) |
Increase n1 if necessary to yield a variable aligned address. |
| /c |
( -- n ) |
The number of address units to a byte: 1. |
| /c* |
( nu1 -- nu2 ) |
Synonym for chars. |
| ca+ |
( addr1 index -- addr2 ) |
Increment addr1 by index times the value of /c. |
| ca1+ |
( addr1 -- addr2 ) |
Synonym for char+. |
| cell+ |
( addr1 -- addr2 ) |
Increment addr1 by the value of /n. |
| cells |
( nu1 -- nu2 ) |
Multiply nu1 by the value of /n. |
| char+ |
( addr1 -- addr2 ) |
Increment addr1 by the value of /c. |
| chars |
( nu1 -- nu2 ) |
Multiply nu1 by the value of /c. |
| /l |
( -- n ) |
Number of address units to a quadlet; typically 4. |
| /l* |
( nu1 -- nu2 ) |
Multiply nu1 by the value of /l. |
| la+ |
( addr1 index -- addr2 ) |
Increment addr1 by index times the value of /l. |
| la1+ |
( addr1 -- addr2 ) |
Increment addr1 by the value of /l. |
| /n |
( -- n ) |
Number of address units in a cell. |
| /n* |
( nu1 -- nu2 ) |
Synonym for cells. |
| na+ |
( addr1 index -- addr2 ) |
Increment addr1 by index times the value of /n. |
| na1+ |
( addr1 -- addr2 ) |
Synonym for cell+. |
| /w |
( -- n ) |
Number of address units to a doublet; typically 2. |
| /w* |
( nu1 -- nu2 ) |
Multiply nu1 by the value of /w. |
| wa+ |
( addr1 index -- addr2 ) |
Increment addr1 by index times the value of /w. |
| wa1+ |
( addr1 -- addr2 ) |
Increment addr1 by the value of /w. |
The address arithmetic commands listed in Table 4-10 are available only on 64-bit OpenBoot implementations.
Table 4-10 64-Bit Address Arithmetic Functions|
Command |
Stack Diagram |
Description |
|---|---|---|
| /x |
( -- n ) |
Number of address units in an octlet, typically eight. |
| /x* |
( nu1 -- nu2 ) |
Multiply nu1 by the value of /x. |
| xa+ |
( addr1 index -- addr2 ) |
Increment addr1 by index times the value of /x. |
| xa1+ |
( addr1 -- addr2 ) |
Increment addr1 by the value of /x. |