SQUASH/write_reg_contents_ex 3: adjust maxlen calc