Updating the code to read and write to the debug registers.