decode and encode cpu register bit fields: A perl script