Lecture Computer organization and assembly language - Lecture 30: High-level language interface (1/2)

In this lecture, students will be able to understand: Why Link ASM and HLL Programs? inline assembly code, general and calling conventions, external identifiers, register usage, file encryption example. | CSC 221 Computer Organization and Assembly Language Lecture 30: High-Level Language Interface (1/2) Lecture 29: Review Win32 API Functions that create, read, and write to files: CreateFile ReadFile WriteFile SetFilePointer Console Window Manipulation Functions Screen buffer Console window Controlling the cursor Controlling the text color CreateFile PROTO, pFilename:PTR BYTE, desiredAccess:DWORD, shareMode:DWORD, lpSecurity:DWORD, creationDisposition:DWORD, flagsAndAttributes:DWORD, htemplate:DWORD Lecture 29: Review Time and Date Functions GetLocalTime, SetLocalTime GetTickCount, Sleep GetDateTime SYSTEMTIME Structure Graphical Window Functions POINT, RECT Structures MSGStruct, WNDCLASS Structures MessageBox Function WinMain, WinProc Procedures (cont.) Lecture Outline Why Link ASM and HLL Programs? General and Calling Conventions External Identifiers .MODEL Directive STDCALL C Inline Assembly Code _asm Directive You Can Do the Following . . . You Cannot Do the Following . . . . | CSC 221 Computer Organization and Assembly Language Lecture 30: High-Level Language Interface (1/2) Lecture 29: Review Win32 API Functions that create, read, and write to files: CreateFile ReadFile WriteFile SetFilePointer Console Window Manipulation Functions Screen buffer Console window Controlling the cursor Controlling the text color CreateFile PROTO, pFilename:PTR BYTE, desiredAccess:DWORD, shareMode:DWORD, lpSecurity:DWORD, creationDisposition:DWORD, flagsAndAttributes:DWORD, htemplate:DWORD Lecture 29: Review Time and Date Functions GetLocalTime, SetLocalTime GetTickCount, Sleep GetDateTime SYSTEMTIME Structure Graphical Window Functions POINT, RECT Structures MSGStruct, WNDCLASS Structures MessageBox Function WinMain, WinProc Procedures (cont.) Lecture Outline Why Link ASM and HLL Programs? General and Calling Conventions External Identifiers .MODEL Directive STDCALL C Inline Assembly Code _asm Directive You Can Do the Following . . . You Cannot Do the Following . . . Register Usage File Encryption Example Why Link ASM and HLL Programs? Use high-level language for overall project development Relieves programmer from low-level details Less time Slow Speed and Large Size Use assembly language code Speed up critical sections of code Access nonstandard hardware devices Write platform-specific code Extend the HLL's capabilities Objective Interface or Connection, between assembly language and high-level programming languages. Inline assembly code in C++. General Conventions Considerations when calling assembly language procedures from high-level languages: Does the assembler or compiler alter the names of identifiers placed in object files, and if so, how? Both must use the same naming convention (rules or characteristics regarding the naming of variables and procedures) Both must use the same memory model, with compatible segment names Both must use the same calling convention Calling Convention Refers to the low-level details about how procedures are called.

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.