Physical address calculation assembly IAPX8088

你说的曾经没有我的故事 提交于 2019-12-11 11:53:09

问题


Given that: CS=0x5645, DS=0x1000, ES=0x6783, SS=0x0FFF, BX=0x4567, SI=0x1000, DI=0x2000, BP=0x4500
Write the physical address of the memory locations read or written by the following instructions if ax=0.

mov ax,[si]        
mov ax,[bp]        
mov ax,cs:[bp+20]
mov ax,[bx+si+10]  
mov ss:[bx+di],ax  
mov es:[bp+si+0x200],20 

What is the formula for calculation address this way and how to deal with segment registers in this.


回答1:


To calculate the physical address do the following:

  • All the components between the square brackets must be added together using 64KB wraparound, so sum is in [0,65535].
  • The segment register's value must first be multiplied by 16 and then added to the result using 1MB wraparound, so sum is in [0,1048575]. Take care to use the correct segment register!

Example:

mov ax,es:[bx+si+123]

Physical address is (((bx+si+123) and 0x0000'FFFF)+es*16) and 0x000F'FFFF



来源:https://stackoverflow.com/questions/32145039/physical-address-calculation-assembly-iapx8088

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