In mbr start.S, does the way the Ax register is set affect subsequent mbr interpretation

57 views Asked by At

As we know, the first step in mbr is to set the segment register to 0. But there can be two methods to set the segment register, first we can use "xorw %ax, %ax" to set AX to 0, and second we can use "movw %cs, %ax" to set AX, then we will use the AX register to set other segment registers, ds, es, ss. The question is whether these two writing methods have any impact on the subsequent code of MBR.

movw %cs, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %ss
xorw %ax, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %ss

If it has an effect, I want to know what is the effect. Well, if not, I want to know why it hasn't an effect.

0

There are 0 answers