;error in input, inform the user
10$: TYPECR <Usage: XCALL CHGMOD,new'name,old'name>
TYPE < where new'name is the name you would like to change>
TYPECR < the module name to, and>
TYPECR < old'name is the name of the MODULE.>
RTN
;input looks good - let's get on with it!
20$: MOV 14.(A3),A2 ;A2 points to old'name
FILNAM BUFFER(A4) ;default extension is .MOD
SRCH @A4,A1,F.USR ;look only in users memory
BEQ 30$ ;found it!
;didn't find the module - report no change
MOV #7,D1 ;get a bell
TTY ;beep!
TYPECR <?Module not found in user memory.>
RTN
;found the module - rename it
30$: MOV 4(A3),A2 ;point to new'name
SUB #6,A1 ;point to name area
FILNAM @A1,MOD ;create new name for module
RTN ;and return