Comparison of several Assembly commands

Source: Internet
Author: User

Purple endurerOriginal

2006-10-141Version

1. assign a 32-bit value to the memory variable for an immediate numerical test
1) Use the push-pop command
0040100a |. 68 31323334 push 34333231
0040100f |. 8f05 50304000 pop dword ptr ds: [403050]
00401015 |
Command length: 015h-0ah = 0bh = 11d

2) use the mov command
0040101a |. c705 50304000> mov dword ptr ds: [403050], 34333231
00401024 |
Instruction length: 024h-01ah = 0ah = 10D

2. Assign the value of 32-Bit Memory variable A to 32-Bit Memory variable B.
1) Use the push-pop command
0040102e |. ff35 50304000 push dword ptr ds: [403050]
00401034 |. 8f05 4c304000 pop dword ptr ds: [40304c]
0040103a |
Instruction length: 03ah-02eh = 0ch = 12D

2) use the mov command to pass the Register
0040103f |. A1 50304000 mov eax, dword ptr ds: [403050]
00401044 |. A3 4c304000 mov dword ptr ds: [40304c], eax
00401049 |
Command length: 049h-03fh = 0ah = 10D

3. Call a custom function with a 32-bit value of 0.
1) directly use 32-bit value 0 as the parameter
0040104e |. 6a 00 push 0
00401050 |. 6a 00 push 0
00401052 |. 6a 00 push 0
00401054 |. 6a 00 push 0
00401056 |. 6a 00 push 0
00401058 |. E8 18000000 call test.00401075
0040105d |
Command length: 05dh-04eh = 0fh = 15d

2) set the register eax to 0, and then set the five eax parameters.
00401062 |. 33c0 XOR eax, eax
00401064 |. 50 push eax
00401065 |. 50 push eax
00401066 |. 50 push eax
00401067 |. 50 push eax
00401068 |. 50 push eax
00401069 |. E8 07000000 call test.00401075
0040106e |
Instruction length: 06eh-062h = 0ch = 12D

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.