#CONT: Convert binary to character binary

Use this macro to generate inline code to convert a binary number in the low-order byte of a register to character binary. A character binary number is a binary number represented in a string that contains only EBCDIC 0 or 1.

Note: See Table 1 for a summary of all the conversion macros.

Last updated

  • Start of changeChanged in 2024 (information only; no code change).End of change
  • Changed for PUT11.
  • Changed for PUT08.
  • Changed for PUT07.
  • Changed for PUT05.
  • Changed for PUT00.

Format

Read syntax diagramSkip visual syntax diagram#CONT INPUT=R14INPUT= reg1,TO=R1,TO= reg2,ON=C'1',ON=C' onchar',OFF=C'0',OFF=C' offchar',WORK=CE1ARS,WORK= workarea
INPUT=reg1
Specifies a register, reg1, that contains the binary number to convert.
TO=reg2
Specifies a register, reg2, that points to the location that will contain the converted value.
ON=C'onchar'
Specifies the character used to represent binary 1 in the output string, where onchar is the character.
OFF=C'offchar'
Specifies the character used to represent binary 0 in the output string, where offchar is the character.
WORK=workarea
Specifies one of the following work areas based on the addressing mode:
  • A 5-byte work area in 31-bit addressing mode.
  • A 9-byte work area in 64-bit addressing mode.

Entry requirements

None.

Return conditions

  • The contents of reg1 are overwritten during the conversion process.
  • reg2 points to the next available byte following the output string.
  • Start of changeThe contents of the area referenced by the WORK parameter are unpredictable.End of change

Programming considerations

  • If AMODE=64 is coded on the BEGIN macro, all 8 bytes of a register are used.
  • For information about macro register conventions, see Assembler program register conventions.
  • You can specify the parameters for this macro in any order.
  • All labels used in the SPM conditional expression can be no more than 32 characters long. Any additional characters are truncated.

Examples

  • In the following example,
             L     R14,CONT0                     SET UP BINARY VALUE
             LA    R15,EBW000                    WHERE TO PLACE
             #CONT INPUT=R14,TO=R15,ON='1',OFF=C'0',WORK=CE1ARS
              :
    CONT0    DC    F'43'                         BINARY VALUE (X'2B')
    
  • In the following example,
             L     R14,CONT1                     SET UP BINARY VALUE
             LA    R15,EBW030                    WHERE TO PLACE
             #CONT INPUT=R14,TO=R15              LOW-ORDER BYTE TO BINARY
              :
    CONT1    DC   X'ABF1FF23'                   BINARY VALUE
    
  • In the following example:
             L     R4,CONT2                      SET UP BINARY VALUE
             LA    R15,EBW010                    WHERE TO PLACE
             #CONT INPUT=R14,TO=R15,ON=C'*',OFF=C'-' LOW-ORDER BYTE TO BINARY
              :
    CONT2    DC    F'241'                        BINARY VALUE (X'F1')