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)

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

Philadelphia University Student Name: Student Number:

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

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

Introduction to IA-32. Jo, Heeseung

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

INTRODUCTION TO IA-32. Jo, Heeseung

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

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

Basic Execution Environment

Intel 8086: Instruction Set

Complex Instruction Set Computer (CISC)

Hardware and Software Architecture. Chapter 2

Chapter 3: Addressing Modes

Code segment Stack segment

The Microprocessor and its Architecture

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

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

The x86 Architecture

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

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

Reverse Engineering II: The Basics

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

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

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

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

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

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI

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

ADVANCE MICROPROCESSOR & INTERFACING

COMPUTER ENGINEERING DEPARTMENT

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

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

Computer Architecture 1 ح 303

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

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

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

Assembly Language Lab # 9

Addressing Modes on the x86

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

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

CMSC Lecture 03. UMBC, CMSC313, Richard Chang

Memory Models. Registers

Assembler Programming. Lecture 2

The Instruction Set. Chapter 5

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

Lab 2: Introduction to Assembly Language Programming

Experiment 3 3 Basic Input Output

Module 3 Instruction Set Architecture (ISA)

3.1 DATA MOVEMENT INSTRUCTIONS 45

System calls and assembler

EEM336 Microprocessors I. Addressing Modes

Reverse Engineering II: The Basics

EEM336 Microprocessors I. Data Movement Instructions

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

16.317: Microprocessor Systems Design I Fall 2013

CS241 Computer Organization Spring 2015 IA

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

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

Program Exploitation Intro

Lab 3. The Art of Assembly Language (II)

Instruction Set Architectures

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.

Arithmetic Instructions

ADDRESSING MODES. Operands specify the data to be used by an instruction

Basic Assembly SYSC-3006

Credits and Disclaimers

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

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

EC-333 Microprocessor and Interfacing Techniques

Assembly level Programming. 198:211 Computer Architecture. (recall) Von Neumann Architecture. Simplified hardware view. Lecture 10 Fall 2012

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 03, SPRING 2013

Assembly Language: IA-32 Instructions

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

Machine-level Representation of Programs. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Ethical Hacking. Assembly Language Tutorial

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming)

Assembly Language. Lecture 2 x86 Processor Architecture

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

16.317: Microprocessor Systems Design I Fall 2015

16.317: Microprocessor Systems Design I Fall 2014

Assembly Language. Lecture 2 - x86 Processor Architecture. Ahmed Sallam

MICROPROCESSOR TECHNOLOGY

FACULTY OF ENGINEERING LAB SHEET

History of the Intel 80x86

T Reverse Engineering Malware: Static Analysis I

Computer Science Final Examination Wednesday December 13 th 2006

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-11: 80x86 Architecture

Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD /12/2014 Slide 1

Chapter Four Instructions Set

Instruction Set Architectures

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

THE UNIVERSITY OF TRINIDAD & TOBAGO

Practical Malware Analysis

Transcription:

Philadelphia University Student Name: Student Number: Faculty of Engineering Serial Number: Final Exam, First Semester: 2017/2018 Dept. of Computer Engineering Course Title: Microprocessors Date: 30/01/2018 Course No: 0630313 Time Allowed: 2 hours Lecturer: Dr. Qadri Hamarsheh No. Of Pages: 6 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. (10 marks) 1) The first processor that includes Virtual Memory in the Intel microprocessor family was: a) 4004 c) Pentium Pro b) 80286 d) 80486 2) If SS = 90A3H, then the range of physical addresses for the stack segment is: a) 00000H 090A3H c) 090A3 190A2H b) 90A30H 9FA30H d) 90A30 A0A2FH 3) The special output bits in the adder/subtractor circuitry (like OF) are maintained in what register? a) EFLAGS c) EIP b) EBP d) ESP 4) Which directive is used when defining 64-bit IEEE long reals? a) REAL4 c) REAL64 b) REAL8 d) REAL 5) The instruction, CMP to compare source and destination operands it performs a) Addition c) Subtraction b) Division d) Multiplication 1

6) The instruction that loads effective address formed by destination operand into the specified source register is a) LES c) LDS b) LEA d) LAHF 7) What does the NEG instruction do? a) Two s Complement b) One s Complement 8) Given that BL contains B the effect of the following code OR BL, 0010 0000 ADD BL, 2 is to a) clear BL c) store b in BL b) store 0110 0001 in BL d) store d in BL 9) The instructions that are used to call a subroutine (procedure) from a main program and return to the main program after execution of called function are a) JMP,IRET c) CALL,JMP b) CALL,RET d) JMP,RET 10) Which of the following instructions changes the CS register: a) INT 21h c) INC CS b) MOV CS, DS d) CS cannot be changed 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 (7 marks) a) Explain Memory Models that can be used in assembly language. (3 marks) 2

b) List four types of the memory addressing modes used in Intel Microprocessor. (2 marks) c) What is the use of Interrupt vector table of 8086 microprocessor and describe the IVT Format? (2 marks) 3

Question 3 (10 marks) a) Write assembly code to do the following: (4 marks) i) Write a single instruction using 16-bit operands that clears the high 8 bits of AX and does not change the low 8 bits. ii) Write a single instruction using 16-bit operands that set the high 8 bits of AX and does not change the low 8 bits. iii) Write instructions that jump to label L1 when the unsigned integer in DX is less than or equal to the integer in CX. iv) Write an instruction that moves the first two bytes in the array named (A1) to the AX register. The resulting value will be 2010h. A1 BYTE 10h, 20h, 30h, 40h b) Use the following data declarations. (3 marks).data X1 DWord 1234ff3bh, 3456cfdeh X2 Byte Enter Your Name, 0 Indicate whether or not each of the following assembly code is valid: Ñ Instruction Answer 1) MOV DS, BX 2) test AL, X2 3) add eip, X1 4) MOV ES,DS 5) sub si,di 6) cmp 75,EAX 4

c) Use the following data declarations. (3 marks).data valw LABEL WORD val DWORD 01234567h TABLE DB 14, 15, 22, 45 ; Vector DWORD 01234567h,15 vec1 WORD 0,1,2,3,4,5 WORD 6,7,8,9,10,11 vec2 DWORD 0,1,2,3,4,5, 6,7,8,9,10,11 Fill in the contents of the specified registers in the following code:.code mov ax,valw ; ax= --------------- MOV CL, TABLE[2] ; CL = --------------- mov al,type Vector; al= --------------- mov eax,lengthof vec1 ; eax= --------------- mov ebx,lengthof vec2 ; ebx= --------------- mov ebx,sizeof vec2 ; ebx= --------------- Question 4 a) Consider the following Boolean expression: while (Avg >= Std) do begin Avg := Avg - 1; Std := Std + 1; end; Write an assembly language code to implement the above expression. Assume that all variables are declared and of type WORD. (3 marks) (1.5 marks) b) The array Name of 33 bytes is assumed to contain string of ASCII characters. Check it to see if it contains the 'A' character and go to location HasAchar if it does. (1.5 marks) 5

Question 5 (10 marks) Write a complete assembly program to do the following: a) Create an array of 16 randomly ordered integers using Irvine library's Random32 procedure. b) Create procedure named Swap that exchanges the values of two 32-bit integers. c) Using the Swap procedure from Section b as a tool, write a loop that exchanges each consecutive pair of integers in the array. d) Display the array before and after the exchange (swap) using Irvine library's DumpMem procedure, use suitable messages for this step. Assume that protected Addressing-mode is used. Use indexing addressing memory mode. Good Luck 6