.TITLE EDMSGX ; This is the extended edit message routine which is designed to ; be used in conjunction with the standard RSX routine as a ; preprocessor. ; ; It is called in the same way as $EDMSG with the same arguments. ; As with $EDMSG, it ignores commands it doesn't understand. OUTLEN: .WORD 0 ; Length of output string EDMSGX:: JSR R5,$SAVRG ; Save registers 3-5 CLR OUTLEN ; Zero byte transfer total LOOP: CMPB (R1),#'% ; Is this a command? BNE XFR ; Branch if not MOV R1,R4 ; Address of format string CALL PRSFMT BCS XFR ; Just transfer if not one of ours ; We had a valid command; translate MOV R4,R1 ; Advance format string pointer MOV R1,-(SP) MOV (R2)+,R1 ; Get the next argument MOV R2,-(SP) MOV R3,R2 ; Options word returned by PRSFMT MOV R0,R5 ; Save address in output buffer CALL $CBTA ; Convert to ASCII SUB R0,R5 ; Calculate length of string SUB R5,OUTLEN MOV (SP)+,R2 MOV (SP)+,R1 ; Restore R1 and R2 BR LOOP ; Not a valid command; just transfer format string to output buffer XFR: MOVB (R1)+,(R0)+ BEQ 1$ INC OUTLEN BR LOOP 1$: DEC R0 ; Pointer sits on ASCII null (like $EDMSG) MOV OUTLEN,R1 ; Return number of characters transferred RETURN .END