The Assemble, Unassemble commands of the debugger: U Command for converting machine code language source Equivalent machine code instructions Equivalent.

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.
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. 05.c: Logical Operations Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization,
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
Computer Organization & Assembly Language
Assembly Language Lecture 9
80x86 Instruction Set Dr. Qiang Lin.
Gursharan Singh Tatla 21-Nov-20101www.eazynotes.com.
8086 : INSTRUCTION SET By, Pramod Sunagar Assistant Professor
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
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Fall 2012 Lecture 10: Flag control instructions Conditional execution.
Chapter 4 Basic Instructions. 4.1 Copying Data mov Instructions mov (“move”) instructions are really copy instructions, like simple assignment statements.
Introduction to Computer Engineering by Richard E. Haskell Shift and Rotate Instructions Module M16.2 Section 10.3.
Assembly Language – Lab 5
Ch. 7 Logic, Shift and Rotate instr.
Khaled A. Al-Utaibi  Introduction  Arithmetic Instructions  Basic Logical Instructions  Shift Instructions  Rotate Instructions.
Flag Control instructions CLC clear carry flag CF = 0 STC set carry flag CF= 1 CMC complement carry flag [CF] CF.
Lecture 4 ( Assembly Language).
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
Arithmetic Flags and Instructions
1 Logic, Shift, and Rotate Instructions Read Sections 6.2, 7.2 and 7.3 of textbook.
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.
Microprocessor MA Rahim Khan Computer Engineering and Networks Department.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
Microprocessor & Assembly Language Arithmetic and logical Instructions.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Bitwise and Logical Manipulations Assembly Language Programming University of Akron Dr. Tim Margush.
Multiplication and Division instructions Dr.Hadi AL Saadi.
Chapter Nov-2010
Assembly Language for Intel-Based Computers, 5th Edition
Microprocessor Systems Design I
Assembly Language Programming Part 3
8086 Microprocessor.
Chapter instruction description and assembler directives from Microprocessors and Interfacing by Douglas Hall.
Today we are going to discuss about,
Microprocessor Systems Design I
ICS312 SET 7 Flags.
Microprocessor Systems Design I
EE3541 Introduction to Microprocessors
Instruction System - Bit Manipulation Instruction
Multiplication and Division Instructions
Machine control instruction
INSTRUCTION SET.
More on logical instruction and
Assembly Language Programming Part 2
16.317: Microprocessor System Design I
4.2 Arithmetic Instructions
INSTRUCTION SET OF 8086 PAWAN KUMAR SINGH.
CS 301 Fall 2002 Assembly Instructions
X86’s instruction sets.
Introduction to Assembly Language
Lecture 4 ( Assembly Language).
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Microprocessor and Assembly Language
Shift & Rotate Instructions)
ADDITION Register Addition. ADD AX,BX AX=AX+BX 2. Immediate Addition.
Shift & Rotate Instructions)
Assembly Language for Intel-Based Computers, 4th Edition
Assembly Language for Intel-Based Computers, 5th Edition
Introduction to 8086 Assembly Language Programming
Chapter 5 Arithmetic and Logic Instructions
Microprocessor and Assembly Language
Multiplication and Division Instructions
Multiplication and Division Instructions
Chapter 8: Instruction Set 8086 CPU Architecture
Shift and Rotate Instructions.
CS-401 Computer Architecture & Assembly Language Programming
Ch. 5 – Intel 8086 – study details from Yu & Marut
Presentation transcript:

The Assemble, Unassemble commands of the debugger: U Command for converting machine code language source Equivalent machine code instructions Equivalent assembly statements A command for converting assembly statements

The Go command of the debugger: Format G =[starting address] [breakpoint address] Execute the instructions from the starting address till the breakpoint address appears in the IP register (address of the instruction following the end of the program)

Unsigned Multiplication Format MUL S S is the source: R 8 or R 16, M 8 or M 16 Action [AL] * [S 8 ] [AX] [AX] * [S 16 ] [DX]:[AX] Affects all flags

Signed Multiplication Format IMUL S S is the source: R 8 or R 16, M 8 or M 16 Action [AL] * [S 8 ] [AX] [AX] * [S 16 ] [DX]:[AX] Affects all flags

MOV AL, FF MOV CL,FE MUL CL [AX] = FD02 16 = MOV AX, 00FF MOV CX,00FE IMUL CL [AL] = [CL] = Unsigned multiplication Signed multiplication [AX] = = 2 16 [AL] = [CL] = -2 10

MOV AL, 09 MOV CL, 08 MUL CL [AX] = 48 H AAM Adjust AL after multiplication Q(AL 10 ) / 10 AH R(AL 10 ) / 10 AL Affects all flags BCD Arithmetics [AX] = 0702 Result is unpacked BCD

Unsigned Division Format DIV S S is the source: R 8 or R 16, M 8 or M 16 Action Q([AX] / [S 8 ]) [AL] R([AX] / [S 8 ]) [AH] If Q is ≥ FF then type 0 interrupt occurs Q(([AX]:[DX]) / [S 16 ]) [AX] R(([DX]:[AX]) / [S 16 ]) [DX] If Q is ≥ FFFF then type 0 interrupt occurs Affects all flags

Signed Division Format IDIV S S is the source: R 8 or R 16, M 8 or M 16 Action Q([AX] / [S 8 ]) [AL] R([AX] / [S 8 ]) [AH] If Q is ≥ 7F then type 0 interrupt occurs Q(([AX]:[DX]) / [S 16 ]) [AX] R(([DX]:[AX]) / [S 16 ]) [DX] If Q is7FFF then type 0 interrupt occurs Affects all flags

AAD Adjust AX for division This instruction assumes that AH and AL contain unpacked DCD numbers MOV AX,0702 AAD Action: [AH] 10 * 10 + [AL] 10 [AL] 00 [AH] [AL] 10 [AL] 16 This instruction does the opposite of AAM

MOV AX, 314E 314E 16 = MOV BL, = IDIV BL quotient = quotient > or 7F 16 divide overflow MOV AX, = MOV BL,FD FD 16 = IDIV BL quotient in AL [AL] = = FB 16 residue in AH [AH] = 1 10 = 1 16

MOV AX, 3149 [AX] 10 = MOV BL,04 quotient = 3154 quotient > or FF 16 DIV BL divide overflow MOV AX, 314E 314E 16 = MOV BL, = DIV BL quotient in AL [AL] = = C5 16 residue in AH [AH] = = E 16

CBW convert byte to word Action most significant bit of AL all bits of AH does not affect any flag CWD convert word to double word Action most significant bit of AX all bits of DX does not affect any flag

MOV AL, 81 [AX] = CBW [AX] = FF81 16 CWD [DX] = FFFF 16 : [AX] = FF81 16

The Compare Instruction Format CMP D, S Effect Affects all flags Subtraction using 2’s complement MOV AH, 00 SAHF MOV AL, 99 [AL] = ve 2’s complement = = MOV BL, 1B [BL] = ve = ’s complement CMP AL, BL = – = OV, PL, NZ, AC, PE, NC Overflow, positive, not zero, auxiliary carry, parity even, no carry DS Register Memory Register Immediate MemoryImmediate AccumulatorImmediate

Flag Control Instructions MnemonicMeaningOperationFlags Affected LAHF Load AH from flags [AH] [flags] None SAHF Store AH into flags [flags] [AH] SF, ZF, AF, PF, CF CLC Clear Carry flag [CF] 0 CF STC Set Carry flag [CF] 1 CF CMC Complement carry flag [CF] CF CLI Clear Interrupt flag [IF] 0 IF STI Set Interrupt flag [IF] 0 IF

MOV AH, 00 SAHF MOV AX, 1234 [AX] = ve = MOV BX, 0ABCD [BX] = ve 2’s complement [BX] = CMP AX, BX = – ( ) No overflow, Auxiliary carry, Carry, Not zero, Positive, Odd parity NV AC CY PL NG PO SF CF PF AF ZF X X X

Logic Instructions No Flags [D] [D]NOT D All Flags[S] + [D] [D]XOR D,S All Flags[S] + [D] [D]OR D,S All Flags[S]. [D] [D]AND D,S Flags Affected OperationFormat immediate Acc immediate M R RM MR RR SD

MOV AX,0055 [AL] = = AND AL,1F [AL] = = OR AL,C [AL] = = D5 16 XOR AL,0F [AL] = = DA 1 NOT AL [AL] = = 25 16

Shift Instructions: SHL shift logical left format SHL D, Count Example: SHL AX,1 D Count register 1 CL memory 1 CL CF

SHR shift logical right format SHL R, Count Example: SHR AX,CL [CL] = 2 SAR AX,CL [CL] = CF D A CF

Rotate Instructions: ROL D, Count ROL AX, 1 CF ROR AX, CL [CL] = 4 CF 0

RCL D, Count RCL AX, CL [CL] = CF 0 Before execution [AX] = CF 1 After execution [AX] =

RCR D, Count RCR AX, CL [CL] = CF 0 Before execution [AX] = CF 0 After execution [AX] =