User guide

11.2. MC LIBRARY FUNCTIONS 191
mcRK Two operands, R and K
mcAK Two operands, A and K
mcVK Two operands, V and K
mcGK Two operands, G and K
mcMK Two operands, M and K
mcLK Two operands, L and K
mcDK Two operands, D and K
mcDXK Two ope r ands , DX and K
mcDXsK Two operands, DXs and K
mcDXsBK Two operands, DXsB and K
mcKK Two integer operands
mcKKK Three integer operands
mcPRF One printf format string and one register
11.2 MC L i br a ry Functions
mcb := mcInit(maxfno, dsize, csize)
Create an instance of the MC package, allocating space for maxfno functions, dsize
words of data space and csize words of code space. The MC control block is as si gne d
to mcb.
mcSelect(mcb)
Select an instance of the MC package by assigning mcb to the global variable mc.
For efficiency reasons, mcSelect copies various field i n the control bl ock to global
variables. If mc was non zero, the pre v i ous setting of the globals are saved in the
previously selected MC instance. It is thus important to set mc to zero before the first
call od mcSelect.
res := mcCall(fno, a1, a2, a3)
Call the function with number fno giving it the three arguments a1, a2, a3. The
result is assigned to res. Function fno must have been defined to expect three argu-
ments.
mcClose()
Close the currently selected MC instance deleting all its workspace and compiled
code. It also sets mc to zero.
mcPRF(mess, reg)
This function is an invaluable debugging aid which compiles code to call the C
function printf with the given format string (packed in th e data area) and the value
of the spec i fie d register. All registers, including the condition code, are preser ved. The
register argument may be omitted if the format string requires no register argument.
Typical use of mcPRF is as follows:
mcRK(mc_mv, D, #x01234567)
mcRK(mc_mv, A, #x89ABCDEF)