Tags: OS SP Div code BS as method simple functionSTOs 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 E
in the operation, such as Movl $foo,%eax equivalent to Intel's mov eax, word ptr foo
Long jumps and calls are different in format, att for ljmp $section, $offset, while Intel is JMP Section:offset
The main difference is these, the other details are many, here is a concrete example to illustrate
#cpuid. S Sample Program
. Section. Data
Output
. ASCII "The processor vendor ID is ' xxxxxxxxxxxx '/n '
. section. Text
. globl _start
_start:
MOVL $,%eax
Cpuid
MOVL $output,%
ptr [ebp-4]14.013b1059 Add Eax,esi15.013b105b Add Eax,edx16.013B105D mov edx,dword ptr [__imp_std::endl (13B204CH)]17.013b1063 Add Ecx,eax//The top 3 Add instructions add Ebx,ecx,edx,edi to ECX, that is, the ECX is the cumulative result
Visible compiler generated code is the best code, eliminate the intermediate variable i, reduce the number of cycles, eliminate the CPU can not be disorderly execution of the factors.
BTW:
One might have a question: i
loadRetDllentry ENDP
To convert the value in Edx:eax to a decimal output form string, which is familiar, as in the previous example!OUTEDXEAX proc \; For example: edx=0,eax=01234567h, the converted string is:Uses ebx esi edi,lpstring; -> ' 19088743 ', 0mov edi,lpstring; point to address where results are storedMOV esi,lpstring
mov ecx,10; convert to Decimal. While eax!=0 | | Edx!=0Push EAXMOV Eax,edxXOR
1 parameter passing (default calling convention)
Use VC6.0 to create a new empty console application, create a new source file Main.c, write the following code, pay attention to debug compile, do not use release, lest the code by VC optimization, disassembly does not correspond.
int addint (int a, int b)
{
int c = a+b;
return c;
}
int main ()
{
int x = AddInt (1, 3);
return 0;
}
In the main function into the braces down, press F5 run, the program is broken, then press the combination of
this limit//run: Run.exe automatically compiles pm16.c and pm32.c and then generates an IMG and calls Bochs to run the program// Hint: Please first compile run.c file with yc09, generate Run.exe Program//After modify PM16.C and pm32.c code, can run Run.exe view effect directly, click Enter again compile run//author: Miao//Time: 2010-2-8 #define Ycbit 32//Tell the compiler to compile the program in 32-bit format #define ycorg 0x0//This value generates an address base offset for variable function
Assembly language: Movsb,movsw,movsdTransferred from: http://blog.csdn.net/zhenyongyuan123/article/details/8364011Currently, the 80386 series of processors provide several sets of instructions for handling byte, Word, and double-word values, although these directives become basic string directives, but their usage is not limited to character arrays.Instructions:MOVSB, MOVSW, Movsd Describe:Moves the string data, copying the data at the memory address addressed by the ESI register to the memory a
))LSet L = bIp2long = L.valEnd Function
It's good and powerful to copy mybytes type variables to MyLong type variables with LSet. Look at the generated assembly code:
Copy Code code as follows:
00401A0E Lea eax, DWORD ptr [ebp-0x20]; Address of variable B
00401A11 push EAX
00401a12 Lea eax, DWORD ptr [ebp-0x14]; The address of the variable L
00401A15 push EAX
00401A16 Push 0x4
00401a18 call __vbacopybytes; JMP to Msvbvm60.__vbacopybytes
Called is the __v
The usage of "[]" has been described in "FAQ" and is cited as follows:
1, push DWORD ptr [024c1100] pressure stack 024c1100 value of two words2, CMP eax,[ebp+14] eax-ebp+14 valid value, does not retain the value, mainly looks at the sign bit3, CMP byte ptr [eax],46 byte type eax-46, see sign bit4, Lea eax,[edx-02] edx-02 valid value (an address value) to EAX5, MOV ecx,[edx+08] edx+8 value as the address, this address points to the value of ECX
I am going to add a few more examples of what I have
Wang huaying
Wang huaying and Xu lingbo
Print Distribution
Xu lingbo
Xu lingbo
User Training
Xu lingbo
Xu lingbo
Software Installation
Xu lingbo
Xu lingbo
3.2 contact person
Describe the personnel responsible for interface work and their responsibilities, including:
A. the liaison officer responsible for the project and the user:
B. Liaison officers r
chaos, and Chen shengwu was unveiled. heroes from all directions, driven by Chen shengwu Guang, stood up to fight against the violent Qin Dynasty. At this time, Han Xin's hometown also experienced an uprising. Xiang Yu's Uncle Xiang Liang pulled up a volunteer army, So Han Xin "took the sword from it ". After joining the army, Han Xin followed Xiang Liang and later Xiang Yu, but Xiang Yu did not pay attention to him. At this time, si ma Qian used four words to summarize his situation: "No Name
French.Broad perspective of Japan people, culture, and customs, as well as Japan-American diplomatic relations.Computer literate in most popular software, including WordPerfect 5.0 and 5.1 (including Japanese WordPerfect), Lotus 1-2-3, drawperfect and Computer Aided Design (CAD ).Japan-American RelationsServed as liaison between Japanese diplomats and the Japanese-American Relations Group and with the Japanese press during the Prime Minister's stay.T
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.