Coa Report
Coa Report
By
K.J.TILAK REDDY(RA2211026010059)
P.BHARADWAJ(RA2211026010061)
N.UMESH KARTHIK(RA2211026010064)
of
SCHOOL OF COMPUTING
KATTANKULATHUR
NOVEMBER 2023
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
BONAFIDE CERTIFICATE
Certified that this minor project report for the course 21CSS201T– Computer
SIGNATURE SIGNATURE
Finally, we thank our parents and friends near and dear ones who directly and
Course project.
ABSTRACT
6
TABLE OF CONTENTS
NO NO
1 INTRODUCTION 2
1.1 Objective 2
1.2 Introduction 3
3 CONCEPT/WORKING PRINCIPLE 5
4 APPROACH/METHODOLOGY/PROGRAM 6
5 FLOWCHART 9
7 CONCLUSION 11
8 REFERENCES 12
1
1.INTRODUCTION
1.1 Objective
the program takes input for marks, compares it with predefined grade boundaries,
and then prints the corresponding letter grade. Here are some objectives and
potential improvements for the code:
Add comments to explain each section of the code. This will make it more readable
for others (or even yourself in the future) who may need to understand or modify
the code.
Modularization:
Break down the code into smaller, more modular functions or procedures. This can
improve code readability and make it easier to maintain.
Error Handling:
Implement error handling to check if the input marks are within a valid range (0-
100). Provide appropriate messages if the input is invalid.
Input Validation:
Ensure that the user enters a numerical value for the marks. Implement input
validation to handle non-numeric inputs.
Dynamic Grade Boundaries:
Enhance the output messages to be more user-friendly. For example, you can
display a message like "Your grade is: A+" instead of just "A+ (Plus)".
Code Optimization:
Look for opportunities to optimize the code for better performance or reduced size.
However, be cautious not to sacrifice readability for optimization in this case.
Testing:
Develop a set of test cases to ensure that the program works correctly under various
2
scenarios. Test with different input values to cover all possible grade boundaries.
Documentation:
Provide documentation for the program, including instructions on how to use it and
any specific requirements or dependencies.
Portability:
Ensure that the code is portable and can be easily adapted to run on different
assembly environments or emulators.
1.2 Introduction
The program begins with the inclusion of the 'emu8086.inc' file, which likely
contains macros or definitions specific to the emu8086 assembler. The 'org 100h'
directive sets the origin of the program to the address 100h, which is a common
starting point for DOS programs.
The code prompts the user to input a percentage value for marks and then scans
and stores the input using the 'scan_num' subroutine. After that, a series of
conditional comparisons (using the 'cmp' instruction) are made to determine the
letter grade based on the input percentage. Depending on the comparison results,
the program jumps to specific labels corresponding to different grade ranges.
For example, if the input percentage is greater than or equal to 80, the program
jumps to the 'gradeA+' label and prints 'A+ (Plus)'. The same logic is applied to
other grade ranges such as 'gradeA', 'grdA-', 'gradeB+', and so on. The final 'stop'
label is used to terminate the program after printing the determined letter grade.
It's worth noting that the program seems to use a letter grading system commonly
used in academic contexts, ranging from 'A+' to 'F' (Fail). Additionally, the code
includes macro definitions for scanning and printing numbers, although the
actual definitions are not provided in the snippet.
3
2.SOFTWARE and HARDWARE REQUIREMENT
Software Requirements:
Emu8086 Emulator:
You need to have the emu8086 emulator installed on your system. The code is
specifically written for this emulator.
The emulator allows you to run and debug x86 assembly language programs on
a Windows platform.
Text Editor:
You can use any text editor to write the assembly code. Popular choices include
Notepad, Notepad++, or any integrated development environment (IDE) that
supports assembly language.
Hardware Requirements:
Windows Operating System:
Emu8086 is designed for the Windows platform, so you need a computer running
a Windows operating system.
x86-Compatible Processor:
Since the code is written for the x86 architecture, you need a computer with an
x86-compatible processor. This includes most modern CPUs.
Adequate RAM:
Ensure that your system has enough RAM to run the emulator and execute the
assembly code.
Disk Space:
Allocate some disk space for the emu8086 emulator and the assembly code file.
4
3.CONCEPT/WORKING PRINCIPLE
Include emu8086.inc:
This line includes a file emu8086.inc, which likely contains macro definitions
and other necessary settings for the emu8086 assembler.
User Input:
The code prompts the user to input a numeric value for marks percentage.
print "Input Marks % value :"
call scan_num ;
This section uses a function scan_num (presumably defined in emu8086.inc) to
read an integer input from the user and stores it in the cx register.
Stopping Execution:
The code includes a stop label with a ret instruction, which likely serves as a way
to end the program or return control to the calling code.
5
4.APPROACH/METHODOLOGY/PROGRAM
include 'emu8086.inc'
org 100h
printn ''
printn 'Your Letter Grade:'
cmp cx,80
jge gradeA+
cmp cx,75
jge gradeA
cmp cx,70
jge grdA-
cmp cx,65
jge gradeB+
cmp cx,60
jge gradeB
cmp cx,55
jge grdB-
cmp cx,50
jge gradeC+
cmp cx,45
jge gradeC
cmp cx,40
jge gradeD
6
cmp cx,40
jl gradeF
gradeA+:
printn 'A+ (Plus)'
jmp stop
gradeA:
printn 'A (Plain)'
jmp stop
grdA-:
printn 'A- (Minus)'
jmp stop
gradeB+:
printn 'B+ (Plus)'
jmp stop
gradeB:
printn 'B (Plain)'
jmp stop
grdB-:
printn 'B- (Minus)'
jmp stop
gradeC+:
printn 'C+ (Plus)'
jmp stop
gradeC:
printn 'C (Plain)'
jmp stop
7
gradeD:
printn 'D (Plain)'
jmp stop
gradeF:
printn 'F (Fail)'
jmp stop
stop:
ret
define_scan_num
define_print_num
define_print_num_uns
end
8
5.FLOWCHART
9
6. EXPERIMENT RESULTS & ANALYSIS
10
7.CONCLUSION
The assembly code effectively implements a simple grading system that takes a
percentage input and translates it into letter grades ranging from 'A+' to 'F'.
The code structure is clear and organized, with well-defined labels for each grade
category.
It also includes a set of predefined macros for scanning numbers and printing
messages. The code concludes by printing the calculated letter grade.
11
8.REFERENCES
emu8086 Documentation:
Check the documentation for the specific features and functions
provided by the emu8086 emulator. It usually includes information
on its directives and macros.
Intel Manuals:
Intel provides manuals for their processors, including detailed
information on the instruction set. You can find these on the Intel
website.
12