The Intel Developer Manual suggests that after switching to protected mode, we immediately perform the JMP or CALL instruction immediately after the MOV CR0 instruction changes the flow of execution and serializes the processor. The purpose is for invalidating the prefetch queue, as suggested by the code example in chapter 9, section 9.10.2, START.ASM Listing
, line 174-186:
174 ; enter protected mode
175 MOV EBX,CR0
176 OR EBX,PE_BIT
177 MOV CR0,EBX
178
179 ; clear prefetch queue
180 JMP CLEAR_LABEL
181 CLEAR_LABEL:
182
183 ; make DS and ES address 4G of linear memory
184 MOV CX,LINEAR_SEL
185 MOV DS,CX
186 MOV ES,CX
Why should we need to perform such operation? Isn't the code remain the same in the queue, since a short jump like that does not change any flag or segment at all, except for invalidating the current data in the prefetch queue to reload the same thing again?