汇编代码,需要帮助来了解“ movzwl 0x40272e(,%rax,4),%esi”在做什么

时间:2018-11-04 23:19:37

标签: assembly x86-64 att

我知道其他电话在做什么,但是当我接到第36行时,我不知道发生了什么事?

我的3个参数分别是rsi = 5,rdx = 6,rcx = 7

第26行,我的%rax = 25 然后在第30行,我的rsi从5更改为37

您能解释为什么会这样吗?什么是0x40272e

0x0000000000401212 <+0>:        sub    $0x8,%rsp                # subtract 8 from rsp
0x0000000000401216 <+4>:        lea    -0x1(%rdx),%rax          # rax = -1 + rdx  
0x000000000040121a <+8>:        cmp    $0xf,%rax                # rax ?? 0xf '-1' 'SI' 
0x000000000040121e <+12>:   ja     0x40124f <phase_3+61>    # if(rax > 0xf) goto L1 
0x0000000000401220 <+14>:   cmp    $0x2,%rdi                # rdi ?? 0x2 
0x0000000000401224 <+18>:   jle    0x40124f <phase_3+61>    # if(rdi <= 0x2) goto L1 
0x0000000000401226 <+20>:   cmp    $0xa,%rsi                # rsi ?? 0xa '10' 'LF' 
0x000000000040122a <+24>:   ja     0x40124f <phase_3+61>    # if(rsi > 0xa) goto L1   
0x000000000040122c <+26>:   lea    (%rsi,%rsi,4),%rax       # rax = 5 * rsi 
0x0000000000401230 <+30>:   movzwl 0x40272e(,%rax,4),%esi   # esi = 0 + rax * 4 
0x0000000000401238 <+38>:   movsbq 0x402801(,%rdx,4),%rax   # rax = 0 + rdx * 4 
0x0000000000401241 <+47>:   xor    %rax,%rsi                # rsi ^ rax 
0x0000000000401244 <+50>:   sete   %al                      # if (rsi == rax) al = 1
0x0000000000401247 <+53>:   movzbl %al,%eax                 # rax = al
0x000000000040124a <+56>:   cmp    %rcx,%rsi                # rsi ?? rcx
0x000000000040124d <+59>:   je     0x40125b <phase_3+73>    # if (rsi == rcx) goto L2 
0x000000000040124f <+61>:   callq  0x401b17 <bomb_explodes> # boom boom
0x0000000000401254 <+66>:   mov    $0xffffffffffffffff,%rax # rax = -1
0x000000000040125b <+73>:   add    $0x8,%rsp                # add 8 to rsp
0x000000000040125f <+77>:   retq                            # return rax

0 个答案:

没有答案