TD - Assembly
TD - Assembly
Science
Sousse Year: 2024-2025
Number of pages: 2
Problem 1:
a. What are the sizes of data bus and address bus of the microprocessor 8086? Calculate the
addressable space size as well as the processing capacity of the 8086 microprocessor.
b. The system in the following figure uses 256k of memory distributed over 4 identical circuits.
a y0
b y1
c y2
d y3
y15
Decoder
4/16
• What should be the size of each RAM. Find the address bus size of each.
• Fill in the information that is missing in the figure.
• Determine the address mapping of this system.
c. Assume that the CS register contains 1000H, the DS register contains 3000H, and the IP register
contains F3H. Find:
• The physical addresses of the Code Segment and that of the Data Segment. Based on this
information, determine in which RAM each segment is located at.
• The physical address of the currently executed instruction.
• The physical address of the data with an offset (or displacement) 30.
Problem 2:
Consider the following 8086 assembly program:
.DATA
S DB 0
N DW 4
.CODE
start: MOV AX,0 ;Instruction 1
MOV CX,N ;Instruction 2
next: ADD AX,CX ;Instruction 3
LOOP next ;Instruction 4
MOV S,AL ;Instruction 5
Page 1/2
a. Determine the contents of AX, CX, S, and N during the execution of this program by completing
the following table:
Instruction AX CX S N
1
2
….
b. Based on the final result, what is the function performed by this program.
c. Can we change instruction 5 to MOV S,AX? Justify your answer.
Problem 3:
Write 8086 assembly programs to do the following calculations:
a. Calculate the sum S of 2 numbers N1=0x25 and N2=0xA3 (S, N1, and N2 must be stored in memory).
b. Calculate the sum S of 2 numbers N1=0x2A37 and N2=0x24 (S, N1, and N2 must be stored in
memory).
c. Calculate the sum S and the carry C of 3 numbers N1=0xA03C, N2=0xC421, and N3=0x67 (S, C, N1,
N2, and N3 must be stored in memory).
d. Calculate the sum S of the numbers 1 to N=100 (S and N must be stored in memory).
e. Using a loop, calculate the sum S of the numbers 1, 3, 5, 7, ..., 101.
f. Using a loop, calculate the sum S of the 10 numbers 2, 5, 7, 10, 11, 3, 20, 18, 6, and 9. The numbers
must be stored in memory in the array TAB (use the keyword OFFSET to determine the start
address of the TAB array.
Page 2/2