hw3_solution - b. LDX $150C Loads index register X with...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE331 SS-08 HOMEWORK #3 Solution 1. For each of the following problems determine the 8-bit result (give answers in hex) and the C, V, Z, N, and H flag values. a. $AF (C=0, V=0, Z=0, N=1, H=1/0) b. $09 (C=1, V=0, Z=0, N=0, H=1) c. $D1 (C=0, V= 0, Z=0, N=1, H=1) d. $08 (C=1, V= 0, Z=0, N=0, H=1/0) Subtraction operation does not affect H flag, hence H=1 or 0 is correct. 2. Write an instruction for each of the following: a. LDAA $6700. b. LDD $4000. 3. For the following instructions, briefly explain what the operation will do. a. LDAB $04C0 – Loads accumulator B with 8-bit value from memory location $04C0. N and Z flags are updated and V flag is cleared.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b. LDX $150C Loads index register X with 16-bit value from memory location $150C. N and Z flags are updated and V flag is cleared. c. STAB $2C5D Stores the contents of accumulator B at memory location $2C5D. N and Z flags are updated and V flag is cleared. d. SUBA $3000 Subtract the 8-bit contents of memory location $3000 from accumulator A. Updates N, Z, V, C flags. 4. Determine the C flag value after the following operations are executed by the CPU. Assume that accumulators A and B contain $57 and $AE respectively. a. C = 1 b. C = 1 c. C = 0 d. C = 1...
View Full Document

Ask a homework question - tutors are online