### Document

```Assembly Language
Conditional Processing
Exercise 1







Write a program to check and show the
values of the Carry, Zero, and Sign flags
where indicated:
mov al, 00001111b
test al, 2 ; a. CF = ZF =
mov al, 6
cmp al, 5 ; b. CF = ZF =
mov al, 5
cmp al, 7 ; c. CF = ZF =
SF=
SF=
SF=
Exercise 2








Implement the following C code in
assembly language, and show the
result.
int array[] = {10,60,20,33,72,89,45,72,18};
int sample = 50;
int ArraySize = sizeof array /sizeof sample;
int index = 0;
int sum = 0;
while( index < ArraySize )
{





}
if (array[index] <= sample )
{
sum += array[index];
index++;
}



Due date: 95/11/3, 8:00 AM
ftp://[email protected]
a09xxxxx_951102.zip

Example: Encrypt.asm
Exercise 3

Boolean Calculator






Create a program that functions as a
simple boolean calculator for 32-bit
integers. It should display a menu that
asks the user to make a selection from
the following list:
1. x AND y
2. x OR y
3. NOT x
4. x XOR y
5. Exit program



Implement the following procedures:
AND_op: Prompt the user for two
together and display the result in
OR_op: Prompt the user for two
together and display the result in



NOT_op: Prompt the user for a
and display the result in hexadecimal.
XOR_op: Prompt the user for two
them together and display the result in
Example: ch06_08.exe
Exercise 4


Implement the following FSM that
recognizes strings beginning with 'x',
followed by letters 'a'..'y', ending with 'z':
Example: Finite.asm
'a'..'y'
start
A
'x'
C
B
'z
'



Due date: 95/11/10, 8:00 AM
ftp://[email protected]