Docsity

5 Problems Midterm Exam 1 - Artificial Intelligence | ECE 447, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 447
Midterm exam 1
October 26, 2000
INSTRUCTIONS: Please solve selected 4 out of 5 problems. Clearly cross
out the problem you do not want to be graded. Failure to do that will result
in grading first four problems.
HONOR CODE PLEDGE: “On my honor I have neither given nor received
aid on this exam”
Your first and last name (printed): …………………….
Your signature …………………….
Failure to sign the pledge may result in receiving no credit for the exam.
pf3
pf4

Partial preview of the text

Download 5 Problems Midterm Exam 1 - Artificial Intelligence | ECE 447 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

ECE 447

Midterm exam 1

October 26, 2000

INSTRUCTIONS: Please solve selected 4 out of 5 problems. Clearly cross

out the problem you do not want to be graded. Failure to do that will result

in grading first four problems.

HONOR CODE PLEDGE: “On my honor I have neither given nor received

aid on this exam”

Your first and last name (printed): …………………….

Your signature …………………….

Failure to sign the pledge may result in receiving no credit for the exam.

Problems

Problem 1 (4 points)

What are the values of the registers A, B, IX, and CC (condition code register), the array BETA, and the variable COUNT after executing the following code written in the assembly language. Please provide relevant intermediate values of registers and variables to qualify for a partial credit in case of a mistake.

SIZE EQU 4

section .data org $C COUNT dc.b 4 BETA dc.b $12, $4F, $ED, $CB

section .text SHIFT: LDAA COUNT

OUTER_LOOP LDAB #SIZE LDX #BETA CLC

INNER_LOOP ROR 0,X INX DECB BNE INNER_LOOP

DECA BNE OUTER_LOOP

LDD BETA ADDD BETA+

RTS END

Problem 5 (4 points) Write a sequence of assembler directives corresponding to the following sequence of declarations and definitions in C. Define sections, and group together variables belonging to the same section.

#define ROW_NR 4 #define COLUMN_NR 5 static int array1[ROW_NR][COLUMN_NR]; unsigned long var1 = -2L; char array2[] = {'\n', '\t', ' '}; char array3[] = "ECE 447"; char *string1 = "Exam 1"; extern long counter;