4.4 Bit Manipulation Instructions

Slides:



Advertisements
Similar presentations
Addressing Mode Wannachai Wannasawade Department of Computer Education
Advertisements

10-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Subroutine and Interrupt.
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 IKI10230 Pengantar Organisasi Komputer Kuliah no. 05.c: Logical Operations Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization,
EZ-COURSEWARE State-of-the-Art Teaching Tools From AMS Teaching Tomorrow’s Technology Today.
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
Computer Organization & Assembly Language
80x86 Instruction Set Dr. Qiang Lin.
Introduction to Assembly Here we have a brief introduction to IBM PC Assembly Language –CISC instruction set –Special purpose register set –8 and 16 bit.
8086 : INSTRUCTION SET By, Pramod Sunagar Assistant Professor
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 7: Integer Arithmetic (c) Pearson Education, All rights reserved. You may modify.
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
Microcomputer & Interfacing Lecture 3
8.4 Instruction Execution Times TOBIN PROC FAR SUB AX,AX MOV DX,AX MOV CX,4 NEXTD: PUSH CX SUB BP,BP MOV CX,4 GETNUM: RCL BX,1 RCL BP,1 LOOP GETNUM.
Introduction to Computer Engineering by Richard E. Haskell Shift and Rotate Instructions Module M16.2 Section 10.3.
Assembly Language – Lab 5
Micro-Computer Applications: Procedures & Interrupts Dr. Eng. Amr T. Abdel-Hamid ELECT 707 Fall 2011.
Ch. 7 Logic, Shift and Rotate instr.
Lecture 11 Last notes on interrupts and exam review Dr. Dimitrios S. Nikolopoulos CSL/UIUC.
Stack Operations LIFO structure (last-in,first-out) –The last value put into the stack is the first value taken out Runtime stack –A memory array that.
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
Lecture 5 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
Executing and Linking an assembly program. Lesson plan Review Program logic and control Practice exercise Assembling, Linking and Executing Programs Practice.
1 ECE 372 – Microcontroller Design Assembly Programming HCS12 Assembly Programming Addressing Modes Stack Operations Subroutines.
Introduction to Assembly Language Programming 1. Overview of Assembly Language  Advantages:  Disadvantages: Faster as compared to programs written using.
EEL 3801 Part IV The Assembler. OFFSET Operator Returns address of variable used as operand. Actually, it represents the offset from the beginning of.
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.
Lecture 12 Integer Arithmetic Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Chapter four – The 80x86 Instruction Set Principles of Microcomputers 2016年3月17日 2016年3月17日 2016年3月17日 2016年3月17日 2016年3月17日 2016年3月17日 1 Chapter Four.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
7-Nov Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Oct lecture23-24-hll-interrupts 1 High Level Language vs. Assembly.
Stack Operations Dr. Hadi AL Saadi.
Computer Architecture and Assembly Language
Chapter Nov-2010
Practical Session 2.
Microprocessor Systems Design I
Microprocessor Systems Design I
Instruksi Set Prosesor 8088
Subroutines and the Stack
Microprocessor and Assembly Language
Microprocessor and Assembly Language
Chapter 3 Bit Operations
EE3541 Introduction to Microprocessors
Instruction System - Bit Manipulation Instruction
INSTRUCTION SET.
Machine control instruction
INSTRUCTION SET.
Assembly Language Programming Part 2
(The Stack and Procedures)
UNIT: 2 INSTRUCTION SET OF 8086.
CS 301 Fall 2002 Assembly Instructions
CS 301 Fall 2002 Control Structures
Stack and Subroutines Module M17.1 Section 11.2.
(The Stack and Procedures)
Shift & Rotate Instructions)
Shift & Rotate Instructions)
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Shift, Multiply, and Divide
Subroutines and the Stack
Computer Organization and Assembly Language
CNET 315 Microprocessor & Assembly Language
(The Stack and Procedures)
The JUMP GROUP Unconditional Jump (JMP).
Shift and Rotate Instructions.
CS-401 Computer Architecture & Assembly Language Programming
(The Stack and Procedures)
Presentation transcript:

4.4 Bit Manipulation Instructions Shift instructions: SHL/SAL, SHR, SAR Examples: initial value in AX= 0110111100000001B CF=0 SAL AX,1 AX=1101111000000010B lost AX=1111110111100000B SAR AX,4 CF=0 Shift instructions: SHLD, SHRD Examples: CX=0BC3H; AX= 5678H SHRD AX,CX,4 CF=1 CX=0BC3H; AX= 3567H unchanged

4.4 Bit Manipulation Instructions Rotate instructions: ROL, ROR, RCL, RCR Examples: initial value in AX= 0110111100000001B CF=0 ROL AX,1 AX=1101111000000010B AX=0010110111100000B ROR AX,4 CF=0 Examples: initial value in AX= 0110111100000001B and CF=1 RCL AX,1 AX=1101111000000011B CF= 0 AX=0110110111100000B CF=0 RCR AX,4

4.5 Program Transfer Instructions JMP Short jump address is computed adding the signed byte operand to the address of the first byte following the JMP instruction. LOOP, LOOPE/LOOPZ, LOOPNE/LOOPNZ JCXZ, JECXZ

4.5 Program Transfer Instructions Jcc The terms “less” and “greater” are used for comparisons of signed integers. The terms “above” and “below” are used for comparisons of unsigned integers.

4.5 Program Transfer Instructions CALL … 0100 CALL EXSUB 0103 ADD AX, 1 0204 CALL EXSUB 0207 ADD AX,2 RET … 0500 EXSUB PROC NEAR ... 0550 RET EXSUB ENDP Assembler directives specifying the begin and the end of a NEAR or FAR procedure (subroutine) Stack: 1FFE ?? 1FFF ?? 2000 ?? Stack: 1FFE 07 1FFF 02 2000 ?? Stack: 1FFE 03 1FFF 01 2000 ?? SP SP SP SP SP

4.5 Program Transfer Instructions INT … 0000:0084 B4 0000:0085 16 0000:0086 26 0000:0087 07 IPT= Interrupt Pointer Table 4*21H=84H IRET,IRETD … 0100:00FF MOV AH, 2CH; 0100:0101 INT 21H 0100:0103 ADD AX, 1 … 0726:16B4 ISR for INT 21 ... … IRET INTO,BOUND Stack: 1FFA ?? 1FFB ?? 1FFC ?? 1FFD ?? 1FFE ?? 1FFF ?? 2000 ?? Stack: 1FFA 03 1FFB 01 1FFC 00 1FFD 01 1FFE 08 1FFF 41 2000 ?? SP SP SP FLAGS=4108H

4.5 Program Transfer Instructions ENTER, LEAVE ENTER 6,0 … 00F8 ?? 00F9 ?? 00FA ?? 00FB ?? 00FC ?? 00FD ?? 00FE ?? 00FF ?? 0100 ?? … 00F8 ?? 00F9 ?? 00FA ?? 00FB ?? 00FC ?? 00FD ?? 00FE 34 00FF 12 0100 ?? SP SP BP SP If Level=0, BP is saved on stack, BP is loaded with the content of SP, Reserved memory space SP is decremented by Space16. BP old value =1234H SP old value =0100H BP new value =00FEH SP intermediate value =00FEH SP final value =00F8H LEAVE SP is loaded with the content of BP, BP is popped from stack.=> values before ENTER restored. Stack Frame Frame pointer SP back to old value =0100H BP back to old value =1234H

4.6 Processor Control Instructions