Q1: Multiple choice / 20 Q2: Protected mode memory accesses. / 40 Q3: Reading PIC. / 40 assembly language TOTAL SCORE / 100

Similar documents
16.317: Microprocessor-Based Systems I Fall 2012

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

16.317: Microprocessor Systems Design I Spring 2015

16.317: Microprocessor-Based Systems I Spring 2012

16.317: Microprocessor Systems Design I Fall 2015

16.317: Microprocessor Systems Design I Fall 2014

/ 40 Q3: Writing PIC / 40 assembly language TOTAL SCORE / 100 EXTRA CREDIT / 10

16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution

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

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

16.317: Microprocessor-Based Systems I Summer 2012

16.317: Microprocessor Systems Design I Fall 2013

Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar

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

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006

Assembly Language Instructions

TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE. E4160 Microprocessor & Microcontroller System. Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010

Instuction set

Chapter 13. PIC Family Microcontroller

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

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

SOLUTIONS!! DO NOT DISTRIBUTE!!

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

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

16.317: Microprocessor Systems Design I Fall Exam 3 December 15, Name: ID #:

16.317: Microprocessor Systems Design I Fall 2013

Lecture (04) PIC16F84A (3)

ECE Test #1: Name

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours

EEE111A/B Microprocessors

PIC16F84A 7.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design

Arithmetic,logic Instruction and Programs

PIC 16F84A programming (II)

More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work

Arithmetic and Logic Instructions. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!!

Lecture 16: Passing Parameters on the Stack. Push Examples. Pop Examples. CALL and RET

ALU and Arithmetic Operations

4.5.1) The Label Field ) The Mnemonic Field. 4.5) Assembly Language Program Structure A PIC18 ALP consists of 3 type of statements:

CONNECT TO THE PIC. A Simple Development Board

IA32 Intel 32-bit Architecture

Chapter 2: The Microprocessor and its Architecture

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

Philadelphia University Student Name: Student Number:

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

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017

ECE 354 Introduction to Lab 2. February 23 rd, 2003

16.317: Microprocessor Systems Design I Spring 2014

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory

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

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

iapx Systems Electronic Computers M

Chapter 6. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code.

Introduction to IA-32. Jo, Heeseung

INTRODUCTION TO IA-32. Jo, Heeseung

The University of Texas at Arlington Lecture 7

Fortune. Semiconductor Corporation 富晶半導體股份有限公司. 8-bit MCU with 1k program ROM, 64-byte RAM, 1 R2F module and 3 13 LCD driver. TD Rev. 1.

Chapter 5. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code.

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses

Philadelphia University Student Name: Student Number:

Application Note - PIC Source Code v1.1.doc

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

Architecture of 8086 Microprocessor

FACULTY OF ENGINEERING LAB SHEET

CISC324: Operating Systems. Assignment 1

Chapter 5 Sections 1 6 Dr. Iyad Jafar

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller

Ex: Write a piece of code that transfers a block of 256 bytes stored at locations starting at 34000H to locations starting at 36000H. Ans.

Chapter 3: Addressing Modes

Reverse Engineering II: The Basics

Q. State and Explain steps involved in program development. [w-08, w-10, s-12, w-11]

Flow Charts and Assembler Programs

PTK8756B 8 Bit Micro-controller Data Sheet

Week1. EEE305 Microcontroller Key Points

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

IA-32 Architecture COE 205. Computer Organization and Assembly Language. Computer Engineering Department

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

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

LABORATORY WORK NO. 7 FLOW CONTROL INSTRUCTIONS

CS Bootcamp x86-64 Autumn 2015

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

PIC16C63A/65B/73B/74B

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller

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

FACULTY OF ENGINEERING LAB SHEET

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

1. Introduction to Assembly Language

CSE351 Spring 2018, Midterm Exam April 27, 2018

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

IA32/Linux Virtual Memory Architecture

Computer Science Final Examination Wednesday December 13 th 2006

/* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */

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

COMPUTER ENGINEERING DEPARTMENT

An Introduction & Guide to JALV2

Transcription:

16.317: Microprocessor-Based Systems I Fall 2012 Exam 2 November 7, 2012 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g., cellular phones, laptops, PDAs) are prohibited. If you have a cellular phone, please turn it off prior to the start of the exam to avoid distracting other students. The exam contains 3 questions for a total of 100 points. Please answer the questions in the spaces provided. If you need additional space, use the back of the page on which the question is written and clearly indicate that you have done so. You will be provided with six pages (3 double-sided sheets) of reference material: a list of the 80386 instructions and condition codes we covered, as well as the PIC 16F684 instruction set and memory map. You do not have to submit these pages when you turn in your exam. You will have 50 minutes to complete this exam. Q1: Multiple choice / 20 Q2: Protected mode memory accesses / 40 Q3: Reading PIC / 40 assembly language TOTAL SCORE / 100 1

1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling or underlining the single choice you think best answers the question. a. Which of the following statements most accurately describes the role of the LDTR in 80386 protected mode? i. The LDTR directly provides the base address and limit for the global descriptor table. ii. iii. iv. The LDTR directly provides the base address and limit for the current local descriptor table. The LDTR is a selector that points to a descriptor in the global descriptor table. This descriptor directly provides the base address and limit for the current local descriptor table. The LDTR is a selector that points to a descriptor in the global descriptor table. This descriptor directly provides the base address and limit for the current data segment. v. The LDTR is a selector that points to a descriptor in the current local descriptor table. This descriptor directly provides the base address and limit for the current data segment. b. Say you have a high-level program containing an array of short int values, X[30], and an integer variable, i. If the base address of this array is 31700000H and the value of i is 2, what is the address of the array element X[i]? Assume short int values hold 16 bits. i. 31700000H ii. iii. iv. 31700002H 31700004H 31700008H 2

1 (cont.) c. Given the conditional statement below: if (AX == BX) CX++; else CX--; Which of the following assembly sequences correctly implements this conditional statement? i. CMP AX, BX JE L1 JMP L2 ii. CMP AX, BX JNE L1 JMP L2 iii. CMP AX, BX JE L1 iv. CMP AX, BX JNE L1 3

1 (cont.) d. Which of the following pieces of information related to function calls are stored on the stack? A. The function s return address B. The starting address of the function C. Function arguments (i.e., values passed to the function) D. Local variables (i.e., variables declared inside the function) E. The function s name i. A and C ii. A, B, and C iii. A, C, and D iv. B, C, and D v. All of the above (A, B, C, D, and E) 4

2. (40 points) Protected mode memory accesses Assume the 80386 is running in protected mode with the state given below. Note that each memory location shown contains a descriptor for a particular segment. Also, please note that you cannot assume the memory range shown contains the entire GDT and LDT. GDTR = 117201500050 LDTR = 0010 (incorrectly written as 0008 in original exam) LDTR cache: base = 11720128 LDTR cache: limit = 0027 DS = 0007 ES = 001F SS = 0003 ESI = 00001202 EBP = 00000FC4 Memory Base = 030010F0 Limit = 020F Base = 0FEE0110 Limit = 0FEC Base = A0331010 Limit = 0027 Base = FE002200 Limit = FFFF Base = 011B1002 Limit = 0AFF Address 11720120 11720128 11720130 11720138 11720140 Memory Base = AC000000 Limit = 0317 Base = 01610200 Limit = 03F7 Base = 11620128 Limit = FFFF Base = 11720128 Limit = 0027 Base = 11720120 Limit = 0007 Address 11720148 11720150 11720158 11720160 11720168 What physical address does each of the following instructions access? a. MOVSX DX, BYTE PTR SS:[BP-4] b. ADD AX, [SI] c. ROR WORD PTR ES:[SI+10H], 7 5

3. (40 points, 20 points per part) Reading PIC assembly language Show the result of each PIC 16F684 instruction in the sequences below. Be sure to show not only the state of updated registers, but also the carry (C) and zero (Z) bits. a. cblock 0x20 x endc clrf x movlw 0x72 addlw 0xF0 movwf x comf x, W bsf x, 4 incf x, F sublw 0x02 swapf x, F addwf x, W 6

3 (cont.) b. cblock 0x20 q endc movlw 0x0B movwf q xorlw 0x33 iorwf q, W andlw 0x87 bsf STATUS, C rlf q, F btfss q, 7 goto L1 rrf q, W L1: andwf q, F 7