TAILIEUCHUNG - Lecture Computer organization and assembly language: Chapter 20 - Dr. Safdar Hussain Bouk

After studying this chapter you will be able to understand: Understand what XML is and how it is used within business-to-business transactions, understand XML Schemas and XSL Transforms and how they are used within the context of XML, read and process data that is stored in an XML document, read data from a relational database and transform it into its equivalent XML, transform one XML document into a new XML document using an XSLT document. | CSC 221 Computer Organization and Assembly Language Lecture 20: Conditional and Block Structures Lecture 19: Review I/O Instructions StdIn proc lpszBuffer:DWORD,bLen:DWORD StdOut proc lpszText:DWORD invoke StdOut, addr message1 invoke StdIn, addr buffer, 100 Conditional Jumps Specific flags Equality Unsigned comparisons Signed Comparisons Lecture 19: Review Conditional Jumps JB, JC jump to a label if the Carry flag is set JE, JZ jump to a label if the Zero flag is set JS jumps to a label if the Sign flag is set JNE, JNZ jump to a label if the Zero flag is clear JECXZ jumps to a label if ECX equals 0 Assembly Examples (cont.) Lecture Outline Bit Test Instruction Conditional LOOP Instructions LOOPZ and LOOPE LOOPNZ and LOOPNE Block Structures Block-Structured IF Statements Compound Expressions with AND Compound Expressions with OR WHILE Loops REPEAT Loops BT (Bit Test) Instruction Copies bit n from an operand into the Carry flag Syntax: BT bitBase, n bitBase may be r/m16 or r/m32 n may be r16, r32, or imm8 Example: jump to label L1 if bit 9 is set in the AX register: bt AX,9 ; CF = bit 9 jc L1 ; jump if Carry Conditional Loop Instructions LOOPZ and LOOPE LOOPNZ and LOOPNE LOOPZ and LOOPE Syntax: LOOPE destination LOOPZ destination Logic: ECX ECX – 1 if ECX > 0 and ZF=1, jump to destination Useful when scanning an array for the first element that does not match a given value. LOOPNZ and LOOPNE LOOPNZ (LOOPNE) is a conditional loop instruction Syntax: LOOPNZ destination LOOPNE destination Logic: ECX ECX – 1; if ECX > 0 and ZF=0, jump to destination Useful when scanning an array for the first element that matches a given value. LOOPNZ Example .data array SWORD -3,-6,-1,-10,10,30,40,4 sentinel SWORD 0 .code mov esi,OFFSET array mov ecx,LENGTHOF array next: test WORD PTR [esi],8000h ; test sign bit pushfd ; push flags on stack add esi,TYPE array popfd ; pop flags from stack loopnz next ; continue loop jnz quit ; none found sub esi,TYPE array ; ESI points to value .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.