I said earlier that up to three arguments can be passed to a machine language function in the HL, DE, and BC register pairs. It is important to note that the value of the argument is not passed to the machine language function but rather a pointer to its internal representation. To interpret the arguments, you must understand how data is represented internally in muLISP. The following information is taken from Section II of the muLISP Reference Manual.
muLISP recognizes three primitive data types: names, numbers, and nodes. Each has a different internal representation. To simplify the machine language functions, I have restricted them to accept and return numbers only. Note that this does not restrict their generality, since any data type can be transmitted as a sequence of numbers. I will confine my attention here to the numbers data type and merely note that the other data types have a similar representation. Those interested in further details should see Section II of the muLISP manual.
A number (in muLISP) consists of
Dr. Dobb’s Journal, November 1984
OO
three consecutive pointers:
number eee vector
A pointer is a 16-bit value (2 bytes) that contains a memory address—a pointer to another location. The first pointer (number) points to itself; that is, it contains its own address. The second pointer or cell (sign) indicates whether the number is positive or negative. The third cell (vector) points to the machine representation of the numerical value of the number.
In contrast to most languages, integers in muLISP are not confined to 16or 32-bit values. In fact, numbers up to approximately 10°'! can be represented exactly by allowing the length of the binary representation of a number to be arbitrary and including the length in that representation. The machine representation of the numerical value of a number consists of a single-byte byte counter preceded by the number of bytes required to express the number in binary (including the byte counter). The vector cell is a pointer to this in binary representation—in fact it points to the byte counter. Contrary to the manual, the byte counter follows rather than precedes the bit vector, which itself is stored most significant bit first. The number zero is a special case; it is represented by a single byte, the byte counter, which has the value one.
The argument that is passed to a machine language function in one of the register pairs (assuming a numerical argument) is a pointer to the number cell of the internal representation of the number. For example, suppose that the first argument is the value six. Then the register pair (HL) will point to a muLISP number that has the value six. The internal representation of this is depicted in Figure 4 (page 22).