Lecture Computer organization and assembly language - Lecture 17: Boolean and Comparison Instructions

In this lecture, students will be able to understand: Computer organization, data representation, integer arithmetic, binary representation, floating point representation, machine instruction characteristics, instruction cycles, types of operands, pentium and power PC data types, microporessor bus structure, address, data, control buses and registers, memory organization and structure, addressing modes. | CSC 221 Computer Organization and Assembly Language Lecture 17: Boolean and Comparison Instructions Lecture 16: Review Creating Procedures Documenting Procedures Example: SumOf Procedure CALL and RET Instructions The CALL instruction calls a procedure pushes offset of next instruction on the stack and copies the address of the called procedure into EIP The RET instruction returns from a procedure Lecture 16: Review (cont.) Nested Procedure Calls Local and Global Labels Flowchart Symbols USES Operator Lecture Outline Boolean and Comparison Instructions CPU Status Flags AND Instruction OR Instruction XOR Instruction NOT Instruction Applications TEST Instruction CMP Instruction Status Flags - Review The Zero flag is set when the result of an operation equals zero. The Carry flag is set when an instruction generates a result that is too large (or too small) for the destination operand. The Sign flag is set if the destination operand is negative, and it is clear if the destination operand | CSC 221 Computer Organization and Assembly Language Lecture 17: Boolean and Comparison Instructions Lecture 16: Review Creating Procedures Documenting Procedures Example: SumOf Procedure CALL and RET Instructions The CALL instruction calls a procedure pushes offset of next instruction on the stack and copies the address of the called procedure into EIP The RET instruction returns from a procedure Lecture 16: Review (cont.) Nested Procedure Calls Local and Global Labels Flowchart Symbols USES Operator Lecture Outline Boolean and Comparison Instructions CPU Status Flags AND Instruction OR Instruction XOR Instruction NOT Instruction Applications TEST Instruction CMP Instruction Status Flags - Review The Zero flag is set when the result of an operation equals zero. The Carry flag is set when an instruction generates a result that is too large (or too small) for the destination operand. The Sign flag is set if the destination operand is negative, and it is clear if the destination operand is positive. Status Flags - Review The Overflow flag is set when an instruction generates an invalid signed result (bit 7 carry is XORed with bit 6 Carry). The Parity flag is set when an instruction generates an even number of 1 bits in the low byte of the destination operand. The Auxiliary Carry flag is set when an operation produces a carry out from bit 3 to bit 4 AND Instruction Performs a Boolean AND operation between each pair of matching bits in two operands Syntax: AND destination, source (same operand types as MOV) AND OR Instruction Performs a Boolean OR operation between each pair of matching bits in two operands Syntax: OR destination, source OR XOR Instruction Performs a Boolean exclusive-OR operation between each pair of matching bits in two operands Syntax: XOR destination, source XOR XOR is a useful way to toggle (invert) the bits in an operand. NOT Instruction Performs a Boolean NOT operation on a single destination operand Syntax: NOT destination NOT Applications (1 .

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
71    225    2    29-04-2024
Đã 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.