COAL. Fall 2024, Section A, B Problem Set 2 Instructions
COAL. Fall 2024, Section A, B Problem Set 2 Instructions
Problem Set 2
____________________________________________________________________________________________________________
Instructions:
This problem set contains 13 questions. Some of these questions are for your practice and some are to be submitted as an assignment.
The list of the questions that are to be submitted as assignment is as follow.
____________________________________________________________________________________________________________
Physical Address:
CS= 0AFFh
DS= FFFFh
ES= F001h
SS=01BBh
4. What is the highest and the lowest possible signed number that can be stored in 8 bits
5. What is the highest and lowest unsigned number that can be stored in 8 bits
6. What is the highest and the lowest possible signed number that can be stored in 16 bits
7. What is the highest and lowest unsigned number that can be stored in 16 bits
8. Write a program to find square of ‘num’ and saves it in ‘square’. You will find the square of num by adding it num times. The
addition should be performed in a loop.
The basic structure of code is given write you code where specified
[org 0x0100]
int 21h
num: dw 16
square: dw 0
9. Write a program in assembly to find the square of each number in array1 and store it in array 2, using loops. The size of array 1
and array 2 is 10. Note that array 1 is unsigned array and you can only use addition to find the square (use of multiplication
instruction is not allowed).
The basic structure of code is given write you code where specified
[org 0x0100]
Array1: dw 3,5,7,4,9,2,1,0,12,16
Array 2: dw 0,0,0,0,0,0,0,0,0,0
10. Write a program in assembly to find the maximum number from a signed array, array 1. Write that number in max. The basic
structure of code is given write you code where specified.
[org 0x0100]
Array1: dw 3,-5,7,4,-9,2,1,0,12,-16
Max: dw 0
11. How will you modify above code if the array was unsigned?
12. How will you modify the following code using unconditional jump such that it works properly?
num1: dw 1,
num2: db 10
sum: dw 0
[org 0x0100]
mov ax, [num1]
mov bl, [num2]
add ax, bx
mov [sum], ax