Task 1

Development of Some Simple Assembly Language Programs

The task is to develop a program to add all the odd numbers from 1 to 10.

  1+3+5+7+9= ?

        

     The result is 19H  0R  25.

Questions 1:

Where is the final result kept? 

The final result is kept in Accumulator.

Question 2:

Apart from register R0, could we use any other register? Name them.

Yes.

 Any other registers could be used such as R1, R2, R3, R4, R5, R6 and R7.

Question 3:

Modify the above program to sum all even numbers from 0 to 10 (inclusive).

2+4+6+8+10=?

        

The result is 1EH  0R  30.

Question 4:

Modify the above program (Question 3) to determine the average of the numbers.

(2+4+6+8+10)/5=?

The result is 06H  OR 6.

Revisions & Tutorial Questions

1.What is the highest 8-bit number in decimal and Hexadecimal?

    Decimal : 255                  Hexadecimal:  FF        

2. What is the highest 16-bit number in decimal and Hexadecimal?

     Decimal : 65535                  Hexadecimal:  FFFF

3. If you add two 8-bit numbers, how many bits would the sum if both numbers are

    set at their maximum values?

    9 bits

4. How many bits are required to represent the result of multiplying two 8-bit

     numbers?

Multiplying 2,n bit numbers produce 2n bit result so multiplying 2,8 bits number gives the

        result:16 bits        

5. Convert each of the following hexadecimal numbers to decimal and binary equivalent.

Hexadecimal                 Decimal                      Binary

∙  2FDH                                765                      1011111101        

∙  77H                                   119                      1110111

Join now!

∙  1ECH                                492                      111101100

∙  FA98                             64152                      1111101010011000

6. Convert the decimal number 1625 to: Hexadecimal, Octal and Binary.

              Hexadecimal          Octal                      Binary

      ...

This is a preview of the whole essay