This general macro converts the time of day from a 2-byte binary
representation to a 5-byte EBCDIC representation, or vice versa. The
EBCDIC time may be based on either the 12- or 24-hour clock.
Format
- label
- A symbolic name can be assigned to the macro statement.
- MODE=BCDBIN
- EBCDIC time is converted to binary. This is the default if MODE is
omitted.
- INPUT=address
- For MODE=BCDBIN, this is the symbolic address of a 5-byte field (no
alignment necessary) which contains the following.
- Bytes 0-1 - EBCDIC hour
- Bytes 2-3 - EBCDIC minutes
- Byte 4 (12-hour clock only) - an alpha character indicating AM(A),
NOON(N), PM(P), or MIDNIGHT(M). 1200A is treated as midnight and 1200P
is treated as noon.
- OUTPUT=address
- For MODE=BCDBIN, this is the symbolic address of a 2-byte field (no
alignment necessary) which will contain the following upon return from this
macro.
- Byte 0 - binary representation of hour of 24-hour clock. (Midnight
is returned as X'00'.)
- Byte 1 - binary representation of minutes.
- MODE=BINBCD
- Binary time is converted to EBCDIC.
- INPUT=address
- For MODE=BINBCD, this is the symbolic address of a 2-byte field (no
alignment necessary) which contains the following.
- Byte 0 - binary representation of hour of 24-hour clock.
- Byte 1 - binary representation of minutes.
- OUTPUT=address
- For MODE=BINBCD, this is the symbolic address of a 5-byte field (no
alignment necessary) which will contain the following upon return from this
macro.
- Bytes 0-1 - EBCDIC hour in either 12- or 24-hour clock format as
requested.
- Bytes 2-3 - EBCDIC minutes.
- Byte 4 (12-hour clock only) - an alpha character indicating AM(A),
NOON(N), or PM(P). NOON(N) is considered 1200 only. For example,
one minute after noon will be returned as 1201P.
- HOUR
- The EBCDIC clock format of the INPUT time for BCDBIN or the OUTPUT time
for BINBCD.
- X12
- Indicates 12 hour format.
- X24
- Indicates 24-hour format.
X12 is the default if HOUR is omitted.
- REG=Rx|R2
- This is a general register that can be used by TYCVA. If omitted,
the default is R2. (R0 is not valid for this parameter.)
- WORK=address
- The symbolic address of an 8-byte field aligned on a doubleword
boundary.
Entry Requirements
None.
Return Conditions
- Control is returned to the next sequential instruction.
- The contents of the register specified in REG are unknown. The
contents of all other registers are preserved across this macro call.
- The converted time will be placed in the field referenced by
OUTPUT.
- When converting EBCDIC to binary, an alpha character other than P or M is
treated as A (AM).
Programming Considerations
- This macro can be executed on any I-stream.
- The INPUT field is not altered at macro completion.
- The OUTPUT field will contain the converted time at macro
completion.
- WORK and REG are used as work areas by TYCVA. Their contents are
unknown at macro completion.
Examples
ANYNAME TYCVA MODE=BCDBIN,INPUT=EBW010,OUTPUT=EBW015,
WORK=EBW024,REG=R3,HOUR=X12