Pergunta

CodeProject has an article:

CS always holds the segment of the currently executing code. You cannot set CS by using, say, mov cs,ax. When you call a function that resides in another segment (FAR call), or when you jump to another segment (FAR jump), CS changes.

So what happens when we try to modify the register directly by using mov cs, ax?

Foi útil?

Solução

According to the Intel manual, you get an "undefined opcode" exception:

mov — Move

{ Protected Mode, Real-Address Mode, Virtual-8086 Mode, 64-Bit Mode} Excpetions

#UD If attempt is made to load the CS register.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top