User's Manual
PMAC Dual-Ported RAM User Manual
Dual-Ported RAM Automatic Functions 11
DUAL-PORTED RAM AUTOMATIC FUNCTIONS
PMAC provides many facilities for using the dual-ported RAM (DPRAM) to pass information back and
forth between the host computer and PMAC. These facilities are comprised of the following functions:
• DPRAM Control Panel Function (Host to PMAC)
• DPRAM Servo Data Reporting Function (PMAC to Host)
• DPRAM Background Fixed Data Reporting Function (PMAC to Host)
• DPRAM Background Variable Data Reporting Function (PMAC to Host)
• DPRAM ASCII Communications Buffer (Bi-directional)
• DPRAM Binary Rotary Program Buffer (Host to PMAC)
• DPRAM Data Gathering Buffer (PMAC to Host -- already existing)
• DPRAM <CONTROL-W> ASCII Command Function (Host to PMAC -- superseded by DPRAM
ASCII Communications)
In addition to these automatic functions, the user is free to access otherwise unused registers in the
DPRAM through the use of M-variables on the PMAC side, and through pointer variables on the host side,
for sending data either way between the host and PMAC.
Each of the automatic functions is described in detail below.
Note:
In listing memory locations, both the host memory address and the PMAC memory
address will be given. The host address is given as an offset from the base address
of the DPRAM in the host memory space; it is expressed in standard C-language
hexadecimal notation (e.g. 0x1F80). The PMAC address is given in parentheses as
an absolute location in PMAC memory; it is expressed in the standard PMAC
hexadecimal notation (e.g. X:$D008)
DPRAM Data Format
Long-format data is stored in the DPRAM in 32-bit sign-extended form. That is, each short (24-bit) from
PMAC is sign-extended and stored in 32 bits of DPRAM. The most significant byte is all ones or all
zeros, matching bit 23. Each long (48-bit) word is treated as 2 24-bit words, with each short word sign-
extended to 32 bits. The host computer must re-assemble these words into a single value. The data
appears in the DPRAM in Intel format: the less significant bytes and words appear in the lower-numbered
addresses.
To reassemble a long fixed-point word in the host, take the less significant 32-bit word, and mask out the
sign extension (top eight bits). In C, this operation could be done with a bit-by- bit AND: (LSW and
16777215). Treat this result as an unsigned integer. Next, take the more significant word and multiply it
by 16,777,216. Finally, add the two intermediate results together.
To reassemble a long floating-point word in the host, treat the less significant word the same as for the
fixed-point case above. Take the bottom 12 bits of the more significant word (MSW and 4095), multiply
by 16,777,216 and add to the masked less significant word. This forms the mantissa of the floating-point
value. Now take the next 12 bits (MSW and 16773120) of the more significant word. This is the exponent
to the power of two, which can be combined with the mantissa to form the complete value.