开发者

Flags on Instruction pointer overflow in 8086/8088

开发者 https://www.devze.com 2023-01-03 21:50 出处:网络
Hey guys, Im new to the 8086 architecture and have not been able to find much on Google related to the following:

Hey guys, Im new to the 8086 architecture and have not been able to find much on Google related to the following:

On the i8086 or i8088 (ie 16bit, segmented addressing) what happens if an instruction fetch occurs with the instruction pointer (program counter) at 0xFFFF? I assume the CPU increments the IP and it overflows and becomes 0x0 while the CS register remains unchanged.

However if this happens do any flags get set (like the开发者_高级运维 overflow bit of the flags register?)

Thanks,


The architectural flags are changed only as the result of instruction execution, never as the result of a fetch. An overflow like you describe would result in a wraparound but this would not be reflected anywhere except the current IP.


I'm not sure it is supposed to have any special effect to flags, but it should trigger a reset. IP would increment to 0000: and CS would remain as FFFF, which I would reset the CS:IP to FFFF:0000 which is supposed to be the start instruction for the bootstrap loader.

0

精彩评论

暂无评论...
验证码 换一张
取 消