Starting from:
$24.99

$18.99

Conditionals, Booleans, Loops Solution

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. 

 

 

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.

 

 

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

 

A.    if ( (cx = bx) OR (cx !=  val1) )

                                    Apple = 10;

                              Else

                                    Apple = 20;

 

 

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

Pear = 0;

                              Else

                                    Pear = 1;

More products