Lecture Computer organization and assembly language - Lecture 18: Program Components, I/O and Conditional Jump Instructions

In this lecture, students will be able to understand: Creating Procedures, Documenting Procedures, CALL and RET Instructions, The CALL instruction calls a procedure, boolean and Comparison Instructions, CPU Status Flags, AND Instruction, OR Instruction, XOR Instruction, NOT Instruction, Applications, TEST Instruction, CMP Instruction. | CSC 221 Computer Organization and Assembly Language Lecture 18: Program Components, I/O and Conditional Jump Instructions Lecture 17: Review AND Instruction AND destination, source OR Instruction OR destination, source XOR Instruction XOR destination, source NOT Instruction NOT destination Lecture 17: Review (cont.) Applications TEST Instruction Performs a nondestructive AND operation between each pair of matching bits in two operands. ZERO Flag CMP Instruction CMP destination, source Zero (Dest. Equal) and Carry (Dest. Less) ZF = CF = 0 (Dest. > Src) Lecture Outline Program Components I/O Instructions Jumps Based On . . . Specific flags Equality Unsigned comparisons Signed Comparisons Applications Program Components .386 Assembler directive tells the assembler to use the 386 instruction set. There are hardly any processors out there that are older than the 386 nowadays. Alternatively, you can use .486, .586 or .686, but .386 will be the most compatible instruction set. Program . | CSC 221 Computer Organization and Assembly Language Lecture 18: Program Components, I/O and Conditional Jump Instructions Lecture 17: Review AND Instruction AND destination, source OR Instruction OR destination, source XOR Instruction XOR destination, source NOT Instruction NOT destination Lecture 17: Review (cont.) Applications TEST Instruction Performs a nondestructive AND operation between each pair of matching bits in two operands. ZERO Flag CMP Instruction CMP destination, source Zero (Dest. Equal) and Carry (Dest. Less) ZF = CF = 0 (Dest. > Src) Lecture Outline Program Components I/O Instructions Jumps Based On . . . Specific flags Equality Unsigned comparisons Signed Comparisons Applications Program Components .386 Assembler directive tells the assembler to use the 386 instruction set. There are hardly any processors out there that are older than the 386 nowadays. Alternatively, you can use .486, .586 or .686, but .386 will be the most compatible instruction set. Program Components .model flat, stdcall .MODEL memorymodel [, langtype] [, stackoption] memorymodel Required parameter that determines the size of code and data pointers. langtype Optional parameter that sets the calling and naming conventions for procedures and public symbols. stackoption Optional parameter. stackoption is not used if memory model is FLAT. NEARSTACK groups the stack segment into a single physical segment along with data (DS=SS) (cont.) Program Components Parameter 32-bit values 16-bit values (support for earlier 16-bit development) memorymodel FLAT TINY , SMALL, COMPACT, MEDIUM, LARGE, HUGE, FLAT langtype C , STDCALL C , BASIC, FORTRAN, PASCAL, SYSCALL, STDCALL stackoption Not used NEARSTACK , FARSTACK (cont.) Program Components .model flat, stdcall MODEL is an assembler directive that specifies the memory model of your program. flat is the model for Windows programs. stdcall is the parameter passing method used by Windows functions, which means you need to push your parameters .

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.