SECTION VI-17: Instruction Size of the PIC18 GOTO Instruction Formation

The GOTO is a 4 byte (32 bit) instruction. Of the 32 bits, only 12 bits are set aside for the opcode and the rest (20 bits) are used for the target address of the GOTO. This is shown below:

 

Instruction Size of the PIC18 GOTO Instruction Formation
goto-instruction-formation-pic18.jpg

 

The 20 bits address gives us only 1M of address space and the PIC18 has 2M of ROM space. This is solved by making the least significant bit (LSB) of the GOTO instruction 0 as shown below:

 

goto-instruction-formation2-pic18.jpg

 

Setting the LSB of the target address to zero will make sure that the target address is an even address. This is what we want because all the instructions are either 2 byte or 4 byte. This should also avoid landing at the middle of an instruction.

 

More From Iamtechnical.com

Advertisement:

SiteLock