Princess Sumaya Univ. Computer Engineering Dept. Chapter 6:

Slides:



Advertisements
Similar presentations
Princess Sumaya Univ. Computer Engineering Dept. Chapter 9:
Advertisements

Princess Sumaya University
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
CSC 221 Computer Organization and Assembly Language Lecture 21: Conditional and Block Structures: Assembly Programs.
NEG Instruction Change operand content into two’s complement (negative value) and stored back into its operand mov bl, b neg bl; bl = mov.
1 x86’s instruction sets. 2 Instruction Set Classification  Transfer Move  Arithmetic Add / Subtract Mul / Div, etc.  Control Jump Call / Return, etc.
Princess Sumaya Univ. Computer Engineering Dept. د. بســام كحـالــه Dr. Bassam Kahhaleh.
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, Conditional Loop Instructions LOOPZ and LOOPE LOOPNZ.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
80x86 Instruction Set Dr. Qiang Lin.
Computer Organization And Assembly Language
Princess Sumaya Univ. Computer Engineering Dept. Chapter 4:
Princess Sumaya University
Conditional Processing
Assembly Language for Intel-Based Computers
CS2422 Assembly Language & System Programming October 17, 2006.
CS2422 Assembly Language and System Programming Conditional Processing Department of Computer Science National Tsing Hua University.
Practical Session 2. Labels Definition valid characters in labels are: letters, numbers, _, $, ~,., and ? first character can be: letter, _, ? and.
Practical Session 2. Labels Definition valid characters in labels are: letters, numbers, _, $, ~,., and ? first character can be: letter, _, ? and.
Conditional Processing If … then … else While … do; Repeat … until.
CS2422 Assembly Language & System Programming October 19, 2006.
Prof. Muhammad Saeed III. 1/27/2015Computer Architecture & Assembly Language2 Assembly Language Instructions.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Quiz #2 Topics Character codes Intel IA-32 architecture Mostly MASM
Princess Sumaya Univ. Computer Engineering Dept. Chapter 7:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 4: IT Students.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 4:
Conditional Processing Computer Organization & Assembly Language Programming Dr Adnan Gutub aagutub ‘at’ uqu.edu.sa [Adapted from slides of Dr. Kip Irvine:
Sahar Mosleh California State University San MarcosPage 1 CPU Flags and Boolean Instructions.
Low Level Programming Lecturer: Duncan Smeed Low Level Program Control Structures.
Lecture 8. MIPS Instructions #3 – Branch Instructions #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education.
Copyright 2000ELEC 242 Arithmetic Instructions1 Arithmetic Instructions Arithmetic and logical instructions modify the contents of the Flag (Status) register.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Dr. José M. Reyes Álamo 1.  Review: ◦ of Comparisons ◦ of Set on Condition  Statement Labels  Unconditional Jumps  Conditional Jumps.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 5:
Assembly Language for Intel-Based Computers, 6 th Edition Chapter 6: Conditional Processing (c) Pearson Education, All rights reserved. You may modify.
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 5 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
EEL 3801 Part V Conditional Processing. This section explains how to implement conditional processing in Assembly Language for the 8086/8088 processors.
LEA instruction The LEA instruction can be used to get the offset address of a variable Example ORG 100h MOV AL, VAR1 ; check value of VAR1 by moving it.
Conditional Loop Instructions, Conditional Structures
Microprocessor MA Rahim Khan Computer Engineering and Networks Department.
Comparison Instructions Test instruction –Performs an implied AND operation between each of the bits in 2 operands. Neither operand is modified. (Flags.
CSC 221 Computer Organization and Assembly Language Lecture 20: Conditional and Block Structures.
Assembly Language for Intel-Based Computers, 4 th Edition Lecture 22: Conditional Loops (c) Pearson Education, All rights reserved. You may modify.
Assembly Language for Intel-Based Computers, 4 th Edition Week 10: Conditional Processing Slides modified by Dr. Osama Younes.
K.K. Leung Fall 2008Introductory Pentium Programming1 Pentium Architecture: Introductory Programming Kin K. Leung
Assembly תרגול 7 תכנות באסמבלי, המשך. Condition Codes Single bit registers  CF – carry flag  ZF – zero flag  SF – sign flag  OF – overflow flag Relevant.
Assembly Language for Intel-Based Computers, 5th Edition
Chapter 6: Conditional Processing
Microprocessor and Assembly Language
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Basic Assembly Language
More on logical instruction and
UNIT: 2 INSTRUCTION SET OF 8086.
CS 301 Fall 2002 Assembly Instructions
X86’s instruction sets.
Computer Organization and Assembly Language
Practical Session 2.
Program Logic and Control
Program Logic and Control
CNET 315 Microprocessor & Assembly Language
EECE.3170 Microprocessor Systems Design I
Computer Organization and Assembly Language
Chapter 7 –Program Logic and Control
CS-401 Computer Architecture and Assembly Language Programming
Chapter 8: Instruction Set 8086 CPU Architecture
Chapter 7 –Program Logic and Control
Presentation transcript:

Princess Sumaya Univ. Computer Engineering Dept. Chapter 6:

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 1 / 11 Boolean Instructions  AND ●ANDreg, reg ●AND reg, mem ●AND reg, imm ●AND mem, reg ●AND mem, imm  Sign, Zero Flags  OR  XOR  NOT

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 2 / 11 Boolean Instructions Example:ASCII Case: A = a = Sentence = “I aM A sTudeNT”

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 3 / 11 Boolean Instructions  TEST (Similar to AND) ●TESTreg, reg ●TEST reg, mem ●TEST reg, imm ●TEST mem, reg ●TEST mem, imm  Sign, Zero Flags

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 4 / 11 Compare Instruction  CMP (Similar to SUB) ●CMPreg, reg ●CMP reg, mem ●CMP reg, imm ●CMP mem, reg ●CMP mem, imm  Carry, Overflow, Sign, Zero Flags

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 5 / 11 Jump on Condition Instructions  Jcondition Label ●Zero ●Carry ●Overflow ●Sign ●CX = 0

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 6 / 11 Jump on Compare Result  Unsigned Comparison (CMP X, Y) ●X > Y ●X ≥ Y ●X = Y ●X < Y ●X ≤ Y

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 7 / 11 Jump on Compare Result  Signed Comparison (CMP X, Y) ●X > Y ●X ≥ Y ●X = Y ●X < Y ●X ≤ Y

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 8 / 11 Jump on Compare Result Example: Z = MAX ( X, Y )

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 9 / 11 Jump on Compare Result Example: D = MIN ( A, B, C )

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 10 / 11 Jump on Compare Result Example: Find the first nonzero element in an array

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 11 / 11 LOOP on Condition (Repeat While)  LOOPZ (LOOPE) ●Decrement the Counter ●If Counter > 0 and ZF = 1 jump to label  LOOPNZ (LOOPNE)

Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. Chapter 6