tailieunhanh - Lecture Computer organization and assembly language - Lecture 31: High-Level Language Interface (2/2)

In this lecture, students will be able to understand: Function call overhead, linking to visual C++ programs, linking to visual C++, optimizing your code, loop optimization example, findarray example, creating the findarray project. | CSC 221 Computer Organization and Assembly Language Lecture 31: High-Level Language Interface (2/2) Lecture 30: Review Why Link ASM and HLL Programs? HLL Hides low-level details, Less time, Slow Speed and Large Size Assembly Speed up critical sections of code, Access nonstandard hardware devices, Write platform-specific code, Extend the HLL's capabilities External Identifier: is a name that has been placed in a module’s object file in such a way that the linker can make the name available to other program modules. Naming convention: rules or characteristics regarding the naming of variables and procedures Lecture 30: Review Calling Convention: Refers to the low-level details about how procedures are called Registers that must be preserved by procedures. How arguments are passed to procedures? The order in which arguments are passed by calling programs to procedures. Whether arguments are passed by value or by reference. How the stack pointer is restored after a procedure call? How . | CSC 221 Computer Organization and Assembly Language Lecture 31: High-Level Language Interface (2/2) Lecture 30: Review Why Link ASM and HLL Programs? HLL Hides low-level details, Less time, Slow Speed and Large Size Assembly Speed up critical sections of code, Access nonstandard hardware devices, Write platform-specific code, Extend the HLL's capabilities External Identifier: is a name that has been placed in a module’s object file in such a way that the linker can make the name available to other program modules. Naming convention: rules or characteristics regarding the naming of variables and procedures Lecture 30: Review Calling Convention: Refers to the low-level details about how procedures are called Registers that must be preserved by procedures. How arguments are passed to procedures? The order in which arguments are passed by calling programs to procedures. Whether arguments are passed by value or by reference. How the stack pointer is restored after a procedure call? How functions return values? (cont.) Lecture 30: Review .MODEL Directive stdcall AddTwo(5, 6) last to 1st. push 6 push 5 call AddTwo Saves EBP, ESP and access parameters using EBP. ret 8 ; clean up the stack _name@nn C specifier: push 6 ; Second Argument push 5 ; First Argument call AddTwo add esp,8 ; clean up the stack _AddTwo (cont.) Lecture 30: Review _asm Directive in Microsoft Visual C++stdcall Syntax: __asm statement __asm { statement-1 statement-2 . statement-n } (cont.) Lecture Outline Function Call Overhead Linking to Visual C++ Programs Linking to Visual C++ Optimizing Your Code Loop Optimization Example FindArray Example Creating the FindArray Project Function Call Overhead using namespace std; int main( ) { const int BUFSIZE = 2000; char buffer[BUFSIZE]; unsigned int count; unsigned char encryptCode; cout > encryptCode; ifstream infile( "", ios::binary ); ofstream outfile( "", ios::binary ); cout << “ENCODING“<< endl; .

TÀI LIỆU LIÊN QUAN
TỪ KHÓA LIÊN QUAN