


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
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 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;