User guide
9.2. THE CINTCODE INSTRUCTION SET 159
command. The use of a 16 bit resol v i ng word places a slight restriction on the maximum
size of relative references. Any Cintcode module of less than 64K bytes will have no
problem.
9.2 The C intcode Instruction Set
The resulting selection of function codes is shown in Table 9.2 and they are described
in the sections that follow. In the remaining sections of this chapter the foll owing
conventions hold:
Symbol
Meaning
n An integer encoded in the function byte.
Ln
The one byte operand of a relative addressing instruction.
b
An unsigned byte, range 0 ≤ b ≤ 255.
h
An unsigned halfword, range 0 ≤ h ≤ 65535.
w
A signed 32 bit word.
filler
Optional filler by t e to round up to a 16 bit boundary.
A
The Cintcode A register.
B
The Cintcode B register.
C
The Cintcode C register.
P
The Cintcode P register.
G
The Cintcode G register.
PC
The Cintcode PC register.
MW
The Cintcode MW register used in 64-bit Cintcode.
9.2.1 Byte Ordering and Alignment
A Cintcode module is a vector of 32 bit words containing the compiled code and static
data of a section of program. The first word of a module holds its size in words th at
is used as a relative address to the end of the module where the global initialisation
data is placed. The last word of a module holds the highest referenced global number,
and working back, there are pairs of words giving the global number and relative entry
address of each global function or label defined i n t he module. A relative address of
zero marks the end of the initialisation data. See section 8.3 for more details.
The compiler can ge ne r ate co d e for either a big- or little-endian machine. These
differ onl y in the byte ordering of bytes within words. For a little endian machine, the
first byte of a 32 bit word is at the least significant end, and on a big-endian machine, it
is the most signific ant byte. This affect th e ordering of bytes in 2 and 4 byte immediate
operands, 2 byte relative address resolving words, 4 byte static quantities and global
initialisation data. Resolving words are ali gne d on 16 bit boundaries relative to the
start of the module, and 4 byte statics values are aligned on 32 bit boundaries. The 2
and 4 byte immediate operands are not ali gne d.
For efficiency reasons, the byte orde r i ng i s chosen to sui t the machine on whi ch the
code is to be interpreted. The compiler option OENDER cause s the BCPL compiler to