Flags on Instruction pointer overflow in 8086/8088

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 08:25:27

问题


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,


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/3078821/flags-on-instruction-pointer-overflow-in-8086-8088

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!