Joseph L. Lindo Assembly Programming Sir Joseph Lindo University of the Cordilleras.

Slides:



Advertisements
Similar presentations
Assembly Programming Notes for Practical2 Munaf Sheikh
Advertisements

Department of Computer Science and Software Engineering
6-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 Addressing modes.
Assembly 02. Outline mov Command Registers Memory EFLAGS Arithmetic 1.
KMUTT: S. Srakaew Instructions Can Be Divided into 3 Classes Data movement instructions  Move data from a memory location or register to another memory.
1 Lecture 4: Data Transfer, Addressing, and Arithmetic Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Irvine: Assembly Language for Intel-Based Computers (1999) Symbolic Constants Equal-sign Directive EQU Directive TEXTEQU Directive.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 4: Data Transfers, Addressing, and Arithmetic (c) Pearson Education, All rights.
CS2422 Assembly Language & System Programming September 28, 2006.
Shift and Rotate Instructions
ICS312 Set 3 Pentium Registers. Intel 8086 Family of Microprocessors All of the Intel chips from the 8086 to the latest pentium, have similar architectures.
Microprocessor Systems Design I
Outline Data Transfer Instructions Arithmetic Instructions Data-Related Operations and Directives Indirect Addressing JMP and LOOP Instructions.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 4: Data Transfers, Addressing, and Arithmetic (c) Pearson Education, All rights.
Joseph L. Lindo Assembly Programming Sir Joseph Lindo University of the Cordilleras.
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
Basic Operational Concepts of a Computer
Chapter 4: Data Transfers, Addressing, and Arithmetic.
CSC 221 Computer Organization and Assembly Language
1/2002JNM1 Basic Elements of Assembly Language Integer Constants –If no radix is given, the integer is assumed to be decimal. Int 21h  Int 21 –A hexadecimal.
Introduction to 8086 Assembly Language Assembly Language Programming University of Akron Dr. Tim Margush.
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 4 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
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.
Overview of Assembly Language Chapter 4 S. Dandamudi.
Assembly Language for x86 Processors 6th Edition
Assembly Language for Intel-Based Computers Chapter 4: Data Transfers, Addressing, and Arithmetic Kip Irvine.
Fall 2012 Chapter 4: Data Transfers, Addressing, and Arithmetic.
2/20/2016CAP 2211 Flow Control Instructions. 2/20/2016CAP 2212 Transfer of Control Flow control instructions are used to control the flow of a program.
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Assembly Language Data Movement Instructions. MOV Instruction Move source operand to destination mov destination, source The source and destination are.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Computer Organization and Assembly Language Petra University Dr. Hadi Hassan Introduction to 8086 Assembly Language.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
Addressing Modes Instruction – Op-code – Operand Addressing mode indicates a way of locating data or operands. – Any instruction may belong to one or more.
CS2422 Assembly Language and System Programming 0 Week 9 Data Transfers, Addressing, and Arithmetic.
Assembly Language for Intel-Based Computers, 4th Edition
Instruction set Architecture
Assembly Language for Intel-Based Computers, 5th Edition
Data Transfers, Addressing, and Arithmetic
Microprocessor Systems Design I
Assembly Language for Intel-Based Computers, 5th Edition
Assembly Language for x86 Processors 7th Edition
Assembly Language for x86 Processors
CS-401 Assembly Language Programming
Arithmetic Instructions
Assembly Language for Intel-Based Computers, 4th Edition
Assembly Language for Intel-Based Computers, 4th Edition
Symbolic Instruction and Addressing
Assembly Language for x86 Processors 6th Edition
Introduction to Assembly Language
Assembly Language for x86 Processors 6th Edition
Data Transfers, Addressing, and Arithmetic
8086 MICROPROCESSOR PROGRAMMING – INTEGER INSTRUCTIONS AND COMPUTATIONS Amar Saraswat.
Data Transfer, Addressing and Arithmetic
8086 Registers Module M14.2 Sections 9.2, 10.1.
CS-401 Computer Architecture & Assembly Language Programming
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
Symbolic Instruction and Addressing
Basic Instructions.
University of Gujrat Department of Computer Science
Computer Architecture CST 250
Data Transfers, Addressing, and Arithmetic
Microprocessor and Assembly Language
Chapter 6 –Symbolic Instruction and Addressing
Data Transfer, Addressing and Arithmetic
Introduction to 8086 Assembly Language
Computer Architecture and System Programming Laboratory
Presentation transcript:

Joseph L. Lindo Assembly Programming Sir Joseph Lindo University of the Cordilleras

Joseph L. Lindo Data + and - Section 1 Assembly Programming Registers Named storage locations inside the CPU, optimized for speed. High speed storage locations directly inside the MPU Registers

Joseph L. Lindo Data + and - Section 1 Assembly Programming Registers There are 8 general purpose registers, 6 segment registers, Eflags registers and instruction pointers. Registers

Joseph L. Lindo Data + and - Registers Assembly Programming Instruction Operand Types: Immediate – a constant integer (8, 16, or 32 bits) Register – the name of a register is converted to a number and encoded within the instruction Memory – reference to a location in memory Data

Joseph L. Lindo Data + and - Registers Assembly Programming Data Transfer Mnemonics Data

Joseph L. Lindo Data + and - Registers Assembly Programming Addition and Subtraction + and -

Joseph L. Lindo Assembly Programming --end-- Sir Joseph Lindo University of the Cordilleras

Joseph L. Lindo Assembly Programming --end na to-- Sir Joseph Lindo University of the Cordilleras

Joseph L. Lindo CPU vs MPU Online Task Provide the differences between CPU and MPU. Post it as comment on our FB Group. (COAL) Due on February 21, 2012

Joseph L. Lindo General Purpose Registers Registers Primarily used for arithmetic and data movement. Each register could be addressed as either 8, 16 or 32 bit value.

Joseph L. Lindo General Purpose Registers Registers

Joseph L. Lindo MOV Data Transfer Moves data fro source to destination Syntax: MOV destination,source Rules: Destination should not be an immediate operand

Joseph L. Lindo MOV Data Transfer.data count BYTE 100 wVal WORD 2.code mov bl,count mov al,wVal mov ax,wVal mov count,al mov ax,count mov eax,count

Joseph L. Lindo MOV Data Transfer CodeAXBX MOV ah,10 MOV ax,35 MOV bh,al MOV bx,1234 MOV bl,04 MOV bh,55

Joseph L. Lindo XCHG Data Transfer XCHG exchanges the values of two operands. Syntax: XCHG operand1,operand2 Rules: At least one operand must be a register. No immediate operands are permitted.

Joseph L. Lindo XCHG Data Transfer.data var1 WORD 1000h var2 WORD 2000h.code xchg ax,bx xchg ah,al xchg var1,bx xchg 3,100 xchg eax,ebx xchg var1,var2

Joseph L. Lindo XCHG Data Transfer CodeAXBX MOV bx,4810 MOV ax,35 XCHG bh,bl XCHG bh,ah MOV bl,04 XCHG bl,al

Joseph L. Lindo INC and DEC Add and Sub Add 1, subtract 1 from destination operand operand may be register or memory INC destination Logic: destination  destination + 1 DEC destination Logic: destination  destination – 1

Joseph L. Lindo INC and DEC Add and Sub.data myWord WORD 1000h myDword DWORD h.code inc myWord dec myWord inc myDword mov ax,00FFh inc ax mov ax,00FFh inc al

Joseph L. Lindo INC and DEC Add and Sub CodeAXBX MOV ah,10 MOV al,35 INC al MOV bx,1234 DEC bl INC bh

Joseph L. Lindo ADD and SUB Add and Sub ADD destination, source Logic: destination  destination + source SUB destination, source Logic: destination  destination – source Same operand rules as for the MOV instruction

Joseph L. Lindo ADD and SUB Add and Sub.data var1 DWORD 10000h var2 DWORD 20000h.code mov eax,var1 add eax,var2 add var2,var1 add ax,0FFFFh sub 1,2 sub var1,var2 add eax,1 sub ax,1

Joseph L. Lindo ADD and SUB Add and Sub CodeAXBX MOV ah,10 MOV al,35 ADD ah,al MOV bx,1294 SUB bl,ah ADD ax,bh

Joseph L. Lindo MOV and XCHG Comprehension Check

Joseph L. Lindo INC, DEC ADD and SUB Comprehension Check

Joseph L. Lindo Assembly Programming --end-- Sir Joseph Lindo University of the Cordilleras

Joseph L. Lindo Back Integer Expressions

Joseph L. Lindo INC and DEC MOV Reserved Word and Identifiers Directives Character and String Constants ADD and SUB More XCHG