Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Computer organization and assembly language: Chapter 28 - Dr. Safdar Hussain Bouk
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
This chapter begins with an examination of the three types of processor scheduling, showing how they are related. We see that long-term scheduling and mediumterm scheduling are driven primarily by performance concerns related to the degree of multiprogramming. | CSC 221 Computer Organization and Assembly Language Lecture 28: Macros & Win32 Console Programming Lecture 27: Review Two Dimensional Arrays Basic Concept 2-D Array Representation Row-major: (Most Common) Col.-major: Order Lecture 27: Review Base-Index Operands A base-index operand adds the values of two registers (called base and index), producing an effective address. [base + index] (cont.) .data array WORD 1000h,2000h,3000h .code mov ebx,OFFSET array mov esi,2 mov ax,[ebx+esi] ; AX = 2000h mov edi,OFFSET array mov ecx,4 mov ax,[edi+ecx] ; AX = 3000h mov ebp,OFFSET array mov esi,0 mov ax,[ebp+esi] ; AX = 1000h Lecture 27: Review Base-Index Displacement A base-index-displacement operand adds base and index registers to a constant, producing an effective address. Displacement can be the name of a variable or a constant expression. (cont.) [ base + index + displacement ] displacement [ base + index ] RowNumber = 1 ColumnNumber = 2 mov ebx,NumCols * RowNumber mov esi,ColumnNumber mov al,table[ebx + esi] Lecture 27: Review Structures (cont.) name STRUCT field-declarations name ENDS Employee STRUCT ; bytes IdNum BYTE "000000000" ; 9 LastName BYTE 30 DUP(0) ; 30 Years WORD 0 ; 2 SalaryHistory DWORD 0,0,0,0 ; 16 Employee ENDS .data worker Employee mov eax,TYPE Employee ; 57 mov eax,SIZEOF Employee ; 57 mov eax,SIZEOF worker ; 57 mov eax,TYPE Employee.SalaryHistory ; 4 mov eax,LENGTHOF Employee.SalaryHistory ; 4 mov eax,SIZEOF Employee.SalaryHistory ; 16 Lecture Outline Macros Introducing Macros Defining Macros Invoking Macros Windows 32 Console Programming Background Information Win32 Console Programs API and SDK Windows Data Types Standard Console Handles Console Input Console Output Introducing Macros A macro1 is a named block of assembly language statements. Once defined, it can be invoked (called) one or more times. During the assembler's preprocessing step, each macro call is expanded into a copy of the macro. The expanded code is passed to the assembly step, . | CSC 221 Computer Organization and Assembly Language Lecture 28: Macros & Win32 Console Programming Lecture 27: Review Two Dimensional Arrays Basic Concept 2-D Array Representation Row-major: (Most Common) Col.-major: Order Lecture 27: Review Base-Index Operands A base-index operand adds the values of two registers (called base and index), producing an effective address. [base + index] (cont.) .data array WORD 1000h,2000h,3000h .code mov ebx,OFFSET array mov esi,2 mov ax,[ebx+esi] ; AX = 2000h mov edi,OFFSET array mov ecx,4 mov ax,[edi+ecx] ; AX = 3000h mov ebp,OFFSET array mov esi,0 mov ax,[ebp+esi] ; AX = 1000h Lecture 27: Review Base-Index Displacement A base-index-displacement operand adds base and index registers to a constant, producing an effective address. Displacement can be the name of a variable or a constant expression. (cont.) [ base + index + displacement ] displacement [ base + index ] RowNumber = 1 ColumnNumber = 2 mov ebx,NumCols * RowNumber mov esi,ColumnNumber mov .