;
TN3270DEF.MAR EBCDIC to DEC multinational character set translation table
.TITLE TN3270DEF Translation Tables
.IDENT /V01.01/
;
; ****************************************************************************
; * *
; * Copyright (c) 1993 *
; * by DIGITAL Equipment Corporation, Maynard, Mass. *
; * *
; * This software is furnished under a license and may be used and copied *
; * only in accordance with the terms of such license and with the *
; * inclusion of the above copyright notice. This software or any other *
; * copies thereof may not be provided or otherwise made available to any *
; * other person. No title to and ownership of the software is hereby *
; * transferred. *
; * *
; * The information in this software is subject to change without notice *
; * and should not be construed as a commitment by DIGITAL Equipment *
; * Corporation. *
; * *
; * DIGITAL assumes no responsibility for the use or reliability of its *
; * software on equipment which is not supplied by DIGITAL. *
; * *
; ****************************************************************************
;
;++
;
; FACILITY: UCX
;
; ABSTRACT: This is the file for generating
; an EBCDIC to DEC multi national and
; DEC multi national to EBCDIC
; translation table
;
; ENVIRONMENT: VAX/VMS
;
; AUTHOR: John Borchek
;
; CREATION DATE: 31-Jan-1993
;
; Mod history:
; V01.01 Gabriel Shapira 28-May-1993
; Modified comments to explain the file usage
;
;--
;+
;
; Loadable Translation Tables
;
;
; This file contains a 256 byte EBCDIC to DEC multinational character set (DMCS)
; and 256 byte DMCS to EBCDIC translation table. The translation tables
; are as per ANSI X3.26 1970. There is one exception, code hex FF translates
; to code hex FF in both tables. All characters in the top half of the
; DMCS set (128-255) translate to the EBCDIC SUB character (Hex 3F). No
; EBCDIC characters translate to a character in the top half of the DCMS
; table. All unnassigned EBCDIC characters translate to the DMCS/ASCII
; fill character. This character is defined in this file by assigning
; its value to a symbol DMFILL eg
; DMFILL = 45.
; will make backslash ('-') the substitution character. If you do not
; specify a value for DMFILL it defaults to 92. ('\') the fill character
; defined by ANSII X3.26 - 1970.
;
; This file alters the above two tables by the use of the following
; three macros
;
;
; REVTRA (Fully REVersible TRAnslation)
; -------------------------------------
;
; This macro overlays an entry in the EBCDIC to DMCS and DMCS to EBCDIC
; translation tables. The macro is invoked as follows
;
; REVTRA EB, AS ; Comment
;
; EB is the code for the EBCDIC character, AS is the code for the DMCS
; character. EB is specified as a 1 or 2 digit hex number. AS is specified as
; a 1 or 2 digit HEX number or by the 2 character sequence 'x where x is the
; DMCS character. The second method of specifying EB can only be used for
; printable ASCII characters. The result of using this macro is that the EBCDIC
; character EB translates to the DMCS character AS and the DMCS character AS
; translates to the EBCDIC character EB. Thus fully reversible translation is
; provided for this character pair. This macro is recommended in preference to
; the following two macros. The macros EB2AS and AS2EB should only be used if
; non reversible translation is desired.
;
; Examples
;
; REVTRA 4A, A2 ; EBCDIC cent sign <--> DMCS cent sign
; REVTRA 5A, '! ; EBCDIC exclamation mark <--> DMCS exclamation
; ; mark
;
;
; EB2AS (EBCDIC to DMCS translation)
; ----------------------------------
;
; This macro changes an entry in the EBCDIC to DMCS table but not the DMCS
; to EBCDIC table. The macro is invoked as follows
;
; EB2AS EB, AS
;
; The arguments are as per REVTRA.
;
; Examples
;
; EB2AS 4A, A2 ; EBCDIC cent sign --> DMCS cent sign
; EB2AS 5A, '! ; EBCDIC exclamation mark --> DMCS exclamation
; ; mark
;
;
; AS2EB (DMCS to EBCDIC translation)
; ----------------------------------
;
; This macro changes an entry in the DMCS to EBCDIC table but not the EBCDIC
; to DMCS table. The macro is invoked as follows
;
; AS2EB AS, EB ; Comment
;
; The arguments are as per REVTRA.
;
; Examples
;
; AS2EB A2, 4A ; DMCS cent sign --> EBCDIC cent sign
; AS2EB '!, 5A ; DMCS exclamation mark --> EBCDIC exclamation
; ; mark
;
; This file is edited to produce a loadable translation table for the
; UCX TELNET/TN3270 client software. To produce a loadable translation
; table follow the procedure outlined below.
;
; Procedure for producing a loadable translation table
; ----------------------------------------------------
;
; 1) Create the translation table:
; Take a copy of this file and insert calls to the macros REVTRA, EB2AS
; and/or AS2EB at the end of this file just before the .END statement. The
; following assumes that you have called the copy of this file TN3270DEF.MAR
; and that it is in your current default directory.
;
; 2) Assemble this file:
; $ MACRO/LIST TN3270DEF
;
; 3) Link:
; Link TN3270DEF.OBJ, it does not matter how you link TN3270DEF as long as the
; image is produced with a header. The smallest file is produced with the
; following command:-
; $ LINK/SYSTEM/HEADER TN3270DEF
;
; If you wish you can use the command $ LINK TN3270DEF, this will produce the
; warning error that there is no user transfer address. You can ignore this
; error since you will never be running the image! $ LINK/SHARE TN3270DEF also
; works.
;
; 4) Copy the resultant image to a place where it is accessible to
; everybody that wants to use it. If you wish to make it the default
; translation table for UCX TELNET/TN3270 client do the following.
;
; $ COPY TN3270DEF.EXE SYS$LIBRARY:TN3270DEF.TBL
;
.NLIST
;
; Declare MAC$32 if this is the
; VMS assembler
;
.IIF EQ, <10/2>-5, MAC$32 = 0
.IIF NDF MAC$32, .ENABL LC
.LIST MEB
.SBTTL Macro definitions
;
; Convert 1 or 2 hex characters
; to a hex byte
;
.MACRO .HEX VAL
.NLIST
.DSABL CRF
.NCHR LEN,
.IF DF, MAC$32
HEXVAL = ^X
.IFF
HEXVAL = 0
.NCHR .HEX0,
.HEX1 = 0
.IRPC X,
.HEX2 = 16.
.IIF IDN ,<0>, .HEX2 = 0
.IIF IDN ,<1>, .HEX2 = 1
.IIF IDN ,<2>, .HEX2 = 2
.IIF IDN ,<3>, .HEX2 = 3
.IIF IDN ,<4>, .HEX2 = 4
.IIF IDN ,<5>, .HEX2 = 5
.IIF IDN ,<6>, .HEX2 = 6
.IIF IDN ,<7>, .HEX2 = 7
.IIF IDN ,<8>, .HEX2 = 8.
.IIF IDN ,<9>, .HEX2 = 9.
.IIF IDN ,, .HEX2 = 10.
.IIF IDN ,, .HEX2 = 11.
.IIF IDN ,, .HEX2 = 12.
.IIF IDN ,, .HEX2 = 13.
.IIF IDN ,, .HEX2 = 14.
.IIF IDN ,, .HEX2 = 15.
.IF GT .HEX2-15.
.ERROR ; Invalid HEX character
.MEXIT
.ENDC
.IF EQ .HEX1
.HEX3 = .HEX2
.HEX1 = 1
.IFF
.HEX1 = 0
.HEX2 = <.HEX3*16.>+.HEX2
.ENDC
.ENDR
HEXVAL = .HEX2
.ENDC
.ENABL CRF
.LIST
.ENDM .HEX
;
; Calculate a value from a string argument
;
.MACRO .VAL STR
VALUE = 0
.NCHR LEN,
.IF NE, LEN-1
.IF NE, LEN-2
.ERROR ; Invalid argument, only 1 or 2 characters allowed
.MEXIT
.ENDC
.ENDC
CHRNUM = 0
ITSHEX = 1
.IRPC X,
CHRNUM = CHRNUM + 1
.IF EQ, CHRNUM - 1
.IF DF MAC$32
.IIF EQ APOS - ^A/X/, ITSHEX = 0
.IFF
.IIF EQ APOS - <''X>, ITSHEX = 0
.ENDC
.IFF
.IF DF MAC$32
.IIF EQ, ITSHEX, VALUE = ^A/X/
.IFF
.IIF EQ, ITSHEX, VALUE = <''X>
.ENDC
.ENDC
.ENDR
.IF EQ, ITSHEX
.IF EQ, EBCARG - 1
.ERROR ; EBCDIC argument must be 1 or 2 digit HEX number
.MEXIT
.ENDC
.IFF
.IF DF, MAC$32
VALUE = ^X
.IFF
.HEX
VALUE = HEXVAL
.ENDC
.ENDC
.ENDM
;
; Add an element to the EBCDIC, to DEC multinational translation
; table
;
.MACRO EB2AS EB, AS
EBCARG = 1 ; Indicate EBCDIC argument
.VAL ; Compute value of EBCDIC argument
. = $EB2AS + VALUE ; Position to correct offset in table
EBCARG = 0 ; Indicate ASCII argument
.VAL ; Compute value of ASCII argument
; and store the translated character
.BYTE VALUE
.ENDM
;
; Add an element to the DEC multinational,
; to EBCDIC translation table
;
.MACRO AS2EB AS, EB
EBCARG = 0 ; Indicate ASCII argument
.VAL ; Compute value of ASCII argument
. = $AS2EB + VALUE ; Position to correct offset in table
EBCARG = 1 ; Indicate EBCDIC argument
.VAL ; Compute value of EBCDIC argument
; and store the translated character
.BYTE VALUE
.ENDM
;
; Add an element to both translation tables
; so that the translation is reversible. Thus
;
; REVTRA 5A, '!
;
; would cause EBCDIC '!' to be translated to ASCII '!'
; and ASCII to '!' to EBCDIC '!'
;
.MACRO REVTRA EB, AS
EB2AS EB, AS ; Enter in EBCDIC to ASCII table
AS2EB AS, EB ; Enter in ASCII to EBCDIC table
.ENDM
.SBTTL Context and symbol initialisation
;
; Handy symbol for ' and \
;
.IF DF MAC$32
APOS = ^A/'/
EBSSUB = ^X3F
.IFF
APOS = ''
.HEX 3F
EBSSUB = HEXVAL
.ENDC
.SBTTL Table Initialisation
.IF DF MAC$32
.PSECT _SNASYS$GLOBAL, NOEXE, RD, WRT
.IFF
.PSECT $$TRTB
.ENDC
;+
; Initialise the DEC multinational to EBCDIC
; table with EBCDIC SUB character.
; Initialise the EBCDIC to DEC multinational
; with the '\' character as per ANSI X3.26 -1970.
; Note FF maps to FF.
;-
$EB2AS::
.REPT 255.
.BYTE DMFILL
.ENDR
.BYTE 255.
$AS2EB::
.REPT 255.
.BYTE EBSSUB
.ENDR
.BYTE 255.
.SBTTL EBCDIC International translation tables
.SBTTL International EBCDIC to DEC multinational
. = $EB2AS
.BYTE 0. ; NUL --> NUL
.BYTE 1. ; --> ^A
.BYTE 2. ; --> ^B
.BYTE 3. ; --> ^C
.BYTE DMFILL
.BYTE 9. ; PT --> HT
.BYTE DMFILL
.BYTE 127. ; --> DEL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE 11. ; --> ^K
.BYTE 12. ; FF --> FF
.BYTE 13. ; CR --> CR
.BYTE 14. ; --> ^N
.BYTE 15. ; --> ^O
.BYTE 16. ; --> ^P
.BYTE 17. ; SBA --> ^Q
.BYTE 18. ; EUA --> ^R
.BYTE 19. ; IC --> ^S
.BYTE DMFILL
.BYTE DMFILL
.BYTE 8. ; --> ^H
.BYTE DMFILL
.BYTE 24. ; --> ^X
.BYTE 25. ; EM --> ^Y
.BYTE DMFILL
.BYTE DMFILL
.BYTE 28. ; DUP --> ^\
.BYTE 29. ; SF --> ^]
.BYTE 30. ; FM --> ^^
.BYTE 31. ; --> ^_
. = $EB2AS + 37.
.BYTE 10. ; --> ^J
.BYTE 23. ; --> ^W
.BYTE 27. ; --> ESC
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE 5. ; --> ^E
.BYTE 6. ; --> ^F
.BYTE 7. ; --> ^G
. = $EB2AS + 50.
.BYTE 22. ; --> ^V
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE 4. ; --> ^D
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE 20. ; RA --> ^T
.BYTE 21. ; --> ^U
.BYTE DMFILL
.BYTE 26. ; SUB --> SUB
.BYTE 32. ; SP --> SP
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE 91. ; CENT --> '[
.BYTE 46. ; '. --> '.
.BYTE 60. ; '< --> '<
.BYTE 40. ; '( --> '(
.BYTE 43. ; '+ --> '+
.BYTE 33. ; LOG OR --> '!
.BYTE 38. ; '& --> '&
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE 93. ; '! --> ']
.BYTE 36. ; '$ --> '$
.BYTE 42. ; '* --> '*
.BYTE 41. ; ') --> ')
.BYTE 59. ; '; --> ';
.BYTE 94. ; LOG NOT --> '^
.BYTE 45. ; '- --> '-
.BYTE 47. ; '/ --> '/
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE DMFILL
.BYTE 124. ; Split vertical bar --> LOG OR
.BYTE 44. ; ', --> ',
.BYTE 37. ; '% --> '%
.BYTE 95. ; '_ --> '_
.BYTE 62. ; '> --> '>
.BYTE 63. ; '? --> '?
. = $EB2AS + 121.
.BYTE 96. ; '` --> '`
.BYTE 58. ; ': --> ':
.BYTE 35. ; '# --> '#
.BYTE 64. ; '@ --> '@
.BYTE 39. ; '' --> ''
.BYTE 61. ; '= --> '=
.BYTE 34. ; '" --> '"
.BYTE DMFILL
.BYTE 97. ; 'a --> 'a
.BYTE 98. ; 'b --> 'b
.BYTE 99. ; 'c --> 'c
.BYTE 100. ; 'd --> 'd
.BYTE 101. ; 'e --> 'e
.BYTE 102. ; 'f --> 'f
.BYTE 103. ; 'g --> 'g
.BYTE 104. ; 'h --> 'h
.BYTE 105. ; 'i --> 'i
. = $EB2AS + 145.
.BYTE 106. ; 'j --> 'j
.BYTE 107. ; 'k --> 'k
.BYTE 108. ; 'l --> 'l
.BYTE 109. ; 'm --> 'm
.BYTE 110. ; 'n --> 'n
.BYTE 111. ; 'o --> 'o
.BYTE 112. ; 'p --> 'p
.BYTE 113. ; 'q --> 'q
.BYTE 114. ; 'r --> 'r
. = $EB2AS + 161.
.BYTE 126. ; '~ --> '~
.BYTE 115. ; 's --> 's
.BYTE 116. ; 't --> 't
.BYTE 117. ; 'u --> 'u
.BYTE 118. ; 'v --> 'v
.BYTE 119. ; 'w --> 'w
.BYTE 120. ; 'x --> 'x
.BYTE 121. ; 'y --> 'y
.BYTE 122. ; 'z --> 'z
. = $EB2AS + 192.
.BYTE 123. ; '{ --> '{
.BYTE 65. ; 'A --> 'A
.BYTE 66. ; 'B --> 'B
.BYTE 67. ; 'C --> 'C
.BYTE 68. ; 'D --> 'D
.BYTE 69. ; 'E --> 'E
.BYTE 70. ; 'F --> 'F
.BYTE 71. ; 'G --> 'G
.BYTE 72. ; 'H --> 'H
.BYTE 73. ; 'I --> 'I
. = $EB2AS + 208.
.BYTE 125. ; '} --> '}
.BYTE 74. ; 'J --> 'J
.BYTE 75. ; 'K --> 'K
.BYTE 76. ; 'L --> 'L
.BYTE 77. ; 'M --> 'M
.BYTE 78. ; 'N --> 'N
.BYTE 79. ; 'O --> 'O
.BYTE 80. ; 'P --> 'P
.BYTE 81. ; 'Q --> 'Q
.BYTE 82. ; 'R --> 'R
. = $EB2AS + 224.
.BYTE 92. ; '\ --> '\
.BYTE DMFILL
.BYTE 83. ; 'S --> 'S
.BYTE 84. ; 'T --> 'T
.BYTE 85. ; 'U --> 'U
.BYTE 86. ; 'V --> 'V
.BYTE 87. ; 'W --> 'W
.BYTE 88. ; 'X --> 'X
.BYTE 89. ; 'Y --> 'Y
.BYTE 90. ; 'Z --> 'Z
. = $EB2AS + 240.
.BYTE 48. ; '0 --> '0
.BYTE 49. ; '1 --> '1
.BYTE 50. ; '2 --> '2
.BYTE 51. ; '3 --> '3
.BYTE 52. ; '4 --> '4
.BYTE 53. ; '5 --> '5
.BYTE 54. ; '6 --> '6
.BYTE 55. ; '7 --> '7
.BYTE 56. ; '8 --> '8
.BYTE 57. ; '9 --> '9
.SBTTL DEC multinational to International EBCDIC
. = $AS2EB
.BYTE 0. ; NUL --> NUL
.BYTE 1. ; ^A
.BYTE 2. ; ^B
.BYTE 3. ; ^C
.BYTE 55. ; ^D
.BYTE 45. ; ^E
.BYTE 46. ; ^F
.BYTE 47. ; ^G
.BYTE 22. ; ^H
.BYTE 5. ; HT --> PT
.BYTE 37. ; ^J
.BYTE 11. ; ^K
.BYTE 12. ; FF --> FF
.BYTE 13. ; CR --> CR
.BYTE 14. ; ^N
.BYTE 15. ; ^O
.BYTE 16. ; ^P
.BYTE 17. ; ^Q --> SBA
.BYTE 18. ; ^R --> EUA
.BYTE 19. ; ^S --> IC
.BYTE 60. ; ^T --> RA
.BYTE 61. ; ^U
.BYTE 50. ; ^V
.BYTE 38. ; ^W
.BYTE 24. ; ^X
.BYTE 25. ; ^Y --> EM
.BYTE 63. ; ^Z --> SUB
.BYTE 39. ; ESC
.BYTE 28. ; ^\ --> DUP
.BYTE 29. ; ^] --> SF
.BYTE 30. ; ^^ --> FM
.BYTE 31. ; ^_
.BYTE 64. ; SP --> SP
.BYTE 79. ; '! --> LOG OR
.BYTE 127. ; '" --> '"
.BYTE 123. ; '# --> '#
.BYTE 91. ; '$ --> '$
.BYTE 108. ; '% --> '%
.BYTE 80. ; '& --> '&
.BYTE 125. ; '' --> ''
.BYTE 77. ; '( --> '(
.BYTE 93. ; ') --> ')
.BYTE 92. ; '* --> '*
.BYTE 78. ; '+ --> '+
.BYTE 107. ; ', --> ',
.BYTE 96. ; '- --> '-
.BYTE 75. ; '. --> '.
.BYTE 97. ; '/ --> '/
.BYTE 240. ; '0 --> '0
.BYTE 241. ; '1 --> '1
.BYTE 242. ; '2 --> '2
.BYTE 243. ; '3 --> '3
.BYTE 244. ; '4 --> '4
.BYTE 245. ; '5 --> '5
.BYTE 246. ; '6 --> '6
.BYTE 247. ; '7 --> '7
.BYTE 248. ; '8 --> '8
.BYTE 249. ; '9 --> '9
.BYTE 122. ; ': --> ':
.BYTE 94. ; '; --> ';
.BYTE 76. ; '< --> '<
.BYTE 126. ; '= --> '=
.BYTE 110. ; '> --> '>
.BYTE 111. ; '? --> '?
.BYTE 124. ; '@ --> '@
.BYTE 193. ; 'A --> 'A
.BYTE 194. ; 'B --> 'B
.BYTE 195. ; 'C --> 'C
.BYTE 196. ; 'D --> 'D
.BYTE 197. ; 'E --> 'E
.BYTE 198. ; 'F --> 'F
.BYTE 199. ; 'G --> 'G
.BYTE 200. ; 'H --> 'H
.BYTE 201. ; 'I --> 'I
.BYTE 209. ; 'J --> 'J
.BYTE 210. ; 'K --> 'K
.BYTE 211. ; 'L --> 'L
.BYTE 212. ; 'M --> 'M
.BYTE 213. ; 'N --> 'N
.BYTE 214. ; 'O --> 'O
.BYTE 215. ; 'P --> 'P
.BYTE 216. ; 'Q --> 'Q
.BYTE 217. ; 'R --> 'R
.BYTE 226. ; 'S --> 'S
.BYTE 227. ; 'T --> 'T
.BYTE 228. ; 'U --> 'U
.BYTE 229. ; 'V --> 'V
.BYTE 230. ; 'W --> 'W
.BYTE 231. ; 'X --> 'X
.BYTE 232. ; 'Y --> 'Y
.BYTE 233. ; 'Z --> 'Z
.BYTE 74. ; '[ --> CENT
.BYTE 224. ; '\ --> '\
.BYTE 90. ; '] --> '!
.BYTE 95. ; '^ --> LOG NOT
.BYTE 109. ; '_ --> '_
.BYTE 121. ; '` --> '`
.BYTE 129. ; 'a --> 'a
.BYTE 130. ; 'b --> 'b
.BYTE 131. ; 'c --> 'c
.BYTE 132. ; 'd --> 'd
.BYTE 133. ; 'e --> 'e
.BYTE 134. ; 'f --> 'f
.BYTE 135. ; 'g --> 'g
.BYTE 136. ; 'h --> 'h
.BYTE 137. ; 'i --> 'i
.BYTE 145. ; 'j --> 'j
.BYTE 146. ; 'k --> 'k
.BYTE 147. ; 'l --> 'l
.BYTE 148. ; 'm --> 'm
.BYTE 149. ; 'n --> 'n
.BYTE 150. ; 'o --> 'o
.BYTE 151. ; 'p --> 'p
.BYTE 152. ; 'q --> 'q
.BYTE 153. ; 'r --> 'r
.BYTE 162. ; 's --> 's
.BYTE 163. ; 't --> 't
.BYTE 164. ; 'u --> 'u
.BYTE 165. ; 'v --> 'v
.BYTE 166. ; 'w --> 'w
.BYTE 167. ; 'x --> 'x
.BYTE 168. ; 'y --> 'y
.BYTE 169. ; 'z --> 'z
.BYTE 192. ; '{ --> '{
.BYTE 106. ; LOG OR --> Split vertical bar
.BYTE 208. ; '} --> '}
.BYTE 161. ; '~ --> '~
.BYTE 7. ; DEL
DMFILL = 92. ; Default DM fill character to '\
; as per ANSII X3.26 - 1970
;
; INSERT CHANGES HERE
;
.END