STOs string storage commands

Source: Internet
Author: User
STOs includes stosb stosw stosd. The registers involved are eax and EDI. The functions are as follows: stosb copies values in Al to byte ptr es: [EDI, at the same time, EDI ++ stosw copies the value in ax to word ptr es: [EDI], and EDI ++ stosd copies the value in eax to dword ptr es: [EDI, EDI ++ at the same time
Example: int A [0x22] = {0}; // The usual initialization method, but since memset function is called during assembly (there are many internal code ), therefore, the efficiency is low. _ ASM mov eax, 0xcc // useless code to prompt _ ASM mov eax, 0xcc // int B [0x33]; __asm // The following three Assembly statements are used to initialize array B, simple and efficient {XOR eax, eax Lea EDI, bmov ECx, 0x33rep stosd}

STOs string storage commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.