What does the “rep stos” x86 assembly instruction sequence do?

后端 未结 2 833
不思量自难忘°
不思量自难忘° 2020-12-02 10:10

I recently stumbled across the following assembly instruction sequence:

rep stos    dword ptr [edi]
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 10:21

    Empty array: 
    char buff[256] = { }; 
    
     776      1c5:   48 8d 95 e0 fc ff ff    lea    -0x320(%rbp),%rdx
     777      1cc:   b8 00 00 00 00          mov    $0x0,%eax
     778      1d1:   b9 20 00 00 00          mov    $0x20,%ecx
     779      1d6:   48 89 d7                mov    %rdx,%rdi
     780      1d9:   f3 48 ab                **rep stos %rax,%es:(%rdi)**
    

提交回复
热议问题