; 0001 MODULE KERFIL (IDENT = '1.0.001' ; 0002 ) = ; 0003 BEGIN ; 0004 ; 0005 !++ ; 0006 ! FACILITY: ; 0007 ! KERMIT-32 Microcomputer to mainframe file transfer utility. ; 0008 ! ; 0009 ! ABSTRACT: ; 0010 ! KERFIL contains all of the file processing for KERMIT-32. This ; 0011 ! module contains the routines to input/output characters to files ; 0012 ! and to open and close the files. ; 0013 ! ; 0014 ! ENVIRONMENT: ; 0015 ! VAX/VMS user mode. ; 0016 ! ; 0017 ! AUTHOR: Robert C. McQueen, CREATION DATE: 28-March-1983 ; 0018 ! ; 0019 !-- ; 0020 ; 0021 %SBTTL 'Table of Contents' ; 0022 %SBTTL 'Revision History' ; 0023 ; 0024 !++ ; 0025 ! ; 0026 ! 1.0.000 By: Robert C. McQueen On: 28-March-1983 ; 0027 ! Create this module. ; 0028 ! 1.0.001 By: Robert C. McQueen On: 4-May-1983 ; 0029 ! Remove checks on the PUT_FILE routine. ; 0030 ! ; 0031 !-- ; 0032 ; 0033 %SBTTL 'Forward definitions' ; 0034 ; 0035 FORWARD ROUTINE ; 0036 FILE_DUMP, ! Dump the contents of the record ; 0037 DUMP_BUFFER, ! Worker routine for FILE_DUMP. ; 0038 FILE_ERROR : NOVALUE; ! Error processing routine ; 0039 ; 0040 %SBTTL 'Require/Library files' ; 0041 ! ; 0042 ! INCLUDE FILES: ; 0043 ! ; 0044 ; 0045 LIBRARY 'SYS$LIBRARY:STARLET'; ; 0046 ; 0047 REQUIRE 'KERCOM.REQ'; ; 0204 ; 0205 REQUIRE 'KERERR.REQ'; ; 0254 ; 0255 %SBTTL 'Macro definitions' ; 0256 ! ; 0257 ! MACROS: ; 0258 ! ; 0259 %SBTTL 'Literal symbol definitions' ; 0260 ; 0261 ! ; 0262 ! EQUATED SYMBOLS: ; 0263 ! ; 0264 ! ; 0265 ! Various states for reading the data from the file ; 0266 ! ; 0267 ; 0268 LITERAL ; 0269 F_STATE_PRE = 0, ! Prefix state ; 0270 F_STATE_PRE1 = 1, ! Other prefix state ; 0271 F_STATE_DATA = 2, ! Data processing state ; 0272 F_STATE_POST = 3, ! Postfix processing state ; 0273 F_STATE_POST1 = 4, ! Secondary postfix processing state ; 0274 F_STATE_MIN = 0, ! Min state number ; 0275 F_STATE_MAX = 4; ! Max state number ; 0276 ; 0277 %SBTTL 'Local storage' ; 0278 ! ; 0279 ! OWN STORAGE: ; 0280 ! ; 0281 ; 0282 OWN ; 0283 EOF_FLAG, ! End of file reached. ; 0284 STATUS, ! Status returned by RMS calls ; 0285 ! used in the FIL_ERROR routine ; 0286 FILE_FAB : $FAB_DECL, ! FAB for file processing ; 0287 FILE_NAM : $NAM_DECL, ! NAM for file processing ; 0288 FILE_RAB : $RAB_DECL, ! RAB for file processing ; 0289 ; 0290 FILE_MODE, ! Mode of file (reading/writing) ; 0291 FILE_REC_POINTER, ! Pointer to the record information ; 0292 FILE_REC_COUNT, ! Count of the number of bytes ; 0293 FILE_RECORD : VECTOR [CH$ALLOCATION (MAX_REC_LENGTH)], ; 0294 ; 0295 EXP_STR : VECTOR [CH$ALLOCATION (NAM$C_MAXRSS)], ; 0296 RES_STR : VECTOR [CH$ALLOCATION (NAM$C_MAXRSS)], ; 0297 RES_STR_D : BLOCK [8, BYTE]; ! Descriptor for the string ; 0298 ; 0299 %SBTTL 'Global storage' ; 0300 ! ; 0301 ! Global storage: ; 0302 ! ; 0303 ; 0304 GLOBAL ; 0305 FILE_TYPE, ! Type of file being xfered ; 0306 FILE_DESC : BLOCK [8, BYTE]; ! File name descriptor ; 0307 ; 0308 %SBTTL 'External routines and storage' ; 0309 ! ; 0310 ! EXTERNAL REFERENCES: ; 0311 ! ; 0312 ! ; 0313 ! Storage in KERMSG ; 0314 ! ; 0315 ; 0316 EXTERNAL ; 0317 FILE_SIZE, ! Number of characters in FILE_NAME ; 0318 FILE_NAME : VECTOR [CH$ALLOCATION (MAX_FILE_NAME)]; ; 0319 ; 0320 ! ; 0321 ! System libraries ; 0322 ! ; 0323 ; 0324 EXTERNAL ROUTINE ; 0325 LIB$SIGNAL : ADDRESSING_MODE(GENERAL) NOVALUE; ; 0326 ; 0327 %SBTTL 'File processing -- FILE_INIT - Initialization' ; 0328 ; 0329 GLOBAL ROUTINE FILE_INIT : NOVALUE = ; 0330 ; 0331 !++ ; 0332 ! FUNCTIONAL DESCRIPTION: ; 0333 ! ; 0334 ! This routine will initialize some of the storage in the file processing ; 0335 ! module. ; 0336 ! ; 0337 ! CALLING SEQUENCE: ; 0338 ! ; 0339 ! FILE_INIT(); ; 0340 ! ; 0341 ! INPUT PARAMETERS: ; 0342 ! ; 0343 ! None. ; 0344 ! ; 0345 ! IMPLICIT INPUTS: ; 0346 ! ; 0347 ! None. ; 0348 ! ; 0349 ! OUPTUT PARAMETERS: ; 0350 ! ; 0351 ! None. ; 0352 ! ; 0353 ! IMPLICIT OUTPUTS: ; 0354 ! ; 0355 ! None. ; 0356 ! ; 0357 ! COMPLETION CODES: ; 0358 ! ; 0359 ! None. ; 0360 ! ; 0361 ! SIDE EFFECTS: ; 0362 ! ; 0363 ! None. ; 0364 ! ; 0365 !-- ; 0366 ; 0367 BEGIN ; 0368 FILE_TYPE = FILE_ASC; ; 0369 ! Now set up the file specification descriptor ; 0370 FILE_DESC [DSC$B_CLASS] = DSC$K_CLASS_S; ; 0371 FILE_DESC [DSC$B_DTYPE] = DSC$K_DTYPE_T; ; 0372 FILE_DESC [DSC$A_POINTER] = FILE_NAME; ; 0373 FILE_DESC [DSC$W_LENGTH] = 0; ; 0374 EOF_FLAG = FALSE; ; 0375 END; ! End of FILE_INIT .TITLE KERFIL .IDENT \1.0.001\ .PSECT $OWN$,NOEXE,2 ;EOF_FLAG U.4: .BLKB 4 ;STATUS U.5: .BLKB 4 ;FILE_FAB U.6: .BLKB 80 ;FILE_NAM U.7: .BLKB 96 ;FILE_RAB U.8: .BLKB 68 ;FILE_MODE U.9: .BLKB 4 ;FILE_REC_POINTER U.10: .BLKB 4 ;FILE_REC_COUNT U.11: .BLKB 4 ;FILE_RECORD U.12: .BLKB 256 ;EXP_STR U.13: .BLKB 252 ;RES_STR U.14: .BLKB 252 ;RES_STR_D U.15: .BLKB 8 .PSECT $GLOBAL$,NOEXE,2 FILE_TYPE:: .BLKB 4 FILE_DESC:: .BLKB 8 .EXTRN FILE_SIZE, FILE_NAME, LIB$SIGNAL .PSECT $CODE$,NOWRT,2 .ENTRY FILE_INIT, ^M<> ;FILE_INIT, Save nothing ; 0329 MOVL #1, W^FILE_TYPE ;#1, FILE_TYPE ; 0368 MOVL #17694720, W^FILE_DESC ;#17694720, FILE_DESC ; 0373 MOVAB W^FILE_NAME, W^FILE_DESC+4 ;FILE_NAME, FILE_DESC+4 ; 0372 CLRL W^U.4 ;U.4 ; 0374 RET ; ; 0329 ; Routine Size: 28 bytes, Routine Base: $CODE$ + 0000 ; 0376 ; 0377 %SBTTL 'GET_FILE' ; 0378 ; 0379 GLOBAL ROUTINE GET_FILE (CHARACTER) = ; 0380 ; 0381 !++ ; 0382 ! FUNCTIONAL DESCRIPTION: ; 0383 ! ; 0384 ! This routine will return a character from the input file. ; 0385 ! The character will be stored into the location specified by ; 0386 ! CHARACTER. ; 0387 ! ; 0388 ! CALLING SEQUENCE: ; 0389 ! ; 0390 ! GET_FILE (LOCATION_TO_STORE_CHAR); ; 0391 ! ; 0392 ! INPUT PARAMETERS: ; 0393 ! ; 0394 ! LOCATION_TO_STORE_CHAR - This is the address to store the character ; 0395 ! into. ; 0396 ! ; 0397 ! IMPLICIT INPUTS: ; 0398 ! ; 0399 ! None. ; 0400 ! ; 0401 ! OUTPUT PARAMETERS: ; 0402 ! ; 0403 ! Character stored into the location specified. ; 0404 ! ; 0405 ! IMPLICIT OUTPUTS: ; 0406 ! ; 0407 ! None. ; 0408 ! ; 0409 ! COMPLETION CODES: ; 0410 ! ; 0411 ! True - Character stored into the location specified. ; 0412 ! False - End of file reached. ; 0413 ! ; 0414 ! SIDE EFFECTS: ; 0415 ! ; 0416 ! None. ; 0417 ! ; 0418 !-- ; 0419 ; 0420 BEGIN ; 0421 ; 0422 OWN ; 0423 CC_COUNT, ! Count of the number of CC things to output ; 0424 CC_TYPE; ! Type of carriage control being processed. ; 0425 ; 0426 LOCAL ; 0427 RAT; ; 0428 ; 0429 IF .EOF_FLAG THEN RETURN KER_EOF; ; 0430 ; 0431 RAT = .FILE_FAB [FAB$B_RAT] AND ( NOT FAB$M_BLK); ; 0432 RETURN ; 0433 ; 0434 WHILE TRUE DO ; 0435 BEGIN ; 0436 ; 0437 SELECTONE .RAT OF ; 0438 SET ; 0439 ; 0440 [FAB$M_PRN, FAB$M_FTN, FAB$M_CR] : ; 0441 ; 0442 CASE .FILE_FAB [FAB$L_CTX] FROM F_STATE_MIN TO F_STATE_MAX OF ; 0443 SET ; 0444 ; 0445 [F_STATE_PRE] : ; 0446 BEGIN ; 0447 STATUS = $GET (RAB = FILE_RAB); ; 0448 ; 0449 IF NOT .STATUS ; 0450 THEN ; 0451 ; 0452 IF .STATUS EQL RMS$_EOF ; 0453 THEN ; 0454 BEGIN ; 0455 EOF_FLAG = TRUE; ; 0456 EXITLOOP KER_EOF; ; 0457 END ; 0458 ELSE ; 0459 BEGIN ; 0460 FILE_ERROR (); ; 0461 EOF_FLAG = TRUE; ; 0462 EXITLOOP KER_RMS32; ; 0463 END; ; 0464 ; 0465 FILE_REC_POINTER = CH$PTR (FILE_RECORD); ; 0466 FILE_REC_COUNT = .FILE_RAB [RAB$W_RSZ]; ; 0467 ; 0468 SELECTONE .RAT OF ; 0469 SET ; 0470 ; 0471 [FAB$M_CR] : ; 0472 BEGIN ; 0473 .CHARACTER = CHR_LFD; ; 0474 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0475 EXITLOOP KER_NORMAL; ; 0476 END; ; 0477 ; 0478 [FAB$M_PRN] : ; 0479 BEGIN ; 0480 CC_COUNT = CH$RCHAR_A (FILE_REC_POINTER); ; 0481 CC_TYPE = CH$RCHAR_A (FILE_REC_POINTER); ; 0482 FILE_REC_COUNT = .FILE_REC_COUNT - 2; ; 0483 ; 0484 IF .CC_COUNT<6, 1> EQL 0 ; 0485 THEN ; 0486 BEGIN ; 0487 ; 0488 IF .CC_COUNT<0, 6> NEQ 0 ; 0489 THEN ; 0490 BEGIN ; 0491 .CHARACTER = CHR_LFD; ; 0492 FILE_FAB [FAB$L_CTX] = F_STATE_PRE1; ; 0493 EXITLOOP KER_NORMAL; ; 0494 END ; 0495 ELSE ; 0496 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0497 ; 0498 END ; 0499 ELSE ; 0500 BEGIN ; 0501 ; 0502 SELECTONE .CC_COUNT<4, 2> OF ; 0503 SET ; 0504 ; 0505 [%B'00'] : ; 0506 BEGIN ; 0507 .CHARACTER = .CC_COUNT<0, 4>; ; 0508 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0509 EXITLOOP KER_NORMAL; ; 0510 END; ; 0511 ; 0512 [%B'10'] : ; 0513 BEGIN ; 0514 .CHARACTER = .CC_COUNT<0, 4> + 128; ; 0515 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0516 EXITLOOP KER_NORMAL; ; 0517 END; ; 0518 ; 0519 [OTHERWISE, %B'11'] : ; 0520 EXITLOOP KER_ILLFILTYP; ; 0521 TES; ; 0522 ; 0523 END; ; 0524 ; 0525 END; ; 0526 ; 0527 [FAB$M_FTN] : ; 0528 BEGIN ; 0529 CC_TYPE = CH$RCHAR_A (FILE_REC_POINTER); ; 0530 FILE_REC_COUNT = .FILE_REC_COUNT - 1; ; 0531 ; 0532 SELECTONE .CC_TYPE OF ; 0533 SET ; 0534 ; 0535 [CHR_NUL] : ; 0536 BEGIN ; 0537 .CHARACTER = CH$RCHAR_A (FILE_REC_POINTER); ; 0538 FILE_REC_COUNT = .FILE_REC_COUNT - 1; ; 0539 END; ; 0540 ; 0541 [%C'$', %C' ', OTHERWISE] : ; 0542 BEGIN ; 0543 .CHARACTER = CHR_LFD; ; 0544 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0545 END; ; 0546 ; 0547 [%C'0'] : ; 0548 BEGIN ; 0549 .CHARACTER = CHR_LFD; ; 0550 FILE_FAB [FAB$L_CTX] = F_STATE_PRE1; ; 0551 CC_COUNT = 1; ; 0552 END; ; 0553 ; 0554 [%C'1'] : ; 0555 BEGIN ; 0556 .CHARACTER = CHR_FFD; ; 0557 EXITLOOP KER_NORMAL; ; 0558 END; ; 0559 ; 0560 [%C'+'] : ; 0561 BEGIN ; 0562 .CHARACTER = CH$RCHAR_A (FILE_REC_POINTER); ; 0563 FILE_REC_COUNT = .FILE_REC_COUNT - 1; ; 0564 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0565 END; ; 0566 TES; ; 0567 ; 0568 EXITLOOP KER_NORMAL; ; 0569 END; ; 0570 TES; ; 0571 ; 0572 END; ; 0573 ; 0574 [F_STATE_PRE1] : ; 0575 ; 0576 IF .RAT EQL FAB$M_FTN OR .RAT EQL FAB$M_PRN ; 0577 THEN ; 0578 BEGIN ; 0579 .CHARACTER = CHR_LFD; ; 0580 CC_COUNT = .CC_COUNT - 1; ; 0581 ; 0582 IF .CC_COUNT EQL 0 AND .RAT EQL FAB$M_FTN ; 0583 THEN ; 0584 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0585 ; 0586 EXITLOOP KER_NORMAL; ; 0587 END ; 0588 ELSE ; 0589 EXITLOOP KER_ILLFILTYP; ; 0590 ; 0591 [F_STATE_DATA] : ; 0592 BEGIN ; 0593 IF .FILE_REC_COUNT EQL 0 THEN ; 0594 FILE_FAB[FAB$L_CTX] = F_STATE_POST ; 0595 ELSE ; 0596 BEGIN ; 0597 .CHARACTER = CH$RCHAR_A (FILE_REC_POINTER); ; 0598 FILE_REC_COUNT = .FILE_REC_COUNT - 1; ; 0599 EXITLOOP KER_NORMAL; ; 0600 END; ; 0601 END; ; 0602 ; 0603 [F_STATE_POST] : ; 0604 BEGIN ; 0605 ; 0606 SELECTONE .RAT OF ; 0607 SET ; 0608 ; 0609 [FAB$M_CR] : ; 0610 BEGIN ; 0611 .CHARACTER = CHR_CRT; ; 0612 FILE_FAB [FAB$L_CTX] = F_STATE_PRE; ; 0613 EXITLOOP KER_NORMAL; ; 0614 END; ; 0615 ; 0616 [FAB$M_FTN] : ; 0617 BEGIN ; 0618 FILE_FAB [FAB$L_CTX] = F_STATE_PRE; ; 0619 ; 0620 IF .CC_TYPE NEQ CHR_NUL AND .CC_TYPE NEQ %C'$' ; 0621 THEN ; 0622 BEGIN ; 0623 .CHARACTER = CHR_CRT; ; 0624 EXITLOOP KER_NORMAL; ; 0625 END; ; 0626 ; 0627 END; ; 0628 ; 0629 [FAB$M_PRN] : ; 0630 BEGIN ; 0631 ; 0632 IF .CC_TYPE<6, 1> EQL 0 ; 0633 THEN ; 0634 BEGIN ; 0635 ; 0636 IF .CC_COUNT<0, 6> NEQ 0 ; 0637 THEN ; 0638 BEGIN ; 0639 .CHARACTER = CHR_LFD; ; 0640 FILE_FAB [FAB$L_CTX] = F_STATE_POST1; ; 0641 EXITLOOP KER_NORMAL; ; 0642 END ; 0643 ELSE ; 0644 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0645 ; 0646 END ; 0647 ELSE ; 0648 BEGIN ; 0649 ; 0650 SELECTONE .CC_TYPE<4, 2> OF ; 0651 SET ; 0652 ; 0653 [%B'00'] : ; 0654 BEGIN ; 0655 .CHARACTER = .CC_TYPE<0, 4>; ; 0656 FILE_FAB [FAB$L_CTX] = F_STATE_PRE; ; 0657 EXITLOOP KER_NORMAL; ; 0658 END; ; 0659 ; 0660 [%B'10'] : ; 0661 BEGIN ; 0662 .CHARACTER = .CC_TYPE<0, 4> + 128; ; 0663 FILE_FAB [FAB$L_CTX] = F_STATE_PRE; ; 0664 EXITLOOP KER_NORMAL; ; 0665 END; ; 0666 ; 0667 [OTHERWISE, %B'11'] : ; 0668 EXITLOOP KER_ILLFILTYP; ; 0669 TES; ; 0670 ; 0671 END; ; 0672 ; 0673 END; ; 0674 TES; ! End SELECTONE .RAT ; 0675 ; 0676 END; ; 0677 ; 0678 [F_STATE_POST1] : ; 0679 ; 0680 IF .RAT EQL FAB$M_PRN ; 0681 THEN ; 0682 BEGIN ; 0683 .CHARACTER = CHR_LFD; ; 0684 CC_COUNT = .CC_COUNT - 1; ; 0685 ; 0686 IF .CC_COUNT EQL 0 AND .RAT EQL FAB$M_FTN ; 0687 THEN ; 0688 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0689 ; 0690 IF .CC_COUNT EQL -1 AND .RAT EQL FAB$M_PRN ; 0691 THEN ; 0692 BEGIN ; 0693 .CHARACTER = CHR_CRT; ; 0694 FILE_FAB [FAB$L_CTX] = F_STATE_DATA; ; 0695 END; ; 0696 ; 0697 EXITLOOP KER_NORMAL; ; 0698 END ; 0699 ELSE ; 0700 EXITLOOP KER_ILLFILTYP; ; 0701 ; 0702 TES; ! End of CASE .STATE ; 0703 ; 0704 [OTHERWISE] : ; 0705 BEGIN ; 0706 ; 0707 WHILE .FILE_REC_COUNT LEQ 0 DO ; 0708 BEGIN ; 0709 FILE_REC_POINTER = CH$PTR (FILE_RECORD); ; 0710 STATUS = $GET (RAB = FILE_RAB); ; 0711 ; 0712 IF NOT .STATUS ; 0713 THEN ; 0714 ; 0715 IF .STATUS EQL RMS$_EOF ; 0716 THEN ; 0717 BEGIN ; 0718 EOF_FLAG = TRUE; ; 0719 EXITLOOP KER_EOF; ; 0720 END ; 0721 ELSE ; 0722 BEGIN ; 0723 FILE_ERROR (); ; 0724 EOF_FLAG = TRUE; ; 0725 EXITLOOP KER_RMS32; ; 0726 END; ; 0727 ; 0728 FILE_REC_COUNT = .FILE_RAB [RAB$W_RSZ]; ; 0729 END; ; 0730 ; 0731 FILE_REC_COUNT = .FILE_REC_COUNT - 1; ; 0732 .CHARACTER = CH$RCHAR_A (FILE_REC_POINTER); ; 0733 EXITLOOP KER_NORMAL; ; 0734 END; ; 0735 TES; ! End of SELECTONE .RAT ; 0736 ; 0737 END; ! End WHILE TRUE DO loop ; 0738 ; 0739 END; ! End of GET_FILE .PSECT $OWN$,NOEXE,2 ;CC_COUNT U.20: .BLKB 4 ;CC_TYPE U.21: .BLKB 4 .EXTRN SYS$GET .PSECT $CODE$,NOWRT,2 .ENTRY GET_FILE, ^M ;GET_FILE, Save R2,R3,R4 ; 0379 MOVAB G^SYS$GET, R4 ;SYS$GET, R4 ; MOVAB W^U.10, R3 ;U.10, R3 ; BLBS -256(R3), 6$ ;EOF_FLAG, 6$ ; 0429 MOVZBL -218(R3), R2 ;FILE_FAB+30, RAT ; 0431 BICL2 #8, R2 ;#8, RAT ; 1$: TSTL R2 ;RAT ; 0437 BLEQ 2$ ;2$ ; CMPL R2, #2 ;RAT, #2 ; BLEQ 3$ ;3$ ; 2$: CMPL R2, #4 ;RAT, #4 ; BEQL 3$ ;3$ ; BRW 38$ ;38$ ; 3$: CASEL -224(R3), #0, #4 ;FILE_FAB+24, #0, #4 ; 0442 4$: .WORD 5$-4$,- ;5$-4$,- ; 17$-4$,- ;17$-4$,- ; 23$-4$,- ;23$-4$,- ; 24$-4$,- ;24$-4$,- ; 35$-4$ ;35$-4$ ; 5$: PUSHAB -72(R3) ;FILE_RAB ; 0447 CALLS #1, (R4) ;#1, SYS$GET ; MOVL R0, -252(R3) ;R0, STATUS ; BLBS -252(R3), 8$ ;STATUS, 8$ ; 0449 CMPL -252(R3), #98938 ;STATUS, #98938 ; 0452 BNEQ 7$ ;7$ ; MOVL #1, -256(R3) ;#1, EOF_FLAG ; 0455 6$: MOVL #134316107, R0 ;#134316107, R0 ; 0454 RET ; ; 7$: CALLS #0, W^U.3 ;#0, U.3 ; 0460 MOVL #1, -256(R3) ;#1, EOF_FLAG ; 0461 MOVL #134316114, R0 ;#134316114, R0 ; 0459 RET ; ; 8$: MOVAB 8(R3), (R3) ;FILE_RECORD, FILE_REC_POINTER ; 0465 MOVZWL -38(R3), 4(R3) ;FILE_RAB+34, FILE_REC_COUNT ; 0466 CMPL R2, #2 ;RAT, #2 ; 0468 BNEQ 10$ ;10$ ; 9$: MOVL #10, @4(AP) ;#10, @CHARACTER ; 0473 BRB 14$ ;14$ ; 0474 10$: CMPL R2, #4 ;RAT, #4 ; 0468 BNEQ 15$ ;15$ ; MOVZBL @0(R3), 776(R3) ;@FILE_REC_POINTER, CC_COUNT ; 0480 INCL (R3) ;FILE_REC_POINTER ; MOVZBL @0(R3), 780(R3) ;@FILE_REC_POINTER, CC_TYPE ; 0481 INCL (R3) ;FILE_REC_POINTER ; SUBL2 #2, 4(R3) ;#2, FILE_REC_COUNT ; 0482 BBS #6, 776(R3), 12$ ;#6, CC_COUNT, 12$ ; 0484 BITB 776(R3), #63 ;CC_COUNT, #63 ; 0488 BNEQ 11$ ;11$ ; BRW 29$ ;29$ ; 11$: MOVL #10, @4(AP) ;#10, @CHARACTER ; 0491 MOVL #1, -224(R3) ;#1, FILE_FAB+24 ; 0492 BRB 22$ ;22$ ; 0490 12$: EXTZV #4, #2, 776(R3), R0 ;#4, #2, CC_COUNT, R0 ; 0502 BNEQ 13$ ;13$ ; EXTZV #0, #4, 776(R3), @4(AP) ;#0, #4, CC_COUNT, @CHARACTER ; 0507 BRB 21$ ;21$ ; 0508 13$: CMPL R0, #2 ;R0, #2 ; 0502 BNEQ 19$ ;19$ ; EXTZV #0, #4, 776(R3), @4(AP) ;#0, #4, CC_COUNT, @CHARACTER ; 0514 ADDL2 #128, @4(AP) ;#128, @CHARACTER ; 14$: BRB 21$ ;21$ ; 0515 15$: CMPL R2, #1 ;RAT, #1 ; 0468 BNEQ 27$ ;27$ ; MOVZBL @0(R3), 780(R3) ;@FILE_REC_POINTER, CC_TYPE ; 0529 INCL (R3) ;FILE_REC_POINTER ; DECL 4(R3) ;FILE_REC_COUNT ; 0530 MOVL 780(R3), R0 ;CC_TYPE, R0 ; 0532 BNEQ 9$ ;9$ ; 16$: MOVZBL @0(R3), @4(AP) ;@FILE_REC_POINTER, @CHARACTER ; 0537 INCL (R3) ;FILE_REC_POINTER ; DECL 4(R3) ;FILE_REC_COUNT ; 0538 BRB 28$ ;28$ ; 0532 17$: CLRL R0 ;R0 ; 0576 CMPL R2, #1 ;RAT, #1 ; BNEQ 18$ ;18$ ; INCL R0 ;R0 ; BRB 20$ ;20$ ; 18$: CMPL R2, #4 ;RAT, #4 ; 19$: BEQL 20$ ;20$ ; BRW 37$ ;37$ ; 20$: MOVL #10, @4(AP) ;#10, @CHARACTER ; 0579 DECL 776(R3) ;CC_COUNT ; 0580 BNEQ 28$ ;28$ ; 0582 BLBC R0, 28$ ;R0, 28$ ; 21$: MOVL #2, -224(R3) ;#2, FILE_FAB+24 ; 0584 22$: BRB 28$ ;28$ ; 0578 23$: TSTL 4(R3) ;FILE_REC_COUNT ; 0593 BNEQ 16$ ;16$ ; MOVL #3, -224(R3) ;#3, FILE_FAB+24 ; 0594 BRB 30$ ;30$ ; 0593 24$: CMPL R2, #2 ;RAT, #2 ; 0606 BNEQ 25$ ;25$ ; MOVL #13, @4(AP) ;#13, @CHARACTER ; 0611 BRB 33$ ;33$ ; 0612 25$: CMPL R2, #1 ;RAT, #1 ; 0606 BNEQ 26$ ;26$ ; CLRL -224(R3) ;FILE_FAB+24 ; 0618 MOVL 780(R3), R0 ;CC_TYPE, R0 ; 0620 BEQL 30$ ;30$ ; CMPL R0, #36 ;R0, #36 ; BEQL 30$ ;30$ ; MOVL #13, @4(AP) ;#13, @CHARACTER ; 0623 BRB 34$ ;34$ ; 0622 26$: CMPL R2, #4 ;RAT, #4 ; 0606 27$: BNEQ 30$ ;30$ ; BBS #6, 780(R3), 31$ ;#6, CC_TYPE, 31$ ; 0632 BITB 776(R3), #63 ;CC_COUNT, #63 ; 0636 BEQL 29$ ;29$ ; MOVL #10, @4(AP) ;#10, @CHARACTER ; 0639 MOVL #4, -224(R3) ;#4, FILE_FAB+24 ; 0640 28$: BRB 34$ ;34$ ; 0638 29$: MOVL #2, -224(R3) ;#2, FILE_FAB+24 ; 0644 30$: BRW 1$ ;1$ ; 0632 31$: EXTZV #4, #2, 780(R3), R0 ;#4, #2, CC_TYPE, R0 ; 0650 BNEQ 32$ ;32$ ; EXTZV #0, #4, 780(R3), @4(AP) ;#0, #4, CC_TYPE, @CHARACTER ; 0655 BRB 33$ ;33$ ; 0656 32$: CMPL R0, #2 ;R0, #2 ; 0650 BNEQ 37$ ;37$ ; EXTZV #0, #4, 780(R3), @4(AP) ;#0, #4, CC_TYPE, @CHARACTER ; 0662 ADDL2 #128, @4(AP) ;#128, @CHARACTER ; 33$: CLRL -224(R3) ;FILE_FAB+24 ; 0663 34$: BRB 42$ ;42$ ; 0661 35$: CLRL R1 ;R1 ; 0680 CMPL R2, #4 ;RAT, #4 ; BNEQ 37$ ;37$ ; INCL R1 ;R1 ; MOVL #10, @4(AP) ;#10, @CHARACTER ; 0683 DECL 776(R3) ;CC_COUNT ; 0684 MOVL 776(R3), R0 ;CC_COUNT, R0 ; 0686 BNEQ 36$ ;36$ ; CMPL R2, #1 ;RAT, #1 ; BNEQ 36$ ;36$ ; MOVL #2, -224(R3) ;#2, FILE_FAB+24 ; 0688 36$: CMPL R0, #-1 ;R0, #-1 ; 0690 BNEQ 42$ ;42$ ; BLBC R1, 42$ ;R1, 42$ ; MOVL #13, @4(AP) ;#13, @CHARACTER ; 0693 BRW 21$ ;21$ ; 0694 37$: MOVL #134316130, R0 ;#134316130, R0 ; 0700 RET ; ; 38$: TSTL 4(R3) ;FILE_REC_COUNT ; 0707 BGTR 41$ ;41$ ; MOVAB 8(R3), (R3) ;FILE_RECORD, FILE_REC_POINTER ; 0709 PUSHAB -72(R3) ;FILE_RAB ; 0710 CALLS #1, (R4) ;#1, SYS$GET ; MOVL R0, -252(R3) ;R0, STATUS ; BLBS -252(R3), 40$ ;STATUS, 40$ ; 0712 CMPL -252(R3), #98938 ;STATUS, #98938 ; 0715 BEQL 39$ ;39$ ; CALLS #0, W^U.3 ;#0, U.3 ; 0723 39$: MOVL #1, -256(R3) ;#1, EOF_FLAG ; 0724 BRB 41$ ;41$ ; 0722 40$: MOVZWL -38(R3), 4(R3) ;FILE_RAB+34, FILE_REC_COUNT ; 0728 BRB 38$ ;38$ ; 0707 41$: DECL 4(R3) ;FILE_REC_COUNT ; 0731 MOVZBL @0(R3), @4(AP) ;@FILE_REC_POINTER, @CHARACTER ; 0732 INCL (R3) ;FILE_REC_POINTER ; 42$: MOVL #134316043, R0 ;#134316043, R0 ; 0705 RET ; ; 0379 ; Routine Size: 573 bytes, Routine Base: $CODE$ + 001C ; 0740 ; 0741 %SBTTL 'PUT_FILE' ; 0742 ; 0743 GLOBAL ROUTINE PUT_FILE (CHARACTER) = ; 0744 ; 0745 !++ ; 0746 ! FUNCTIONAL DESCRIPTION: ; 0747 ! ; 0748 ! This routine will store a character into the record buffer ; 0749 ! that we are building. It will output the buffer to disk ; 0750 ! when the end of line characters are found. ; 0751 ! ; 0752 ! CALLING SEQUENCE: ; 0753 ! ; 0754 ! STATUS = PUT_FILE(Character); ; 0755 ! ; 0756 ! INPUT PARAMETERS: ; 0757 ! ; 0758 ! Character - Address of the character to output in the file. ; 0759 ! ; 0760 ! IMPLICIT INPUTS: ; 0761 ! ; 0762 ! None. ; 0763 ! ; 0764 ! OUTPUT PARAMETERS: ; 0765 ! ; 0766 ! Status - True if no problems writing the character ; 0767 ! False if there were problems writing the character. ; 0768 ! ; 0769 ! IMPLICIT OUTPUTS: ; 0770 ! ; 0771 ! None. ; 0772 ! ; 0773 ! COMPLETION CODES: ; 0774 ! ; 0775 ! None. ; 0776 ! ; 0777 ! SIDE EFFECTS: ; 0778 ! ; 0779 ! None. ; 0780 ! ; 0781 !-- ; 0782 ; 0783 BEGIN ; 0784 ; 0785 SELECTONE .FILE_TYPE OF ; 0786 SET ; 0787 [FILE_ASC] : ; 0788 BEGIN ; 0789 IF .CHARACTER EQL CHR_LFD OR .CHARACTER EQL CHR_NUL THEN ; 0790 RETURN KER_NORMAL; ; 0791 ; 0792 IF .CHARACTER EQL CHR_CRT THEN RETURN DUMP_BUFFER(); ; 0793 ; 0794 IF .FILE_REC_COUNT EQL MAX_REC_LENGTH THEN ; 0795 BEGIN ; 0796 LIB$SIGNAL (KER_REC_TOO_BIG); ; 0797 RETURN KER_REC_TOO_BIG; ; 0798 END; ; 0799 ; 0800 FILE_REC_COUNT = .FILE_REC_COUNT + 1; ; 0801 CH$WCHAR_A (.CHARACTER, FILE_REC_POINTER); ; 0802 ; 0803 END; ; 0804 ; 0805 [FILE_BIN] : ; 0806 BEGIN ; 0807 ; 0808 IF .FILE_REC_COUNT EQL MAX_REC_LENGTH THEN ; 0809 BEGIN ; 0810 LIB$SIGNAL (KER_REC_TOO_BIG); ; 0811 RETURN KER_REC_TOO_BIG; ; 0812 END; ; 0813 ; 0814 FILE_REC_COUNT = .FILE_REC_COUNT + 1; ; 0815 CH$WCHAR_A (.CHARACTER, FILE_REC_POINTER); ; 0816 END; ; 0817 TES; ; 0818 RETURN KER_NORMAL; ; 0819 END; ! End of PUT_FILE .ENTRY PUT_FILE, ^M ;PUT_FILE, Save R2 ; 0743 MOVAB W^U.11, R2 ;U.11, R2 ; MOVL W^FILE_TYPE, R0 ;FILE_TYPE, R0 ; 0785 CMPL R0, #1 ;R0, #1 ; BNEQ 2$ ;2$ ; CMPL 4(AP), #10 ;CHARACTER, #10 ; 0789 BEQL 5$ ;5$ ; TSTL 4(AP) ;CHARACTER ; BEQL 5$ ;5$ ; CMPL 4(AP), #13 ;CHARACTER, #13 ; 0792 BNEQ 1$ ;1$ ; CALLS #0, W^U.2 ;#0, U.2 ; RET ; ; 1$: CMPL (R2), #256 ;FILE_REC_COUNT, #256 ; 0794 BEQL 3$ ;3$ ; BRB 4$ ;4$ ; 0800 2$: CMPL R0, #2 ;R0, #2 ; 0785 BNEQ 5$ ;5$ ; CMPL (R2), #256 ;FILE_REC_COUNT, #256 ; 0808 BNEQ 4$ ;4$ ; 3$: PUSHL #134316138 ;#134316138 ; 0810 CALLS #1, G^LIB$SIGNAL ;#1, LIB$SIGNAL ; MOVL #134316138, R0 ;#134316138, R0 ; 0809 RET ; ; 4$: INCL (R2) ;FILE_REC_COUNT ; 0814 MOVB 4(AP), @-4(R2) ;CHARACTER, @FILE_REC_POINTER ; 0815 INCL -4(R2) ;FILE_REC_POINTER ; 5$: MOVL #134316043, R0 ;#134316043, R0 ; 0783 RET ; ; 0743 ; Routine Size: 104 bytes, Routine Base: $CODE$ + 0259 ; 0820 %SBTTL 'FILE_DUMP - Output a record to the disk.' ; 0821 ; 0822 GLOBAL ROUTINE FILE_DUMP = ; 0823 ; 0824 !++ ; 0825 ! FUNCTIONAL DESCRIPTION: ; 0826 ! ; 0827 ! This routine will dump the contents of the current record into the ; 0828 ! user's file. It will return the status of the operation. ; 0829 ! ; 0830 ! CALLING SEQUENCE: ; 0831 ! ; 0832 ! FILE_DUMP (); ; 0833 ! ; 0834 ! INPUT PARAMETERS: ; 0835 ! ; 0836 ! None. ; 0837 ! ; 0838 ! IMPLICIT INPUTS: ; 0839 ! ; 0840 ! FILE_REC_COUNT - Count of the number of characters in the record ; 0841 ! FILE_RECORD - Record to output. ; 0842 ! None. ; 0843 ! ; 0844 ! OUPTUT PARAMETERS: ; 0845 ! ; 0846 ! None. ; 0847 ! ; 0848 ! IMPLICIT OUTPUTS: ; 0849 ! ; 0850 ! None. ; 0851 ! ; 0852 ! COMPLETION CODES: ; 0853 ! ; 0854 ! KER_NORMAL - Did ok. ; 0855 ! KER_RMS32 - RMS-32 error. ; 0856 ! ; 0857 ! SIDE EFFECTS: ; 0858 ! ; 0859 ! None. ; 0860 ! ; 0861 !-- ; 0862 ; 0863 BEGIN ; 0864 IF .FILE_TYPE EQL FILE_BIN THEN ; 0865 RETURN DUMP_BUFFER() ; 0866 ELSE ; 0867 RETURN KER_NORMAL; ; 0868 END; ! End of FILE_DUMP U.1: .ENTRY FILE_DUMP, ^M<> ;FILE_DUMP, Save nothing ; 0822 CMPL W^FILE_TYPE, #2 ;FILE_TYPE, #2 ; 0864 BNEQ 1$ ;1$ ; CALLS #0, W^U.2 ;#0, U.2 ; 0865 RET ; ; 0863 1$: MOVL #134316043, R0 ;#134316043, R0 ; RET ; ; 0822 ; Routine Size: 23 bytes, Routine Base: $CODE$ + 02C1 ; 0869 ; 0870 %SBTTL 'DUMP_BUFFER - Dump the current record to disk' ; 0871 ; 0872 ROUTINE DUMP_BUFFER = ; 0873 ; 0874 !++ ; 0875 ! FUNCTIONAL DESCRIPTION: ; 0876 ! ; 0877 ! This routine will dump the current record to disk. It doesn't ; 0878 ! care what type of file you are writing, unlike FILE_DUMP. ; 0879 ! ; 0880 ! CALLING SEQUENCE: ; 0881 ! ; 0882 ! STATUS = DUMP_BUFFER(); ; 0883 ! ; 0884 ! INPUT PARAMETERS: ; 0885 ! ; 0886 ! None. ; 0887 ! ; 0888 ! IMPLICIT INPUTS: ; 0889 ! ; 0890 ! None. ; 0891 ! ; 0892 ! OUPTUT PARAMETERS: ; 0893 ! ; 0894 ! None. ; 0895 ! ; 0896 ! IMPLICIT OUTPUTS: ; 0897 ! ; 0898 ! None. ; 0899 ! ; 0900 ! COMPLETION CODES: ; 0901 ! ; 0902 ! KER_NORMAL - Output went ok. ; 0903 ! KER_RMS32 - RMS-32 error. ; 0904 ! ; 0905 ! SIDE EFFECTS: ; 0906 ! ; 0907 ! None. ; 0908 ! ; 0909 !-- ; 0910 ; 0911 BEGIN ; 0912 ! ; 0913 ! First update the record length ; 0914 ! ; 0915 FILE_RAB [RAB$W_RSZ] = .FILE_REC_COUNT; ; 0916 ! ; 0917 ! Now output the record to the file ; 0918 ! ; 0919 STATUS = $PUT (RAB = FILE_RAB); ; 0920 ! ; 0921 ! Update the pointers first ; 0922 ! ; 0923 FILE_REC_COUNT = 0; ; 0924 FILE_REC_POINTER = CH$PTR (FILE_RECORD); ; 0925 ! ; 0926 ! Now determine if we failed attempting to write the record ; 0927 ! ; 0928 IF NOT .STATUS ; 0929 THEN ; 0930 BEGIN ; 0931 FILE_ERROR (); ; 0932 RETURN KER_RMS32 ; 0933 END; ; 0934 RETURN KER_NORMAL ; 0935 END; ! End of DUMP_BUFFER .EXTRN SYS$PUT ;DUMP_BUFFER U.2: .WORD ^M ;Save R2 ; 0872 MOVAB W^U.11, R2 ;U.11, R2 ; MOVW (R2), -42(R2) ;FILE_REC_COUNT, FILE_RAB+34 ; 0915 PUSHAB -76(R2) ;FILE_RAB ; 0919 CALLS #1, G^SYS$PUT ;#1, SYS$PUT ; MOVL R0, -256(R2) ;R0, STATUS ; CLRL (R2) ;FILE_REC_COUNT ; 0923 MOVAB 4(R2), -4(R2) ;FILE_RECORD, FILE_REC_POINTER ; 0924 BLBS -256(R2), 1$ ;STATUS, 1$ ; 0928 CALLS #0, W^U.3 ;#0, U.3 ; 0931 MOVL #134316114, R0 ;#134316114, R0 ; 0930 RET ; ; 1$: MOVL #134316043, R0 ;#134316043, R0 ; 0911 RET ; ; 0872 ; Routine Size: 59 bytes, Routine Base: $CODE$ + 02D8 ; 0936 %SBTTL 'OPEN_READING' ; 0937 ROUTINE OPEN_READING = ; 0938 ; 0939 !++ ; 0940 ! FUNCTIONAL DESCRIPTION: ; 0941 ! ; 0942 ! This routine will open a file for reading. It will return either ; 0943 ! true or false to the called depending on the success of the ; 0944 ! operation. ; 0945 ! ; 0946 ! CALLING SEQUENCE: ; 0947 ! ; 0948 ! status = OPEN_READING(); ; 0949 ! ; 0950 ! INPUT PARAMETERS: ; 0951 ! ; 0952 ! None. ; 0953 ! ; 0954 ! IMPLICIT INPUTS: ; 0955 ! ; 0956 ! None. ; 0957 ! ; 0958 ! OUTPUT PARAMETERS: ; 0959 ! ; 0960 ! None. ; 0961 ! ; 0962 ! IMPLICIT OUTPUTS: ; 0963 ! ; 0964 ! None. ; 0965 ! ; 0966 ! COMPLETION CODES: ; 0967 ! ; 0968 ! None. ; 0969 ! ; 0970 ! SIDE EFFECTS: ; 0971 ! ; 0972 ! None. ; 0973 ! ; 0974 !-- ; 0975 ; 0976 BEGIN ; 0977 ! ; 0978 ! We now have an expanded file specification that we can use to process ; 0979 ! the file. ; 0980 ! ; 0981 $FAB_INIT (FAB = FILE_FAB, FAC = GET, FOP = NAM, RFM = STM, NAM = FILE_NAM); ; 0982 STATUS = $OPEN (FAB = FILE_FAB); ; 0983 ; 0984 IF (.STATUS NEQ RMS$_NORMAL AND .STATUS NEQ RMS$_KFF) ; 0985 THEN ; 0986 BEGIN ; 0987 FILE_ERROR (); ; 0988 RETURN KER_RMS32; ; 0989 END; ; 0990 ; 0991 ! ; 0992 ! Initialize the RAB for the $CONNECT RMS call ; 0993 ! ; 0994 $RAB_INIT (RAB = FILE_RAB, FAB = FILE_FAB, RAC = SEQ, ROP = NLK, UBF = FILE_RECORD, USZ = MAX_REC_LENGTH); ; 0995 STATUS = $CONNECT (RAB = FILE_RAB); ; 0996 ; 0997 IF NOT .STATUS ; 0998 THEN ; 0999 BEGIN ; 1000 FILE_ERROR (); ; 1001 RETURN KER_RMS32; ; 1002 END; ; 1003 ; 1004 FILE_REC_COUNT = -1; ; 1005 FILE_FAB [FAB$L_CTX] = F_STATE_PRE; ; 1006 RETURN KER_NORMAL; ; 1007 END; ! End of OPEN_READING U.24= U.6 U.25= U.8 .EXTRN SYS$OPEN, SYS$CONNECT ;OPEN_READING U.23: .WORD ^M ;Save R2,R3,R4,R5,R6 ; 0937 MOVAB W^U.5, R6 ;U.5, R6 ; MOVC5 #0, (SP), #0, #80, 4(R6) ;#0, (SP), #0, #80, $RMS_PTR ; 0981 MOVW #20483, 4(R6) ;#20483, $RMS_PTR ; MOVL #16777216, 8(R6) ;#16777216, $RMS_PTR+4 ; MOVB #2, 26(R6) ;#2, $RMS_PTR+22 ; MOVB #4, 35(R6) ;#4, $RMS_PTR+31 ; MOVAB 84(R6), 44(R6) ;FILE_NAM, $RMS_PTR+40 ; PUSHAB 4(R6) ;FILE_FAB ; 0982 CALLS #1, G^SYS$OPEN ;#1, SYS$OPEN ; MOVL R0, (R6) ;R0, STATUS ; CMPL (R6), #65537 ;STATUS, #65537 ; 0984 BEQL 1$ ;1$ ; CMPL (R6), #98353 ;STATUS, #98353 ; BNEQ 2$ ;2$ ; 1$: MOVC5 #0, (SP), #0, #68, 180(R6) ;#0, (SP), #0, #68, $RMS_PTR ; 0994 MOVW #17409, 180(R6) ;#17409, $RMS_PTR ; MOVL #1048576, 184(R6) ;#1048576, $RMS_PTR+4 ; CLRB 210(R6) ;$RMS_PTR+30 ; MOVW #256, 212(R6) ;#256, $RMS_PTR+32 ; MOVAB 260(R6), 216(R6) ;FILE_RECORD, $RMS_PTR+36 ; MOVAB 4(R6), 240(R6) ;FILE_FAB, $RMS_PTR+60 ; PUSHAB 180(R6) ;FILE_RAB ; 0995 CALLS #1, G^SYS$CONNECT ;#1, SYS$CONNECT ; MOVL R0, (R6) ;R0, STATUS ; BLBS (R6), 3$ ;STATUS, 3$ ; 0997 2$: CALLS #0, W^U.3 ;#0, U.3 ; 1000 MOVL #134316114, R0 ;#134316114, R0 ; 0999 RET ; ; 3$: MNEGL #1, 256(R6) ;#1, FILE_REC_COUNT ; 1004 CLRL 28(R6) ;FILE_FAB+24 ; 1005 MOVL #134316043, R0 ;#134316043, R0 ; 0976 RET ; ; 0937 ; Routine Size: 170 bytes, Routine Base: $CODE$ + 0313 ; 1008 %SBTTL 'FILE_OPEN' ; 1009 ; 1010 GLOBAL ROUTINE FILE_OPEN (FUNCTION) = ; 1011 ; 1012 !++ ; 1013 ! FUNCTIONAL DESCRIPTION: ; 1014 ! ; 1015 ! This routine will open a file for reading or writing depending on ; 1016 ! the function that is passed this routine. It will handle wildcards ; 1017 ! on the read function. ; 1018 ! ; 1019 ! CALLING SEQUENCE: ; 1020 ! ; 1021 ! status = FILE_OPEN(FUNCTION); ; 1022 ! ; 1023 ! INPUT PARAMETERS: ; 1024 ! ; 1025 ! FUNCTION - Function to do. Either FNC_READ or FNC_WRITE. ; 1026 ! ; 1027 ! IMPLICIT INPUTS: ; 1028 ! ; 1029 ! FILE_NAME and FILE_SIZE set up with the file name and the length ; 1030 ! of the name. ; 1031 ! ; 1032 ! OUTPUT PARAMETERS: ; 1033 ! ; 1034 ! None. ; 1035 ! ; 1036 ! IMPLICIT OUTPUTS: ; 1037 ! ; 1038 ! FILE_NAME and FILE_SIZE set up with the file name and the length ; 1039 ! of the name. ; 1040 ! ; 1041 ! COMPLETION CODES: ; 1042 ! ; 1043 ! KER_NORMAL - File opened correctly. ; 1044 ! KER_RMS32 - Problem processing the file. ; 1045 ! ; 1046 ! SIDE EFFECTS: ; 1047 ! ; 1048 ! None. ; 1049 ! ; 1050 !-- ; 1051 ; 1052 BEGIN ; 1053 ; 1054 LOCAL ; 1055 SIZE : WORD, ! Length returned by $FAO ; 1056 TEMP1_DESC : BLOCK [8, BYTE], ! I/O descriptor ; 1057 TEMP2_DESC : BLOCK [8, BYTE]; ! I/O descriptor ; 1058 ; 1059 ! ; 1060 ! Now do the function dependent processing ; 1061 ! ; 1062 FILE_MODE = .FUNCTION; ; 1063 SELECTONE .FUNCTION OF ; 1064 SET ; 1065 ; 1066 [FNC_READ] : ; 1067 BEGIN ; 1068 ! ; 1069 ! Now set up the FAB with the information it needs. ; 1070 ! ; 1071 $FAB_INIT (FAB = FILE_FAB, FOP = NAM, FNA = FILE_NAME, FNS = .FILE_SIZE, NAM = FILE_NAM); ; 1072 ! ; 1073 ! Now initialize the NAM block ; 1074 ! ; 1075 $NAM_INIT (NAM = FILE_NAM, RSA = RES_STR, RSS = NAM$C_MAXRSS, ESA = EXP_STR, ESS = NAM$C_MAXRSS); ; 1076 ! ; 1077 ! First parse the file specification. ; 1078 ! ; 1079 STATUS = $PARSE (FAB = FILE_FAB); ; 1080 ; 1081 IF NOT .STATUS ; 1082 THEN ; 1083 BEGIN ; 1084 FILE_ERROR (); ; 1085 RETURN KER_RMS32; ; 1086 END; ; 1087 ; 1088 STATUS = $SEARCH (FAB = FILE_FAB); ; 1089 ; 1090 IF NOT .STATUS ; 1091 THEN ; 1092 BEGIN ; 1093 FILE_ERROR (); ; 1094 RETURN KER_RMS32; ; 1095 END; ; 1096 ; 1097 ! ; 1098 ! We now have an expanded file specification that we can use to process ; 1099 ! the file. ; 1100 ! ; 1101 $FAB_INIT (FAB = FILE_FAB, FAC = GET, FOP = NAM, RFM = STM, NAM = FILE_NAM); ; 1102 STATUS = $OPEN (FAB = FILE_FAB); ; 1103 ; 1104 IF (.STATUS NEQ RMS$_NORMAL AND .STATUS NEQ RMS$_KFF) ; 1105 THEN ; 1106 BEGIN ; 1107 FILE_ERROR (); ; 1108 RETURN KER_RMS32; ; 1109 END; ; 1110 ; 1111 ! ; 1112 ! Initialize the RAB for the $CONNECT RMS call ; 1113 ! ; P 1114 $RAB_INIT (RAB = FILE_RAB, FAB = FILE_FAB, RAC = SEQ, ROP = NLK, UBF = FILE_RECORD, ; 1115 USZ = MAX_REC_LENGTH); ; 1116 STATUS = $CONNECT (RAB = FILE_RAB); ; 1117 ; 1118 IF NOT .STATUS ; 1119 THEN ; 1120 BEGIN ; 1121 FILE_ERROR (); ; 1122 RETURN KER_RMS32; ; 1123 END; ; 1124 ; 1125 FILE_REC_COUNT = -1; ; 1126 END; ! End of [FNC_READ] ; 1127 ; 1128 [FNC_WRITE] : ; 1129 BEGIN ; 1130 IF .FILE_TYPE EQL FILE_ASC THEN ; 1131 BEGIN ; P 1132 $FAB_INIT (FAB = FILE_FAB, FAC = PUT, FNA = FILE_NAME, FNS = .FILE_SIZE, ; P 1133 FOP = (MXV, CBT, SQO, TEF), NAM = FILE_NAM, ORG = SEQ, RFM = VAR, ; 1134 RAT = CR); ; 1135 END; ; 1136 IF .FILE_TYPE EQL FILE_BIN THEN ; 1137 BEGIN ; P 1138 $FAB_INIT (FAB = FILE_FAB, FAC = PUT, FNA = FILE_NAME, ; P 1139 FNS = .FILE_SIZE, FOP = (MXV, CBT, SQO, TEF), NAM = FILE_NAM, ; 1140 ORG = SEQ, RFM = VAR); ; 1141 END; ; 1142 $NAM_INIT (NAM = FILE_NAM, ESA = EXP_STR, ESS = NAM$C_MAXRSS, RSA = RES_STR, RSS = NAM$C_MAXRSS); ; 1143 STATUS = $CREATE (FAB = FILE_FAB); ; 1144 ; 1145 IF NOT .STATUS ; 1146 THEN ; 1147 BEGIN ; 1148 FILE_ERROR (); ; 1149 RETURN KER_RMS32; ; 1150 END; ; 1151 ; P 1152 $RAB_INIT(RAB = FILE_RAB, FAB = FILE_FAB, RAC = SEQ, RBF = FILE_RECORD, ; 1153 ROP = ); ; 1154 STATUS = $CONNECT (RAB = FILE_RAB); ; 1155 IF NOT .STATUS THEN ; 1156 BEGIN ; 1157 FILE_ERROR (); ; 1158 RETURN KER_RMS32; ; 1159 END; ; 1160 ; 1161 FILE_REC_COUNT = 0; ; 1162 FILE_REC_POINTER = CH$PTR (FILE_RECORD); ; 1163 END; ; 1164 ; 1165 [OTHERWISE] : ; 1166 RETURN KER_INTERNALERR; ; 1167 TES; ; 1168 ; 1169 ! ; 1170 ! Initialize the output descriptors. ; 1171 ! ; 1172 TEMP1_DESC [DSC$B_CLASS] = DSC$K_CLASS_S; ; 1173 TEMP1_DESC [DSC$B_DTYPE] = DSC$K_DTYPE_T; ; 1174 TEMP1_DESC [DSC$A_POINTER] = .FILE_NAM [NAM$L_NAME]; ; 1175 TEMP1_DESC [DSC$W_LENGTH] = .FILE_NAM [NAM$B_NAME]; ; 1176 TEMP2_DESC [DSC$B_CLASS] = DSC$K_CLASS_S; ; 1177 TEMP2_DESC [DSC$B_DTYPE] = DSC$K_DTYPE_T; ; 1178 TEMP2_DESC [DSC$A_POINTER] = .FILE_NAM [NAM$L_TYPE]; ; 1179 TEMP2_DESC [DSC$W_LENGTH] = .FILE_NAM [NAM$B_TYPE]; ; 1180 FILE_DESC [DSC$W_LENGTH] = MAX_FILE_NAME; ; 1181 ; 1182 STATUS = $FAO (%ASCID'!AS!AS', SIZE, FILE_DESC, TEMP1_DESC, TEMP2_DESC); ; 1183 IF NOT .STATUS THEN ; 1184 BEGIN ; 1185 LIB$SIGNAL(.STATUS); ; 1186 RETURN .STATUS; ; 1187 END; ; 1188 ; 1189 FILE_SIZE = .SIZE; ; 1190 RETURN KER_NORMAL; ; 1191 END; ! End of FILE_OPEN .PSECT $PLIT$,NOWRT,NOEXE,2 P.AAB: .ASCII \!AS!AS\<0><0> ; ; P.AAA: .LONG 17694726 ; ; .ADDRESS P.AAB ; ; U.27= U.6 U.28= U.7 U.29= U.6 U.30= U.8 U.31= U.6 U.32= U.6 U.33= U.7 U.34= U.8 .EXTRN SYS$PARSE, SYS$SEARCH, SYS$CREATE, SYS$FAO .PSECT $CODE$,NOWRT,2 .ENTRY FILE_OPEN, ^M ; ; MOVAB W^FILE_NAME, R10 ;FILE_NAME, R10 ; MOVAB W^FILE_TYPE, R9 ;FILE_TYPE, R9 ; MOVAB G^SYS$CONNECT, R8 ;SYS$CONNECT, R8 ; MOVAB W^FILE_SIZE, R7 ;FILE_SIZE, R7 ; MOVAB W^U.5, R6 ;U.5, R6 ; SUBL2 #20, SP ;#20, SP ; MOVL 4(AP), R0 ;FUNCTION, R0 ; 1062 MOVL R0, 248(R6) ;R0, FILE_MODE ; BEQL 1$ ;1$ ; 1063 BRW 4$ ;4$ ; 1$: MOVC5 #0, (SP), #0, #80, 4(R6) ;#0, (SP), #0, #80, $RMS_PTR ; 1071 MOVW #20483, 4(R6) ;#20483, $RMS_PTR ; MOVL #16777216, 8(R6) ;#16777216, $RMS_PTR+4 ; MOVB #2, 26(R6) ;#2, $RMS_PTR+22 ; MOVB #2, 35(R6) ;#2, $RMS_PTR+31 ; MOVAB 84(R6), 44(R6) ;FILE_NAM, $RMS_PTR+40 ; MOVAB (R10), 48(R6) ;FILE_NAME, $RMS_PTR+44 ; MOVB (R7), 56(R6) ;FILE_SIZE, $RMS_PTR+52 ; MOVC5 #0, (SP), #0, #96, 84(R6) ;#0, (SP), #0, #96, $RMS_PTR ; 1075 MOVW #24578, 84(R6) ;#24578, $RMS_PTR ; MNEGB #4, 86(R6) ;#4, $RMS_PTR+2 ; MOVAB 768(R6), 88(R6) ;RES_STR, $RMS_PTR+4 ; MNEGB #4, 94(R6) ;#4, $RMS_PTR+10 ; MOVAB 516(R6), 96(R6) ;EXP_STR, $RMS_PTR+12 ; PUSHAB 4(R6) ;FILE_FAB ; 1079 CALLS #1, G^SYS$PARSE ;#1, SYS$PARSE ; MOVL R0, (R6) ;R0, STATUS ; BLBC (R6), 2$ ;STATUS, 2$ ; 1081 PUSHAB 4(R6) ;FILE_FAB ; 1088 CALLS #1, G^SYS$SEARCH ;#1, SYS$SEARCH ; MOVL R0, (R6) ;R0, STATUS ; BLBC (R6), 2$ ;STATUS, 2$ ; 1090 MOVC5 #0, (SP), #0, #80, 4(R6) ;#0, (SP), #0, #80, $RMS_PTR ; 1101 MOVW #20483, 4(R6) ;#20483, $RMS_PTR ; MOVL #16777216, 8(R6) ;#16777216, $RMS_PTR+4 ; MOVB #2, 26(R6) ;#2, $RMS_PTR+22 ; MOVB #4, 35(R6) ;#4, $RMS_PTR+31 ; MOVAB 84(R6), 44(R6) ;FILE_NAM, $RMS_PTR+40 ; PUSHAB 4(R6) ;FILE_FAB ; 1102 CALLS #1, G^SYS$OPEN ;#1, SYS$OPEN ; MOVL R0, (R6) ;R0, STATUS ; CMPL (R6), #65537 ;STATUS, #65537 ; 1104 BEQL 3$ ;3$ ; CMPL (R6), #98353 ;STATUS, #98353 ; BEQL 3$ ;3$ ; 2$: BRW 8$ ;8$ ; 3$: MOVC5 #0, (SP), #0, #68, 180(R6) ;#0, (SP), #0, #68, $RMS_PTR ; 1115 MOVW #17409, 180(R6) ;#17409, $RMS_PTR ; MOVL #1048576, 184(R6) ;#1048576, $RMS_PTR+4 ; CLRB 210(R6) ;$RMS_PTR+30 ; MOVW #256, 212(R6) ;#256, $RMS_PTR+32 ; MOVAB 260(R6), 216(R6) ;FILE_RECORD, $RMS_PTR+36 ; MOVAB 4(R6), 240(R6) ;FILE_FAB, $RMS_PTR+60 ; PUSHAB 180(R6) ;FILE_RAB ; 1116 CALLS #1, (R8) ;#1, SYS$CONNECT ; MOVL R0, (R6) ;R0, STATUS ; BLBC (R6), 2$ ;STATUS, 2$ ; 1118 MNEGL #1, 256(R6) ;#1, FILE_REC_COUNT ; 1125 BRW 11$ ;11$ ; 1063 4$: CMPL R0, #1 ;R0, #1 ; BEQL 5$ ;5$ ; BRW 10$ ;10$ ; 5$: CMPL (R9), #1 ;FILE_TYPE, #1 ; 1130 BNEQ 6$ ;6$ ; MOVC5 #0, (SP), #0, #80, 4(R6) ;#0, (SP), #0, #80, $RMS_PTR ; 1134 MOVW #20483, 4(R6) ;#20483, $RMS_PTR ; MOVL #270532674, 8(R6) ;#270532674, $RMS_PTR+4 ; MOVB #1, 26(R6) ;#1, $RMS_PTR+22 ; MOVW #512, 33(R6) ;#512, $RMS_PTR+29 ; MOVB #2, 35(R6) ;#2, $RMS_PTR+31 ; MOVAB 84(R6), 44(R6) ;FILE_NAM, $RMS_PTR+40 ; MOVAB (R10), 48(R6) ;FILE_NAME, $RMS_PTR+44 ; MOVB (R7), 56(R6) ;FILE_SIZE, $RMS_PTR+52 ; 6$: CMPL (R9), #2 ;FILE_TYPE, #2 ; 1136 BNEQ 7$ ;7$ ; MOVC5 #0, (SP), #0, #80, 4(R6) ;#0, (SP), #0, #80, $RMS_PTR ; 1140 MOVW #20483, 4(R6) ;#20483, $RMS_PTR ; MOVL #270532674, 8(R6) ;#270532674, $RMS_PTR+4 ; MOVB #1, 26(R6) ;#1, $RMS_PTR+22 ; CLRB 33(R6) ;$RMS_PTR+29 ; MOVB #2, 35(R6) ;#2, $RMS_PTR+31 ; MOVAB 84(R6), 44(R6) ;FILE_NAM, $RMS_PTR+40 ; MOVAB (R10), 48(R6) ;FILE_NAME, $RMS_PTR+44 ; MOVB (R7), 56(R6) ;FILE_SIZE, $RMS_PTR+52 ; 7$: MOVC5 #0, (SP), #0, #96, 84(R6) ;#0, (SP), #0, #96, $RMS_PTR ; 1142 MOVW #24578, 84(R6) ;#24578, $RMS_PTR ; MNEGB #4, 86(R6) ;#4, $RMS_PTR+2 ; MOVAB 768(R6), 88(R6) ;RES_STR, $RMS_PTR+4 ; MNEGB #4, 94(R6) ;#4, $RMS_PTR+10 ; MOVAB 516(R6), 96(R6) ;EXP_STR, $RMS_PTR+12 ; PUSHAB 4(R6) ;FILE_FAB ; 1143 CALLS #1, G^SYS$CREATE ;#1, SYS$CREATE ; MOVL R0, (R6) ;R0, STATUS ; BLBC (R6), 8$ ;STATUS, 8$ ; 1145 MOVC5 #0, (SP), #0, #68, 180(R6) ;#0, (SP), #0, #68, $RMS_PTR ; 1153 MOVW #17409, 180(R6) ;#17409, $RMS_PTR ; MOVL #1179648, 184(R6) ;#1179648, $RMS_PTR+4 ; CLRB 210(R6) ;$RMS_PTR+30 ; MOVAB 260(R6), 220(R6) ;FILE_RECORD, $RMS_PTR+40 ; MOVAB 4(R6), 240(R6) ;FILE_FAB, $RMS_PTR+60 ; PUSHAB 180(R6) ;FILE_RAB ; 1154 CALLS #1, (R8) ;#1, SYS$CONNECT ; MOVL R0, (R6) ;R0, STATUS ; BLBS (R6), 9$ ;STATUS, 9$ ; 1155 8$: CALLS #0, W^U.3 ;#0, U.3 ; 1157 MOVL #134316114, R0 ;#134316114, R0 ; 1156 RET ; ; 9$: CLRL 256(R6) ;FILE_REC_COUNT ; 1161 MOVAB 260(R6), 252(R6) ;FILE_RECORD, FILE_REC_POINTER ; 1162 BRB 11$ ;11$ ; 1063 10$: MOVL #134316050, R0 ;#134316050, R0 ; 1166 RET ; ; 11$: MOVW #270, 14(SP) ;#270, TEMP1_DESC+2 ; 1173 MOVL 160(R6), 16(SP) ;FILE_NAM+76, TEMP1_DESC+4 ; 1174 MOVZBW 143(R6), 12(SP) ;FILE_NAM+59, TEMP1_DESC ; 1175 MOVW #270, 6(SP) ;#270, TEMP2_DESC+2 ; 1177 MOVL 164(R6), 8(SP) ;FILE_NAM+80, TEMP2_DESC+4 ; 1178 MOVZBW 144(R6), 4(SP) ;FILE_NAM+60, TEMP2_DESC ; 1179 MOVZBW #132, 4(R9) ;#132, FILE_DESC ; 1180 PUSHAB 4(SP) ;TEMP2_DESC ; 1182 PUSHAB 16(SP) ;TEMP1_DESC ; PUSHAB 4(R9) ;FILE_DESC ; PUSHAB 12(SP) ;SIZE ; PUSHAB W^P.AAA ;P.AAA ; CALLS #5, G^SYS$FAO ;#5, SYS$FAO ; MOVL R0, (R6) ;R0, STATUS ; BLBS (R6), 12$ ;STATUS, 12$ ; 1183 PUSHL (R6) ;STATUS ; 1185 CALLS #1, G^LIB$SIGNAL ;#1, LIB$SIGNAL ; MOVL (R6), R0 ;STATUS, R0 ; 1184 RET ; ; 12$: MOVZWL (SP), (R7) ;SIZE, FILE_SIZE ; 1189 MOVL #134316043, R0 ;#134316043, R0 ; 1052 RET ; ; 1010 ; Routine Size: 648 bytes, Routine Base: $CODE$ + 03BD ; 1192 ; 1193 %SBTTL 'FILE_CLOSE' ; 1194 ; 1195 GLOBAL ROUTINE FILE_CLOSE = ; 1196 ; 1197 !++ ; 1198 ! FUNCTIONAL DESCRIPTION: ; 1199 ! ; 1200 ! This routine will close a file that was opened by FILE_OPEN. ; 1201 ! It assumes any data associated with the file is stored in this ; 1202 ! module, since this routine is called by KERMSG. ; 1203 ! ; 1204 ! CALLING SEQUENCE: ; 1205 ! ; 1206 ! FILE_CLOSE(); ; 1207 ! ; 1208 ! INPUT PARAMETERS: ; 1209 ! ; 1210 ! None. ; 1211 ! ; 1212 ! IMPLICIT INPUTS: ; 1213 ! ; 1214 ! None. ; 1215 ! ; 1216 ! OUTPUT PARAMETERS: ; 1217 ! ; 1218 ! None. ; 1219 ! ; 1220 ! IMPLICIT OUTPUTS: ; 1221 ! ; 1222 ! None. ; 1223 ! ; 1224 ! COMPLETION CODES: ; 1225 ! ; 1226 ! None. ; 1227 ! ; 1228 ! SIDE EFFECTS: ; 1229 ! ; 1230 ! None. ; 1231 ! ; 1232 !-- ; 1233 ; 1234 BEGIN ; 1235 ; 1236 IF .FILE_MODE EQL FNC_WRITE AND .FILE_REC_COUNT NEQ 0 THEN ; 1237 BEGIN ; 1238 STATUS = DUMP_BUFFER(); ; 1239 IF NOT .STATUS THEN RETURN .STATUS; ; 1240 END; ; 1241 ; 1242 STATUS = $CLOSE (FAB = FILE_FAB); ; 1243 ; 1244 EOF_FLAG = FALSE; ; 1245 ; 1246 IF NOT .STATUS ; 1247 THEN ; 1248 BEGIN ; 1249 FILE_ERROR (); ; 1250 RETURN KER_RMS32; ; 1251 END ; 1252 ELSE ; 1253 RETURN KER_NORMAL; ; 1254 ; 1255 END; ! End of FILE_CLOSE .EXTRN SYS$CLOSE .ENTRY FILE_CLOSE, ^M ;FILE_CLOSE, Save R2 ; 1195 MOVAB W^U.5, R2 ;U.5, R2 ; CMPL 248(R2), #1 ;FILE_MODE, #1 ; 1236 BNEQ 1$ ;1$ ; TSTL 256(R2) ;FILE_REC_COUNT ; BEQL 1$ ;1$ ; CALLS #0, W^U.2 ;#0, U.2 ; 1238 MOVL R0, (R2) ;R0, STATUS ; BLBS (R2), 1$ ;STATUS, 1$ ; 1239 MOVL (R2), R0 ;STATUS, R0 ; RET ; ; 1$: PUSHAB 4(R2) ;FILE_FAB ; 1242 CALLS #1, G^SYS$CLOSE ;#1, SYS$CLOSE ; MOVL R0, (R2) ;R0, STATUS ; CLRL -4(R2) ;EOF_FLAG ; 1244 BLBS (R2), 2$ ;STATUS, 2$ ; 1246 CALLS #0, W^U.3 ;#0, U.3 ; 1249 MOVL #134316114, R0 ;#134316114, R0 ; 1234 RET ; ; 2$: MOVL #134316043, R0 ;#134316043, R0 ; RET ; ; 1195 ; Routine Size: 75 bytes, Routine Base: $CODE$ + 0645 ; 1256 ; 1257 %SBTTL 'NEXT_FILE' ; 1258 ; 1259 GLOBAL ROUTINE NEXT_FILE = ; 1260 ; 1261 !++ ; 1262 ! FUNCTIONAL DESCRIPTION: ; 1263 ! ; 1264 ! This routine will cause the next file to be opened. It will ; 1265 ! call the RMS-32 routine $SEARCH and $OPEN for the file. ; 1266 ! ; 1267 ! CALLING SEQUENCE: ; 1268 ! ; 1269 ! STATUS = NEXT_FILE; ; 1270 ! ; 1271 ! INPUT PARAMETERS: ; 1272 ! ; 1273 ! None. ; 1274 ! ; 1275 ! IMPLICIT INPUTS: ; 1276 ! ; 1277 ! FAB/NAM blocks set up from previous processing. ; 1278 ! ; 1279 ! OUTPUT PARAMETERS: ; 1280 ! ; 1281 ! None. ; 1282 ! ; 1283 ! IMPLICIT OUTPUTS: ; 1284 ! ; 1285 ! FAB/NAM blocks set up for the next file. ; 1286 ! ; 1287 ! COMPLETION CODES: ; 1288 ! ; 1289 ! TRUE - There is a next file. ; 1290 ! KER_RMS32 - No next file. ; 1291 ! ; 1292 ! SIDE EFFECTS: ; 1293 ! ; 1294 ! None. ; 1295 ! ; 1296 !-- ; 1297 ; 1298 BEGIN ; 1299 ; 1300 LOCAL ; 1301 TEMP1_DESC : BLOCK [8, BYTE], ! I/O descriptor ; 1302 TEMP2_DESC : BLOCK [8, BYTE], ! I/O descriptor ; 1303 SIZE : WORD; ! Size of the $FAO string ; 1304 ; 1305 ! ; 1306 ! Now search for the next file that we want to process. ; 1307 ! ; 1308 STATUS = $SEARCH (FAB = FILE_FAB); ; 1309 ; 1310 IF .STATUS EQL RMS$_NMF THEN RETURN KER_NOMORFILES; ; 1311 ; 1312 IF NOT .STATUS ; 1313 THEN ; 1314 BEGIN ; 1315 FILE_ERROR (); ; 1316 RETURN KER_RMS32; ; 1317 END; ; 1318 ; 1319 ! ; 1320 ! Now we have the new file name. All that we have to do is open the file ; 1321 ! for reading now. ; 1322 ! ; 1323 STATUS = OPEN_READING (); ; 1324 ; 1325 IF .STATUS THEN RETURN .STATUS; ; 1326 ; 1327 ! ; 1328 ! Initialize the output descriptors. ; 1329 ! ; 1330 TEMP1_DESC [DSC$B_CLASS] = DSC$K_CLASS_S; ; 1331 TEMP1_DESC [DSC$B_DTYPE] = DSC$K_DTYPE_T; ; 1332 TEMP1_DESC [DSC$A_POINTER] = .FILE_NAM [NAM$L_NAME]; ; 1333 TEMP1_DESC [DSC$W_LENGTH] = .FILE_NAM [NAM$B_NAME]; ; 1334 TEMP2_DESC [DSC$B_CLASS] = DSC$K_CLASS_S; ; 1335 TEMP2_DESC [DSC$B_DTYPE] = DSC$K_DTYPE_T; ; 1336 TEMP2_DESC [DSC$A_POINTER] = .FILE_NAM [NAM$L_TYPE]; ; 1337 TEMP2_DESC [DSC$W_LENGTH] = .FILE_NAM [NAM$B_TYPE]; ; 1338 FILE_DESC [DSC$W_LENGTH] = MAX_FILE_NAME; ; 1339 STATUS = $FAO (%ASCID'!AS!AS', SIZE, FILE_DESC, TEMP1_DESC, TEMP2_DESC); ; 1340 ; 1341 IF NOT .STATUS ; 1342 THEN ; 1343 BEGIN ; 1344 LIB$SIGNAL(.STATUS); ; 1345 RETURN .STATUS; ; 1346 END; ; 1347 ; 1348 FILE_SIZE = .SIZE; ; 1349 RETURN KER_NORMAL; ; 1350 END; ! End of NEXT_FILE .PSECT $PLIT$,NOWRT,NOEXE,2 P.AAD: .ASCII \!AS!AS\<0><0> ; ; P.AAC: .LONG 17694726 ; ; .ADDRESS P.AAD ; ; .PSECT $CODE$,NOWRT,2 .ENTRY NEXT_FILE, ^M ;NEXT_FILE, Save R2 ; 1259 MOVAB W^U.5, R2 ;U.5, R2 ; SUBL2 #20, SP ;#20, SP ; PUSHAB 4(R2) ;FILE_FAB ; 1308 CALLS #1, G^SYS$SEARCH ;#1, SYS$SEARCH ; MOVL R0, (R2) ;R0, STATUS ; CMPL (R2), #99018 ;STATUS, #99018 ; 1310 BNEQ 1$ ;1$ ; MOVL #134316123, R0 ;#134316123, R0 ; RET ; ; 1$: BLBS (R2), 2$ ;STATUS, 2$ ; 1312 CALLS #0, W^U.3 ;#0, U.3 ; 1315 MOVL #134316114, R0 ;#134316114, R0 ; 1314 RET ; ; 2$: CALLS #0, W^U.23 ;#0, U.23 ; 1323 MOVL R0, (R2) ;R0, STATUS ; BLBS (R2), 3$ ;STATUS, 3$ ; 1325 MOVW #270, 14(SP) ;#270, TEMP1_DESC+2 ; 1331 MOVL 160(R2), 16(SP) ;FILE_NAM+76, TEMP1_DESC+4 ; 1332 MOVZBW 143(R2), 12(SP) ;FILE_NAM+59, TEMP1_DESC ; 1333 MOVW #270, 6(SP) ;#270, TEMP2_DESC+2 ; 1335 MOVL 164(R2), 8(SP) ;FILE_NAM+80, TEMP2_DESC+4 ; 1336 MOVZBW 144(R2), 4(SP) ;FILE_NAM+60, TEMP2_DESC ; 1337 MOVZBW #132, W^FILE_DESC ;#132, FILE_DESC ; 1338 PUSHAB 4(SP) ;TEMP2_DESC ; 1339 PUSHAB 16(SP) ;TEMP1_DESC ; PUSHAB W^FILE_DESC ;FILE_DESC ; PUSHAB 12(SP) ;SIZE ; PUSHAB W^P.AAC ;P.AAC ; CALLS #5, G^SYS$FAO ;#5, SYS$FAO ; MOVL R0, (R2) ;R0, STATUS ; BLBS (R2), 4$ ;STATUS, 4$ ; 1341 PUSHL (R2) ;STATUS ; 1344 CALLS #1, G^LIB$SIGNAL ;#1, LIB$SIGNAL ; 3$: MOVL (R2), R0 ;STATUS, R0 ; 1343 RET ; ; 4$: MOVZWL (SP), W^FILE_SIZE ;SIZE, FILE_SIZE ; 1348 MOVL #134316043, R0 ;#134316043, R0 ; 1298 RET ; ; 1259 ; Routine Size: 165 bytes, Routine Base: $CODE$ + 0690 ; 1351 ; 1352 %SBTTL 'FILE_ERROR - Error processing for all RMS errors' ; 1353 ROUTINE FILE_ERROR : NOVALUE = ; 1354 ; 1355 !++ ; 1356 ! FUNCTIONAL DESCRIPTION: ; 1357 ! ; 1358 ! This routine will process all of the RMS-32 error returns. It will ; 1359 ! get the text for the error and then it will issue a KER_ERROR for ; 1360 ! the RMS failure. ; 1361 ! ; 1362 ! CALLING SEQUENCE: ; 1363 ! ; 1364 ! FILE_ERROR(); ; 1365 ! ; 1366 ! INPUT PARAMETERS: ; 1367 ! ; 1368 ! None. ; 1369 ! ; 1370 ! IMPLICIT INPUTS: ; 1371 ! ; 1372 ! STATUS - RMS error status. ; 1373 ! FILE_NAME - File name and extension. ; 1374 ! FILE_SIZE - Size of the thing in FILE_NAME. ; 1375 ! ; 1376 ! OUPTUT PARAMETERS: ; 1377 ! ; 1378 ! None. ; 1379 ! ; 1380 ! IMPLICIT OUTPUTS: ; 1381 ! ; 1382 ! None. ; 1383 ! ; 1384 ! COMPLETION CODES: ; 1385 ! ; 1386 ! None. ; 1387 ! ; 1388 ! SIDE EFFECTS: ; 1389 ! ; 1390 ! None. ; 1391 ! ; 1392 !-- ; 1393 ; 1394 BEGIN ; 1395 ; 1396 LOCAL ; 1397 ERR_LENGTH : WORD, ! Length of the text ; 1398 ERR_DESC : BLOCK [8, BYTE], ; 1399 ERR_BUFFER : VECTOR [CH$ALLOCATION(MAX_MSG)]; ; 1400 ; 1401 ERR_DESC [DSC$A_POINTER] = ERR_BUFFER; ; 1402 ERR_DESC [DSC$W_LENGTH] = MAX_MSG; ; 1403 ERR_DESC [DSC$B_CLASS] = DSC$K_CLASS_S; ; 1404 ERR_DESC [DSC$B_DTYPE] = DSC$K_DTYPE_T; ; 1405 ; P 1406 $GETMSG( MSGID = .STATUS, MSGLEN = ERR_LENGTH, BUFADR = ERR_DESC, ; 1407 FLAGS = 0); ; 1408 ; 1409 ERR_DESC [DSC$W_LENGTH] = .ERR_LENGTH; ; 1410 ; 1411 LIB$SIGNAL(KER_RMS32, ERR_DESC, FILE_DESC); ; 1412 END; ! End of FILE_ERROR .EXTRN SYS$GETMSG ;FILE_ERROR U.3: .WORD ^M<> ;Save nothing ; 1353 MOVAB -108(SP), SP ;-108(SP), SP ; MOVAB 4(SP), 104(SP) ;ERR_BUFFER, ERR_DESC+4 ; 1401 MOVL #17694816, 100(SP) ;#17694816, ERR_DESC ; 1402 CLRQ -(SP) ;-(SP) ; 1407 PUSHAB 108(SP) ;ERR_DESC ; PUSHAB 12(SP) ;ERR_LENGTH ; PUSHL W^U.5 ;U.5 ; CALLS #5, G^SYS$GETMSG ;#5, SYS$GETMSG ; MOVW (SP), 100(SP) ;ERR_LENGTH, ERR_DESC ; 1409 PUSHAB W^FILE_DESC ;FILE_DESC ; 1411 PUSHAB 104(SP) ;ERR_DESC ; PUSHL #134316114 ;#134316114 ; CALLS #3, G^LIB$SIGNAL ;#3, LIB$SIGNAL ; RET ; ; 1353 ; Routine Size: 63 bytes, Routine Base: $CODE$ + 0735 ; 1413 %SBTTL 'End of KERFIL' ; 1414 ; 1415 END ! End of module ; 1416 ; 1417 ELUDOM ; PSECT SUMMARY ; ; Name Bytes Attributes ; ; $OWN$ 1040 NOVEC, WRT, RD ,NOEXE,NOSHR, LCL, REL, CON,NOPIC,ALIGN(2) ; $GLOBAL$ 12 NOVEC, WRT, RD ,NOEXE,NOSHR, LCL, REL, CON,NOPIC,ALIGN(2) ; $CODE$ 1908 NOVEC,NOWRT, RD , EXE,NOSHR, LCL, REL, CON,NOPIC,ALIGN(2) ; $PLIT$ 32 NOVEC,NOWRT, RD ,NOEXE,NOSHR, LCL, REL, CON,NOPIC,ALIGN(2) ; LIBRARY STATISTICS ; ; -------- Symbols -------- Blocks ; File Total Loaded Percent Read ; ; SYS$SYSROOT:[SYSLIB]STARLET.L32;1 5809 112 1 279 ; COMMAND QUALIFIERS ; BLISS KERFIL/LIST=KERFIL.MAR/MACHIN=(ASSEM,NOBIN,UNIQ)/SOURCE=NOHEADER ; Compilation Complete .END