Project
By Notes Vandar
8.1 The student should develop a simple application using 8086 Assembly Language Program.
To develop a simple application using 8086 Assembly Language, we can create a program that performs basic operations such as adding two numbers. This example will illustrate the use of registers, memory, and the basics of assembly language structure in the 8086 architecture.
Example: Adding Two Numbers
The following program will add two numbers and display the result. We will assume you are using an assembler like MASM (Microsoft Macro Assembler) or TASM (Turbo Assembler) to compile the code.
Code
; Simple 8086 Assembly Program to Add Two Numbers
.MODEL SMALL
.STACK 100h
.DATA
num1 DB 5 ; First number
num2 DB 10 ; Second number
result DB 0 ; To store the result
.CODE
main PROC
; Load the first number into AL register
MOV AL, num1
; Add the second number to AL
ADD AL, num2
; Store the result in the result variable
MOV result, AL
; Display the result
; Convert the result to a string and display it (DOS interrupt)
; First, convert the number to ASCII
ADD AL, ‘0’ ; Convert to ASCII
; Print the character
MOV DL, AL ; Move the character to DL
MOV AH, 02h ; DOS function to print character
INT 21h ; Call DOS interrupt
; Exit the program
MOV AX, 4C00h ; DOS function to exit
INT 21h ; Call DOS interrupt
main ENDP
END main
Explanation of the Code
- .MODEL SMALL: This directive specifies the memory model to be used. The SMALL model allows for a single code and data segment.
- .STACK 100h: This allocates 256 bytes of stack space.
- .DATA: This section declares and initializes data variables:
num1
: The first number to be added (5).num2
: The second number to be added (10).result
: A variable to store the result of the addition.
- .CODE: This section contains the executable code.
- main PROC: Defines the start of the main procedure.
- MOV AL, num1: Loads the value of
num1
into the AL register. - ADD AL, num2: Adds the value of
num2
to the value in AL. - MOV result, AL: Moves the result of the addition from AL into the
result
variable. - ADD AL, ‘0’: Converts the binary result to its ASCII representation for display.
- MOV DL, AL: Moves the ASCII character into the DL register.
- MOV AH, 02h: Prepares to call the DOS interrupt to print a character.
- INT 21h: Calls the DOS interrupt to display the character stored in DL.
- MOV AX, 4C00h: Prepares to exit the program.
- INT 21h: Calls the DOS interrupt to terminate the program.
Assembling and Running the Program
To run this program, follow these steps:
- Save the code in a file with a
.ASM
extension (e.g.,add_numbers.asm
). - Open the command prompt in the directory where the file is saved.
- Assemble the program using an assembler (e.g., MASM or TASM):
- For MASM:
masm add_numbers.asm
- For TASM:
tasm add_numbers.asm
- For MASM:
- Link the object file to create an executable:
- For MASM:
link add_numbers.obj
- For TASM:
tlink add_numbers.obj
- For MASM:
- Run the executable:
- Type the name of the executable (e.g.,
add_numbers.exe
).
- Type the name of the executable (e.g.,
8.2 The student should develop a project on computer Architecture.
Here’s a detailed outline for your project on computer architecture. This framework includes specific sections and topics that will help you structure your work effectively.
Project Outline: Computer Architecture
1. Title Page
- Title of the Project
- Your Name
- Institution Name
- Date of Submission
2. Abstract
- A brief summary of the project, including the objectives, methodology, and key findings.
3. Introduction
- Define computer architecture and its significance.
- Discuss the evolution of computer architecture.
- State the main goals and objectives of the project.
4. Background and Literature Review
- Historical overview of computer architecture.
- Key concepts and principles:
- von Neumann vs. Harvard architecture
- RISC (Reduced Instruction Set Computing) vs. CISC (Complex Instruction Set Computing)
- The role of ALU, control unit, and registers
- Recent advancements and trends in computer architecture.
5. Methodology
- Describe the approach taken for the project:
- Research: Analysis of existing architectures.
- Design: Diagrams and block representations.
- Implementation: Any simulations or coding performed.
6. Core Topics
- 6.1 CPU Structure and Function
- Components of a CPU and their functions.
- The role of the ALU, registers, and control units.
- 6.2 Memory Hierarchy
- Discuss the different types of memory (RAM, ROM, cache).
- Explain the importance of memory hierarchy in performance.
- 6.3 Input/Output Organization
- Overview of I/O devices and their interfaces.
- Discuss programmed I/O, interrupt-driven I/O, and DMA (Direct Memory Access).
- 6.4 Instruction Formats and Addressing Modes
- Describe different instruction formats.
- Discuss various addressing modes (immediate, direct, indirect, indexed).
- 6.5 Pipelining and Parallelism
- Explain the concept of instruction pipelining.
- Discuss its impact on CPU performance.
7. Case Study
- Case Study of a Specific Architecture (e.g., ARM, x86)
- Discuss the architecture’s design, advantages, and applications.
- Compare it with another architecture.
8. Practical Implementation
- Implementation of a Simple CPU or Processor Model
- Use tools like Logisim to design and simulate a basic CPU.
- Include components like ALU, registers, and instruction set.
- Code Example: (Optional)
- Provide a simple assembly language program that demonstrates key architecture principles.
9. Results and Discussion
- Analyze the results from the simulation or any practical implementation.
- Discuss performance metrics and any observed efficiencies.
10. Conclusion
- Summarize the main findings of the project.
- Discuss future trends in computer architecture and potential areas for further research.
11. References
- List all books, articles, and online resources used in your research.
Tools and Resources
- Simulation Software: Use tools like Logisim or CircuitVerse for designing circuit diagrams and CPU simulations.
- Programming Languages: C/C++ or Assembly for implementing programs.
- Documentation: Microsoft Word or LaTeX for writing the report.
Suggested Topics to Explore
- Design and Implementation of a RISC Processor: Detail the design principles and instruction set.
- Analysis of Cache Memory Designs: Discuss how different caching strategies impact performance.
- Development of a Simple Assembly Language Program: Write a program that runs on a simulated architecture.
- Exploration of Parallel Processing Architectures: Analyze multicore and many-core designs.
Tips for Success
- Start early to allow ample time for research, design, and implementation.
- Document your progress regularly.
- Seek feedback from peers or instructors throughout the project.