Philadelphia University Student Name: Student Number:

Similar documents
Marking Scheme. Examination Paper. Module: Microprocessors (630313)

Philadelphia University Student Name: Student Number:

Faculty of Engineering Student Number:

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)

Philadelphia University Student Name: Student Number:

Marking Scheme. Examination Paper. Module: Microprocessors (630313)

Data Transfers, Addressing, and Arithmetic. Part 2

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

Code segment Stack segment

Q1: Multiple choice / 20 Q2: Memory addressing / 40 Q3: Assembly language / 40 TOTAL SCORE / 100

16.317: Microprocessor Systems Design I Fall 2013

Q1: Multiple choice / 20 Q2: Data transfers and memory addressing

16.317: Microprocessor Systems Design I Spring 2014

X86 Addressing Modes Chapter 3" Review: Instructions to Recognize"

Addressing Modes on the x86

Q1: Multiple choice / 20 Q2: Memory addressing / 40 Q3: Assembly language / 40 TOTAL SCORE / 100

Module 3 Instruction Set Architecture (ISA)

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات

Hardware and Software Architecture. Chapter 2

CSC 2400: Computer Systems. Towards the Hardware: Machine-Level Representation of Programs

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil

Assembly Language Each statement in an assembly language program consists of four parts or fields.

Chapter 3: Addressing Modes

16.317: Microprocessor Systems Design I Fall 2013

Q1: Multiple choice / 20 Q2: Protected mode memory accesses

Faculty of Engineering Computer Engineering Department Islamic University of Gaza Assembly Language Lab # 2 Assembly Language Fundamentals

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit

COMPUTER ENGINEERING DEPARTMENT

8086 INTERNAL ARCHITECTURE

Experiment 3 3 Basic Input Output

UNIVERSITY OF CALIFORNIA, RIVERSIDE

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

CSC 8400: Computer Systems. Machine-Level Representation of Programs

Arithmetic Instructions

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86

EC-333 Microprocessor and Interfacing Techniques

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

PESIT Bangalore South Campus

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

1. Introduction to Assembly Language

ADVANCE MICROPROCESSOR & INTERFACING

EC 333 Microprocessor and Interfacing Techniques (3+1)

Introduction to IA-32. Jo, Heeseung

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,...

EEM336 Microprocessors I. Data Movement Instructions

INTRODUCTION TO IA-32. Jo, Heeseung

CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 21: Generating Pentium Code 10 March 08

complement) Multiply Unsigned: MUL (all operands are nonnegative) AX = BH * AL IMUL BH IMUL CX (DX,AX) = CX * AX Arithmetic MUL DWORD PTR [0x10]

/ 28 HLL assembly Q4: Conditional instructions / 40 TOTAL SCORE / 100 EXTRA CREDIT / 10

MODE (mod) FIELD CODES. mod MEMORY MODE: 8-BIT DISPLACEMENT MEMORY MODE: 16- OR 32- BIT DISPLACEMENT REGISTER MODE

16.317: Microprocessor Systems Design I Fall 2014

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.

UMBC. A register, an immediate or a memory address holding the values on. Stores a symbolic name for the memory location that it represents.

/ 30 Q3: Arithmetic instructions / 30 Q4: Logical instructions / 20 TOTAL SCORE / 100 Q5: EXTRA CREDIT / 10

CS241 Computer Organization Spring 2015 IA

Conditional Processing

The x86 Architecture

16.317: Microprocessor Systems Design I Spring 2015

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

Computer Architecture 1 ح 303

Lab 4: Basic Instructions and Addressing Modes

Intel 8086 MICROPROCESSOR ARCHITECTURE

Chapter Three Addressing Mode MOV AX, BX

Reverse Engineering II: Basics. Gergely Erdélyi Senior Antivirus Researcher

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU)

Reverse Engineering II: The Basics

Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee

Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB. Lab # 8. Conditional Processing

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 4: Data Transfers, Addressing, and Arithmetic. Chapter Overview

Instructions moving data

mith College Computer Science CSC231 - Assembly Week #4 Dominique Thiébaut

icroprocessor istory of Microprocessor ntel 8086:

Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998

Microprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)

EECE.3170: Microprocessor Systems Design I Summer 2017 Homework 4 Solution

9/25/ Software & Hardware Architecture

Basic Execution Environment

EECE.3170: Microprocessor Systems Design I Spring 2016

Lab 3: Defining Data and Symbolic Constants

EE2007 Microprocessor systems.

Transfer of Control. Lecture 10 JMP. JMP Formats. Jump Loop Homework 3 Outputting prompts Reading single characters

6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:

Intel 8086 MICROPROCESSOR. By Y V S Murthy

BEng (Hons.) Telecommunications. BSc (Hons.) Computer Science with Network Security

Data Transfer, Addressing and Arithmetic

The Microprocessor and its Architecture

BAHAR DÖNEMİ MİKROİŞLEMCİLER LAB3 FÖYÜ

EEM336 Microprocessors I. Addressing Modes

Lab 6: Conditional Processing

Assembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:

Inline Assembler. Willi-Hans Steeb and Yorick Hardy. International School for Scientific Computing

Come and join us at WebLyceum

Basic Assembly SYSC-3006

Interfacing Compiler and Hardware. Computer Systems Architecture. Processor Types And Instruction Sets. What Instructions Should A Processor Offer?

IA32 Intel 32-bit Architecture

CSE2421 FINAL EXAM SPRING Name KEY. Instructions: Signature

SHEET-2 ANSWERS. [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte.

Logic Instructions. Basic Logic Instructions (AND, OR, XOR, TEST, NOT, NEG) Shift and Rotate instructions (SHL, SAL, SHR, SAR) Segment 4A

Transcription:

Philadelphia University Student Name: Student Number: Faculty of Engineering Serial Number: Final Exam, Second Semester: 2016/2017 Dept. of Computer Engineering Course Title: Microprocessors Date: 12/06/2017 Course No: 0630313 Time Allowed: 2 hours Lecturer: Dr. Qadri Hamarsheh No. Of Pages: 7 Instructions: ALLOWED: pens and drawing tools (no red color). NOT ALLOWED: Papers, calculators, literatures and any handouts. Otherwise, it will lead to the non-approval of your examination. Shut down Telephones, and other communication devices. Please note: This exam paper contains 5 questions totaling 40 marks Write your name and your matriculation number on every page of the solution sheets. All solutions together with solution methods (explanatory statement) must be inserted in the labelled position on the solution sheets. You can submit your exam after the first hour. Basic notions: The aim of the questions in this part is to evaluate the required minimal student knowledge and skills. Answers in the pass category represent the minimum understanding of IA-32 Processor Architecture, Assembly Language Fundamentals: Instructions, Directives, Identifiers, Defining Data, Symbolic Constants, Data Transfers, Addressing, and Arithmetic instructions Addressing Modes, Conditional and Unconditional instructions, Stack, Pointers, Arrays and Procedures. Question 1 Multiple Choices Identify the choice that best completes the statement or answers the question. 1) The 8086/8088 used two processing logical units which were known as: a) Segment and Offset Units b) Bus Interface Unit and Execution Unit c) Bus Unit and Execution Interface Unit d) ALU and Control Unit (10 marks) 2) What are the names of the 4 segment registers? a) Data, Index, Code, Stack b) Stack, Index, Extra, Code c) Stack, Extra, Code, Data d) Stack, Data, Base, Counter 3) Memory segmentation (partitioning) was necessary because the x86 registers were 16-bits and could not hold the 20-bit addresses of the main memory a) True b) False 4) In the following data definition, assume that List2 begins at offset 2000h. What is the offset of the third value (5)? List2 WORD 3, 4, 5, 6, 7 a) 2006h c) 2004h b) 2003h d) None of above 5) Which of the following is an invalid instruction? a) MOV AX, [BP] c) MOV AX, CS b) MOV DS, CS d) None of the above 1

6) Assume the following initial state for AX, BX, CX registers: AX BX CX 6521 H ABCD H 0105 H What are the flags after CMP AH, CL a) C=1, Z=0, S=1 c) C=0, Z=1, S=1 b) C=0, Z=1, S=0 d) C=0, Z=0, S=0 7) Given that the BL register contains b, the effect of the following instruction and BL, 1101 1111 is to a) clear bl c) store B in bl b) store 0010 0000 in bl d) leave bl unchanged 8) Given that the subprogram WriteChar displays the character in AL register, the effect of the following instructions: mov AL, c sub AL, 2 call WriteChar is to a) display 2 c) display 'c' b) display 'a' d) display a blank 9) The interrupt vector table (IVT) is located at addresses: a) 00000H 01024H c) 00000H 003FFH b) 00000H 000FFH d) FFF00H - FFFFFH 10) INT 21 service 01H is used to read character from standard input with echo. It returns the result in register. a) AL c) BH b) BL d) CL 2

Familiar and Unfamiliar problems solving: the aim of the questions in this part is to evaluate that the student has some basic knowledge of the key aspects of the lecture material and can attempt to solve familiar and unfamiliar problems of Assembly Language Fundamentals: Instructions, Directives, Identifiers, Defining Data, Symbolic Constants, Data Transfers, Addressing, and Arithmetic instructions Addressing Modes, Conditional and Unconditional instructions, Stack, Pointers, Arrays and Procedures. Question 2 (9 marks) a) Explain 8086 flag register? (2.5 marks) b) Fill the following table that describes data-related operators and directives used in assembly language. (3 marks) Operator Usage and Description OFFSET PTR TYPE LENGTHOF SIZEOF LABEL 3

c) What is the use of Interrupt vector table of 8086 microprocessor, describe the IVT Format? (2 marks) d) Explain the following instructions: (1.5 marks) NEG LOOP SAHF 4

Question 3 (8 marks) a) What will be the final value of EAX in the following assembly code? (2.5 marks) L1: L2: mov eax, 0 mov ecx, 10 mov eax, 3 mov ecx, 5 add eax, 5 loop L2 loop L1 b) Write instruction(s) to perform the following tasks: (3.5 marks) Task mark 1. Invert the seventh bit in DX (note: the LSB is the first bit) 2. Set the 5 th and the 11 th bits in AX 3. 4. 5. Calculate the 2's complement of AX Jump to label 'HELP' if AX is even Three different instructions that will subtract 1 from register DX 1.5 marks c) Assume that we have the following data definitions: (2 marks) mybytes BYTE 10h, 20h, 30h, 40h mywords WORD 8Ah, 3Bh, 72h, 44h, 66h mydoubles DWORD 1, 2, 3, 4, 5 mypointer DWORD mydoubles Fill in the requested register values on the right side of the following instruction sequence: mov esi, OFFSET mybytes mov ax, [esi] ; AX =---------- mov eax, DWORD PTR mywords ; EAX =--------- mov esi, mypointer mov ax, [esi+2] ; AX =---------- mov ax, [esi-4] ; AX =---------- 5

Question 4 (6 marks) Write complete assembly language program that: Declares the following array of DWORD: 44h, FFh, 555, 11. Declares the following string "Assembly language is easy". Displays the content of the array and the string to standard output using DumpMem Procedure. Saves and restores the content of the used registers into the stack before and after calling. 6

Question 5 (7 marks) Write an Assembly Language program to compare two strings and display if they are equal. The program should: Use Real Mode Programming. Use Indirect Addressing Mode. Use Irvine16 library for output. Two strings must be assigned within the definition of the strings. Use EQU and $ operators to calculate the size of the string. Display the message "EQUAL" when the strings are equal and the message "NOT EQUAL" otherwise. DS must point to the segment address. Good Luck 7