Lecture (07) x86 programming 6
|
|
- Randall Perkins
- 5 years ago
- Views:
Transcription
1 Lecture (07) x86 programming 6 By: Dr. Ahmed ElShafee 1 The Flag Register ID VIP VIF AC VM RF NT IOP 1 IOP 0 O D I T S Z A P C 8088/ Pentium A (Auxiliary) C (carry): O (overflow): P (Parity) S (sign): Z (zero):
2 Carry Flag 1. The carry flag is set if the addition of two numbers causes a carry out of the most significant (leftmost) bits added = 0000 (carry flag is turned on) 2. The carry (borrow) flag is also set if the subtraction of two numbers requires a borrow into the most significant (leftmost) bits subtracted = 1111 (carry flag is turned on) Otherwise, the carry flag is turned off (zero). 3 Overflow Flag 1. If the sum of two numbers with the sign bits off yields a result number with the sign bit on, the "overflow" flag is turned on = 1000 (overflow flag is turned on) 2. If the sum of two numbers with the sign bits on yields a result number with the sign bit off, the "overflow" flag is turned on = 0000 (overflow flag is turned on) Otherwise, the overflow flag is turned off. 4
3 5 Arithmetic and Logic Instructions Addition: (Flags affected: A,C,O,P,S,Z) ADD AL,BL ; AL AL + BL, BL unchanged Register addressing mode ADD CX,DI ; CX CX + DI, DI unchanged Register addressing mode ADD AH,45H ; AH AH + 45H Immediate addressing mode ADD [BX],AL ; [BX] [BX] + AL Register indirect addressing mode ADD CX,[BX] ; CX CX + [BX] ADD AL,CX ; INVALID 6
4 Add with Carry: (Flags affected: A,C,O,P,S,Z) ADC AH,BH ; AH AH + BH + Carry Register addressing mode ADC AX,CX ; AX AX + CX + Carry Register addressing mode ADC AL,[BX+SI] ; AL AL + [BX+SI] + Carry Register indirect addressing mode 7 Subtraction: (Flags affected: A,C,O,P,S,Z) SUB AL,BL ; AL AL - BL ;BL unchanged Register addressing mode SUB CX,DI ; CX CX - DI ;DI unchanged Register addressing mode SUB AH,45H ; AH AH - 45H Immediate addressing mode SUB BL,ARRAY ; BL BL - [ARRAY] Direct Addressing mode SUB [BX],AL ; [BX] [BX] AL Register indirect addressing mode 8 SUB AL,CX ; INVALID
5 Subtract with Borrow: (Flags affected: A,C,O,P,S,Z) SBB AH,BH ; AH AH - BH Carry Register addressing mode SBB AX,CX ; AX AX - CX Carry Register addressing mode SBB AL,[BX+SI] ; AL AL - [BX+SI] Carry Register indirect addressing mode 9 Increment: (Flags affected: A,O,P,S,Z) INC AL ; AL AL + 1 INC SP ; SP SP + 1 INC COUNT1 ; [COUNT1] [COUNT1] + 1 INC BYTE PTR[BX] ; [BX] [BX] + 1 INC WORD PTR[BX] ; [BX] [BX]
6 Example 01 org 100h jmp start db 0feh,00h start: mov INC INC ret bx,0102h BYTE PTR[BX] BYTE PTR[BX] org 100h jmp start db 0feh,00h start: mov bx,0102h INC BYTE PTR[BX] INC WORD PTR[BX] ret 11 12
7 13 Decrement: (Flags affected: A,O,P,S,Z) DEC AL ; AL AL - 1 DEC SP ; SP SP - 1 DEC COUNT1 ; [COUNT1] [COUNT1] - 1 DEC BYTE PTR[BX] ; [BX] [BX] - 1 DEC WORD PTR[BX] ; [BX] [BX]
8 Example 02 org 100h jmp start db 001h,00h start: mov dec dec ret bx,0102h BYTE PTR[BX] BYTE PTR[BX] org 100h jmp start db 01h,00h start: mov bx,0102h dec BYTE PTR[BX] dec WORD PTR[BX] ret 15 16
9 17 Example 03 What will be the values of the carry, overflow, sign and zero flags after the execution of each of the following instructions: MOV DX,0 DEC DX MOV AX,720H SUB AX, 0E6H MOV DX,0 DEC DX 18
10 Instruction AX DX Flags H L H L C Z S O MOV DX, DEC DX FF FF MOV AX,720H SUB AX, 0E6H 06 3A Example 04 MOV AX,847AH SUB CX,CX MOV BX,5CE8H ADD AL,BH ADC AH,BL MOV CL,AL ADD CH,BL MOV SI,0108H SUB BL,[SI] SBB BH,[SI+4] ADD AL,[010CH] MOV AX,[0106H] INC AL DEC BX ADD CX,[SI+4] Fill up the trace table given below. 20
11 Instruction MOV AX,847AH SUB CX,CX MOV BX,5CE8H ADD AL,BH ADC AH,BL MOV CL,AL ADD CH,BL MOV SI,0108H SUB BL,[SI] SBB BH,[SI+4] ADD AL,[010CH] MOV AX,[0106H] INC AL DEC BX ADD CX,[SI+4] 21 AX BX CX SI Flags H L H L H L C Z S O Instruction AX BX CX SI Flags H L H L H L C Z S O MOV AX,847AH 84 7A SUB CX,CX MOV BX,5CE8H 5C E8 ADD AL,BH D ADC AH,BL 6C MOV CL,AL D6 ADD CH,BL E MOV SI,0108H 0108 SUB BL,[SI] E SBB BH,[SI+4] (8A) D ADD AL,[010CH] (8A) MOV AX,[0106H] 5C E8 (5CE8) INC AL E DEC BX D2 E ADD CX,[SI+4] (5C8A) B
12 23 G. Multiplication: (Flags affected: C,O, (A,P,S,Z are undefined)) Unsigned multiplication: MUL CL ; AX AL * CL MUL CX ; DX,AX AX * CX MUL BYTE PTR [BX] ; AX AL * [BX] MUL WORD PTR [SI] ; DX,AX AX * [SI] 24
13 Signed multiplication (2's complement): IMUL BL ; AX AL * BL IMUL BX ; DX,AX AX * BX IMUL BYTE PTR [BX] ; AX AL * [BX] IMUL WORD PTR [SI] ; DX,AX AX * [SI] 25 Example 05 org 100h jmp start start: mov al,15h mov cl,15h mul cl mov al,00h mul cl ret 26
14 27 28
15 Division: (Flags affected: A,C,O,P,S,Z (all undefined)) Unsigned Division: DIV CL ; AL Quotient of AX/CL ; AH Remainder of AX/CL DIV CX ; AX Quotient of DX,AX/CX ; DX Remainder of DX,AX/CX 29 Signed Division: IDIV CL ; AL Quotient of AX/CL ; AH Remainder of AX/CL IDIV CX ; AX Quotient of DX,AX/CX ; DX Remainder of DX,AX/CX 30
16 Example 06 org 100h jmp start start: mov ax,1234h mov cl,15h div cl mov ax,0000h div cl ret 31 32
17 33 Example 07 org 100h MOV AX,42C1H SUB DX,DX MOV BX,2456H MUL BL MUL BX MOV AX,0A42H MOV CH,32H DIV CH MOV SI,0103H MUL BYTE PTR [SI] MOV AX,[0109H] MUL AH MOV BL,0F0 DIV BL ret 34 Fill up the trace table given below.
18 Instruction MOV AX,42C1H SUB DX,DX MOV BX,2456H MUL BL MUL BX MOV AX,0A42H MOV CH,32H DIV CH MOV SI,0103H MUL BYTE PTR [SI] (2B) MOV AX,[0109H] (F7E3) MUL AH MOV BL,0F0H DIV BL 35 AX BX CX DX Flags SI H L H L H L H L C Z S O AX BX CX DX Flags Instruction SI H L H L H L H L C Z S O MOV AX,42C1H 42 C1 SUB DX,DX MOV BX,2456H MUL BL 40 D6 1 1 MUL BX F3 E4 93 3D 1 1 MOV 36 0A 42 AX,0A42H MOV CH,32H 32 DIV CH 1A 34 MOV SI,0103H 103 MUL BYTE PTR [SI] (2B) MOV AX,[0109H] (F7E3) 08 BC 1 1 F7 E3 MUL AH DB MOV BL,0F0H F0 DIV BL 95 E9
19 BCD and ASCII Arithmetic: DAA ; Decimal Adjust for Addition DAS ; Decimal Adjust for Subtraction AAA ; ASCII Adjust for Addition AAS ; ASCII Adjust for Subtraction AAM ; ASCII Adjust for Multiplication AAD ; ASCII Adjust for Division 37 Example 08 org 100h mov al,08 mov bl,07 add al,bl daa mov al,08 mov bl,07 add al,bl aaa ret 38
20 39 Logic Instructions: AND AL,BL ; AL AL AND BL (Always clears C and O flags) AND CL,33H ; CL CL AND 33H AND AX,[DI] ; AX AX AND [DI] OR AL,BL ; AL AL OR BL OR AX,1234H ; AX AX OR 1234H XOR AL,CL ; AL AL EX-OR CL XOR BH,0FH ; BH BH EX-OR 0FH NOT CH ; CH 1's complement of CH (No flags affected) 40
21 NOT AX ; AX 1's complement of AX NEG CH ; CH 2's complement of CH (ALWAYS SETS CF) NEG BX ; BX 2's complement of BX TEST AL,30H ;Perform AL AND30H and set the flags. AL is unchanged. CMP AL,30H ;Perform AL-30H and set the flags. AL is unchanged. 41 Example 09 MOV AX,847AH XOR BX,BX MOV CX,5CE8H AND AL,BH AND AH,92H OR CL,AL XOR CH,BL MOV SI,0108H OR BL,[SI] AND BH,[SI+2] XOR AL,[010CH] NOT AX NEG BL TEST BL, 14H TEST AL,3FH 42 Fill up the trace table given below.
22 Instruction MOV AX,847AH XOR BX,BX MOV CX,5CE8H AND AL,BH AND AH,92H OR CL,AL XOR CH,BL MOV SI,0108H OR BL,[SI] (22) AND BH,[SI+2] (80) XOR AL,[010CH] (92) NOT AX NEG BL TEST BL, 14H TEST AL,3FH 43 AX BX CX DX Flags SI H L H L H L H L C Z S O AX BX CX DX Flags Instruction SI H L H L H L H L C Z S O MOV 84 7A AX,847AH XOR BX,BX MOV CX,5CE8H 5C E8 AND AL,BH AND AH,92H OR CL,AL E XOR CH,BL 5C MOV SI,0108H 108 OR BL,[SI] (22) AND BH,[SI+2] (80) XOR AL,[010CH] (92) NOT AX 7F 6D NEG BL DE TEST BL, 14H TEST AL,3FH
23 Unconditional jump (JMP): The JMP instruction specifies the address of the next instruction to be executed. There are three types of unconditional jump instructions: the SHORT, the NEAR, and the FAR. A SHORT jump is specified with only one byte which represents the displacement between the current instruction to the next instruction. The next instruction can be located at a distance from +127 to memory locations away from the current instruction. 45 A NEAR jump specifies the address of the next instruction within the current Code Segment. A FAR jump specifies the exact address of the next instruction by specifying the values of the CS and IP registers. Examples: JMP NEXT JMP SHORT AGAIN JMP NEAR AGAIN JMP FAR AGAIN 46
24 Example 10 org 100h jmp start db 100h DUP (?) start: nop jmp SHORT part1 db 20h DUP (?) part1: nop jmp NEAR part2 db 00ffh DUP (?) part2: nop jmp FAR 1B31h:000bh 47 part3: nop ret 48
25 49 50
26 51 Thanks,.. 52
Arithmetic Instructions
Segment 3C Arithmetic Instructions This topic covers the following instructions: Addition (ADD, INC, ADC) Subtraction (SUB, DEC, SBB,CMP) Multiplication (MUL, IMUL) Division (DIV, IDIV) BCD Arithmetic
More informationWeek /8086 Microprocessor Programming I
Week 4 8088/8086 Microprocessor Programming I Example. The PC Typewriter Write an 80x86 program to input keystrokes from the PC s keyboard and display the characters on the system monitor. Pressing any
More informationEC 333 Microprocessor and Interfacing Techniques (3+1)
EC 333 Microprocessor and Interfacing Techniques (3+1) Lecture 6 8086/88 Microprocessor Programming (Arithmetic Instructions) Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC
More informationMnem. Meaning Format Operation Flags affected ADD Addition ADD D,S (D) (S)+(D) (CF) Carry ADC Add with ADC D,C (D) (S)+(D)+(CF) O,S,Z,A,P,C
ARITHMETIC AND LOGICAL GROUPS 6-1 Arithmetic and logical groups: The arithmetic group includes instructions for the addition, subtraction, multiplication, and division operations. The state that results
More informationINSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI
8 Unsigned and Signed Integer Numbers 1. Unsigned integer numbers: each type of integer can be either byte-wide or word-wide. This data type can be used to represent decimal numbers in the range 0 through
More informationIntel 8086: Instruction Set
IUST-EE (Chapter 6) Intel 8086: Instruction Set 1 Outline Instruction Set Data Transfer Instructions Arithmetic Instructions Bit Manipulation Instructions String Instructions Unconditional Transfer Instruction
More information8086 Programming. Multiplication Instructions. Multiplication can be performed on signed and unsigned numbers.
Multiplication Instructions 8086 Programming Multiplication can be performed on signed and unsigned numbers. MUL IMUL source source x AL source x AX source AX DX AX The source operand can be a memory location
More informationKingdom of Saudi Arabia Ministry of Higher Education. Taif University. Faculty of Computers & Information Systems
Kingdom of Saudi Arabia Ministry of Higher Education Taif University Faculty of Computers & Information Systems المملكة العربية السعودية وزارة التعليم العالي جامعة الطاي ف آلية الحاسبات ونظم المعلومات
More information8088/8086 Programming Integer Instructions and Computations
Unit3 reference 2 8088/8086 Programming Integer Instructions and Computations Introduction Up to this point we have studied the software architecture of the 8088 and 8086 microprocessors, their instruction
More informationInstructions moving data
do not affect flags. Instructions moving data mov register/mem, register/mem/number (move data) The difference between the value and the address of a variable mov al,sum; value 56h al mov ebx,offset Sum;
More informationSigned number Arithmetic. Negative number is represented as
Signed number Arithmetic Signed and Unsigned Numbers An 8 bit number system can be used to create 256 combinations (from 0 to 255), and the first 128 combinations (0 to 127) represent positive numbers
More informationAssignment no:4 on chapter no :3 : Instruction set of 8086
Assignment no:4 on chapter no :3 : Instruction set of 8086 1) Describe any two string operation instruction of 8086 with syntax & one example of each. 1] REP: REP is a prefix which is written before one
More informationEx : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H.
Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H. MOV AX, 5000H MOV DS, AX MOV AL, 20H MOV CL, 30H ADD AL, CL MOV CL, 10H MUL CL
More informationArithmetic and Logic Instructions And Programs
Dec Hex Bin 3 3 00000011 ORG ; FOUR Arithmetic and Logic Instructions And Programs OBJECTIVES this chapter enables the student to: Demonstrate how 8-bit and 16-bit unsigned numbers are added in the x86.
More informationWeek /8086 Microprocessor Programming
Week 5 8088/8086 Microprocessor Programming Multiplication and Division Multiplication Multiplicant Operand Result (MUL or IMUL) (Multiplier) Byte * Byte AL Register or memory Word * Word AX Register or
More information8086 Programming ADD BX,245FH BX BX + 245FH ADD [BX],AL [DS:BX] [DS:BX] + AL ADD CL,[BP] CL CL + [SS:BP] ADD BX,[SI + 2] BX BX + [DS:(SI + 3:SI + 2)]
Addition Instruction 8086 Programming The table illustrates the addressing modes available to the ADD instruction. These addressing modes include almost all addressing modes. The only types of addition
More informationEEM336 Microprocessors I. Arithmetic and Logic Instructions
EEM336 Microprocessors I Arithmetic and Logic Instructions Introduction We examine the arithmetic and logic instructions. The arithmetic instructions include addition, subtraction, multiplication, division,
More informationSPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY
BACKGROUND 8086 CPU has 8 general purpose registers listed below: AX - the accumulator register (divided into AH / AL): 1. Generates shortest machine code 2. Arithmetic, logic and data transfer 3. One
More informationLecture (08) x86 programming 7
Lecture (08) x86 programming 7 By: Dr. Ahmed ElShafee 1 Conditional jump: Conditional jumps are executed only if the specified conditions are true. Usually the condition specified by a conditional jump
More informationInteger Arithmetic. Pu-Jen Cheng. Adapted from the slides prepared by Kip Irvine for the book, Assembly Language for Intel-Based Computers, 5th Ed.
Computer Organization & Assembly Languages Integer Arithmetic Pu-Jen Cheng Adapted from the slides prepared by Kip Irvine for the book, Assembly Language for Intel-Based Computers, 5th Ed. Chapter Overview
More informationUNIT III MICROPROCESSORS AND MICROCONTROLLERS MATERIAL OVERVIEW: Addressing Modes of Assembler Directives. Procedures and Macros
OVERVIEW: UNIT III Addressing Modes of 8086 Assembler Directives Procedures and Macros Instruction Set of 8086 Data Transfer Group Arithmetic Group Logical Instructions Rotate and Shift instructions Loop
More informationWeek /8086 Microprocessor Programming II
Week 5 8088/8086 Microprocessor Programming II Quick Review Shift & Rotate C Target register or memory SHL/SAL 0 C SHR 0 SAR C Sign Bit 2 Examples Examples Ex. Ex. Ex. SHL dest, 1; SHL dest,cl; SHL dest,
More informationEx: Write a piece of code that transfers a block of 256 bytes stored at locations starting at 34000H to locations starting at 36000H. Ans.
INSTRUCTOR: ABDULMUTTALIB A H ALDOURI Conditional Jump Cond Unsigned Signed = JE : Jump Equal JE : Jump Equal ZF = 1 JZ : Jump Zero JZ : Jump Zero ZF = 1 JNZ : Jump Not Zero JNZ : Jump Not Zero ZF = 0
More informationMr. Sapan Naik 1. Babu Madhav Institute of Information Technology, UTU
5 Years Integrated M.Sc.(IT) Semester 4 060010402 System Programming Question Bank Unit 1: Introduction 1. Write the decimal equivalent for each integral power of 2 from 2! to 2!". 2. Convert the following
More informationChapter Four Instructions Set
Chapter Four Instructions set Instructions set 8086 has 117 instructions, these instructions divided into 6 groups: 1. Data transfer instructions 2. Arithmetic instructions 3. Logic instructions 4. Shift
More informationQ1: Multiple choice / 20 Q2: Memory addressing / 40 Q3: Assembly language / 40 TOTAL SCORE / 100
16.317: Microprocessor-Based Systems I Summer 2012 Exam 1 July 20, 2012 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g.,
More informationLecture (06) x86 programming 5
Lecture (06) x86 programming 5 By: Dr. Ahmed ElShafee 1 TOC Format of DOS programs Format of the.com programs Addressing Modes 1> Immediate Addressing Mode 2> Register Addressing Mode 3> Direct Addressing
More informationLecture 9. INC and DEC. INC/DEC Examples ADD. Arithmetic Operations Overflow Multiply and Divide
Lecture 9 INC and DEC Arithmetic Operations Overflow Multiply and Divide INC adds one to a single operand DEC decrements one from a single operand INC destination DEC destination where destination can
More informationcomplement) Multiply Unsigned: MUL (all operands are nonnegative) AX = BH * AL IMUL BH IMUL CX (DX,AX) = CX * AX Arithmetic MUL DWORD PTR [0x10]
The following pages contain references for use during the exam: tables containing the x86 instruction set (covered so far) and condition codes. You do not need to submit these pages when you finish your
More information8086 INSTRUCTION SET
8086 INSTRUCTION SET Complete 8086 instruction set Quick reference: AAA AAD AAM AAS ADC ADD AND CALL CBW CLC CLD CLI CMC CMP CMPSB CMPSW CWD DAA DAS DEC DIV HLT IDIV IMUL IN INC INT INTO I JA JAE JB JBE
More informationASSEMBLY LANGUAGE PROGRAMMING OF THE MICROCOMPUTER
CHAPTER ASSEMBLY LANGUAGE PROGRAMMING OF THE MICROCOMPUTER 2.1 Introduction To run a program, a microcomputer must have the program stored in binary form in successive memory locations. There are three
More information8086 ASSEMBLY LANGUAGE PROGRAMMING
UNIT-II 8086 ASSEMBLY LANGUAGE PROGRAMMING Contents at a glance: 8086 Instruction Set Assembler directives Procedures and macros. 8086 MEMORY INTERFACING: 8086 addressing and address decoding Interfacing
More informationPESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Electronics and Communication
USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Electronics and Communication INTERNAL ASSESSMENT TEST 1 Date : 26/02/2018 Marks: 40 Subject
More information16.317: Microprocessor Systems Design I Fall 2013
16.317: Microprocessor Systems Design I Fall 2013 Exam 1 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling
More informationSummer 2003 Lecture 4 06/14/03
Summer 2003 Lecture 4 06/14/03 LDS/LES/LSS General forms: lds reg,mem lseg reg,mem Load far pointer ~~ outside of current segment {E.g., load reg w/value @ mem, & seg w/mem+2 XCHG Exchange values General
More informationQ1: Multiple choice / 20 Q2: Protected mode memory accesses
16.317: Microprocessor-Based Systems I Summer 2012 Exam 2 August 1, 2012 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g.,
More informationBabu Madhav Institute of Information Technology, UTU
5 Years Integrated M.Sc.(IT) Semester 4 060010309 : DSE3 Microprocessor Programming and Interfacing Question Bank 1. Write an assembly language program to check whether the given number is odd or even.
More informationA4 Sample Solution Ch3
A4 Sample Solution Ch3 2. AL, AH, BL, BH,CL,CH,DLl, DH 3. AX, BX, CX, DX, SP, BP, SI, DI, CS, DS, ES, SS, FS, GS 4. EAX, EBX, ECX, EDX, ESP, EBP, EDI, ESI 5. RAX, RBX, RCX, RDX, RSP, RBP, RSI, RDI and
More informationInteger Arithmetic Part2
Islamic University Of Gaza Assembly Language Faculty of Engineering Discussion Computer Department Chapter 7 Eng. Ahmed M. Ayash Date: 21/04/2013 Chapter 7 Integer Arithmetic Part2 7.4: Multiplication
More information3.1 DATA MOVEMENT INSTRUCTIONS 45
3.1.1 General-Purpose Data Movement s 45 3.1.2 Stack Manipulation... 46 3.1.3 Type Conversion... 48 3.2.1 Addition and Subtraction... 51 3.1 DATA MOVEMENT INSTRUCTIONS 45 MOV (Move) transfers a byte, word,
More information1-Operand instruction types 1 INC/ DEC/ NOT/NEG R/M. 2 PUSH/ POP R16/M16/SR/F 2 x ( ) = 74 opcodes 3 MUL/ IMUL/ DIV/ DIV R/M
Increment R16 1-Operand instruction types 1 INC/ DEC/ NOT/NEG R/M 4 x (16+48) = 256 opcodes 2 PUSH/ POP R16/M16/SR/F 2 x (8+24+4+1) = 74 opcodes 3 MUL/ IMUL/ DIV/ DIV R/M 4 x (16+48) = 256 opcodes INC
More informationECOM Computer Organization and Assembly Language. Computer Engineering Department CHAPTER 7. Integer Arithmetic
ECOM 2325 Computer Organization and Assembly Language Computer Engineering Department CHAPTER 7 Integer Arithmetic Presentation Outline Shift and Rotate Instructions Shift and Rotate Applications Multiplication
More informationPESIT Bangalore South Campus
INTERNAL ASSESSMENT TEST 2 Date : 02/04/2018 Max Marks: 40 Subject & Code : Microprocessor (15CS44) Section : IV A and B Name of faculty: Deepti.C Time : 8:30 am-10:00 am Note: Note: Answer any five complete
More informationLogic Instructions. Basic Logic Instructions (AND, OR, XOR, TEST, NOT, NEG) Shift and Rotate instructions (SHL, SAL, SHR, SAR) Segment 4A
Segment 4A Logic Instructions Basic Logic Instructions (AND, OR, XOR, TEST, NOT, NEG) Shift and Rotate instructions (SHL, SAL, SHR, SAR) Course Instructor Mohammed Abdul kader Lecturer, EEE, IIUC Basic
More information16.317: Microprocessor Systems Design I Spring 2014
16.317: Microprocessor Systems Design I Spring 2014 Exam 1 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by
More informationLesson 1. Fundamentals of assembly language
Lesson 1. Fundamentals of assembly language Computer Structure and Organization Graduate in Computer Sciences Graduate in Computer Engineering Graduate in Computer Sciences Graduate in Computer Engineering
More informationCONTENTS. 1. Display a Message Display a one Digit Number Accept a Character from keyboard and display the character 4
University of Kashmir, North Campus Course Code Course Name Course Instructor MCA-104-DCE Assembly Language Programming Bilal Ahmad Dar CONTENTS 1. Display a Message 2 2. Display a one Digit Number 3 3.
More informationQ1: Multiple choice / 20 Q2: Data transfers and memory addressing
16.317: Microprocessor Systems Design I Fall 2014 Exam 1 October 1, 2014 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g.,
More informationdb "Please enter up to 256 characters (press Enter Key to finish): ",0dh,0ah,'$'
PA4 Sample Solution.model large.stack 100h.data msg1 db "This programs scans a string of up to 256 bytes and counts the repetitions of the number 4206 and sums them.",0dh,0ah,'$' msg2 db "Please enter
More informationAssembler lecture 4 S.Šimoňák, DCI FEEI TU of Košice
Assembler lecture 4 S.Šimoňák, DCI FEEI TU of Košice Addressing data access specification arrays - specification and manipulation impacts of addressing to performance Processor architecture CISC (more
More informationAPPENDIX C INSTRUCTION SET DESCRIPTIONS
APPENDIX C INSTRUCTION SET DESCRIPTIONS This appendix provides reference information for the 80C186 Modular Core family instruction set. Tables C-1 through C-3 define the variables used in Table C-4, which
More informationBasic Execution Environment
Basic Execution Environment 3 CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel Architecture processor as seen by assembly-language programmers.
More informationMarking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)
Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 02/06/2018 Section 1 Weighting 40% of
More informationMicroprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)
Microprocessor and Assembly Language Week-5 System Programming, BCS 6th, IBMS (2017) High Speed Memory Registers CPU store data temporarily in these location CPU process, store and transfer data from one
More informationWe will first study the basic instructions for doing multiplications and divisions
MULTIPLICATION, DIVISION AND NUMERICAL CONVERSIONS We will first study the basic instructions for doing multiplications and divisions We then use these instructions to 1. Convert a string of ASCII digits
More informationChapter 3: Addressing Modes
Chapter 3: Addressing Modes Chapter 3 Addressing Modes Note: Adapted from (Author Slides) Instructor: Prof. Dr. Khalid A. Darabkh 2 Introduction Efficient software development for the microprocessor requires
More informationEEM336 Microprocessors I. Data Movement Instructions
EEM336 Microprocessors I Data Movement Instructions Introduction This chapter concentrates on common data movement instructions. 2 Chapter Objectives Upon completion of this chapter, you will be able to:
More informationSYSC3601 Microprocessor Systems. Unit 2: The Intel 8086 Architecture and Programming Model
SYSC3601 Microprocessor Systems Unit 2: The Intel 8086 Architecture and Programming Model Topics/Reading SYSC3601 2 Microprocessor Systems 1. Registers and internal architecture (Ch 2) 2. Address generation
More informationComputer Architecture 1 ح 303
Lecture 4 A. Addressing MODES 1. Introduction to assembly language programming: Program is a sequence of commands used to tell a microcomputer what to do. Each command in a program is an instruction Programs
More informationCode segment Stack segment
Registers Most of the registers contain data/instruction offsets within 64 KB memory segment. There are four different 64 KB segments for instructions, stack, data and extra data. To specify where in 1
More informationLAB 5 Arithmetic Operations Simple Calculator
LAB 5 Arithmetic Operations Simple Calculator Objective: Practice arithmetic operation for the 80x86, such as add, subtract, multiple, divide, and mod. When dealing with the multiply, divide, and mod instructions
More informationDefining and Using Simple Data Types
85 CHAPTER 4 Defining and Using Simple Data Types This chapter covers the concepts essential for working with simple data types in assembly-language programs The first section shows how to declare integer
More informationBasic Assembly Instructions
Basic Assembly Instructions Ned Nedialkov McMaster University Canada SE 3F03 January 2013 Outline Multiplication Division FLAGS register Branch Instructions If statements Loop instructions 2/21 Multiplication
More informationX86 Addressing Modes Chapter 3" Review: Instructions to Recognize"
X86 Addressing Modes Chapter 3" Review: Instructions to Recognize" 1 Arithmetic Instructions (1)! Two Operand Instructions" ADD Dest, Src Dest = Dest + Src SUB Dest, Src Dest = Dest - Src MUL Dest, Src
More informationENE 334 Microprocessors
Page 1 ENE 334 Microprocessors Lecture 10: MCS-51: Logical and Arithmetic : Dejwoot KHAWPARISUTH http://webstaff.kmutt.ac.th/~dejwoot.kha/ ENE 334 MCS-51 Logical & Arithmetic Page 2 Logical: Objectives
More information8086 Assembly Language Programming
of 28 7/6/2018 1:10 PM Tuesday, June 9, 2015 About Me 8086 Assembly Language Programming Assembly Language Programming is a low level programming language which is processor specific. It means it will
More informationADVANCE MICROPROCESSOR & INTERFACING
VENUS INTERNATIONAL COLLEGE OF TECHNOLOGY Gandhinagar Department of Computer Enggineering ADVANCE MICROPROCESSOR & INTERFACING Name : Enroll no. : Class Year : 2014-15 : 5 th SEM C.E. VENUS INTERNATIONAL
More information8086 INTERNAL ARCHITECTURE
8086 INTERNAL ARCHITECTURE Segment 2 Intel 8086 Microprocessor The 8086 CPU is divided into two independent functional parts: a) The Bus interface unit (BIU) b) Execution Unit (EU) Dividing the work between
More informationBasic Assembly SYSC-3006
Basic Assembly Program Development Problem: convert ideas into executing program (binary image in memory) Program Development Process: tools to provide people-friendly way to do it. Tool chain: 1. Programming
More informationEXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM
EXPERIMENT WRITE UP AIM: Assembly language program to search a number in given array. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM
More informationComputer Architecture and System Software Lecture 04: Floating Points & Intro to Assembly
Computer Architecture and System Software Lecture 04: Floating Points & Intro to Assembly Instructor: Rob Bergen Applied Computer Science University of Winnipeg Decimal Addition Review decimal addition
More informationQ1: Define a character string named CO_NAME containing "Internet Services" as a constant?
CS 321 Lab Model Answers ١ First Lab : Q1: Define a character string named CO_NAME containing "Internet Services" as a constant? ANS: CO_NAME EQU ' Internet Services' Q2: Define the following numeric values
More informationIBM PC Hardware CPU 8088, Pentium... ALU (Arithmetic and Logic Unit) Registers. CU (Control Unit) IP.
IBM PC Hardware CPU 8088, 8086 80286 80386 80486 Pentium... ALU (Arithmetic and Logic Unit) Registers CU (Control Unit) IP Memory ROM BIOS I/O RAM OS Programs Video memory BIOS data Interrupt Vectors Memory
More informationCS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 4: 80X86 INSTRUCTION SET QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS
CS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 4: 80X86 INSTRUCTION SET QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS Q1. IWrite an ALP that will examine a set of 20 memory
More informationSri Krishna Engineering College Panapakkam, Chennai 601 301 Lab Manual CS2259 MICROPROCESSORS LAB Department of Electronics and Communication Engineering CS 2259 Microprocessors Lab SKEC Page 1 List of
More informationHands on Experience for Faculty in Laboratories Phase I JNTUK, Kakinada
Hands on Experience for Faculty in Laboratories Phase I JNTUK, Kakinada Cover page Report Details of College Name of the College College Code and District Name of the Principal Contact No s Lendi Institute
More informationIslamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB
Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB Lab # 9 Integer Arithmetic and Bit Manipulation April, 2014 1 Assembly Language LAB Bitwise
More informationLecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee
Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee ١ INTERNAL MICROPROCESSOR ARCHITECTURE Before a program is written or instruction investigated, internal configuration of the
More informationComputer Organization and Assembly Language CSC-210
Computer Organization and Assembly Language CSC-2 Lab # Lab() Lab(2) Lab(3) Lab(4) Lab(5) Lab(6) Lab(7) Lab(8) Lab(9) Lab() Lab() Lab(2) Lab(3) Title Computer Anatomy Memory and ports Motherboard and cards
More informationMarking Scheme. Examination Paper. Module: Microprocessors (630313)
Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 12/06/2017 Section 1 Weighting 40% of
More informationSPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY
BACKGROUND Segment The "SEGMENT" and "ENDS" directives indicate to the assembler the beginning and ending of a segment and have the following format label SEGMENT [options] ;place the statements belonging
More informationICAL EN LAB MANUAL CS MICROPROCESSOR AND MICROCONTROLLER LABORATORY. Regulation. Branch. Year & Semester. Dharmapuri : B.E. CSE.
Dharmapuri 636 703 LAB MANUAL Regulation : 203 Branch : B.E. CSE. Year & Semester : II Year / IV Semester CS 642 - MICROPROCESSOR AND MICROCONTROLLER LABORATORY ICAL EN 2 ANNA UNIVERSITY CHENNAI Regulation
More informationJones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION 80x86 Instructions
80x86 Instructions Chapter 4 In the following sections, we review some basic instructions used by the 80x86 architecture. This Jones is by & no Bartlett means a Learning, complete list LLC of the Intel
More informationAssembler Programming. Lecture 2
Assembler Programming Lecture 2 Lecture 2 8086 family architecture. From 8086 to Pentium4. Registers, flags, memory organization. Logical, physical, effective address. Addressing modes. Processor Processor
More informationUNIT 4. Modular Programming
1 UNIT 4. Modular Programming Program is composed from several smaller modules. Modules could be developed by separate teams concurrently. The modules are only assembled producing.obj modules (Object modules).
More informationInteger Arithmetic. Computer Organization and Assembly Languages Yung-Yu Chuang 2005/11/17. with slides by Kip Irvine
Integer Arithmetic Computer Organization and Assembly Languages Yung-Yu Chuang 2005/11/17 with slides by Kip Irvine Announcements Assignment #2 is due next week. Assignment #3 box filter is online now,
More informationLecture 16: Passing Parameters on the Stack. Push Examples. Pop Examples. CALL and RET
Lecture 1: Passing Parameters on the Stack Push Examples Quick Stack Review Passing Parameters on the Stack Binary/ASCII conversion ;assume SP = 0202 mov ax, 124h push ax push 0af8h push 0eeeh EE 0E F8
More informationCS-202 Microprocessor and Assembly Language
CS-202 Microprocessor and Assembly Language Lecture 2 Introduction to 8086 Assembly Language Dr Hashim Ali Spring - 2019 Department of Computer Science and Engineering HITEC University Taxila!1 Lecture
More informationSHEET-2 ANSWERS. [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte.
SHEET-2 ANSWERS [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte. TITLE PROG2-3 PURPOSE: TRANSFER 6 WORDS OF DATA PAGE 60,132.MODEL SMALL.STACK 64.DATA ORG 10H DATA_IN DW 234DH,
More informationAlexandria University Faculty of Engineering Communications and Computers SSP
Alexandria University Faculty of Engineering Communications and Computers SSP Course: Microprocessors CC421 Instructor: Dr.M.El-Banna Academic Year: 2016 2017 Assistant: TBA Spring Semester SHEET 1 Introduction
More informationAssembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:
Assembling, Linking and Executing 1) Assembling: - Assembling converts source program into object program if syntactically correct and generates an intermediate.obj file or module. - It calculates the
More informationAssembly Language Each statement in an assembly language program consists of four parts or fields.
Chapter 3: Addressing Modes Assembly Language Each statement in an assembly language program consists of four parts or fields. The leftmost field is called the label. - used to identify the name of a memory
More informationORG ; TWO. Assembly Language Programming
Dec 2 Hex 2 Bin 00000010 ORG ; TWO Assembly Language Programming OBJECTIVES this chapter enables the student to: Explain the difference between Assembly language instructions and pseudo-instructions. Identify
More informationExperiment #2. Addressing Modes and Data Transfer using TASM
2.0 Objective Experiment #2 Addressing Modes and Data Transfer using TASM The objective of this experiment is to learn various addressing modes and to verify the actions of data transfer. 2.1 Introduction
More informationELEG3923 Microprocessor Ch.6 Arithmetic and Logics
Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.6 Arithmetic and Logics Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Arithmetic instructions Signed number operations Logic
More informationScott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998
Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998 Assembler Syntax Everything looks like this: label: instruction dest,src instruction label Comments: comment $ This is a comment
More information6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:
Introduction Efficient software development for the microprocessor requires a complete familiarity with the addressing modes employed by each instruction. This chapter explains the operation of the stack
More informationEEM336 Microprocessors I. Addressing Modes
EEM336 Microprocessors I Addressing Modes Introduction Efficient software development for the microprocessor requires a complete familiarity with the addressing modes employed by each instruction. This
More informationET355 Microprocessors Thursday 6:00 pm 10:20 pm
ITT Technical Institute ET355 Microprocessors Thursday 6:00 pm 10:20 pm Unit 4 Chapter 6, pp. 139-174 Chapter 7, pp. 181-188 Unit 4 Objectives Lecture: BCD Programming Examples of the 805x Microprocessor
More informationLecture 9. INC and DEC. INC/DEC Examples ADD. ADD Examples SUB. INC adds one to a single operand DEC decrements one from a single operand
Lecture 9 INC and DEC Arithmetic Operations Shift Instructions Next week s homework! INC adds one to a single operand DEC decrements one from a single operand INC destination DEC destination where destination
More information