copy-to-register is an interactive compiled Lisp function in `register.el'.

It is bound to C-x r x, C-x r s.

(copy-to-register REGISTER START END &optional DELETE-FLAG REGION)

Copy region into register REGISTER.
With prefix arg, delete as well.
Called from program, takes five args: REGISTER, START, END, DELETE-FLAG,
and REGION. START and END are buffer positions indicating what to copy.
The optional argument REGION if non-nil, indicates that we're not just
copying some text between START and END, but we're copying the region.

Interactively, reads the register using `register-read-with-preview'.