Trailing-Edge
-
PDP-10 Archives
-
BB-FB49A-RM
-
sources/tranx.mac
There are no other files named tranx.mac in the archive.
TITLE TRANX Translation table module
; ====== ------------------------
; Copyright (c) 1984, 1985 by
; DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts 01754
;
; 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: SNA Gateway.
;
; ABSTRACT: This module reads the translation table rel file.
;
; ENVIRONMENT: TOPS-20 Operating Systems, user mode.
;
; AUTHOR: Vicki Gary, CREATION DATE: October 1, 1984.
;
; MODIFIED BY:
;
; D. Brannon, 11-Oct-84 : VERSION 1.00
;
; 1.01 11-Oct-84, D. Brannon
; Added Copyright notice
;
; 1.02
;--
SALL
SEARCH MONSYM,MACSYM
SEARCH GLXMAC
PROLOG (TRANX)
; This module reads in a rel file that contains
; ASCII/EBCDIC to EBCDIC/ASCII translation information
; and formats the data in to two translation tables
; in the form of
; 0/ 0,,1
; 1/ 2,,3
; ect. with two bytes per word. The two tables are each
; 128 words, the first table is for EBCDIC to ASCII,
; the second ASCII to EBCDIC. It directly follows the
; first in memory, so that 256 words of storage in all
; are needed.
;
; This module accepts the address of the FD of the rel
; file in S1, and the address of the 256 word buffer to
; deposit the resulting table in S2.
;
; Errors are returned in S1 with TF set accordingly.
;
FOB: BLOCK 2
REL4: XWD 4,0
TRANX:: $SAVE <T1,T2,T3>
MOVE T3,S2 ; Save the buffer address
MOVEM S1,FOB ; Put FD FOB
MOVEI T1,^D36 ; Byte Size
MOVEM T1,FOB+1 ; Store in the FOB
MOVEI S1,2 ; SIZE OF FOB
MOVEI S2,FOB ; Address of FOB
$CALL F%IOPN## ; open the source file
JUMPF BADOPN ; Any error is fatal
$CALL F%IBYT## ; Get a BYTE
JUMPF BADOPN ; Any error is fatal
CAME S2,REL4 ; Must be a type 4 REL blk
JRST BADFIL ; Any error is fatal
MOVEI S2,6 ; Skip over the crud
MOVE T1,S1 ; Save IFN
$CALL F%POS## ; Position to the correct word
MOVE S1,T1 ; Restore IFN
SETZ T2,T1
BLOOP: $CALL F%IBYT## ; Get the count
HRRZ T1,S2
SOS T1 ; Have to adjust the count
ADD T2,T1 ; Update count
$CALL F%IBYT## ; Skip over Rel
$CALL F%IBYT## ; block info
LOOP: $CALL F%IBYT## ; Get a Byte (36-bits)
MOVEM S2,(T3) ; Store in the buffer
CAIL T2,^D256 ; Done with table?
JRST DONE ; Yes
AOS T3 ; Up the index
SOJG T1,LOOP ; A Word a a time
JRST BLOOP
DONE: $CALL F%REL## ; all done
$RETT
BADFIL:
BADOPN: $RETF
END