Conditionals, Booleans, Loops Solution

$30.00

Category:

Description

  1. Draft a program that scans an array testing each index for a positive value. If a positive value is found  the program should print “found” and the value.  If no positive value is found the program should print “not found.”

Use:

 

.data

myArray1 SWORD -12,4,1,23,-21,45,12,-2

sentinel SWORD 0

 

Next, change the array so that all values are negative and show the run.

 

 

  1. In the following instruction sequence, show the changed value of AL where indicated, in hexadecimal. Answers without work shown, will not receive credit.

 

mov al, C2h          :

not al                      ; a.

 

mov al, D3h

and al, 21h            ; b.

 

mov al, F3h

or al,  7Dh             ; c.

 

mov al, 2Dh

xor al, E5h            ; d.

 

 

  1. Implement the following pseudo-code in assembly language (assume unsigned numbers). Declare Apple and Pear as byte sized variables.

 

  1. if ( (cx >= bx) OR (cx != val1) )

Apple = 10;

Else

Apple = 20;

 

 

  1. if ( (bx <= dx)  OR  (dx = val1) )

Pear = 0;

Else

Pear = 1;


error: Content is protected !!