What does the colon : mean in x86 assembly GAS syntax as in %ds:(%bx)?

淺唱寂寞╮ 提交于 2019-12-01 20:48:41

In real mode, the segment register is used to provide a 20-bit address. In this case, the data segment register ds provides the 'high' 16 bits of the address: (0x1234 << 4 = 0x12340), and the offset in the segment is given by: 0x5678, to yield: 0x179b8.

The data segment register is implicit, so it's not necessary to use: ds:(%bx). If you were using another segment register, like es, it would need to be explicit.

I hope I've understood your question. As to why it's not written as (%ds:%bx), that's really just a syntactic decision that you're stuck with.

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