views:

66

answers:

1

It seems that the following is a common method given in many tutorials on switching a processor from 16-bit to 32-bit:

    mov     eax, cr0            ; set bit 0 in CR0-go to pmode
    or      eax, 1
    mov     cr0, eax

Why wouldn't I simply do the following:

    or      cr0, 1

Is there something I'm missing? Possibly the only thing I can think of is that I cannot perform an operation like this on the cr0 register.

+5  A: 

The or operator doesn't have an op-code in which it can access the CR0 register. (It's not possible to perform this operation on the CR0 register.)

That's why the mov is there: there exists an op-code which can access the CR0 register.

Pindatjuh