Philadelphia University Student Name: Faculty of Engineering Student Number: Dept. of Computer Engineering Final Exam, First Semester: 2012/2013 Course Title: Microprocessors Date: 17/01//2013 Course No: 0630313 Time Allowed: 2 Hours Lecturer: Dr. Qadri Hamarsheh No. Of Pages: 6 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 (6 marks), Question 3 (7 marks) Question 4 (3 marks), Question 5 (6 marks), Question 6 (8 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) Pipelining improves CPU performance due to a) reduced memory access time c) additional functional units b) increased clock speed d) the introduction of parallelism 2) 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 3) Which of the following is an illegal 8086 instruction? a) and bx, bx c) inc Al b) add ax, 30 d) mov 20, bx 4) An arithmetic instruction always modifies the a) an index register c) stack pointer b) program counter d) status register 5) Which of the following is not an MASM directive? a).data c) DWORD b) RET d).model 6) The call instruction is used to a) access subprograms c) perform I/O b) access memory d) access the Stack 7) The instruction jg operates with a) unsigned numbers c) 2 s complement numbers b) floating point numbers d) ASCII codes 8) The interrupt vector table (IVT) is located at addresses: a) 00000H 01024H c) 00000H 003FFH b) 00000H 000FFH d) FFF00H - FFFFFH 1
Assume the following same initial processor state to answer questions (9) and (10) below. Treat each part individually. AX BX CX 6521 H ABCD H 0105 H 9) 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 10) What are the contents of BL after OR BL, 1FH a) DF H c) D2 H b) FC H d) DD H Question 2 (6 marks) a) Put in front of correct statement and in front of wrong one (3 marks) Statement Answer 1. The DI registers is a 16-bit register. 2. The register SI is divided to two registers each of 8 bits. 3. Data transfer instructions can affect the flag bits. 4. The registers SP/ESP are used with CS register to locate the next instruction. 5. Displacement is a signed value, so it can be both positive and negative. 6. In real mode, a far jump accesses any location within the first 1M byte by changing both CS and IP. b) Write instruction(s) to perform the following tasks: (3 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 mark 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 3 (7 marks) a) Draw the basic components of a computer system (Microprocessor-based) and explain the main function of each component. (3 marks) a) List four types of registers used in Intel-based microprocessors (2 marks) b) Explain the various hardware and software interrupts in 8086 microprocessor. (2 marks) 3
Question 4 (3 marks) Write a complete assembly program that computes the following equation In your code: Define the 2-byte unsigned integer variables J, K, M, N and P. ; Initialize K to 9, M to 7, N to 5 and P to 3 4
Question 5 (6 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. 5
Question 6 (8 marks) Write an Assembly Language program which separates odd and even unsigned numbers from given 32-bit data array stored in memory locations and store in different arrays and add them individual in Assembly Language. The program should: Use Protected Mode Programming. Use Indirect Addressing Mode. The size of the array is 100 elements. The array data must be entered from the keyboard. Use Irvine32 library for the input and output operations. Good Luck 6