code structure for global reg