CSE 111, Fall 2000

HW #12 ANSWERS

  1. Biermann, p. 268, #1:

  2.  

     

    a)
    AX CF M1 O/P
    -7      
        -7  
    0      
      NB    
          0

    b)
    AX CF M1 O/P
    0      
        0  
    0      
      NB    
          0

    c)
    AX CF M1 O/P
    7      
        7  
    0      
      B    
    7      
    1      
          1

    General description: if I/P <= 0
                                        then O/P = 0
                                        else O/P = 1

    (So, if I/P = -254, then O/P = 0,
        & if I/P = 32, then O/P = 1;
        try it!)
     



     
  3. Note: There are many other possible solutions!

  4. instruction        comment
    =========        =======
    IN         AX        I/P first integer
    COPY    A, AX     store it in A
    IN         AX         I/P 2nd integer
    COPY     B, AX     store it in B
    IN         AX         I/P 3rd integer
    MUL      AX, B      multiply 3rd & 2nd integers
    MUL      AX, A      multiply product of 3rd & 2nd
                               by the 1st integer
    OUT      AX          O/P the result


Copyright © 2000 by William J. Rapaport (rapaport@cse.buffalo.edu)

file: 111F00/hw12.answers.html.04dc00.html