{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Homework 4

# Homework 4 - B Given the following variable declarations in...

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

ELEC 2220 Homework #4 Due Wednesday, June 2 A. In testing the relationship M < N, the CPU would compute M – N and test the condition flags. (1) Determine the values of the four condition codes (N,C,V,Z), and (2) from the condition codes, determine which block of code would be executed in each of the following cases. Explain your result. N = 11001100 M = 10001000 Case 1: Assuming N and M are signed 8-bit numbers. if (M < N) { Block1 } else { Block2 } Case 2: Same as Case 1, but assuming that N and M are unsigned 8-bit numbers. Case 3: Assuming N and M are signed 8-bit numbers. if (M >=N) { Block1 } else { Block2 } Case 4: Same as Case 2, but assuming that N and M are unsigned 8-bit numbers.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: B. Given the following variable declarations in C, write Code Warrior assembler directives to allocate storage and, where indicated, define initial values. The assembler directives are described in the text in Chapter 5, pages 82-87. Formats for constants are described on pages 72-74. For this exercise, assume that “integers” are 16-bit signed numbers. int c; int d, e, f; char g, h, i; int j[10]; char k[200]; unsigned int m; char n = ‘A’; int p = 1000; int q = -1000; char r = 0x20; char s = “Character String”; int t = {5,6,7,8};...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online