COSC 456 Lesson 8 Cool Codes ADD AL,SIAL AL + SI ADD AL,[SI]AL AL + [SI] INC BXBX BX + 1 INC [BX]Ambiguity error INC BYTE PTR [BX][BX] [BX] + 1 INC WORD.

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.
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.
Gursharan Singh Tatla 21-Nov-20101www.eazynotes.com.
8086 : INSTRUCTION SET By, Pramod Sunagar Assistant Professor
Assembly Language for Intel-Based Computers Chapter 5: Procedures Kip R. Irvine.
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
© 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.
Microcomputer & Interfacing Lecture 3
Assembly Language – Lab 5
Khaled A. Al-Utaibi  Introduction  Arithmetic Instructions  Basic Logical Instructions  Shift Instructions  Rotate Instructions.
11.1/36 Repeat: From Bits and Pieces Till Strings.
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
Strings, Procedures and Macros
5. Assembly Language. Basics of AL Program data Pseudo-ops Array Program structures Data, stack, code segments.
Arithmetic Flags and Instructions
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#9) By Dr. Syed Noman.
ICS312 Lecture13 String Instructions.
Processing String Data and Binary Data (continue)
Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
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.
3.4 Addressing modes Specify the operand to be used. To generate an address, a segment register is used also. Immediate addressing: the operand is a number.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Multiplication and Division instructions Dr.Hadi AL Saadi.
Chapter 8 String Operations. 8.1 Using String Instructions.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Computer Architecture and Assembly Language
Chapter Nov-2010
Data Transfers, Addressing, and Arithmetic
BYTE AND STRING MANIPULATON
Today we are going to discuss about,
EE3541 Introduction to Microprocessors
EE3541 Introduction to Microprocessors
INSTRUCTION SET.
Machine control instruction
Assembly IA-32.
INSTRUCTION SET.
Assembly Language Programming Part 2
(The Stack and Procedures)
INSTRUCTION SET OF 8086 PAWAN KUMAR SINGH.
اصول اساسی برنامه نویسی به زبان اسمبلی
Arithmetic Instructions
Symbolic Instruction and Addressing
CS 301 Fall 2002 Assembly Instructions
X86’s instruction sets.
Chapter 4: Instructions
8086 MICROPROCESSOR PROGRAMMING – INTEGER INSTRUCTIONS AND COMPUTATIONS Amar Saraswat.
Chapter 4 Data Movement Instructions
8086 Registers Module M14.2 Sections 9.2, 10.1.
Microprocessor Lab CSL1543 0:0:2
(The Stack and Procedures)
Shift & Rotate Instructions)
Symbolic Instruction and Addressing
ADDITION Register Addition. ADD AX,BX AX=AX+BX 2. Immediate Addition.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
University of Gujrat Department of Computer Science
X86 Assembly Review.
Chapter 5 Arithmetic and Logic Instructions
UNIT-II Assembly Language Programs Involving Logical
CNET 315 Microprocessor & Assembly Language
(The Stack and Procedures)
Chapter 8: Instruction Set 8086 CPU Architecture
UNIT-II ADDRESSING MODES & Instruction set
Presentation transcript:

COSC 456 Lesson 8

Cool Codes ADD AL,SIAL AL + SI ADD AL,[SI]AL AL + [SI] INC BXBX BX + 1 INC [BX]Ambiguity error INC BYTE PTR [BX][BX] [BX] + 1 INC WORD PTR [BX] [BX + 1 : BX ] [BX + 1 : BX ] + 1

MUL & DIV MUL CLCL x AL AX MUL BXBX x AX DX : AX DIV CLAX/CL calculated. Quotient in AL and remainder in AH DIV CXDX:AX/CX calculated. Quotient in AX and remainder in DX

Shift SHR Shift Logical Right 0 MSBLSB CF SAL Shift Arithmetic Left 0 MSBLSB CF Shift CL times! SHR BX,CL SAL BX,1 SAL AL,CL

XCHG & XLAT XCHG AX, BX XCHG BL, [SI + 2] XLAT Translate. Inherent instruction does not require operand specification. This instruction uses AL and BX in the following way: AL [BX + AL ] This instruction finds applications in data translation tables, look-up tables, and code conversions.

Adder Program MOV CX, 7 MOV SI, 0050 MOV AL,0 AGAIN: ADD AL, [SI] INC SI DEC CX JNE AGAIN INT 3 This program adds 7 numbers stored at the memory locations 0050 through 0056.

Adder Program with LOOP MOV CX, 7 MOV SI, 0050 MOV AL,0 AGAIN: ADD AL, [SI] INC SI LOOP AGAIN INT 3 This program adds 7 numbers stored at the memory locations 0050 through LOOP automatically uses CX as a counter!

String Along! CLD MOV SI, 0200 MOV DI, 0500 MOV CX, 30 REP MOVSB Program copies 30 (48 decimal) bytes of data beginning at0020 to the destination beginning at 0050

SCAN CLD MOV CX,0100H MOV DI, 0200H BACK:MOV AL,0AAH REPNE SCASB JZ JUSTDOIT INT3 JUSTDOIT:MOV AL, 0BBH DEC DI STOSB JMP BACK Program scans memory and replaces AA with BB

CALL & RET HERE :CALL DELAY MOV AL, E3 MOV SI, 0050 CMP AL, [SI] JB HERE INT 3... DELAY:MOV CX,0FFFFH LOOP AGAIN RET Monitors boiler temperature … remember?

Stack … Push and Pop PUSH Saves word (not byte) on stack. First SP is decremented by 2 and then the operand is saved on the stack. POPIncrements SP by 2 and then pulls (pops) the word. Example follows: PUSH CX PUSH BX POP CX POP BX The above program is equivalent to XCHG BX,CX