Add shifted register working. Some common functions added by shashank