Faculty of Engineering Student Number:

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

Philadelphia University Student Name: Student Number:

Philadelphia University Student Name: Student Number:

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

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

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

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

Philadelphia University Student Name: Student Number:

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

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

Module 3 Instruction Set Architecture (ISA)

Conditional Processing

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

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

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

Computer Systems Organization V Fall 2009

SOEN228, Winter Revision 1.2 Date: October 25,

Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB. Lab # 7. Procedures and the Stack

Chapter 3: Addressing Modes

16.317: Microprocessor Systems Design I Fall 2014

UNIVERSITY OF CALIFORNIA, RIVERSIDE

Assembly Language Programming

EECE416 :Microcomputer Fundamentals and Design. X86 Assembly Programming Part 1. Dr. Charles Kim

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

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2016 Lecture 12

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

Load Effective Address Part I Written By: Vandad Nahavandi Pour Web-site:

Assembly Language: Overview!

The Instruction Set. Chapter 5

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

Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB. Lab # 10. Advanced Procedures

Second Part of the Course

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

COMPUTER ENGINEERING DEPARTMENT

Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

Assembly Language Lab # 9

Complex Instruction Set Computer (CISC)

Computer Science Final Examination Wednesday December 13 th 2006

Practical Malware Analysis

16.317: Microprocessor Systems Design I Fall 2013

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

16.317: Microprocessor Systems Design I Spring 2015

16.317: Microprocessor Systems Design I Fall 2015

Memory Models. Registers

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

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

17. Instruction Sets: Characteristics and Functions

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

Computer Architecture 1 ح 303

Registers. Ray Seyfarth. September 8, Bit Intel Assembly Language c 2011 Ray Seyfarth

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

Lab 6: Conditional Processing

Assignment 3. Problem Definition:

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

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

Lab 2: Introduction to Assembly Language Programming

We will first study the basic instructions for doing multiplications and divisions

Towards the Hardware"

Defining and Using Simple Data Types

Course Syllabus [1/2]

ECE232: Hardware Organization and Design

Low Level Programming Lecture 2. International Faculty of Engineerig, Technical University of Łódź

Digital Forensics Lecture 3 - Reverse Engineering

Topic 6: Code Generation

Assembly Language: Overview

MICROPROCESSOR ARCHITECTURE

Lab 3: Defining Data and Symbolic Constants

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 6: Conditional Processing

Hardware and Software Architecture. Chapter 2

Chapter 3: Assembly Language Fundamentals. Cristina G. Rivera

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

Registers. Registers

The x86 Architecture

THE UNIVERSITY OF TRINIDAD & TOBAGO

Introduction to IA-32. Jo, Heeseung

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

Basic Assembly Instructions

16.317: Microprocessor Systems Design I Fall 2013

Sample Exam I PAC II ANSWERS

INTRODUCTION TO IA-32. Jo, Heeseung

Assembly Language for Intel-Based Computers, 5 th Edition. Kip Irvine. Chapter 3: Assembly Language Fundamentals

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

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMMUNICATION ENGINEERING REG 2008 TWO MARKS QUESTION AND ANSWERS

Lab 4: Basic Instructions and Addressing Modes

An Introduction to x86 ASM

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

ORG ; TWO. Assembly Language Programming

Chapter 11. Addressing Modes

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

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 2: IA-32 Processor Architecture Included elements of the IA-64 bit

Program Exploitation Intro

Assembly Language Programming of 8085

9/25/ Software & Hardware Architecture

Lecture 8: Control Structures. Comparing Values. Flags Set by CMP. Example. What can we compare? CMP Examples

Language of x86 processor family

Assembly Language for Intel-Based Computers, 5 th Edition

History of the Intel 80x86

Assembly Language. Lecture 2 x86 Processor Architecture

Modesto Junior College Course Outline of Record CMPSC 241

Transcription:

Philadelphia University Student Name: Faculty of Engineering Student Number: Dept. of Computer Engineering Final Exam, Second Semester: 2013/2014 Course Title: Microprocessors Date: 08/06/2014 Course No: 0630313 Time Allowed: 2 Hours Lecturer: Dr. Qadri Hamarsheh No. Of Pages: 7 Information for Candidates 1.This examination paper contains 6 questions totaling 40 marks. 2.The marks for the questions are : Question 1 (10 marks), Question 2 (8 marks), Question 3 (6 marks) Question 4 (5marks), Question 5 (5 marks), Question 6 (6 marks) Advice to Candidates 1. You should attempt ALL requested parts. 2. You should write your answers clearly. 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 (10 marks) Identify the choice that best completes the statement or answers the question. 1) Since the x86 has an address bus of 20-bits, its memory is segmented into 1 M segments (i.e. 2 20 ). a) True b) False 2) If CS = 7FA2H, SS = 0801H, SI = 0100H and IP = 438EH the address of the next instruction is: a) 83DAEH b) 438EH c) 83DA0H d) None of the above 3) One of the following is not a valid segment address a) 00000 b) E0840 c) 8CE90 d) 8CE91 4) Pipelining improves CPU performance due to a) increased clock speed b) the introduction of parallelism c) reduced memory access time d) additional functional units 5) The basic parts of an instruction, in order from left to right, are: a) label, mnemonic, operand(s), comment b) comment, label, mnemonic, operand(s) c) label, mnemonic, comment d) mnemonic, operand(s), comment 6) Which of the following will generate assembly errors? a) var1 BYTE 1101b, 22, 35 b) var3 BYTE '$','98778', c) var2 BYTE "ABCDE", 18 d) None of the above 7) Which directive is used when defining BCD numbers? a) DWORD b) FWORD c) QWORD d) TBYTE 8) Given that the BL register contains B, the effect of the following instruction OR BL, 0010 0000 is to a) clear BL b) store 0010 0000 in BL c) store b in BL d) leave BL unchanged 1

9) What is the result in AL after executing the following instructions? XOR AL, AL OR AL, 80H a) 80H b) 88H c) 00H d) None of the above 10) Which of the following are performed when an interrupt occurs: (I) FLAGS register is pushed to the stack (II) CS register is pushed to the stack (III) IP register is pushed to the stack a) (I) and (II) and (III) b) (I) and (II) only c) (II) and (III) only d) (I) and (III) only Question 2 (8 marks) a) Design and draw the block diagram for a hypothetical ALU (Arithmetic and logic Unit) having 4 arithmetic operations and 4 logical operations. (3 marks) Four arithmetic operations. Addition, subtraction, multiplication and division. Four logical operations: OR, AND, NOT & XOR. b) Explain the purpose of the TYPEDEF statement. Give the syntax and examples of its use. 2

c) Mention how do the following instructions differ in their functionality. NEG & NOT AND & TEST CMP & SUB d) Explain the various hardware and software interrupts in 8086 microprocessor. (2 marks) 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 3 (6 marks) a) Fill in the contents of the specified registers in the following code as hex-digit numbers:.data DWORD 5 L DWORD 2,3,4 DWORD 6.code MOV EAX,L-4 ; EAX=---------------- MOV EBX,L+4 ; EBX=---------------- MOV ECX,L+12 ; ECX=---------------- 3

b) Consider the following Boolean expression: if (J <= K) then L := L + 1 else L := L - 1 Write an assembly language code to implement the above expression. Assume that all variables are declared and of type SWORD. c) Consider the following Boolean expression: while (j >= k) do begin j := j - 1; k := k + 1; end; Write an assembly language code to implement the above expression. Assume that all variables are declared and of type WORD. d) The array C of 100 bytes is assumed to contain string of ASCII characters. Write an assembly language code to Check if it contains the '$' character and go to location HasDollar if it does. 4

Question 4 (5 marks) Write a complete assembly language program that should: a) Declare array Uarray of four values of data type WORD, initialize values to 1000h, 2000h, 3000h, 4000h respectively. b) Declare array Sarray of four values of data type SWORD, initialize values to FFFFh, FFFEh, FFFDh, FFFCh respectively. c) Write instructions that use direct-offset addressing to move the four values in Uarray to the EAX, EBX, ECX, and EDX registers. When you follow this with a call DumpRegs statement, the following register values should display: EAX=00001000 EBX=00002000 ECX=00003000 EDX=00004000 d) Next, write instructions that use direct-offset addressing to move the four values in Sarray to the EAX, EBX, ECX, and EDX registers. When you follow this with a call DumpRegs statement, the following register values should display: EAX=FFFFFFFF EBX=FFFFFFFE ECX=FFFFFFFD EDX=FFFFFFFC 5

Question 5 (5marks) Write a program that generates and displays 50 random integers between -20 and +20. 6

Question 6 (6 marks) Write an assembly language program (complete) that Reads two strings of 200 characters maximum from the keyboard using Irvine32 Library. Exits from a program if the length of the two strings is different. Encrypts the first string using the second string as a key. Uses suitable I/O Messages for data entry. Good Luck 7