Decimal instructions
Hardware packed-decimal instructions are available to C/C++ programs in the form of built-in functions. These hardware built-in functions are intended to provide access to decimal instructions that are not normally generated by the compiler.
Decimal instructions of SS format carry one or two length fields.
Each length field is encoded with a binary length, that is the actual
length - 1. In the function prototypes, the length parameters need
to be specified as the actual length - 1. Argument names and order
reflects the description of the hardware instructions in z/Architecture® Principles of Operation (that
is, op1
, op2
, op3
, etc.) Additional
arguments provide required information for setting up the actual hardware
instruction. For detailed description of each decimal instruction,
see Chapter 8. Decimal Instructions of the z/Architecture Principles of Operation.
If you want to use any of the decimal functions, your program must
include builtins.h
and be compiled with either the LANGLVL(EXTENDED)
option or the LANGLVL(LIBEXT) option.
PROTOTYPE and Notes | Sample Pseudo Assembly | MIN ARCH |
---|---|---|
int __ap (unsigned char *op1, unsigned
char len1, unsigned char *op2, unsigned char len2 );
Operands:
The return value is the condition code set by the AP instruction. |
AP Op1D(len1, Op1B), Op2D(len2, Op2B) |
ARCH(0) |
int __cp (unsigned char *op1, unsigned
char len1, unsigned char *op2, unsigned char len2 );
Operands:
The return value is the condition code set by the CP instruction. |
CP Op1D(len1, Op1B), Op2D(len2, Op2B) |
ARCH(0) |
void __dp (unsigned char *op1, unsigned
char len1, unsigned char *op2, unsigned char len2 );
Operands:
|
DP Op1D(len1, Op1B), Op2D(len2, Op2B) |
ARCH(0) |
int __ed (unsigned
char *OP1, unsigned char *OP2, unsigned char length);
Operands:
The return value is the condition code. |
ED Op1D(len,Op1B), Op2D(Op2B) |
ARCH(0) |
int __edmk (unsigned
char *OP1, unsigned char *OP2, unsigned char length, unsigned char
**R1);
Operands:
The return value is the condition code. |
EDMK Op1D(len,Op1B), Op2D(Op2B) |
ARCH(0) |
void __mp (unsigned char *op1, unsigned
char len1, unsigned char *op2, unsigned char len2 );
Operands:
|
MP Op1D(len1, Op1B), Op2D(len2, Op2B) |
ARCH(0) |
int __sp (unsigned char *op1, unsigned
char len1, unsigned char *op2, unsigned char len2 );
Operands:
The return value is the condition code set by the SP instruction. |
SP Op1D(len1, Op1B), Op2D(len2, Op2B) |
ARCH(0) |
int __srp (unsigned char *op1, unsigned
char len1, signed char op2, unsigned char op3 );
Operands:
The return value is the condition code set by the SRP instruction. |
SRP Op1D(len1, Op1B), Op2D(Op2B), Op3 |
ARCH(0) |
int __tp(char *op1, unsigned char op1_len);
Operands:
The return value is the condition code set by the TP instruction. |
TP Op1D(Op1_len, Op1B) |
ARCH(6) |
int __zap (unsigned char
*op1, unsigned char len1, unsigned char *op2, unsigned char len2 );
Operands:
The return value is the condition code set by the ZAP instruction. |
ZAP Op1D(len1, Op1B), Op2D(len2, Op2B) |
ARCH(0) |