最近在看 intel 指令手册,有一处不明,求解。 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hazard
V2EX    问与答

最近在看 intel 指令手册,有一处不明,求解。

  •  
  •   hazard 2015-02-01 22:57:43 +08:00 2908 次点击
    这是一个创建于 3912 天前的主题,其中的信息可能已经有所发展或是发生改变。
    In 64-bit mode, there are limitations on accessing byte registers. An instruction cannot reference legacy high-bytes (for example: AH, BH, CH, DH) and one of the new byte registers at the same time (for example: the low byte of the RAX register)

    这段话该怎么理解?
    什么是one of the new byte registers?
    谢谢!
    9 条回复    2015-02-01 23:18:18 +08:00
    yangff
        1
    yangff  
       2015-02-01 23:06:40 +08:00 via Android   1
    ah bh ch ...是高位啊。。。
    hazard
        2
    hazard  
    OP
       2015-02-01 23:09:08 +08:00
    @yangff 那 one of the new byte registers 指的是什么? 是AL吗?
    xieyudi1990
        3
    xieyudi1990  
       2015-02-01 23:11:09 +08:00
    感觉 "new byte registers" 指的是 AL, BL, CL, DL, DIL, SIL, BPL, SPL, R8L - R15L.
    意思应该是 AH BH CH DH 和 上面这些不能同时在一条指令里引用.

    没玩过x86_64, 但我翻了下手册, 结合上下文应该是这个意思.

    In 64-bit mode, there are limitations on accessing byte registers. An instruction cannot reference legacy high-bytes (for example: AH, BH, CH, DH) and one of the new byte registers at the same time (for example: the low byte of the RAX register). However, instructions may reference legacy low-bytes (for example: AL, BL, CL or DL) and new byte registers at the same time (for example: the low byte of the R8 register, or RBP). The architecture enforces this limitation by changing high-byte references (AH, BH, CH, DH) to low byte references (BPL, SPL, DIL, SIL: the low 8 bits for RBP, RSP, RDI and RSI) for instructions using a REX prefix.
    xieyudi1990
        4
    xieyudi1990  
       2015-02-01 23:12:58 +08:00   1
    Byte Registers: AL, BL, CL, DL, DIL, SIL, BPL, SPL, R8L - R15L
    bcxx
        5
    bcxx  
       2015-02-01 23:13:09 +08:00
    @hazard 指 r 开头的那些寄存器吧, 这里的意思应该是指在 64 位下的那些 extended registier 也是只能访问到一个字节(我乱说的,别当真) 应该是和寄存器拓展长度有关的. http://stackoverflow.com/a/1753618
    yfdyh000
        6
    yfdyh000  
       2015-02-01 23:13:50 +08:00   1
    在64位模式,将限制指令存取字节寄存器,指令不能同时使用传统的高字节(比如AH, BH. CH, DH)和新的字节寄存器(比如RAX寄存器的低字节)。-- http://baike.baidu.com/view/809.htm
    yangff
        7
    yangff  
       2015-02-01 23:16:31 +08:00 via Android
    头搞晕。。
    反正就是r**那票64位的寄存器的低位不能和他们的高位一起ref。。
    yangff
        8
    yangff  
       2015-02-01 23:17:57 +08:00 via Android
    阿不是。。r**那票的低位
    hazard
        9
    hazard  
    OP
       2015-02-01 23:18:18 +08:00
    明白了 谢谢各位!
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2514 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 28ms UTC 04:19 PVG 12:19 LAX 21:19 JFK 00:19
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86