improving speed by direct register access