Question

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?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top