title: RISC-V: PC Absolute vs PC Relative
body: <p>I am new to RISC-V.</p>
  
  <p>I am having trouble comprehending when to write PC (Program Counter) relative instructions and when to write PC absolute instructions.</p>
  
  <p>For example, an instruction with <strong>lui</strong> followed by <strong>jalr</strong> instruction is considered <strong>PC-absolute</strong>, and an instruction with  <strong>auipc</strong> followed by <strong>jalr</strong> instruction is considered <strong>PC-relative</strong>.</p>
  
  <p>To my understanding, all instructions will be executed by the PC so doing such PC absolute instructions seem to be hidden (i.e. without the knowledge of PC).</p>
  
  <p>To me, those PC-absolute instructions will not be executed.</p>
  
  <p>Can someone provide some basic examples to help me understand this?</p>