.title rshift ; ; Right SHIFT moves a character string n characters to the right and puts ; spaces in front ; call rshift( string, n ) ; .psect user$i rshift::tst (r5)+ ; skip nargs mov (r5)+,r0 ; get start of array mov r0,r2 ; copy it 10$: tstb (r0)+ ; find end of array... bne 10$ mov r0,r1 ; r0 => 1 past null mov @(r5)+,r3 ; nchrs to shift ble 30$ ; - or 0 is dum add r3,r1 ; r1 => 1 past end of o/p 20$: movb -(r0),-(r1) ; copy character movb #' ,@r0 ; make it a space after copying cmp r0,r2 ; at beginning of array ? bhi 20$ ; br, if false 30$: return .end