write into freg and sreg