From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  1-FEB-1989 14:03
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Fix from DEC for TSDRIVER under VMS 5.0-See subsequent msg for more...


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Wed,  1 FEB 89 05:03:39 PDT
Received: from CORNELLC.ccs.cornell.edu by KL.SRI.COM with TCP; Wed, 1 Feb 89 04:54:43 PST
Received: from SUHEP.BITNET by CORNELLC.ccs.cornell.edu (IBM VM SMTP R1.2) with BSMTP id 7820; Wed, 01 Feb 89 07:55:20 EST
Date:     Wed, 1 Feb 89 07:50 EST
From:     <JUDITH%SUHEP.BITNET@CORNELLC.ccs.cornell.edu> (Judith Reed, JUDITH@SUHEP, ex. 5995)
Subject:  Fix from DEC for TSDRIVER under VMS 5.0-See subsequent msg for more...
To:       INFO-VAX@KL.SRI.COM
X-Original-To:  INFO-VAX@KL.SRI.COM, JUDITH

$!.............................................................................
$! VAX/VMS archive file created by VMS_SHARE V06.03 20-Oct-1988.
$!
$! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from
$! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au).
$!
$! To unpack, simply save, concatinate all parts into one file and
$! execute (@) that file.
$!
$! This archive was created by user CHOJNACKI
$! on  5-JAN-1989 10:08:23.20.
$!
$! It contains the following 2 files:
$!        TSDRIVER.HEX
$!        DEHEX.MAR
$!
$!==============================================================================
$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
$ VERSION = F$GETSYI( "VERSION" )
$ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK
$ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", -
    "VMS_SHARE V06.03 20-Oct-1988 requires VMS V4.4 or higher."
$ EXIT 44
$VERSION_OK:
$ GOTO START
$
$UNPACK_FILE:
$ WRITE SYS$OUTPUT "Creating ''FILE_IS'"
$ DEFINE/USER_MODE SYS$OUTPUT NL:
$ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION -
    VMS_SHARE_DUMMY.DUMMY

b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) );
s_file_spec := GET_INFO( COMMAND_LINE, "output_file" );SET( OUTPUT_FILE, b_part
, s_file_spec );
b_errors := CREATE_BUFFER( "{Errors}" );i_errors := 0;
pat_beg_1 := ANCHOR & "-+-+-+ Beginning";
pat_beg_2 := LINE_BEGIN & "+-+-+-+ Beginning";
pat_end := ANCHOR & "+-+-+-+-+ End";
pat_trail := " " & LINE_END;POSITION( BEGINNING_OF( b_part ) ); LOOP b
:= SEARCH( pat_trail, FORWARD); EXITIF b=0; POSITION( END_OF( b ) )
; LOOP MOVE_HORIZONTAL( -1 ); EXITIF CURRENT_CHARACTER <> ' '; ERASE_CHARACTER
( 1 ); EXITIF CURRENT_OFFSET=0; ENDLOOP; ENDLOOP; POSITION( BEGINNING_OF
( b_part ) ); i_append_line := 0; LOOP EXITIF MARK( NONE ) = END_OF( b_part )
; s_x := ERASE_CHARACTER( 1 );
  IF s_x = "+" THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip <
> 0 THEN
      s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF; ENDIF;
  IF s_x = "-" THEN r_skip := SEARCH( pat_end, FORWARD, EXACT ); IF r_skip <
> 0 THEN
      s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip := MARK( NONE )
; r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip <> 0 THEN POSITION
( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET ); MOVE_VERTICAL( 1 )
; MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) ); ENDIF; ERASE
( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF;
  IF s_x = "V" THEN
    s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL
( -CURRENT_OFFSET ); ENDIF; i_append_line := 1; MOVE_VERTICAL( 1 ); ENDIF;
  IF s_x = "X" THEN
    s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL
( -CURRENT_OFFSET ); ENDIF; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF;
  IF s_x <> "" THEN i_errors := i_errors + 1; s_text := CURRENT_LINE; POSITION
( b_errors );
    COPY_TEXT( "The following line could not be unpacked properly:" )
; SPLIT_LINE; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part )
; MOVE_VERTICAL( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP
  r_x := SEARCH( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x )
; ERASE_CHARACTER( 1 );
  IF CURRENT_CHARACTER = "`" THEN MOVE_HORIZONTAL( 1 ); ELSE COPY_TEXT( ASCII
( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDIF; ENDLOOP; IF i_errors = 0 THEN SET
( NO_WRITE, b_errors, ON ); ELSE POSITION( BEGINNING_OF( b_errors ) );
  COPY_TEXT( FAO( "The following !UL errors were detected while unpacking !AS"
, i_errors, s_file_spec ) ); SPLIT_LINE;
  SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" );ENDIF; EXIT;
$ DELETE VMS_SHARE_DUMMY.DUMMY;*
$ CHECKSUM 'FILE_IS
$ WRITE SYS$OUTPUT " CHECKSUM ", -
  F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!,passed." )
$ RETURN
$
$START:
$ FILE_IS = "TSDRIVER.HEX"
$ CHECKSUM_IS = 927032703
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X:0100000000FF01FF
X:0100000000FE0001
X:0200000000FD0200FF
X:0200000000FC000FF3
X:0C00000000FB74736472697665722E65786516
X:1C0000000000D0003000440058000000A8003032303501020000FFFFFFFFFFFFFFFFDE
X:0C0000002000220000012F554C1E00000001C2
X:1900000048000E00000000000400000000000000000008545344524956455212
X:1E000000800004582D3137000000000000000000000020202F554C9E91000530352D303239
X:1B000000A8003ED10000000001000000010000000100000001000000010000000128
X:1E000000C6000100000001000000010010000C00000000000A000002020000000000FFFFF1
X:1E000000E400FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1C
X:1E0000010200FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD
X:1E0000012000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDF
X:1E0000013E00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1
X:1E0000015C00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA3
X:1E0000017A00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF85
X:1E0000019800FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF67
X:1E000001B600FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49
X:1E000001D400FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2B
X:1E000001F200FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000022171E00010078012C
X:1C00000211000100008200C00000000800050001000000000008545344524956455205
X:1E00000282000410034D544100020B0034023C033840440C02400300020000024C00020282
X:1E000002A0004D000E02A0030B30E96C024E010008025001C004027200150294001002957A
X:1E000002BF00100554023415056802B903040C02D000001F080000282A00807800000010DF
X:1C000002DD00280080181600009800E600282A0080282A008038290080282A008088D2
X:1E000002FC00282A0080282A0080282A0080282A0080282A008000008AC188C088C48BC0A0
X:1C0000031A0088C189C188C1000088C0000085C081C0000085C081C181C381C285C2C8
X:1E0000033A008FC089C089C28AC28AC086C084C05F1FC27FFF017F035F03007EFC017C0305
X:1E000003590010C0000200020028200080000C000101000100302000800000000000000CFF
X:1B0000037900200080000000000000100010200080000000000000600118200080F0
X:1E0000039B0002202000804000007000010000C02F00805B01027A94010000382700800412
X:1D000003B90002000060000000102500800000000408000000C006000000010000D80164
X:1E000004D800E000C5680150D08FD012000051169F80210080E950407C82B05182B08F60A7
X:1E000004F70082D482D052C56C01D052C57001C18FC012000052C57401D08F31060000CF50
X:1E0000051500D805D08F31030000CF160DD08F31030000CFB013A801C5680105E100C56857
X:1E0000053300015A7D507ED05350D1C57401C570011407D0C56C01C57001D0C57001517D29
X:1E000005510080817D80817D80817D80817D80817D80817D80817D80817D80817D80817DA0
X:1E0000056F0080817D8081D0C5700151D05361D09F48440080A104CE01A158CE01A15C7DE3
X:1E0000058D008E5005E100C5680122DD52D0C5700152D050A258D0A550A25CD0C5C400A2DD
X:1E000005AB001CD08E52C08F60000000C5700105D5C5DA001301059EC54001C5DA00169FF7
X:1E000005C900582400801106169FA8270080110330FEFED4C522019004C539019004C53ADB
X:1E000005E700019004C53B019004C53C01D0A52451D0A160C50C01D0A15850D055A004D08B
X:1E00000605002651D0C5DA00527DC58C00C50401B051C59200AB8F00FE52C59000EF0915C3
X:1E00000623005252D09F4084008050DE4260C58C00D0A52451D0C5FC00A160121394A16308
X:1E0000064100169FF8290080D0A52451D0A160C5FC007DC58C00C51001169F082900803C83
X:1E0000065F00C59000507DC50401C58C00D0A52451D0A52453D0A36453E000A33004FFFE8C
X:1E0000067D009C018FA333120412000A000A000A000A00F0A160090D501106F0A16009099C
X:1E0000069B0050D050C5DE00D0C50C01A160D451788FFE5050F050020E51788FF25050F097
X:1E000006B90050000251B051C5E200D0A52453D0A36453E000A33004FFFE9C018FA33312FA
X:1E000006D700041A000A000A000A000A00788FFE5050B4C53001F0500004C53001D0C5DAC7
X:1E000006F60052B08F84C062D0C5DE00A202C008A202B008A206D0C5DE00A208C012A20833
X:1E0000071400B00EA20CD4A20EDB127ED0A52850E99FCC45008008169FE03100801104DA29
X:1D0000073200A00112DA1F12D0A52453D0A36453E000A33004FFFE9C018FA333120410FA
X:1E00000750000A000A000A000A0090C53001A403B0C5E20064A88F0004A57CDD14169FC0B9
X:1D0000076E002A008056FE169F58240080D0C5DA0052E10BA21C079007A54D31AD00EDF9
X:1E0000078C0006A21C0012079004A54D319E00B0A21C509001C53D01ED0006500218061157
X:1E000007AA000494C53D01B08F84C062D0C5DE00A202C008A202B00AA206D0C5DE00A208AF
X:1D000007C800C012A208B010A20CD4A20EDB127ED0A52850E99FCC45008008169FE03167
X:1E000007E600801104DAA00112DA1F12D0A52453D0A36453E000A33004FFFE9C018FA333FC
X:1E0000080400120412000A000A000A000A0090C53001A4031104900DA54DB0C5E20064A852
X:1E00000822008F0004A57CDD14169FC02A008098FD169F58240080A810A57805D08EC5B001
X:1E0000084100AA8F0004A57CD0A52451D0B15854B0A40250E0075003312102E10A50033181
X:1E0000085F002701910EA54D1309910DA54D130331110195C53D0112F7B5C52E01122E91A2
X:1E0000087D00C53E010218EA9101C53E01131995C53601130AD4C5320194C5360111D39114
X:1E0000089B00C53201C5390119CAB001C52E01114C9101C53E0113BC91C53E0102183A9580
X:1E000008B900C5360113AF91C53201C53A01180496C53701D4C5320194C5360191C5370141
X:1E000008D700C53B01199194C5370196C5380191C53801C53C0119059003C53E01B4C52E46
X:1E000008F50001D0C5DA0050B08F84C060D0C5DE00A002C008A002B00AA006D0C5DE00A050
X:1E000009130008C012A008B010A00CD4A00EB5C52E011304A820A010DB127ED0A52850E9DD
X:1E00000931009FCC45008008169FE03100801104DAA00112DA1F12D0A52453D0A36453E087
X:1E0000095000A33004FFFE9C018FA333120410000A000A000A000A0090C53001A403B0C5C3
X:1E0000096E00E20064DD03169FC02A0080F100169F582400809A015017D5B000D0A5245113
X:1E0000098C00D0A160C50C01D0C5FC00A1607DC58C00C504017DC51001C58C00169F0829F6
X:1E000009AB0080D0A52451D0C50C01A1607DC50401C58C00D0C5DA0050B08F84C060D0C552
X:1E000009C900DE00A002C008A002910EA54D131A910DA54D1314B008A006D0C5DE00A00838
X:1E000009E700C012A008B00EA00C1112B00AA006D0C5DE00A008C012A008B010A00CD4A016
X:1D00000A05000EB5C52E011304A820A010DB127ED0A52850E99FCC45008008169FE0314F
X:1E00000A2300801104DAA00112DA1F12D0A52450D0A06450E000A03004FFFE9C018FA033CB
X:1D00000A4100120410000A000A000A000A0090C53001A403B0C5E20064DD02169FC02AE4
X:1E00000A5F00800A00169F582400801108169F582400801109E00AC5E6000331E6FD3C8FE3
X:1E00000A7D0084005017D5B000D0AC04A360D0AC08A364179F88260080910EA54D130891BC
X:1E00000A9B000DA54D1302114C95C53D011246D0A36450121A9004C539019004C53A0190D2
X:1E00000AB90004C53B019004C53C0194C53E01112691015012079001C53E01111AD18FFF9B
X:1E00000AD700FFFFFF5012079002C53E01110A94C53E01D0A360C5390105304AFDE8500FBD
X:1E00000AF50031EA063034FA303EFDE8500331DE0690C59500C59400B0A320C5AE00D0A30D
X:1E00000B13003850EF0006A32051D10251132CD109511333D11A511347D111511363D10D42
X:1E00000B3100511A79AF51220651003E0067001400200070007000A20651316F003C025168
X:1E00000B4F00B55014129A0551110A9A0951B55014069A0751AE5050B050C5D800124F9A67
X:1E00000B6E0051114AB0A338A54CB0A33AA54EB0A33CC590003010FF9A14511132B4C537AC
X:1E00000B8C00019A01511129B08FA400C5AE00AA8F0008A578B4C537019A03511113A212F9
X:1E00000BAA0051110ED10A511A09E106C5AE0003A003519051C5A600D0A56C53E008A32AE8
X:1E00000BC8003FE00BA5783AE113A53C2DE118A53C28E101A55023A88F0010A57C9A155029
X:1E00000BE600305C061500D0A52450D0B05850B0A00250E0065005E30BA578083C8F540228
X:1E00000C04005031DA05D0A52454D0B458549AC5A60050AF50001B540007058C0177042D51
X:1E00000C220005D802F1045D044E00E70354001E015C0054001E01B000F900A5006B0154F7
X:1E00000C4100380038058E04E6042205FC0476018101AA02A57CEF0404C5900051B10E510A
X:1E00000C5F001204A802A57C1106A88F0008A57830D5050000316D0530CD050700D6C5C40E
X:1E00000C7E00319C00DD50169FD8200080D08E50D10450131597C5940019249A0C5030A83B
X:1E00000C9C0005EDFFD6C5C40031840097C59400190F9A1150309305F2FFD6C5C400316F6A
X:1E00000CBB00310905308405030031570031FE043079050700D7C5C400314800DD50169FF5
X:1D00000CD900D8200080D08E50D10450131597C5940019249A0F50305405EDFFD7C5C490
X:1E00000CF70031300097C59400190F9A1050303F05F2FFD7C5C400311B0031B5043030050C
X:1E00000D1500030031030031AA04E10FC5220104B4C5E80031B804E10FC5220104B4C5E843
X:1E00000D340031AB04AA08A5523007050700D6C5C400319B04DD50169FD8200080D08E509E
X:1D00000D5200D10450131597C5940019249A0E5030E204EDFFD6C5C40031760497C59416
X:1E00000D7000190F9A125030CD04F2FFD6C5C40031610431430430BE0403003156043138F9
X:1D00000D8E000430B3040300314B04312D0430A8040300314004312204B0C5D800C5902B
X:1E00000DAC00B0C5D800C59200D0C5C400C5F400A88F4000A57C910EA54D1309910DA54D9E
X:1E00000DCA00130331A80095C53D011303319F00B1C5D800041403319500D0C5DA0050B000
X:1E00000DE8008F84C060D0C5DE00A002C008A002B00AA006D0C5DE00A008C012A008B01086
X:1E00000E0600A00CD4A00EB001C52E01A820A010DB127ED0A52850E99FCC45008008169F55
X:1E00000E2400E03100801104DAA00112DA1F12D0A52450D0A06450E000A03004FFFE9C0117
X:1E00000E42008FA033120410000A000A000A000A0090C53001A403B0C5E20064DD03169F65
X:1E00000E6000C02A00800A00169F582400801109169F58240080315003AA01A57CB08FFFF6
X:1E00000E7E007FC5D8009A025030BD0364003CC5E80051C051C5C400E111A550DEB7C59253
X:1E00000E9D00E113A53C05E118A53C37E100A57C2EB101C5E800122BB001C5D8009A055043
X:1E00000EBB003087032E00B6C59200D7C5C4003C8FA00950A3C59200C59000C5E8003108CB
X:1E00000ED90003A801A57CB5C592001297B0C59000C5E80031F40231D602B0C5D800C590F5
X:1E00000EF800B0C5D800C59200D0C5C400C5F400A88F4000A57C910EA54D1309910DA54D51
X:1E00000F1600130331A80095C53D011303319F00B1C5D800041403319500D0C5DA0050B0B2
X:1E00000F34008F84C060D0C5DE00A002C008A002B00AA006D0C5DE00A008C012A008B01038
X:1E00000F5200A00CD4A00EB001C52E01A820A010DB127ED0A52850E99FCC45008008169F08
X:1E00000F7000E03100801104DAA00112DA1F12D0A52451D0A16451E000A13004FFFE9C01C6
X:1E00000F8E008FA133120410000A000A000A000A0090C53001A403B0C5E20064DD03169F17
X:1D00000FAC00C02A00800A00169F582400801109169F58240080310402B08FFF7FC5D8A7
X:1E00000FCA009A05503075022B00E010A550193CC5E80051C251C5C400E111A550DDB7C534
X:1E00000FE8009200B5C5920012D3A3C59200C59000C5E80031E50131C7013042026E00E199
X:1E000010060011A5505CB101C5E8001255E113A53C05E118A53C4BD5C5C4001345B001C579
X:1E0000102400D8009A07503019024500B001C5D8009A0750300C023800B001C5D8009A09AF
X:1E00001042005030FF012B00E111A5500C3C8FA00950B4C5E800318901B001C5D8009A0921
X:1E00001060005030E1010D003CC5E80051C051C5C400316F0131510130CC011200E010A567
X:1E0000107E00500A3CC5E80051C251C5C40031550131370130B2010F00A801A552AA10A543
X:1E0000109C0052D4C5C400313E013120019103C53E01120494C53E01AA08A552308C010712
X:1E000010BB00D6C5C400312001DD50169FD8200080D08E50D10450131597C5940019249A4A
X:1E000010D9001650306701EDFFD6C5C40031FB0097C59400190F9A1750305201F2FFD6C55C
X:1D000010F700C40031E60031C800304301030031DB0031BD00303801030031D00031B247
X:1E0000111500302D01030031C50031A7003022011300CA8F00080000A578D4C5C400AA1092
X:1D0000113300A55231AA00318C003007010300319F0031810030FC0003003194003176B8
X:1E0000115100B050C52C0130EC006500AA0FA552E101C522010CD4C5C400A801A552AA10D0
X:1E0000116F00A552E10FC5220104A802A552E102C5220123910EA54D1308910DA54D1302AF
X:1E0000118D001111B5C52C01130BB0C52C0150B4C52C0111B6A808A552E100C5220108AADC
X:1E000011AB0010A552A804A552E006C52201053C8FA40150312200B4C52C013100003C8FF4
X:1E000011C9008C0050B4C5E800B18FA40150130BDD50169FD8200080D08E50AA8F4008A54A
X:1E000011E7007CDD50169F90280080B0C5E800AE02E86E36D0A56C54E104A42A2DD0A4181A
X:1E000012050054B4A416D0A538549EA56052D05253D06353D153521313E104A32AF3D0A364
X:1E000012230004530FB300510E61B40411E5D08E50D0A55051179FD82900803051F3179F01
X:1E0000124100D8290080D08EC5B0009A14C50001B4C5EA007CC5EC00B4C5E8009050C5A78A
X:1D0000126000D0C5DA0051B040CFA6F061B08FFFFFA112E50CA57C05A88F004061AF501D
X:1E0000127E001B3800DD0044004400DD004400DD004400380044003800BD01BD013800BD33
X:1E0000129C0001C701B001B001BD0138003800DD00DD00DD00DD00DD00BD01E0003C01505F
X:1E000012BA00C002C5B00017D5B0009103501267DB127ED0A52850E99FCC45008008169FB8
X:1E000012D800E03100801104DAA00112DA1F12E105A57803312B01D0A52450D0A06450E06A
X:1E000012F700A03004FFFE9C018FA033120410000A000A000A000A0090C53001A403B0C519
X:1D0000131500E20064DD8F2C010000169FC02A0080B704169F58240080319B02B0C5D836
X:1E0000133300A102B0C5D800C5E8003CC5D800C50001D18FEC040000C5000118093C8FEC72
X:1E000013510004C500011105C002C50001315700D0C5DE00A102C008A102D4A10E910EA546
X:1E0000136F004D131A910DA54D1314B008A106D0C5DE00A108C012A108B00EA10C112AB0E3
X:1E0000138D000AA106D0C5DE00A108C012A108B010A10CB5C52E011306A820A110110CB184
X:1D000013AB00A1068F180E1A04B000A110DB127ED0A52850E99FCC45008008169FE0310B
X:1E000013C900801104DAA00112DA1F12E005A57840D0A52450D0A06450E000A03004FFFED9
X:1E000013E7009C018FA033120410000A000A000A000A0090C53001A403B0C5E20064DDC511
X:1E000014060001169FC02A0080CE03169F5824008031B201E99FCC4500800AD0A52850161C
X:1E00001424009F00320080DA8E1231B203E109C5AE0005A88F002061110AA820A57C169F26
X:1E0000144200E0290080169FF8290080169F102900803CC5900050D0A52451F0A160090D6D
X:1D000014600050D0C5DA0051D050A102E001A57C06E108C5AE0005A88F001061B0C59284
X:1E0000147E00A106B0C59200C5E800DB127ED0A52850E99FCC45008008169FE03100801125
X:1E0000149C0004DAA00112DA1F12E105A57803319F00D0A52450D0A06450E000A03004FF00
X:1E000014BA00FE9C018FA033120410000A000A000A000A0090C53001A403B0C5E20064DD04
X:1E000014D80014169FC02A0080E302169F58240080169F86A80080E850059001C5EB00E06C
X:1E000014F60005A57865910EA54D1308910DA54D1302111F95C53D01121995C53E0112134F
X:1E00001514009EA56050D160501306D6C53201110496C53601A2C52001C5E800D051C5ECB0
X:1E000015330090A363C5EA003CC590005195C5EA00121EA0C5200151111CE99FCC450080E2
X:1E00001551000AD0A52850169F00320080DA8E12316602A0C5E80051788FF751513CA3608E
X:1E0000156F0050C05051B18FEF0151141A3C8FEF0151D04162C5F000D041A2FCC5F400D092
X:1D0000158D004162C5F800111ED04162C5F000CE01C5F400D150511307D041A2FCC5F40E
X:1E000015AB00D041A204C5F80095C5EA00130A169FA8290080AA20A57C169FB82900801135
X:1D000015C9000DB5C5E8001307A2C52001C5E800E107C5220104AA07A552EF0103C5E62D
X:1E000015E70050AF5000073A0046006400F0002C012C01180010003C8F54005031C8FB3C9B
X:1E00001605008FF40150D5C5C400131AA810A5523C8F8C0050E006C52201053C8FA401507F
X:1E000016230031A6FB3C0150C002C5B00017D5B000E106C52201063C055031DA0090C5A70A
X:1E00001642005091015013DE3C8FA40150317CFBE100C5280116A801A552D4C5C400910F7D
X:1E0000166000C5A60012C13C8F70085011BDE10CC52201073C8F38085011B0E10FC52201FD
X:1E0000167E002CA802A5529116C5A60013219105C5A60013489102C5A60013419103C53EF6
X:1E0000169C0001120494C53E013C8F700850317EFFE100C5220128910CC5A6001321910F73
X:1E000016BA00C5A600131A9110C5A60013139111C5A600130CA804A5523C8F78085031505D
X:1E000016D800FF314AFF3C8F8C0050E101C5220108A801A552D4C5C400E104C5220106A88A
X:1E000016F6008F0010A57CE10BC5220109A808A5523C8F5C0250E006C52201053C8FA401D6
X:1E00001714005031B4FAE00FC5AE001332D5B0007EC08EC5B000C002C5B00017D5B0003117
X:1E0000173200C8FED09E537D6354D0C5DA0050B064C5E400B0A402C5E600E501A5783CE43E
X:1E00001750000AA57C3EB0A012C51C01D0A014C51E017DA018C52201910EA54D1308910DFF
X:1E0000176E00A54D13021106B0A020C52A01D0A5105316B50C7D8E507D8E527D8E5402E433
X:1E0000178C000AA57C0211EFE00AC5E600E9A801A552E105A5781AE00BA57C15E106A57CAE
X:1E000017AA0009D0C5F400C518011107D0C5C400C51801D4C5C40031B8FF169F582400806C
X:1E000017C800E505A57C06169FA8290080169FB82900801106169F58240080E405A5780305
X:1D000017E60031E5003050F0E8500331DAF9169F3AA90080C08FDC05000050D050C59014
X:1E0000180400DB127ED0A52850E99FCC45008008169FE03100801104DAA00112DA1F12DD7D
X:1E000018220002169FC02A00800200169F582400809A0350300EFA0300312100169F3AA9C2
X:1E000018410080D150C590001BBB9A8F0554D09F684D008053169FC02600803195FFA88F2D
X:1E000018600008A57C9A035030DCF94500D1C5C400C518011346D1C5C400C518011433C337
X:1D0000187E00C5C400C5180150D18FFF7F0000501409B08FFF7FC5D8001105B050C5D83E
X:1E0000189C009A095030A3F90C003CC5E80051C051C5C40011BBAA8F0008A57C17CF0DF975
X:1E000018BA00AA8F0008A57CD0A56C537DA32CC58C0017CF21F2169FE02000803C8F2C02B6
X:1E000018D80050179FD829008030AEEC179FD8290080D019803CC5E400803CC5E600809A9B
X:1E000018F600C5EA0080D0C5EC0080D0C5F00080D0C5F40080D0C5F80080D0C5DA00519A2F
X:0E000019140011523C8180F552FA9AC5EB00800515
X:1E00001A00003500000000000208545344524956455204582D313720352D4F43542D313926
X:1E00001A1E0038382031373A323320352D4F43542D313938382031373A3233001600000166
X:1A00001A3C005641582D3131204C696E6B6572205630352D30321300010000838C
X:0F00001A5B00092E242441425324242E0002000300AC
X:0000001A69FA83
X:00000000000000
$ GOSUB UNPACK_FILE
$ FILE_IS = "DEHEX.MAR"
$ CHECKSUM_IS = 391072076
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X`009.TITLE`009DEHEX
X`009.SBTTL`009Stuart Hecht
X
X`009.LIBRARY /SYS$LIBRARY:STARLET/
X`009.LIBRARY /SYS$LIBRARY:LIB/
X`009.IDENT`009/1.0.00/
X
X
X;++
X;This will take a set hexidecimal strings created by the hexify program and`032
X;  recreate the source file(s).
X;--
X
X`009.EXTRN`009LIB$GET_INPUT
X`009.EXTRN`009LIB$PUT_SCREEN
X`009.MCALL`009$FAB`009`009`009`009; RMS calls
X`009.MCALL`009$RAB
X`009.MCALL`009$CLOSE
X`009.MCALL`009$CONNECT
X`009.MCALL`009$CREATE
X`009.MCALL`009$DISCONNECT
X`009.MCALL`009$GET
X`009.MCALL`009$OPEN
X`009.MCALL`009$WRITE
X`009.MCALL`009$RAB_STORE
X`009.MCALL`009$FAB_STORE
X`012
X`009.SBTTL`009Definitions of symbols
X
XDWRLUN`009=1`009`009`009`009; Disk read LUN
XDWWLUN`009=5`009`009`009`009; Disk write LUN
XTRUE`009=1`009`009`009`009; True
XFALSE`009=0`009`009`009`009; False
XKNORMAL`009=0`009`009`009`009; No error
XLEFTBYTE=`094O377*`094O400`009`009`009; All ones in left byte
XHEXOFFSET=7`009`009`009`009; Offset to get to 'A from '9+1
XCR`009=13.`009`009`009`009; Carriage return
XLF`009=10.`009`009`009`009; Line feed
XMAX.MSG`009=256.`009`009`009`009; Maximum number of chars from XK
XRCV.SOH`009=`094A/:/`009`009`009`009; Receive start of packet
XRCV.EOL`009=13.`009`009`009`009; End of line character
XMSB`009=128.`009`009`009`009; Most significant bit
X; Packet types currently supported
XPKDATA`009=00`009`009`009`009; Data packet code
XPKRFM`009=255.`009`009`009`009; Record format
XPKRAT`009=254.`009`009`009`009; Record attributes
XPKMRS`009=253.`009`009`009`009; Maximum record size
XPKALQ`009=252.`009`009`009`009; File length(blocks)
XPKFILNM`009=251.`009`009`009`009; File name
XPKEOF`009=250.`009`009`009`009; End of task file
X;
X
X`012
X`009.SBTTL`009RMS Data
X
X`009.PSECT`009$PLIT$,LONG
X
XDEFALT:`009.ASCIZ`009'SYS$DISK:'`009`009; System default.
XDEFALN`009=.-DEFALT`009`009`009; Size of the default device.
X`009.EVEN
X`012
X`009.SBTTL`009Data
X
X
XM$FILE:`009.BYTE`009CR,LF
X`009.ASCII`009'Please type the file name: '
XL$FILE=`009.-M$FILE
X
XM$CRLF:`009.BYTE`009CR,LF`009`009`009; Data for carriage return/line feed
XL$CRLF`009=.-M$CRLF
X
X;M$AK:
X;`009.ASCII`009'Y'`009`009`009; Data for aknowledged
X
XM$NAK:
X`009.ASCII`009'N'`009`009`009; Data for not aknowledged
X
XM$UN:
X`009.ASCII`009'U'`009`009`009; Data for unrecognized code
X
XM$RMS:`009.BYTE`009CR,LF,LF
X`009.ASCII`009'RMS ERROR'
XL$RMS`009=.-M$RMS
X
XM$REC:`009.BYTE`009CR,LF,LF
X`009.ASCII`009'RECEIVE ERROR - Try again.'
XL$REC`009=.-M$REC
X`009.EVEN
X
X`012
X`009.SBTTL`009Storage locations
X
X`009.PSECT`009$OWN$,LONG
X`009.ALIGN`009LONG
X
XMSGDSC:`009.BLKW`0091`009`009`009; Data block for terminal output
X`009.BYTE`009DSC$K_DTYPE_T
X`009.BYTE`009DSC$K_CLASS_S
XADDR:`009.ADDRESS ADDR
X
XINP_STR_D:`009`009`009`009; Key string desciptor
X`009 .BLKL`0091
XINP_BUF: .ADDRESS ADDR
X
XINP_STR_LEN:`009`009`009`009; Key string length
X`009.BLKL`0091
X
XWTCOUNT: .BLKL`0091`009`009`009; Number of characters written
XLENGTH:`009.BLKL`0091`009`009`009; Length of data portion of packet
XOPENFL:`009.BLKL`0091`009`009`009; Tells us if the file is open
X
XCHKSUM:`009.BLKL`0091`009`009`009; Checksum for the line
XADDRESS: .BLKL`0091`009`009`009; Current address
XALQLOC:`009.BLKW`0092`009`009`009; Storage for allocation
X
XOUT.N:`009.BLKB`00928.`009`009`009; Space for output file name
XOUT.L`009=.-OUT.N`009`009`009; Length of output file name
X
XINP.N:`009.BLKB`00928.`009`009`009; Space for input file name
XINP.L`009=.-INP.N`009`009`009; Length of input file name
X
X`009.EVEN`009`009`009`009; Need to start RDBUF on even boundary
XRDBUF:`009.BLKB`009MAX.MSG`009`009`009; XK read buffer
X`009.EVEN
XWTBUF:`009.BLKB`009512.`009`009`009; Disk write buffer
X`009.EVEN
X
X
X`012
X`009.SBTTL`009RMS Data structures
X`009.ALIGN`009LONG
X
VRDFAB::`009$FAB`009DNA=DEFALT,DNS=DEFALN,FNA=INP.N,FNS=INP.L,LCH=DWRLUN,FAC=GET
X,SHR=GET
X
X`009.ALIGN`009LONG
XRDRAB::`009$RAB`009FAB=RDFAB,RAC=SEQ
X`009`009`009`009`009; Beginning of RAB block.
X
X`009.ALIGN`009LONG
VWTFAB::`009$FAB`009DNA=DEFALT,DNS=DEFALN,FNA=OUT.N,FNS=OUT.L,LCH=DWWLUN,FAC=PUT
X,SHR=NIL
X
XWTRAB::`009$RAB`009FAB=WTFAB,RAC=SEQ
X`009`009`009`009`009; Beginning of RAB block.
X
X`012
X`009.SBTTL`009Start of program
X
X`009.PSECT`009$CODE$,LONG,EXE
X
XDEHEX::`009.WORD`009`094M<>
XFILE:`009MOVAB`009M$FILE,R11`009`009; Output the get file name message
X`009MOVZBL`009#L$FILE,R12
X`009MOVAB`009INP.N,R10`009`009; Get the file name
X`009MOVZBL`009#INP.L,R1
X`009JSB`009READ
X`009TSTL`009R0`009`009`009; Check for no input
X`009BEQL`009FILE`009`009`009; Go back and get some
X;Open the file
X`009MOVAL`009RDFAB,R1`009`009; Put address of FAB into R1.
X`009$FAB_STORE FAB=R1,FNS=R0`009; Tell RMS file name length
X`009$OPEN`009#RDFAB`009`009`009; Open the file
X`009JSB`009RMSERR`009`009`009; Check for file error
X`009MOVAL`009RDRAB,R1`009`009; Put address of RAB into R1.
X; Put address of user buffer and size and record buffer and size in RAB.
X`009$RAB_STORE RAB=R1,UBF=RDBUF,RBF=RDBUF,USZ=#MAX.MSG,RSZ=#MAX.MSG
X`009$CONNECT #RDRAB`009`009`009; Connect to record.
X`009JSB`009RMSERR`009`009`009; Check for file error
X
X`012
X`009.SBTTL`009Do the real work
X;++
X; Do the actual work
X;--
XBEGIN:`009MOVAL`009M$CRLF,R10`009`009; Get a return/linefeed and output them
X`009MOVZBL`009#L$CRLF,R1
X`009JSB`009WRITE
X
X20$:`009CLRL`009WTCOUNT`009`009`009; Initialize the pointer
X`009CLRL`009ADDRESS`009`009`009; Initialize the address
X`009CLRL`009OPENFL`009`009`009; Set the file to not open
X`012
X`009.SBTTL`009Main loop
X
X; Main loop to get data
XDOLIN:
X`009CLRL`009CHKSUM`009`009`009; Clear the checksum
X`009JSB`009RECEIVE`009`009`009; Get the line
X`009JSB`009CVTBIN`009`009`009; Convert it to a real number
X`009MOVL`009R10,LENGTH`009`009; Save the length
X`009JSB`009CVTBIN`009`009`009;`032
X`009MOVL`009R10,R3`009`009`009; Save high order of address
X`009ashl`009#24.,r3,r3
X`009jsb`009cvtbin
X`009ashl`009#16.,r10,r10
X`009bisl`009r10,r3
X`009jsb`009cvtbin
X`009ashl`009#8.,r10,r10
X`009bisl`009r10,r3
X`009JSB`009CVTBIN`009`009`009;`032
X`009BISL`009R10,R3`009`009`009; Fill in the low order of address
X`009JSB`009CVTBIN`009`009`009;`032
X
X`009CMPL`009#PKDATA,R10`009`009; Check to see if this is regular data
X`009BNEQ`009NOTDAT`009`009`009; If not then check the special cases
X; Check for end of hex file
X`009TSTL`009R3`009`009`009; Check to see if the address is all
X`009BNEQ`009DATST`009`009`009;  zero, if not then branch
X`009TSTL`009LENGTH`009`009`009; Check to see if the length is zero
X`009BNEQ`009DATST`009`009`009;  also, if not then branch
X`009JMP`009FINISH`009`009`009; Must be end of hex file so finish up
X; Regular data to put into the file
XDATST:`009TSTL`009OPENFL`009`009`009; Check to see if the file is open yet
X`009BNEQ`009DAT1`009`009`009; If it is then skip the open
X`009JSB`009OPEN`009`009`009; Open the file
XDAT1:`009CMPL`009R3,ADDRESS`009`009; Check for null compression
X`009BEQL`00910$`009`009`009; If none compressed then continue past
X`009CLRL`009R10`009`009`009; Make a null
X`009JSB`009PUT`009`009`009;  and put it into the file
X`009INCL`009ADDRESS`009`009`009; Point to next address
X`009BRW`009DATST`009`009`009; Go see if there are any more nulls
X; Go to work on the HEX we got on the line
X10$:`009MOVL`009LENGTH,R2`009`009; Get the length
X`009TSTL`009R2`009`009`009; See if there is any data
X`009BEQL`00930$`009`009`009; If not then branch
X25$:`009JSB`009CVTBIN`009`009`009; Convert it
X`009JSB`009PUT`009`009`009; Put the character in the file
X`009INCL`009ADDRESS`009`009`009; Increment the address
X`009SOBGTR`009R2,25$`009`009`009; Repeat until all done
X30$:`009BRW`009LINDON`009`009`009; Go finish this line
X
X`012
X
XNOTDAT:`009MOVAL`009WTFAB,R5`009`009; Get the FAB address
X`009CMPL`009#PKRFM,R10`009`009; Check to see if this is record fmt
X`009BNEQ`009NOTRFM`009`009`009; If not then don't do this stuff
X; Store the Record format (FIX, VAR, ...)
X`009JSB`009CVTBIN`009`009`009;
X`009$FAB_STORE FAB=R5,RFM=R10`009; Store the record format
X`009BRW`009LINDON`009`009`009; Go finish this line
X
XNOTRFM:`009CMPL`009#PKRAT,R10`009`009; Check to see if this is record type
X`009BNEQ`009NOTRAT`009`009`009; If not then branch
X; Store the record type (CR, ...)
X`009JSB`009CVTBIN`009`009`009;
X`009$FAB_STORE FAB=R5,RAT=R10`009; Store the record type
X`009BRW`009LINDON`009`009`009; Go finish this line
X
XNOTRAT:`009CMPL`009#PKMRS,R10`009`009; Check to see if this is max record
X`009BNEQ`009NOTMRS`009`009`009;  size, branch if not
X; Get the maximum record size (512. for tasks)
X`009JSB`009CVTBIN`009`009`009; Convert high order byte
X`009MOVL`009R10,R3`009`009`009; Save it
X`009ASHL`009#8.,R3,R3`009`009; Shift it to the high order byte
X`009JSB`009CVTBIN`009`009`009; Convert low order byte
X`009BISL`009R10,R3`009`009`009; Put low order word into R3 also
X`009$FAB_STORE FAB=R5,MRS=R3`009; Store the maximum record size
X`009BRW`009LINDON`009`009`009; Go finish this line
X
XNOTMRS:`009CMPL`009#PKALQ,R10`009`009; Check to see if this is allocation
X`009BNEQ`009NOTALQ`009`009`009; If not then branch
X; Get the file length (in blocks)
X`009JSB`009CVTBIN`009`009`009; Convert high order byte
X`009MOVL`009R10,R3`009`009`009; Save it
X`009ASHL`009#8.,R3,R3`009`009; Shift it to the high order byte
X`009JSB`009CVTBIN`009`009`009; Convert low order byte
X`009BISL`009R10,R3`009`009`009; Put low order word into R3 also
X`009MOVW`009R3,ALQLOC`009`009; Save it
X`009CLRW `009ALQLOC+2`009`009; clear out high word
X`009$FAB_STORE FAB=R5,ALQ=ALQLOC`009; Store the allocation
X`009BRW`009LINDON`009`009`009; Go finish this line
X
XNOTALQ:`009CMPL`009#PKFILNM,R10`009`009; Check to see if this is file name
X`009BNEQ`009NOTFILNM`009`009; If not then branch
X; Get the file name
X`009MOVL`009LENGTH,R2`009`009; Get the length
X`009$FAB_STORE FAB=R5,FNS=R2`009; Store the file name length
X`009MOVAB`009OUT.N,R3`009`009; Get the output file name address
X25$:`009JSB`009CVTBIN`009`009`009; Convert next character of the name
X`009MOVB`009R10,(R3)+`009`009; Save the character
X`009SOBGTR`009R2,25$`009`009`009; Repeat until all done
X`009MOVAB`009M$CRLF,R10`009`009;
X`009MOVZBL`009#L$CRLF,R1`009`009;
X`009JSB`009WRITE`009`009`009; Output a return/line feed
X`009MOVAB`009OUT.N,R10`009`009;
X`009MOVL`009LENGTH,R1`009`009;
X`009JSB`009WRITE`009`009`009; Output the file name
X`009MOVAB`009M$CRLF,R10`009`009;
X`009MOVZBL`009#L$CRLF,R1`009`009;
X`009JSB`009WRITE`009`009`009; Output a return/line feed
X`009BRW`009LINDON`009`009`009; Go finish this line
X
X`012
X
XNOTFILNM:
X`009CMPL`009#PKEOF,R10`009`009; Check to see if this is end of task
X`009BNEQ`009NOTPKEOF`009`009; If not then branch
X; End of ouput file record found
X`009JSB`009CLTSK`009`009`009; Close the task file
X`009CLRL`009WTCOUNT`009`009`009; Initialize the pointer
X`009CLRL`009ADDRESS`009`009`009; Initialize the address
X`009JMP`009LINDON`009`009`009; Go finish this line
X
X; Unknown code
XNOTPKEOF:`009`009`009`009; Since we don't know what the code
X`009MOVAB`009M$UN,R10`009`009;   just send the unknown code text to
X`009MOVZBL`009#1,R1`009`009`009;   the terminal
X`009JSB`009WRITE`009`009`009;
X`009JMP`009DOLIN`009`009`009; Go do next input line
X`009
X`012
X`009.SBTTL`009Finished with this line
X
X; Line processed without a problem
XLINDON:
X;`009MOVAB`009M$AK,R10`009`009; Get the data address of the`032
X`009`009`009`009`009;  single character
X;`009MOVZBL`009#1,R1`009`009`009; Only write single char to terminal
X;`009JSB`009WRITE`009`009`009; Write to the terminal
X`009JMP`009DOLIN`009`009`009; Good so do next line
X
X`012
X`009.SBTTL`009Finish up
X;++
X;Finish up
X;--
XFINISH:
X; Close the file(s)
X`009JSB`009CLTSK`009`009`009; Close the task file if it isn't yet
X`009MOVAL`009RDFAB,R1`009`009; Get FAB for input file
X`009$CLOSE`009R1`009`009`009; Close the input file
X`009JSB`009RMSERR`009`009`009; Check for file error
XEND:`009MOVL`009#SS$_NORMAL,R0`009`009; Set up successful completion
X`009RET
X`012
X`009.SBTTL`009Close file
X
X;++
X; Close the output file if there is one open
X;
X; If there is an error the program stops with an RMS error
X;
X; Registers destroyed:`009R0, R1
X; The OPENFL state is changed to file not open (OPENFL=0).
X;--
X
XCLTSK:`009TSTL`009OPENFL`009`009`009; See if the task file is open
X`009BEQL`00910$`009`009`009; If not then just return
X
X; Write last buffer if needed
X`009TSTL`009WTCOUNT`009`009`009; See if there is any data not written
X`009BEQL`0098$`009`009`009; If not then branch
X`009MOVAL`009WTRAB,R1`009`009; Get the RAB address
X`009$RAB_STORE RAB=R1,RSZ=WTCOUNT`009; Put its size into the RAB.
X`009$WRITE`009R1`009`009`009; Put the buffer of data.
X`009JSB`009RMSERR`009`009`009; Check for file error
X
X; Close the file
X8$:`009MOVAL`009WTFAB,R1`009`009; Get FAB for output file
X`009$CLOSE`009R1`009`009`009; Close output file
X`009JSB`009RMSERR`009`009`009; Check for file error
X`009CLRL`009OPENFL`009`009`009; Set the state to file not open
X10$:`009RSB`009`009`009`009; Return to sender`009
X`009
X`012
X`009.SBTTL`009Output and input to/from terminal
X;++
X; Write data to terminal.
X;`009R10`009Address of data to output
X;`009R1`009Length of data
X;--
XWRITE:
X`009MOVW`009R1,MSGDSC`009`009; Store the length in the descript blk
X`009MOVL`009R10,ADDR`009`009; Store the address of the ASCII
X`009PUSHAQ`009MSGDSC`009`009`009; Push the descriptor block address
X`009CALLS`009#1,G`094LIB$PUT_OUTPUT`009; Do the output
X`009RSB`009`009`009`009; Return to sender
X
X;++
X; Read from the terminal
X;`009R10`009Address of buffer
X;`009R1`009Number of characters to read
X;`009R11`009Input prompt address
X;`009R12`009Length of prompt
X;
X;Returned:
X;`009R0`009Number of characters read
X;--
XREAD:
X`009MOVL`009R1,INP_STR_D`009`009; Store the buffer length in desc block
X`009MOVL`009R10,INP_BUF`009`009; Store the buffer address in desc blk
X`009MOVL`009R11,ADDR`009`009; Store prompt address in desc block
X`009MOVW`009R12,MSGDSC`009`009; Store length in desctriptor block
X`009PUSHAB`009INP_STR_LEN`009`009; Address for string length
X`009PUSHAQ`009MSGDSC`009`009`009; Push address of prompt descriptor blk
X`009PUSHAB`009INP_STR_D`009`009; String buffer descriptor
X`009CALLS`009#3,G`094LIB$GET_INPUT`009; Get input string value
X`009MOVL`009INP_STR_LEN,R0`009`009; Get actual input length back
X`009RSB`009`009`009`009; Return to sender
X
X`012
X`009.SBTTL`009RMS error routine
X;++
X;Check for RMS error
X; Call with:`009`009R0`009Status of last RMS call (automatically stored`032
X;`009`009`009`009  in R0 by RMS after an operation)
X;
X; Returned:`009`009R0`009Status
X; Registers destroyed:`009R0
X; Program stops after error message is displayed if there is any type of error.
X;--
XRMSERR:
X`009BLBC`009R0,60$`009`009`009; If error, go check it out
X`009MOVL`009#KNORMAL,R0`009`009; Set up a successful return code.
X`009RSB`009`009`009`009; Return to caller
X
X; Here if there is an RMS error we don't know how to handle
X60$:`009PUSHL`009R0`009`009`009; Save the error code
X`009MOVAB`009M$RMS,R10`009`009; Get the address and length of the
X`009MOVL`009#L$RMS,R1`009`009;   message to output
X`009JSB`009WRITE`009`009`009; Output it
X`009POPL`009R0`009`009`009; Get the error code back
X`009RET`009`009`009`009; Exit program
X
X`012
X`009.SBTTL`009Open the output file
X;++
X; Create and open the output file and set the file open flag
X;
X; Registers destroyed:`009R0, R1
X; Program stops after error message is displayed if there is any type of error.
X;--
X
XOPEN:`009MOVL`009#TRUE,OPENFL`009`009; State that the file is open
X`009MOVAL`009WTFAB,R1`009`009; Put address of FAB into R1.
X`009$FAB_STORE FAB=R1,FAC=<BIO,GET>`009; Set the block I/O in FAB.
X`009$FAB_STORE FAB=R1,FOP=CTG`009; Tell RMS to make the task contiguous
X`009$CREATE`009#WTFAB`009`009`009; Create the file
X`009JSB`009RMSERR`009`009`009; Check for file error
X`009MOVAL`009WTRAB,R1`009`009; Put address of RAB into R1.
X; Put address of user buffer and record buffer and sizes into RAB
X`009$RAB_STORE RAB=R1,UBF=WTBUF,RBF=WTBUF,USZ=#512.,RSZ=#512.
X`009$CONNECT #WTRAB`009`009`009; Connect to record.
X`009JSB`009RMSERR`009`009`009; Check for file error
X`009RSB`009`009`009`009; Return to sender
X`012
X`009.SBTTL`009Put a character to the file
X;++
X; Put a character to the output file.
X; The buffer is only written when 512. characters have been sent to the routine
X; If the file does not end on a boundary then the buffer will have to be`032
X; written by some other routine.
X;`032
X; Call with:`009`009R10`009Contains the character to be put into file
X; Registers destroyed:`009R1, R10
X;
X; Program stops after error message is displayed if there is any type of error.
X;--
X
XPUT:`009PUSHL`009R10`009`009`009; Save the character
X`009MOVL`009WTCOUNT,R10`009`009; Get the offset into the buffer
X`009MOVB`009(SP),WTBUF(R10)`009`009; Put the character
X`009TSTL`009(SP)+`009`009`009; Restore the stack
X`009INCL`009WTCOUNT`009`009`009; Increment the offset into the buffer
X`009CMPL`009WTCOUNT,#512.`009`009; Check to see if we are past the end
X`009BNEQ`00910$`009`009`009; If not then branch
X`009MOVAL`009WTRAB,R1`009`009; Get the RAB address
X`009$RAB_STORE RAB=R1,RSZ=WTCOUNT`009; Put its size into the RAB.
X`009$WRITE`009R1`009`009`009; Put the buffer of data.
X`009JSB`009RMSERR`009`009`009; Check for file error
X`009CLRL`009WTCOUNT`009`009`009; Clear the pointer
X10$:`009RSB`009`009`009`009; Return to sender
X`012
X`009.SBTTL`009 Convert to binary
X;++
X; Convert 2 hexidecimal digits to binary
X; Input is from the input buffer pointed to by R4 (it is incremented twice)
X;
X; Call with:`009`009R4`009The pointer into the input buffer
X; Returned:`009`009R10`009The binary walue
X; Registers destroyed:`009R10,R1
X;--
X
XCVTBIN:
X`009CLRL`009R10`009`009`009; Clear R10 for the BISB
X`009BISB`009(R4)+,R10`009`009; Get the next digit
X`009JSB`009BIN`009`009`009;   in place and convert to binary
X`009ASHL`009#4,R10,R10`009`009; Multiply the result by 16
X`009MOVL`009R10,R1`009`009`009;  and save it
X`009CLRL`009R10`009`009`009; Clear R10
X`009BISB`009(R4)+,R10`009`009; Get the next digit
X`009JSB`009BIN`009`009`009; Convert to binary
X`009BISL`009R1,R10`009`009`009; Set the correct bits for high order
X`009ADDL2`009R10,CHKSUM`009`009; Add the value to the checksum
X`009RSB`009`009`009`009; Return to sender
X
XBIN:`009CMPL`009R10,#`094A/9/`009`009; Check to see if above '9
X`009BLEQ`0091$`009`009`009; If not then branch
X`009SUBL2`009#HEXOFFSET,R10`009`009; Subtract offset to alphabet
X1$:`009SUBL2`009#48.,R10`009`009; Make binary
X`009RSB`009`009`009`009; Return to sender
X
X`012
X`009.SBTTL`009Receive a line of data
X
X;++
X; This will get a line of data from the input device
X;
X; Returned:`009`009R4`009Address of start of data buffer
X; Registers destroyed:`009R0, R1, R3, R4
X;
X; A checksum error will cause a NAK to be sent and input to be read again
X; A real error will cause an error message to be output and the program to stop
X;--
X
XRECEIVE:
X; Here to read from a file
X`009MOVAL`009RDRAB,R1`009`009; Get the RAB address
X`009$GET`009R1`009`009`009; Get the record
X`009JSB`009RMSERR`009`009`009; Check for file error
X`009MOVZWL`009#MAX.MSG,R3`009`009; Assume we got a full buffer
X; Here to check the data we got
XRECCHK:`009MOVAL`009RDBUF,R4`009`009; Get the address of the information
X`009CLRL`009R1`009`009`009; Clear the data start address`032
X80$:`009BICB`009#MSB,(R4)`009`009; Clear parity bit
X`009CMPB`009(R4)+,#RCV.SOH`009`009; Check for start of header
X`009BNEQ`00981$`009`009`009; If not the just keep going
X`009MOVL`009R4,R1`009`009`009; Start of header so save it
X81$:`009SOBGTR`009R3,80$`009`009`009; Repeat until done
X`009TSTL`009R1`009`009`009; Check to see if we got a SOH
X`009BNEQ`00985$`009`009`009; If good then skip the jump
X`009JMP`009RECEIVE`009`009`009; If not then re-read
X85$:`009MOVL`009R1,R4`009`009`009; Move to R4 for use
X`009PUSHL`009R4`009`009`009; Save SOH pointer on stack
X
X`009JSB`009CVTBIN`009`009`009; Convert all to binary to see if
X`009MOVL`009R10,R3`009`009`009; Get the length of data
X`009addl2`009#6,r3`009`009`009; add the length of address and field
X`009`009`009`009`009;   type and checksum
X`009BLSS`00994$`009`009`009; If we have a negative number then`032
X`009`009`009`009`009;   must have been a bad length
X`009CMPL`009R3,#MAX.MSG/2-1`009`009; If we got some length that is out of
X`009BGEQ`00994$`009`009`009;   range then NAK right away
X92$:`009JSB`009CVTBIN`009`009`009; Convert all to binary to see if
X`009SOBGTR`009R3,92$`009`009`009;   the checksum is OK
X93$:`009BICL`009#LEFTBYTE,CHKSUM`009; We only want an 8 bit checksum
X`009TSTL`009CHKSUM`009`009`009; Test for a zero checksum
X`009BEQL`00995$`009`009`009; If OK then exit normally
X94$:`009CLRL`009CHKSUM`009`009`009; Clear the checksum for the line
X`009MOVAL`009M$NAK,R10`009`009; Get the address of the message
X`009MOVZBL`009#1,R1`009`009`009; Only write the first character to
X`009JSB`009WRITE`009`009`009;   the terminal
X`009TSTL`009(SP)+`009`009`009; Pull the pointer off the stack
X`009JMP`009RECEIVE`009`009`009; Try to get the line again
X
X; Return to sender
X95$:`009POPL`009R4`009`009`009; Get the pointer back
X`009RSB`009`009`009`009; Return to sender
X
X`012
X`009.SBTTL`009End of the Dehexify
X
X`009.END`009DEHEX
X
$ GOSUB UNPACK_FILE
$ EXIT

