.SBTTL TRNTAB - ASCII/EBCDIC translation tables .REPT 0 COPYRIGHT (c) 1982,1981, 1980, 1979 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. .ENDR ; REVISION HISTORY ; 3(001) BS NEW MODULE TO HANDLE EBCDIC TO ASCII TRANSLATION VTRNTB=001 VEDIT=VEDIT+VTRNTB .IIF NDF,FTTRLS,FTTRLS=1 ;if we got this far, default ;is to make descriptive list ;Translate table definition .REPT 0 The following macros define the character mapping between EBCDIC codes (given in hexadecimal) and ASCII codes (given either as the character itself or its octal code). Each invocation of the CHAR macro assigns one ASCII characters to the EBCDIC value given in its first parameter. If there are more ASCII characters, the CHAR macro assigns them to successively higher EBCDIC values. (This makes defining a whole string of contiguous characters very easy.) The ASCII character(s) that correspond to the hexadecimal value form the second parameter. It may be represented as the actual character itself (if it is not a strange character that MACDLX chokes on) or alternatively as an octal value. Multiple characters are given as either a string of characters (e.g. ABCDEFGHI) or as a list of octal values (e.g. <101,102,103,...>). The third parameter is a description of the character used when printing the contents of the translate table (see discussion of FTTRLS below). It can either be omitted (in which case the characters themselves are used) or is a list of strings (e.g. <,colon,period>). The fourth parameter is a prefix to this description which is applied to all the characters generated in the current CHAR macro. Its purpose is to allow some qualification when using the characters themselves as description (i.e. the third parameter is null). The fifth parameter is an offset to be added to the octal value of all the characters in the current CHAR macro (used to make lower case easier to define). The sixth parameter is the octal flag -- if it is non-blank the characters in the second parameter are specified in octal. The macros EBCTAB and ASCTAB generate the translate tables for EBCDIC to ASCII and ASCII to EBCDIC, respectively. They both take as their single argument the tag with which to name the translate table. The tag for the ASCII to EBCDIC table will come at its beginning, while the tag for the EBCDIC to ASCII table will come in the middle (so that the propagated sign won't have to be masked out before indexing). These two macros also produce a detailed listing of what is in the translate table; this listing is, however, costly in CPU time for the assembler. It is therefore under the feature test switch FTTRLS (for Feature Test TRanslate table LiSt) which is normally defaulted to 0 (off) in HDEFIN.P11. If the user wishes to see this list he can either set FTTRLS to a non-zero value in his configuration file, or simply assemble this file by itself (together with MACROS.P11). The translate table generated from the CHAR macros below produces the same translate tables as the hand-coded version in earlier DN60 products. However, there are a few entries which are commented to indicate a recommended translate table with some properties perhaps a bit more desirable for some users, namely mapping EBCDIC exclamation into ASCII exclamation (instead of a square bracket, which only works on TN train IBM printers) and EBCDIC solid vertical bar (which is much more common than the EBCDIC broken vertical bar) into the ASCII broken vertical bar. .ENDR;.REPT 0 ;Uppercase letters CHAR C1,ABCDEFGHI,, CHAR D1,JKLMNOPQR,, CHAR E2,STUVWXYZ,, ;Lowercase letters CHAR 81,ABCDEFGHI,,,40 CHAR 91,JKLMNOPQR,,,40 CHAR A2,STUVWXYZ,,,40 ;Numerals CHAR F0,0123456789,, ;Common punctuation CHAR 40,40,,,,OCTAL CHAR 4B,^/.<(+/,,,PLUS> CHAR 50,&,AMPERSAND CHAR 5B,^/$*)/,> CHAR 5E,<73,136>,<,>,,,OCTAL CHAR 60,^!-/!, CHAR 6B,54,COMMA,,,OCTAL CHAR 6C,^!%_>?!,,QUESTION> CHAR 79,140,<>,,,OCTAL CHAR 7A,^!:#@!,,ATSIGN> CHAR 7D,47,<>,,,OCTAL CHAR 7E,^!="!,> ;Uncommon punctuation CHAR A1,176,TILDE,,,OCTAL CHAR C0,173,<>,,,OCTAL CHAR D0,175,<>,,,OCTAL CHAR E0,^!\!,<> ;Special characters CHAR 7,177,,,,OCTAL CHAR 4A,133,<>,,,OCTAL CHAR 4F,!,<> CHAR 5A,135,<>,,,OCTAL CHAR 6A,174,<>,,,OCTAL ;Suggested modifications are to take out all the special characters ; above and add the following: ;CHAR 5A,!, ;CHAR 4F,174,,,,OCTAL .PAGE .EVEN EBCTAB EBCASC .PAGE ASCTAB ASCEBC .EVEN