保护模式中的地址转换前缀代码

who_1111 2008-12-31 09:42:27
最近在学习保护模式,发现在保护模式下面调用寄存器传送数据的时候,会有以下代码:

DB 66h ; PUSHING ALL REGS AS 32-BIT ONES
PUSH DS
DB 66h
PUSH ES
DB 66h
PUSH FS
DB 66h
PUSH GS

这个DB 66H查了一下,说是地址转换前缀代码,可是之后的一篇程序代码里面,定义的却是DB 67H,请问这个是怎么定义的呢?
db 67h ; use 32-bit registers in 16-bit code
rep movsb
pop es
retn

总之,就是DB 66H; DB 67H是怎么定义的?两个有什么区别呢?
谢谢!
...全文
111 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
who_1111 2009-01-20
  • 打赏
  • 举报
回复
The 80386 has two instruction prefixes that allow mixing of 32-bit and
16-bit operations within one segment:
● The operand-size prefix (66H)
● The address-size prefix (67H)

These prefixes reverse the default size selected by the D-bit. For example,
the processor can interpret the word-move instruction MOV mem, reg in any of
four ways:
● In a USE32 segment:
1. Normally moves 32 bits from a 32-bit register to a 32-bit
effective address in memory.
2. If preceded by an operand-size prefix, moves 16 bits from a 16-bit
register to 32-bit effective address in memory.
3. If preceded by an address-size prefix, moves 32 bits from a 32-bit
register to a16-bit effective address in memory.
4. If preceded by both an address-size prefix and an operand-size
prefix, moves 16 bits from a 16-bit register to a 16-bit effective
address in memory.
● In a USE16 segment:
1. Normally moves 16 bits from a 16-bit register to a 16-bit
effective address in memory.
2. If preceded by an operand-size prefix, moves 32 bits from a 32-bit
register to 16-bit effective address in memory.
3. If preceded by an address-size prefix, moves 16 bits from a 16-bit
register to a32-bit effective address in memory.
4. If preceded by both an address-size prefix and an operand-size
prefix, moves 32 bits from a 32-bit register to a 32-bit effective
address in memory.

分享一下,这个资料还是不错的。
who_1111 2009-01-20
  • 打赏
  • 举报
回复
谢谢!
Guilty 2009-01-01
  • 打赏
  • 举报
回复
mov eax, [bx] //66
mov ax, [ebx] //67
s393658806 2009-01-01
  • 打赏
  • 举报
回复

学一下
xtdumpling 2008-12-31
  • 打赏
  • 举报
回复
请看这个帖子:http://topic.csdn.net/u/20080724/01/57fc554d-ac2b-43fc-ab57-432c7057983b.html

21,497

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧