.SUBTITLE EXTRACT ; ;++ ; FUNCTIONAL DESCRIPTION: ; ; Extracts length and position of text from files such ; as VMSMAIL_PROFILE.DATA or MAIL.MAI ; ; CALLING SEQUENCE: ; ; PUSHL "SEARCH_START_ADDR" ; PUSHL "AFTER_REC_ADDR" ; PUSHL "CODE" ; ; CALLS #3, EXTRACT ; ; INPUT PARAMETERS: ; ; SEARCH_START_ADDR : Contains the search starting address ; AFTER_REC_ADDR : Contains the address of first byte beyond record ; CODE : Code of desired information ; ; IMPLICIT INPUTS: ; ; ; IMPLICIT OUTPUTS: ; ; R1: Address of text| ; | The set (R0,R1) is a descriptor of information ; R0: length of text | ; ; ; COMPLETION CODES: ; ; INFO_NOT_FOUND = ^X0 The searched information was not found ; ; SIDE EFFECTS: ; ; NONE INFO_NOT_FOUND = ^X0 ; Completion code if information was not found .ENTRY EXTRACT,^M MOVL 4(AP), R5 ; Code of desired information MOVL 8(AP), R9 ; Contains the address of first byte ; beyond current record MOVL 12(AP), R2 ; Contains the search starting address GET_INFO_LENGTH_POS: CMPW (R2)+,R5 ; Search position of length ; of information BEQL GET_INFO_LENGTH ; Found ? Yes go to following. MOVZWL (R2)+,R6 ; No -- Get length of current packet ADDL2 R6,R2 ; Compute address of next packet ; and skip the current one CMPL R2,R9 ; Is end of record reached ? BLSS GET_INFO_LENGTH_POS ; No -- go to next byte MOVL #INFO_NOT_FOUND,R0 ; Yes -- Put completion status in R0, BRW END_EXTRACT ; and exit back to mailcheck. GET_INFO_LENGTH: MOVW (R2)+,R0 ; Put length of text information in R0 MOVL R2,R1 ; Put address of information in R1. END_EXTRACT: RET .END