ALWAYS 31JAN4 NAME ;************************************************************************ ;* * ;* MODULE: NAME - ASSIGN A VALUE TO PRGNAM * ;* * ;* AUTHOR: CHRIS DORAN * ;* * ;* DATE: 14-NOV-83 * ;* * ;* INPUT PARAMETERS: * ;* * ;* R0 POINTS TO THE COMMAND LINE IN PROCESS * ;* * ;* OUTPUT PARAMETERS: * ;* * ;* R0 POINTS JUST BEYOND THE LAST CHARACTER OF THE NAME * ;* * ;* DESTROYS: R1 * ;* * ;* IF NO NAME IS SPECIFIED, THE PROGRAM NAME IS DISPLAYED. * ;* * ;************************************************************************ .MCALL DIR$,CALLR NAME:: MOV #PRGNAM,%1 ; Address name storage area TSTB (R0) ; Name specified? BEQ 100$ ; No - just output the current one 10$: MOVB (%0)+,(%1)+ ; Copy character BNE 20$ ; Unless null terminator CMPB -(%0),-(%1) ; Point back to null MOVB #SPACE,(%1)+ ; Which becomes a trailing space 20$: CMP %1,#PRGNAM+8. ; See if eight bytes copied BLO 10$ ; No, copy another TST QUIET ; Echo suppressed? BEQ 250$ ; Yes, don't confirm 100$: OUTPUT FNM ; If no name given, show current one 250$: ; Success always, should be cc from TST or DIR$ CALLR EXTRA ; Purge command line of superfluous junk ; and return from there .END