!
! ebcdic - translate table for ascii-ebcdic conversion and back for
!		talking to ebcdic machines
!
!	10/03/86 - Original	T. L.
!

*       input is ebcdic, use hex codes to avoid munging self

!	\x00-\x03 same			! NUL SOH STX ETX
trans input "\x05" "\x09"
trans input "\x07" "\x7f"
!	\x0c-\x13 same			! FF  CR  SO  SI  DLE DC1 DC2 DC3
trans input "\x16" "\x08"
!	\x18-\x19 same			! CAN EM
!	\x1c-\x1f same			! FS  GS  RS  US
trans input "\x25" "\x0a"
trans input "\x26" "\x17"
trans input "\x27" "\x1b"
trans input "\x2d-\x2f" "\x05-\x07"
trans input "\x32" "\x16"
trans input "\x37" "\x04"
trans input "\x3c-\x3d" "\x14-\x15"
trans input "\x3f" "\x1a"
trans input "\x40" "\x20"
trans input "\x4a" "\x5b"
trans input "\x4b" "\x2e"
trans input "\x4c" "\x3c"
trans input "\x4d" "\x28"
trans input "\x4e" "\x2b"
trans input "\x4f" "\x7c"
trans input "\x50" "\x26"
trans input "\x5a" "\x5d"
trans input "\x5b" "\x24"
trans input "\x5c" "\x2a"
trans input "\x5d" "\x29"
trans input "\x5e" "\x3b"
trans input "\x5f" "\x00"
trans input "\x60" "\x2d"
trans input "\x61" "\x2f"
trans input "\x6a" "\x00"
trans input "\x6b" "\x2c"
trans input "\x6c" "\x25"
trans input "\x6d" "\x5f"
trans input "\x6e" "\x3e"
trans input "\x6f" "\x3f"
trans input "\x7a" "\x3a"
trans input "\x7b" "\x23"
trans input "\x7c" "\x40"
trans input "\x7d" "\x27"
trans input "\x7e" "\x3d"
trans input "\x7f" "\x22"
trans input "\x81-\x89" "\x61-\x69"
trans input "\x91-\x99" "\x6a-\x72"
trans input "\xa1" "\x7e"
trans input "\xa2-\xa9" "\x73-\x7a"
trans input "\xc0" "\x7b"
trans input "\xc1-\xc9" "\x41-\x49"
trans input "\xd0" "\x7d"
trans input "\xd1-\xd9" "\x4a-\x52"
trans input "\xe0" "\x5c"
trans input "\xe2-\xe9" "\x53-\x5a"
trans input "\xf0-\xf9" "\x30-\x39"

*       output is ebcdic, use hex codes to avoid munging self

!	\x00-\x03 same			! NUL SOH STX ETX
trans output "\x09" "\x05"
trans output "\x7f" "\x07"
!	\x0c-\x13 same	
trans output "\x08" "\x16"
!	\x18-\x19 same
!	\x1c-\x1f same
trans output "\x0a" "\x25"
trans output "\x17" "\x26"
trans output "\x1b" "\x27"
trans output "\x05-\x07" "\x2d-\x2f"
trans output "\x16" "\x32"
trans output "\x04" "\x37"
trans output "\x14-\x15" "\x3c-\x3d"
trans output "\x1a" "\x3f"
trans output "\x20" "\x40"
trans output "\x5b" "\x4a"
trans output "\x2e" "\x4b"
trans output "\x3c" "\x4c"
trans output "\x28" "\x4d"
trans output "\x2b" "\x4e"
trans output "\x7c" "\x4f"
trans output "\x26" "\x50"
trans output "\x5d" "\x5a"
trans output "\x24" "\x5b"
trans output "\x2a" "\x5c"
trans output "\x29" "\x5d"
trans output "\x3b" "\x5e"
trans output "\x00" "\x5f"
trans output "\x2d" "\x60"
trans output "\x2f" "\x61"
trans output "\x00" "\x6a"
trans output "\x2c" "\x6b"
trans output "\x25" "\x6c"
trans output "\x5f" "\x6d"
trans output "\x3e" "\x6e"
trans output "\x3f" "\x6f"
trans output "\x3a" "\x7a"
trans output "\x23" "\x7b"
trans output "\x40" "\x7c"
trans output "\x27" "\x7d"
trans output "\x3d" "\x7e"
trans output "\x22" "\x7f"
trans output "\x61-\x69" "\x81-\x89"
trans output "\x6a-\x72" "\x91-\x99"
trans output "\x7e" "\xa1"
trans output "\x73-\x7a" "\xa2-\xa9"
trans output "\x7b" "\xc0"
trans output "\x41-\x49" "\xc1-\xc9"
trans output "\x7d" "\xd0"
trans output "\x4a-\x52" "\xd1-\xd9"
trans output "\x5c" "\xe0"
trans output "\x53-\x5a" "\xe2-\xe9"
trans output "\x30-\x39" "\xf0-\xf9"

!
! Now don't ignore the eighth bit (parity bit) because EBCDIC uses it
!

protocol binary

!
! we're done
!
