Embedded System - Practice Problems for Exam 2 | CSCE 313, Exams of Computer Science

Material Type: Exam; Class: EMBEDDED SYSTEMS; Subject: Computer Science & Engineering; University: University of South Carolina - Columbia; Term: Spring 2005;

Typology: Exams

Pre 2010

Uploaded on 09/17/2009

koofers-user-ih7
koofers-user-ih7 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCE 313 โ€“ Spring 2005 โ€“ Practice Exam: Dr. James P. Davis Page 1 of 2
CSCE 313 โ€“ Spring 2005 _______________________
Practice Exam: Name
Problem 1: Instruction Execution: We have the following instruction sequences, and the contents of memory
and registers as indicated in each part of the problem. Indicate the results of executing the given instruction
sequences in the space provides for each sequence, in terms of the memory locations and/or register values.
1a: If register D3 contains $100030FF and D4 contains $8E552900, what will these registers contain after the
given instruction executes? MOVE.W D3, D4
D3 = __________________________ D4 = __________________________
1b: If register A0 contains $00007F02 and D7 contains $F3052BC9 what will these registers contain after the
given instruction executes? MOVE.B -(A0), D7 Memory locations contain data: $7F00 = $09, $7F01 =
$45, $7F02 = $3C, $7F03 = $6C.
A0 = __________________________ D7 = __________________________
1c: We have the two instruction sequences. Indicate the results of these instruction executions in terms of the
values in the register D0 and bits of the CCR. Assume initially that D0 = $00000000.
MOVE.B #6, D0
SUBI.B #1, D0
D0 = __________________________
C = __, V = __, Z = __, N = __, X = __.
MOVE.B #6, D0
SUBI.B #9, D0
D0 = __________________________
C = __, V = __, Z = __, N = __, X = __.
Problem 2: We have the following 68000-program subroutine fragment, and the initialized data in memory as
shown. Answer the questions, below, for the program. (Note: the โ€˜ โ€˜ characters are delimiters of the DC.B
storage declarations in the data area, and not part of the strings themselves.)
(1) What does this program do? _____________________________________________________________.
(2) How many times will the program loop through the instruction sequence labeled with the symbol
CHECKCHAR before the loop terminates? ___________.
(3) What will be the hexadecimal values in the registers listed below when we hit WISM68 breakpoints at either
location where we have the RTS instructions (return from subroutine)?
A0 = _$_________________________ A1 = _$_________________________
pf2

Partial preview of the text

Download Embedded System - Practice Problems for Exam 2 | CSCE 313 and more Exams Computer Science in PDF only on Docsity!

CSCE 313 โ€“ Spring 2005 โ€“ Practice Exam: Dr. James P. Davis Page 1 of 2

CSCE 313 โ€“ Spring 2005 _______________________

Practice Exam: Name

Problem 1: Instruction Execution : We have the following instruction sequences, and the contents of memory and registers as indicated in each part of the problem. Indicate the results of executing the given instruction sequences in the space provides for each sequence, in terms of the memory locations and/or register values.

1a: If register D3 contains $100030FF and D4 contains $8E552900, what will these registers contain after the given instruction executes? MOVE.W D3, D

D3 = __________________________ D4 = __________________________

1b: If register A0 contains $00007F02 and D7 contains $F3052BC9 what will these registers contain after the given instruction executes? MOVE.B -(A0), D7 Memory locations contain data: $7F00 = $09, $7F01 = $45, $7F02 = $3C, $7F03 = $6C.

A0 = __________________________ D7 = __________________________

1c: We have the two instruction sequences. Indicate the results of these instruction executions in terms of the values in the register D0 and bits of the CCR. Assume initially that D0 = $00000000.

MOVE.B #6, D SUBI.B #1, D

D0 = __________________________

C = __, V = __, Z = __, N = __, X = __.

MOVE.B #6, D

SUBI.B #9, D

D0 = __________________________

C = __, V = __, Z = __, N = __, X = __.

Problem 2: We have the following 68000-program subroutine fragment, and the initialized data in memory as shown. Answer the questions, below, for the program. (Note: the โ€˜ โ€˜ characters are delimiters of the DC.B storage declarations in the data area, and not part of the strings themselves.)

(1) What does this program do? _____________________________________________________________.

(2) How many times will the program loop through the instruction sequence labeled with the symbol CHECKCHAR before the loop terminates? ___________.

(3) What will be the hexadecimal values in the registers listed below when we hit WISM68 breakpoints at either location where we have the RTS instructions (return from subroutine)?

A0 = _$_________________________ A1 = _$_________________________

CSCE 313 โ€“ Spring 2005 โ€“ Practice Exam: Dr. James P. Davis Page 2 of 2

Problem 3: Instruction Decoding : We have the following instructions. Decode and โ€œassembleโ€ them into their corresponding machine code word sequences by indicating the bit patterns, and load them into their appropriate sequence. Use the attached Instruction tables at the back of the exam for reference.

ORG $

MOVEA.L $8000, A

MOVEA.L $800C, A

CMPM.B (A0)+, (A1)+

BNE.S $

15 0

NOTE: When using WISM68K, the ordering of the memory bytes in the display window is OPPOSITE of the way it is actually defined in the 68000 architecture. The memory display window in WISM naturally displays information in left-to-right fashion, which is how we read it in English. However, the way the bits are ordered is from right-to-left (i.e. LSB to MSB).

Here, the bits are ordered right-to-left. Just keep that in mind as you write in the values, since you will have seen them in the reverse order in the WISM display window.