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

Similar documents
Faculty of Engineering Student Number:

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

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

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

Philadelphia University Student Name: Student Number:

Philadelphia University Student Name: Student Number:

Conditional Processing

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

Module 3 Instruction Set Architecture (ISA)

Assembly Language Programming

Microprocessors ( ) Fall 2010/2011 Lecture Notes # 15. Stack Operations. 10 top

UNIVERSITY OF CALIFORNIA, RIVERSIDE

16.317: Microprocessor Systems Design I Spring 2015

Lab 6: Conditional Processing

COMPUTER ENGINEERING DEPARTMENT

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

16.317: Microprocessor Systems Design I Fall 2014

Lab 4: Basic Instructions and Addressing Modes

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

SOEN228, Winter Revision 1.2 Date: October 25,

PESIT Bangalore South Campus

Midterm Exam #2 Answer Key

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

8086 INTERNAL ARCHITECTURE

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

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

LABORATORY WORK NO. 7 FLOW CONTROL INSTRUCTIONS

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]

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 5: Procedures. Chapter Overview. The Book's Link Library

Defining and Using Simple Data Types

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

Computer Science Final Examination Wednesday December 13 th 2006

ORG ; TWO. Assembly Language Programming

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

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

9/25/ Software & Hardware Architecture

EC 333 Microprocessor and Interfacing Techniques (3+1)

Lab 3: Defining Data and Symbolic Constants

Assembly Language Lab # 4 Data Transfer & Arithmetic (1)

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

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

Assembly Language LAB

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

Basic Assembly Instructions

Summer 2003 Lecture 11 06/25/03

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013)

16.317: Microprocessor Systems Design I Fall 2013

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

IFE: Course in Low Level Programing. Lecture 6

AM2: Programming with Contemporary Instruction Set

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

ADVANCE MICROPROCESSOR & INTERFACING

Assembly Language. Lecture 5 Procedures

16.317: Microprocessor Systems Design I Fall 2013

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

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

UMBC. contain new IP while 4th and 5th bytes contain CS. CALL BX and CALL [BX] versions also exist. contain displacement added to IP.

Assembly Language for Intel-Based Computers, 4 th Edition

Objectives. ICT106 Fundamentals of Computer Systems Topic 8. Procedures, Calling and Exit conventions, Run-time Stack Ref: Irvine, Ch 5 & 8

16.317: Microprocessor Systems Design I Fall 2015

Computer Architecture 1 ح 303

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

Hardware and Software Architecture. Chapter 2

Introduction to Microprocessor

Objectives. Saving Interrupt Vectors. Writing a Custom Interrupt Handler. Examples of use of System functions for Input-Output and Interrupts

Chapter 3: Addressing Modes

Lab 2: Introduction to Assembly Language Programming

Program Exploitation Intro

Assembly Language for Intel-Based Computers, 4 th Edition

Week 11 Programmable Interrupt Controller

Lab 5: Input/Output using a Library of Procedures

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

Low-Level Essentials for Understanding Security Problems Aurélien Francillon

Assembly Language for Intel-Based Computers, 4 th Edition

The x86 Architecture

1. Introduction to Assembly Language

THE UNIVERSITY OF TRINIDAD & TOBAGO

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

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

Libraries and Procedures

PHY4635/5635 Spring Lecture 8: Program Control Instructions

Data Transfers, Addressing, and Arithmetic. Part 2

Come and join us at WebLyceum

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

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

Program Control Instructions

COMPUTER ENGINEERING DEPARTMENT

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

Assembly Language for Intel-Based Computers, 4 th Edition. Lecture 25: Interface With High-Level Language

BLDEA S V.P. DR. P.G. HALAKATTI COLLEGE OF ENGINEERING & TECHNOLOGY, VIJAYAPURA

Assembly Language Programming of 8085

Intel 8086: Instruction Set

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

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

Practical Malware Analysis

ELEC 242 Time Delay Procedure

Week /8086 Microprocessor Programming

Northern India Engineering College, Delhi (GGSIP University) PAPER I

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

Transcription:

Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 08/06/2014 Section 1 Weighting 40% of the module total Lecturer: Coordinator: Internal Examiner: Dr. Qadri Hamarsheh Dr. Qadri Hamarsheh Eng. Anis Nazer

Marking Scheme Microprocessors (630313) The presented exam questions are organized to overcome course material, the exam contains 6 questions; all questions are compulsory requested to be answered. Thus, the student is permitted to answer any question out of the existing ones in this section. Marking Assignments The following scheme shows the marks assignments for each question. They show also the steps for which a student can get marks along the related procedure he/she achieves. Question 1This question is attributed with 10 marks if answered properly The answer for this question as the following: 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 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 This question is attributed with 8 marks if answered properly Question 2.a (3 marks) A 3X8 decode is used to decode the instruction. The block diagram of the ALU is shown in figure It performs the operation as: C=A op B Question 2.b Using TYPEDEF The TYPEDEF operator creates a user-defined type. TYPEDEF is ideal for creating pointer variables. Syntax : name TYPEDEF type For example, PBYTE and PWORD are pointers to bytes and words, respectively: PBYTE TYPEDEF PTR BYTE PWORD TYPEDEF PTR WORD then arrayb BYTE 10h,20h,30h,40h ptr1 PBYTE? ptr2 PBYTE arrayb Question 2.c NOT: Logical inversion or the one s complement and NEG: arithmetic sign inversion or the two s complement. AND: Performs the AND operation and changes the destination operand. TEST:Test instruction performs the AND operation and it wont changes destination operand but it only affects the condition of the flag register. SUB: Performs the subtraction operation and changes the destination operand. CMP: Comparison instruction is a subtraction that changes only the flag bits; the destination operand never changes

Question 2.d (2 marks) Software Interrupt - Internal - from int or into The INT instruction executes a software interrupt. The code that handles the interrupt is called an interrupt handler. The Interrupt Vector Table (IVT) holds a 32-bit segment-offset address for each possible interrupt handler. Interrupt Service Routine (ISR) is another name for interrupt handler. Hardware Interrupt - External Uses INTR and NMI Generated by the Intel 8259 Programmable Interrupt Contoller (PIC) o in response to a hardware signal Interrupt Control Instructions STI set interrupt flag CLI clear interrupt flag Question 3 This question is attributed with 6 marks, if answered properly. Question 3.a MOV EAX,L-4 ; EAX=5 MOV EBX,L+4 ; EBX=3 MOV ECX,L+12 ; ECX=6 Question 3.b mov ax, J cmp ax, K jnle DoElse inc L jmp ifdone DoElse: dec L ifdone: Question 3.c WhlLoop: mov ax, j cmp ax, k jnae QuitLoop dec j inc k jmp WhlLoop QuitLoop: exit Main endp Question 3.d mov cx, 100 mov si, OFFSET C ; si = address of C array Check: cmp BYTE PTR [si], '$' ; if [si] == '$' je HasDollar ; then go to HasDollar inc si ; si = si + 1 dec cx jnz Check

Question 4 This question is attributed with 5 marks, if answered properly. The complete code for this question as the following: INCLUDE Irvine32.inc Uarray WORD 1000h,2000h,3000h,4000h Sarray SWORD -1,-2,-3,-4.code main PROC ; Move with zero extension: movzx eax,uarray movzx ebx,uarray+2 movzx ecx,uarray+4 movzx edx,uarray+6 call DumpRegs ; Move with sign extension: movsx eax,sarray movsx ebx,sarray+2 movsx ecx,sarray+4 movsx edx,sarray+6 call DumpRegs exit main ENDP END main (2 marks) (2 marks) Question 5 This question is attributed with 5 marks, if answered properly. The answer for this question as the following: INCLUDE Irvine32.inc COUNT = 50 commastr BYTE ", ",0.code main PROC call Clrscr ; optional: clear screen call Randomize ; optional: reseed random generator mov ecx,count ; loop counter (2 marks) L1: mov eax,41 ; generate rand int (0..40) call RandomRange sub eax,20 call WriteInt mov edx,offset commastr call WriteString loop L1 call Crlf exit main ENDP END main ; bias to -20..+20 range ; display the integer Question 6 This question is attributed with 6 marks, if answered properly. The answer for this question as the following: TITLE (PrnEncStr.asm).MODEL small INCLUDE Irvine16.inc BUFMAX = 200 ; maximum buffer size (3 marks)

sprompt1 BYTE "Enter the plain text: ",0 sprompt2 BYTE "Enter the Key string: ",0 bufsize WORD? buffer BYTE BUFMAX+1 DUP(0) KEY BYTE BUFMAX+1 DUP(0) (2 marks).code main PROC mov dx,offset sprompt1 call WriteString mov cx, BUFMAX mov dx,offset buffer call readstring mov bufsize, ax mov dx,offset sprompt2 call WriteString mov cx, BUFMAX mov dx,offset KEY call readstring cmp ax, bufsize jnz finish mov cx,bufsize mov si,0 L1: mov al, buffer[si] ; get character xor al, KEY[si] inc si loop L1 finish:.exit main ENDP END main