Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Iwsievietei Dr Fernando Rio. Rive sections as la as you clea hich five should se

ID: 2083105 • Letter: I

Question



Iwsievietei Dr Fernando Rio. Rive sections as la as you clea hich five should sewred. ive sections The use of Textbook, Calculator and instruetion Manual is allowed PART Cho the correct answer for every question. ia register A-SAB & register B %11001101. and you execute the instruction ABA. what's the contents of registers A. B atter the execution a) CD. AB b) AB, CD c) 178.00 d) 17s. CD en 78, CD In the instructi above. what's the value of the Condition Codes (N, Z, V,C) after the execution a) 0,0,1,0 b) 0.1 1,0 e) 0,0,1,1 d) 1,0,0,1 e) 1.1.0.1 iii register A 1100 1101 & ster B 253, and you execute the instruction SBA, what's the contents of A, B after the execution: a) 65, AB b) 22,00 c) 44, CD d) 22, AB e) CD, AB iv) If register A S05 & register B S10, and you compare the accumulators with the instruction CBA, what's the contents of A, B after the comparison: a) 05.10 b) 15, 05 c) F1.00 d) F1, 10 e) 15,00 von In the instruction above, what's the value of the Condition Codes (N, z ch after execution a) 0,0,1 b) 1,0,1 c) 0, 1,1 d) 1.1.1.1 e) 0,0,0 vi). If A-SAB, and you execute a logical shift right instruction (LsRA), what are th ontents of A and carry after the execution.

Explanation / Answer

(i) Instruction ABA means "Add contents in B register to contents in A register".

Given, A=$AB=171 in decimal and B=$CD=205 in decimal

Instruction ABA will cause (A)+(B) and stores the result in A register by default which is accumulator.

Therefore, after execution of instruction ABA, COntents of Register A=171+205=376 in decimal=$178 in hexadecimal... and contents of B are the same as loaded i.e. B=$CD

Option D is correct. A=$178, B=$CD, after execution of the instruction ABA.

(ii) N bit is set if result of operation in negative (MSB = 1)

Z bit is set if result of operation is zero (All bits = 0)

V bit is set if operation produced an overflow

C bit is set if operation produced a carry (borrow on subtraction)

In the above instruction, N is '0' as MSB is not 1, Z is '0' as the result is not zero, V is '1' as there is an overflow '1'78 and C is '1' as there is a carry generated during operation.

Hence, Option C is correct. (N Z V C) = (0 0 1 1)

(viii) Option is 'C' Registers

(ix) Option is 'D' Stack