SlideShare a Scribd company logo
1 of 7
Download to read offline
Green University of Bangladesh
Department of Computer Science and Engineering (CSE)
Faculty of Sciences and Engineering
Semester: (Spring, Year: 2021), B.Sc. in CSE (Day)
LAB REPORT NO #02
Course Title: Microprocessor and microcontroller Lab
Course Code: CSE - 304 Section: 192DD
Lab Experiment Name: Write program to find factor and check even and odd by
user input.
Student Details
Name ID
1. Shakh Farid 192002038
Lab Date : 13. 07. 2021
Submission Date : 26. 07. 2021
Course Teacher’s Name : Md. Parvez Hossian
[For Teachers use only: Don’t Write Anything inside this box]
Lab Report Status
Marks: ………………………………… Signature:.....................
Comments:.............................................. Date:..............................
1. TITLE OF THE LAB EXPERIMENT
Write program to find factor and check even and odd by user input.
2. OBJECTIVES/AIM
To learn how to write program for factor and check even and odd by user input.
3. PROCEDURE / ANALYSIS / DESIGN
Even and Odd Number: If a number is exactly divisible by 2 then its an even
number else it is an odd number. In this article we have shared two ways(Two C
programs) to check whether the input number is even or odd. 1) Using Modulus
operator(%) 2) Using Bitwise operator.
Factors: A number which divides completely the number “N” is called the factor of
the number “N”. For example:- the numbers 1, 2, 3, 4, 6 and 12 are complete divides
the number 12 so they are called the factor of 12. Completly divisible means when
we divide the number then it gives result zero.
To find the factor of a positive number “N” divide that number using natural
numbers 1 to “N”. If the number is divisible by the natural number then that
natural number is the factor. A number N can have factors only in between 1 to N.
Steps to find the factors of a number:-
1) Take a number N as input
2) Take an iterator variable and initialize it with 1
3) Dividing the number N with an iterator variable
4) If it is divisible then it is a factor of the given number N
5) Increase the iterator variable
6) Repeat the 4 and 5 steps until the iterator variable becomes equal to N.
4. IMPLEMENTATION
Check Even or Odd:
; You may customize this and other start-up templates;
; The location of this template is c:emu8086inc0_com_template.txt
org 100h
.data
str db 'Enter a Number:$'
a db 'EVEN$'
b db 'ODD$'
n_line db 0ah, 0dh,'$'
.code
mov ax, @data
mov ds, ax
mov ax, 0
lea dx, str
mov ah, 09h
int 21h
mov ah, 01h
int 21h
mov bl, 2
div bl
lea dx, n_line
mov ah, 09h
int 21h
cmp ah, 0
je even
odd:
lea dx, b
mov ah, 09h
int 21h
jmp Exit
even:
lea dx, a
mov ah, 09h
int 21h
Exit:
ret
Find Factor:
; You may customize this and other start-up templates;
; The location of this template is c:emu8086inc0_com_template.txt
org 100h
.data
input db 'Enter a Number:$'
num db ?
n_line db 0ah, 0dh,'$'
.code
main proc
mov ax, @data
mov ds, ax
lea dx, input
mov ah, 09h
int 21h
mov ah, 01h
int 21h
sub al, 48
mov num, al
lea dx, n_line
mov ah, 09h
int 21h
mov cl, num
mov bl, 0
Factor:
mov ax, 0
inc bl
mov al, num
div bl
cmp ah, 0
je print
Exit:
jmp close
print:
mov dl, bl
add dl, 48
mov ah, 02h
int 21h
close:
loop Factor
end proc
ret
5. TEST RESULT / OUTPUT
6. ANALYSIS AND DISCUSSION
1. This experiment, I was learn about factor number and how to check even or
odd number.
2. I was implement two program one is find factor and another one is check even
or odd numbers. To implement those programs I use emu8086 IDE.
3. When I implement those program, I was faced some problem. When I used
loop, I couldn’t apply.
4. This experiment I also learn about JMP command and CMP command. I used
those two command in my program.
7. SUMMARY:
In this experiment, I learn about factor and even or odd number, and how to
implement program in assembly language.

More Related Content

What's hot

Seminar 2 coding_principles
Seminar 2 coding_principlesSeminar 2 coding_principles
Seminar 2 coding_principlesmoduledesign
 
ODS Data Sleuth: Tracking Down Calculated Fields in Banner
ODS Data Sleuth: Tracking Down Calculated Fields in BannerODS Data Sleuth: Tracking Down Calculated Fields in Banner
ODS Data Sleuth: Tracking Down Calculated Fields in BannerBryan L. Mack
 
More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)Nicole Ynne Estabillo
 
Taller número 1 de informática ll
Taller número 1 de informática llTaller número 1 de informática ll
Taller número 1 de informática llramivides
 
Playing Games
Playing GamesPlaying Games
Playing Gamesaneff3
 
C programming session 03
C programming session 03C programming session 03
C programming session 03Dushmanta Nath
 
Abir ppt3
Abir ppt3Abir ppt3
Abir ppt3abir96
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentalsZaibi Gondal
 
Machine Learning Application: Credit Scoring
Machine Learning Application: Credit ScoringMachine Learning Application: Credit Scoring
Machine Learning Application: Credit Scoringeurosigdoc acm
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowchartskhair20
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1Zaibi Gondal
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structuresMicheal Ogundero
 
Cognos Macros: Situational Examples & Syntax
Cognos Macros: Situational Examples & SyntaxCognos Macros: Situational Examples & Syntax
Cognos Macros: Situational Examples & SyntaxBryan L. Mack
 

What's hot (20)

Seminar 2 coding_principles
Seminar 2 coding_principlesSeminar 2 coding_principles
Seminar 2 coding_principles
 
ODS Data Sleuth: Tracking Down Calculated Fields in Banner
ODS Data Sleuth: Tracking Down Calculated Fields in BannerODS Data Sleuth: Tracking Down Calculated Fields in Banner
ODS Data Sleuth: Tracking Down Calculated Fields in Banner
 
Cognos Macros
Cognos MacrosCognos Macros
Cognos Macros
 
More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)
 
Taller número 1 de informática ll
Taller número 1 de informática llTaller número 1 de informática ll
Taller número 1 de informática ll
 
Playing Games
Playing GamesPlaying Games
Playing Games
 
C programming session 03
C programming session 03C programming session 03
C programming session 03
 
Abir ppt3
Abir ppt3Abir ppt3
Abir ppt3
 
Python programs
Python programsPython programs
Python programs
 
Structures
StructuresStructures
Structures
 
Arrays
ArraysArrays
Arrays
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
 
selection structures
selection structuresselection structures
selection structures
 
Machine Learning Application: Credit Scoring
Machine Learning Application: Credit ScoringMachine Learning Application: Credit Scoring
Machine Learning Application: Credit Scoring
 
4. algorithm
4. algorithm4. algorithm
4. algorithm
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1
 
Assignment problem
Assignment problemAssignment problem
Assignment problem
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
 
Cognos Macros: Situational Examples & Syntax
Cognos Macros: Situational Examples & SyntaxCognos Macros: Situational Examples & Syntax
Cognos Macros: Situational Examples & Syntax
 

Similar to @elemorfaruk

Basic Deep Learning.pptx
Basic Deep Learning.pptxBasic Deep Learning.pptx
Basic Deep Learning.pptxmabog44
 
Data simulation basics
Data simulation basicsData simulation basics
Data simulation basicsDorothy Bishop
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxgerardkortney
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptSourabhPal46
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptMard Geer
 
Sample prac exam2013
Sample prac exam2013Sample prac exam2013
Sample prac exam2013hccit
 
C and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdfC and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdfjanakim15
 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docxmercysuttle
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlpankit_ppt
 
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docxDIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docxlynettearnold46882
 
Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22manyaarora19
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questionsDr P Deepak
 
Backtracking based integer factorisation, primality testing and square root c...
Backtracking based integer factorisation, primality testing and square root c...Backtracking based integer factorisation, primality testing and square root c...
Backtracking based integer factorisation, primality testing and square root c...csandit
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solutionKuntal Bhowmick
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questionsSunil0108
 
Tasks In this assignment you are required to design and imp.pdf
Tasks In this assignment you are required to design and imp.pdfTasks In this assignment you are required to design and imp.pdf
Tasks In this assignment you are required to design and imp.pdfacsmadurai
 

Similar to @elemorfaruk (20)

Basic Deep Learning.pptx
Basic Deep Learning.pptxBasic Deep Learning.pptx
Basic Deep Learning.pptx
 
Data simulation basics
Data simulation basicsData simulation basics
Data simulation basics
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docx
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
Sample prac exam2013
Sample prac exam2013Sample prac exam2013
Sample prac exam2013
 
C code examples
C code examplesC code examples
C code examples
 
C and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdfC and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdf
 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx
 
newsql
newsqlnewsql
newsql
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlp
 
Repaso NUMEROS.pptx
Repaso NUMEROS.pptxRepaso NUMEROS.pptx
Repaso NUMEROS.pptx
 
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docxDIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
DIRECTIONS READ THE FOLLOWING STUDENT POST AND RESPOND EVALUATE I.docx
 
Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
 
Backtracking based integer factorisation, primality testing and square root c...
Backtracking based integer factorisation, primality testing and square root c...Backtracking based integer factorisation, primality testing and square root c...
Backtracking based integer factorisation, primality testing and square root c...
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solution
 
Lecture 7.pptx
Lecture 7.pptxLecture 7.pptx
Lecture 7.pptx
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
 
Tasks In this assignment you are required to design and imp.pdf
Tasks In this assignment you are required to design and imp.pdfTasks In this assignment you are required to design and imp.pdf
Tasks In this assignment you are required to design and imp.pdf
 

Recently uploaded

Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Recently uploaded (20)

Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

@elemorfaruk

  • 1. Green University of Bangladesh Department of Computer Science and Engineering (CSE) Faculty of Sciences and Engineering Semester: (Spring, Year: 2021), B.Sc. in CSE (Day) LAB REPORT NO #02 Course Title: Microprocessor and microcontroller Lab Course Code: CSE - 304 Section: 192DD Lab Experiment Name: Write program to find factor and check even and odd by user input. Student Details Name ID 1. Shakh Farid 192002038 Lab Date : 13. 07. 2021 Submission Date : 26. 07. 2021 Course Teacher’s Name : Md. Parvez Hossian [For Teachers use only: Don’t Write Anything inside this box] Lab Report Status Marks: ………………………………… Signature:..................... Comments:.............................................. Date:..............................
  • 2. 1. TITLE OF THE LAB EXPERIMENT Write program to find factor and check even and odd by user input. 2. OBJECTIVES/AIM To learn how to write program for factor and check even and odd by user input. 3. PROCEDURE / ANALYSIS / DESIGN Even and Odd Number: If a number is exactly divisible by 2 then its an even number else it is an odd number. In this article we have shared two ways(Two C programs) to check whether the input number is even or odd. 1) Using Modulus operator(%) 2) Using Bitwise operator. Factors: A number which divides completely the number “N” is called the factor of the number “N”. For example:- the numbers 1, 2, 3, 4, 6 and 12 are complete divides the number 12 so they are called the factor of 12. Completly divisible means when we divide the number then it gives result zero. To find the factor of a positive number “N” divide that number using natural numbers 1 to “N”. If the number is divisible by the natural number then that natural number is the factor. A number N can have factors only in between 1 to N.
  • 3. Steps to find the factors of a number:- 1) Take a number N as input 2) Take an iterator variable and initialize it with 1 3) Dividing the number N with an iterator variable 4) If it is divisible then it is a factor of the given number N 5) Increase the iterator variable 6) Repeat the 4 and 5 steps until the iterator variable becomes equal to N. 4. IMPLEMENTATION Check Even or Odd: ; You may customize this and other start-up templates; ; The location of this template is c:emu8086inc0_com_template.txt org 100h .data str db 'Enter a Number:$' a db 'EVEN$' b db 'ODD$' n_line db 0ah, 0dh,'$' .code mov ax, @data mov ds, ax mov ax, 0 lea dx, str mov ah, 09h int 21h mov ah, 01h int 21h mov bl, 2 div bl lea dx, n_line mov ah, 09h
  • 4. int 21h cmp ah, 0 je even odd: lea dx, b mov ah, 09h int 21h jmp Exit even: lea dx, a mov ah, 09h int 21h Exit: ret Find Factor: ; You may customize this and other start-up templates; ; The location of this template is c:emu8086inc0_com_template.txt org 100h .data input db 'Enter a Number:$' num db ? n_line db 0ah, 0dh,'$' .code main proc
  • 5. mov ax, @data mov ds, ax lea dx, input mov ah, 09h int 21h mov ah, 01h int 21h sub al, 48 mov num, al lea dx, n_line mov ah, 09h int 21h mov cl, num mov bl, 0 Factor: mov ax, 0 inc bl mov al, num div bl cmp ah, 0 je print Exit: jmp close print: mov dl, bl add dl, 48 mov ah, 02h int 21h
  • 6. close: loop Factor end proc ret 5. TEST RESULT / OUTPUT
  • 7. 6. ANALYSIS AND DISCUSSION 1. This experiment, I was learn about factor number and how to check even or odd number. 2. I was implement two program one is find factor and another one is check even or odd numbers. To implement those programs I use emu8086 IDE. 3. When I implement those program, I was faced some problem. When I used loop, I couldn’t apply. 4. This experiment I also learn about JMP command and CMP command. I used those two command in my program. 7. SUMMARY: In this experiment, I learn about factor and even or odd number, and how to implement program in assembly language.