wrote tx code
added reg definitions