CS 301 Fall 2002 Assembly Instructions

Slides:



Advertisements
Similar presentations
Instruction Set of 8086 Engr. M.Zakir Shaikh
Advertisements

NEG Instruction Change operand content into two’s complement (negative value) and stored back into its operand mov bl, b neg bl; bl = mov.
EZ-COURSEWARE State-of-the-Art Teaching Tools From AMS Teaching Tomorrow’s Technology Today.
Chapter four – The 80x86 Instruction Set Principles of Microcomputers 2015年5月14日 2015年5月14日 2015年5月14日 2015年5月14日 2015年5月14日 2015年5月14日 1 Chapter Four.
Department of Computer Science and Software Engineering
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
80x86 Instruction Set Dr. Qiang Lin.
ADD Instruction ADD destination,source ADD AX,BX ADD SUM,EAX
Gursharan Singh Tatla 21-Nov-20101www.eazynotes.com.
8086 : INSTRUCTION SET By, Pramod Sunagar Assistant Professor
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 5 Arithmetic and Logic Instructions.
Flow Control Instructions
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Shift and Rotate Instructions
Ch. 7 Logic, Shift and Rotate instr.
Khaled A. Al-Utaibi  Introduction  Arithmetic Instructions  Basic Logical Instructions  Shift Instructions  Rotate Instructions.
Lecture 5 Multiplication, Division and Branches Dr. Dimitrios S. Nikolopoulos CSL/UIUC.
Arithmetic Flags and Instructions
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 4 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. 05.b: Arithmetic Operations Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization,
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.
October 1, 2003Serguei A. Mokhov, 1 SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003.
Practical Session 2. Flags Register (Status Register) A flag is a single bit of information whose meaning is independent from any other bit Each flag.
Chapter 7: Integer Arithmetic. 2 Chapter Overview Shift and Rotate Instructions Shift and Rotate Applications Multiplication and Division Instructions.
Arithmetic Flags and Instructions Chapter 7 S. Dandamudi.
Irvine, Kip R. Assembly Language for Intel-Based Computers. Chapter 7: Integer Arithmetic Slides to Accompany Assembly Language for Intel-Based Computers,
COMP 2003: Assembly Language and Digital Logic Chapter 2: Flags and Instructions Notes by Neil Dickson.
The Assemble, Unassemble commands of the debugger: U Command for converting machine code language source Equivalent machine code instructions Equivalent.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
Microprocessor & Assembly Language Arithmetic and logical Instructions.
Jumps, Loops and Branching. Unconditional Jumps Transfer the control flow of the program to a specified instruction, other than the next instruction in.
Assembly Language Wei Gao. Assembler language Instructions.
K.K. Leung Fall 2008Introductory Pentium Programming1 Pentium Architecture: Introductory Programming Kin K. Leung
Practical Session 2 Computer Architecture and Assembly Language.
Computer Architecture and Assembly Language
Chapter Nov-2010
Data Transfers, Addressing, and Arithmetic
16.317: Microprocessor System Design I
Assembly Language for Intel-Based Computers, 5th Edition
Practical Session 2.
Chapter instruction description and assembler directives from Microprocessors and Interfacing by Douglas Hall.
Today we are going to discuss about,
Instruction Set of 8086 Microprocessor
Instruksi Set Prosesor 8088
EE3541 Introduction to Microprocessors
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Basic Assembly Language
INSTRUCTION SET.
INSTRUCTION SET.
Assembly Language Programming Part 2
# include < stdio.h > v oid main(void) { long NUM1[5]; long SUM; long N; NUM1[0] = 17; NUM1[1] = 3; NUM1[2] =  51; NUM1[3] = 242; NUM1[4] = 113; SUM =
ECE 353 Introduction to Microprocessor Systems
4.2 Arithmetic Instructions
INSTRUCTION SET OF 8086 PAWAN KUMAR SINGH.
اصول اساسی برنامه نویسی به زبان اسمبلی
X86’s instruction sets.
Chapter 4: Instructions
ADDITION Register Addition. ADD AX,BX AX=AX+BX 2. Immediate Addition.
UNIT-I : 8086 ARCHITECTURE Contents Functional Diagram
Introduction to 8086 Assembly Language Programming
Computer Architecture and System Programming Laboratory
X86 Assembly Review.
Chapter 5 Arithmetic and Logic Instructions
Chapter 5: Arithmetic and Logic Instructions
CNET 315 Microprocessor & Assembly Language
Chapter 8: Instruction Set 8086 CPU Architecture
Computer Architecture and Assembly Language
Computer Architecture and System Programming Laboratory
Ravindra College of Engineering for women
UNIT-II ADDRESSING MODES & Instruction set
Presentation transcript:

CS 301 Fall 2002 Assembly Instructions Slide Set 4 9/20/2018

Symbolic Instructions 1 Arithmetic ADD: Add ADC: Add with carry SUB: Subtract SBB: Subtract with borrow NEG: Negate XADD: Exchange and add INC: Increment by 1 DEC: Decrement by 1 MUL: Unsigned multiply DIV: Unsigned divide IMUL: Signed multiply IDIV: Signed divide 9/20/2018

Symbolic Instructions 2 ASCII-BCD conversion AAA: ASCII Adjust After Addition AAS: ASCII Adjust After Subtraction AAM: ASCII Adjust After Multiplication AAD: ASCII Adjust Before Division DAA: Decimal Adjust After Addition DAS: Decimal Adjust After Subtraction 9/20/2018

Symbolic Instructions 3 Bit Shifting RCL: Rotate Left Through Carry RCR: Rotate Right Through Carry ROL: Rotate Left ROR: Rotate Right SAL: Shift Algebraic Left (=SHL) SAR: Shift Algebraic Right SHL: Shift Logical Left (=SAL) SHR: Shift Logical Right SHLD: Shift Left Double SHRD: Shift Right Double 9/20/2018

Symbolic Instructions 4 Comparison BSF/BSR: Bit Scan BT/BTC/BTR/BTS: Bit Test CMP: Compare CMPSn: Compare String CMPXCHG: Compare and Exchange CMPXCHG8B: Compare and Exchange TEST: Test bits 9/20/2018

Symbolic Instructions 5 Data Transfer LDS: Load DS register LEA: Load Effective Address LnS: Load nS register LODS: Load String MOV: Move Data MOVSn: Move String MOVSX: Move with Sign-Extend MOVZX: Move with Zero-Extend STOS: Store String XCHG: Exchange XLAT: Translate 9/20/2018

Symbolic Instructions 6 Flag Operations CLC/STC: Clear/Set CF CLD/STD: Clear/Set DF CLI/STI: Clear/Set IF CMC: Complement CF LAHF: Load AH from Flags SAHF: Store AH in Flags POPF: Pop Flags Off Stack PUSH: Push Flags On Stack 9/20/2018

Symbolic Instructions 7 Input/Output IN: Input Byte or Word OUT: Output Byte or Word INSn: Input String OUTSn: Output String 9/20/2018

Symbolic Instructions 8 Logical Operations AND: Logical And OR: Logical Or NOT: Logical Not XOR: Logical XOR 9/20/2018

Symbolic Instructions 9 Looping LOOP: Loop Until Complete LOOPE: Loop While Equal LOOPZ: Loop While Zero LOOPNE: Loop While Not Equal LOOPNZ: Loop While Not Zero 9/20/2018

Symbolic Instructions 10 Stack Operations ENTER: Make Stack Frame LEAVE: Terminate Stack Frame POP: Pop Word Off Stack PUSH: Push Word On Stack POPF: Pop Flags Off Stack PUSHF: Push Flags On Stack POPA: Pop All General Registers PUSHA: Push All General Registers 9/20/2018

Symbolic Instructions 11 String Operators CMPS: Compare String LODS: Load String MOVS: Move String REP: Repeat String REPE: Repeat While Equal REPZ: Repeat While Zero REPNE: Repeat While Not Equal REPNZ: Repeat While Not Zero SCAS: Scan String STOS: Store String 9/20/2018

Symbolic Instructions 12 Transfer (Conditional) 1 INTO: Interrupt On Overflow JA: Jump if Above JAE: Jump if Above/Equal JB: Jump if Below JBE: Jump if Below/Equal JC: Jump if Carry JCXZ: Jump if CX is Zero JE: Jump if Equal JG: Jump if Greater JGE: Jump if Greater/Equal JL: Jump if Less 9/20/2018

Symbolic Instructions 13 Transfer (Conditional) 2 JLE: Jump if Less/Equal JNA: Jump if Not Above JNAE: Jump if Not Above/Equal JNB: Jump if Not Below JNBE: Jump if Not Below/Equal JNC: Jump if No Carry JNE: Jump if Not Equal JNG: Jump if Not Greater JNGE: Jump if Not Greater/Equal JNL: Jump if Not Less 9/20/2018

Symbolic Instructions 14 Transfer (Conditional) 3 JNLE: Jump if Not Less/Equal JNO: Jump if No Overflow JNP: Jump if No Parity JNS: Jump if No Sign JNZ: Jump if Not Zero JO: Jump if Overflow JP: Jump if Parity JPE: Jump if Parity Is Even JPO: Jump if Parity Is Odd JS: Jump if Sign JZ: Jump if Zero 9/20/2018

Symbolic Instructions 15 Transfer (Unconditional) CALL: Call a Procedure INT: Interrupt IRET: Interrupt Return JMP: Jump RET: Return RETN/RETF: Return Near/Far 9/20/2018

Symbolic Instructions 16 Type Conversion CBW: Convert Byte To Word CDQ: Convert Doubleword to Quadword CWD: Convert Word to DoubleWord CWDE: Convert Word to Extended DoubleWord 9/20/2018

MOV – Move Data Flags: Affects no flags MOV reg/mem,reg/mem/imm 9/20/2018

ADD (and ADC/SUB/SBB) Add, Add with Carry, Subtract, Subtract with borrow. Flags: All affect AF,CF,OF,PF,SF, and ZF ADD reg/mem, reg/mem/imm ADC reg/mem, reg/mem/imm SBB reg/mem, reg/mem/imm SUB reg/mem, reg/mem/imm 9/20/2018

MUL - Multiply Unsigned Integers Flags: Affects CF and OF. (AF,PF,SF, and ZF are undefined) MUL reg/mem Size of operand Effect 8-bit AX = AL * 8-bit operand 16-bit DX:AX = AX * 16-bit operand 32-bit EDX:EAX = EAX * 32-bit operand 9/20/2018

DIV - Divide Unsigned Integers IDIV – Divide Signed Integers Flags: Affect AF,CF,OF,PF,SF, and ZF (all undefined) DIV reg/mem IDIV reg/mem Size of operand Operation Quotient Remainder 8-bit AX/operand AL AH 16-bit (DX:AX)/operand AX DX 32-bit (EDX:EAX)/operand EAX EDX 9/20/2018

IMUL – Multiply Signed Integers Flags: Affects CF and OF. (AF,PF,SF, and ZF are undefined) Format Effect dest source1 source2 IMUL reg/mem8 AX = AL * source1 reg/mem16 DX:AX = AX * source1 reg/mem32 EDX:EAX = EAX * source1 reg reg/mem/imm dest *= source1 reg/mem imm dest = source1 * source2 9/20/2018

Some Examples Assembled ADD instructions math.asm prime.asm 9/20/2018