1.Indicate whether the following statements are syntactically correct or incorrect in MASM. If incorrect, indicate what is wrong with the statement: *A. .if (number = 0) add number,2 .endif B. .if...

1.Indicate whether the following statements are syntactically correct or incorrect in MASM. If incorrect, indicate what is wrong with the statement: *A. .if (number = 0) add number,2 .endif B. .if count >= 0 then sub count,2 .else add count,3 .endif *C. .if x-1 dec x .endif D. if01: cmp x,y jle endif01 then01: inc x endif01: nop 2. Using MASM directives, write an assembly language code segment to implement the following: if ( a > b ) a = a - 1; else if ( b >= c ) b = b - 2; else if ( c > d) c = c + d; else d = d / 2; 3. Convert the following C selection structures to the corresponding assembly language code segments. Do not use MASM directives, but rather only compares, jumps, and appropriate labels (hint: Problem B, use De Morgan’s rules): *A. if (w == 1 && x == 2) y-; B. if (!(num > 0 && num count=count-2; *C. if ( ( w == 1 || x == 2 ) && y == 3) z++; D. if (a == 1 || b == 2 && c > 3 || d e--; 4. Given the example of the if-then-else-if structure in Problem 2 above, re-implement it using a nested if-then-if structure: A. Use MASM directives. B. Do not use MASM directives, but rather compares, jumps, and appropriate labels. 5. Implement the following C switch statement, which does not have a default statement, using compares, jumps, and appropriate labels. If number does not contain a 0 through 3, then the value of count should not change: switch number { case 0: case 1: count = count +2; break; case 2: case 3: count = count - 2; } 6. Implement the program in Sect. 4.8 in assembly language without using high-level directives with only compares, jumps, and appropriate labels.
May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here