writing reg