Thursday, October 21, 2010

Examples in assembly language, the [] usage



"[]" The use of the "Frequently Asked Questions" has been stated quote:

1, push dword ptr [024c1100] stacking 024c1100 value of the two-word
2, cmp eax, [ebp +14] eax-ebp +14's RMS, not retention, mainly to see the flag
3, cmp byte ptr [eax], 46 byte eax-46, see flags
4, lea eax, [edx-02] Valid values for the edx-02 (an address value) to eax
5, mov ecx, [edx +08] edx +8 value as the address, this address points to the value to ecx

I would like to add a few situations I encountered, with reference to some information and my personal understanding.
-------------------------------------------------- -----------------------------
mov instruction used in "[]"

1 - mov [edi], eax ---- the eax value (dword) in the memory address assigned to the value of edi Department
2 - mov [bp-02], dx --- the dx value (word) is assigned in the memory address values of bp-02 Department
3 - mov esi, [BP +14] --- the memory address of BP +14 in the size of the value of the inflow of dword esi register
4 - mov eax, dword ptr [ebp-04] --- put in the memory address of the dword ebp-04 moved into eax register value of the size of
5 - mov eax, dword ptr [0000003Ah] - to 3A of the dword in the size of the memory address value into the eax register
6 - mov cl, byte ptr [34h] - the byte at memory address 34, the size of the value of the register into the cl
7 - mov dx, word ptr [3Eh] - to 3E of the word in the size of the memory address value into the dx register
8 - mov eax, [00403045h] - 403 045 read from the memory address the value of a 32-bit
9 - mov al, byte ptr [eax + ecx] - to the memory address at eax + ecx the byte size of value into the al register

Integrated brackets "[]" is used from the brackets between the value at memory location, not only the value in parentheses on the register and memory address can be.

10 - mov cx, [eax] - put the word in the size of the memory address of the value of eax moved cx register
In mov cx, [eax], the processor will first see what the value of eax with (= memory address), then what is the memory address value, and this word (16 bit, because the target is a 16-cx- bit registers) moved cx.
-------------------------------------------------- -----------------------------
cmp instruction used in "[]"

1 - cmp dword ptr [ebp-04], 00000007 - the memory address of ebp-04 in the dword value of the size compared with 00,000,007
2 - cmp byte ptr [si], 00 - si to the byte at memory address value of the size compared with 00

-------------------------------------------------- -----------------------------
lea instruction used in "[]"

1 - lea di, [bp-22] ---- the bp-22 of the RMS (= memory address) to di
-------------------------------------------------- -----------------------------
test instructions used in "[]"

1 - test byte ptr [bx +08 FD]
- Will be located in memory address bx +08 FD Department of value byte size of the logic to determine whether the operation result 00







Recommended links:



H.264 to AVI



GOOD E-Commerce



MP4 to 3G2



new battery Can not be fully charged



MOV to MPEG4



Log multiple Gmail accounts at the SAME time - Firefox extension



The basic concepts of object-oriented



Command & Conquer 3 - the most difficult opponents experience



Inventory And BARCODING introduction



Comment E-Mail Clients



Recommend Languages Education



SARFT Issued The First Batch Of 3G Licenses Audio-visual



21st Century Business Herald: reversal eBay



Thread termination



Alipay's disregard the changing circumstances



No comments:

Post a Comment