tailieunhanh - Lecture Computer organization and assembly language: Chapter 17 - Dr. Safdar Hussain Bouk
After studying this chapter you will be able to develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks; to present a number of different methods for preventing or avoiding deadlocks in a computer system. | 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 . | 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
đang nạp các trang xem trước