


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: Lab for Lecture 001; Subject: Electrical & Computer Enginrg; University: George Mason University; Term: Unknown 1989;
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Problem 1 (4 points)
What are the values of the registers A, B, IX, and CC (condition code register), the array GAMMA, and the variable COUNT after executing the following code written in the assembly language. Please provide only relevant intermediate values of registers and variables to qualify for a partial credit in case of a mistake.
SIZE EQU 4
org $D COUNT dc.w 12 GAMMA dc.b $CB, $AF, $FF, $F
section .text SHIFT: LDY COUNT
OUTER_LOOP LDAB #SIZE LDX #GAMMA+ CLC
INNER_LOOP ROL 0,X DEX DECB BNE INNER_LOOP
DEY BNE OUTER_LOOP
LDD GAMMA+ SUBD GAMMA
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 AA 16 #define COLUMN_NR 3 static unsigned int counter1 = 1000; extern long count(int event_nr); static int array1[][COLUMN_NR]={{0x76, 076, 76}, {’a’, 0xAA, AA}} static float *fptr; long long1 = -2; char *string1 = "GMU"; char string2[] = "CpE"; unsigned char blank[] = {’\t’, ’ ’};