finish the send_work code, more register defines