code: public Register getRegister(int index) throws IndexOutOfBoundsException {
          if (index < 0) {
              throw new IndexOutOfBoundsException(index + " < 0");
          }
  
          if (index >= getWriteWordCount()) {
              throw new IndexOutOfBoundsException(index + " > " + getWriteWordCount());
          }
  
          return registers[index];
      }
docs: getRegister - Returns the specified <tt>Register</tt>.
  
  @param index the index of the <tt>Register</tt>.
  
  @return the register as <tt>Register</tt>.
  
  @throws IndexOutOfBoundsException if the index is out of bounds.