SlideShare a Scribd company logo
[15B-145-EL] SamiULLAH
.MODEL SMALL
.STACK 100H
.DATA
MAIN_MENU DB ,0DH,0AH,"Calculater",0DH,0AH
DB "Press 'A' For ADDITION",0DH,0AH
DB "Press 'S' For SUBTRACTION",0DH,0AH
DB "Press 'M' For MULTIPLICATION",0DH,0AH
DB "Press 'D' For DIVISION",0DH,0AH
DB "Press 'E' For EXIT",0DH,0AH
DB "Press 'R' For RETURN to Main Menu",0DH,0AH
DB "*******************************",0DH,0AH
DB "*******************************",0DH,0AH
DB "Enter Your CHOICE",0DH,0AH,'$'
NUM1 DB "Enter First Number",0DH,0AH,'$'
NUM2 DB ,0DH,0AH,"Enter Second
Number",0DH,0AH,'$'
ADD1 DB ,0DH,0AH,"FOR ADDITION",0DH,0AH,'$'
SUB1 DB ,0DH,0AH,"FOR SUBTRACTION",0DH,0AH,'$'
MUL1 DB ,0DH,0AH,"FOR MULTIPLICATION",0DH,0AH,'$'
DIV1 DB ,0DH,0AH,"FOR DIVISION",0DH,0AH,'$'
EX DB ,0DH,0AH,"GOOD BYE AND HAVE A NICE TIME
:)",0DH,0AH,'$'
ANS DB ,0DH,0AH,"ANSWER ",0DH,0AH,'$'
CONTINUE DB ,0DH,0AH,"DO YOU WANT TO
CONTINUE",0DH,0AH,'$'
OP1 DB ?
OP2 DB ?
Operand DB ?
CON DB ?
.CODE
.STARTUP
START:
MOV AH,09H
MOV DX, OFFSET MAIN_MENU
INT 21H
MOV AH,01H
INT 21H
MOV Operand,AL
MOV AL,Operand
CMP AL,'A'
JE ADD
CMP AL,'S'
JE SUB
CMP AL,'M'
JE MUL
CMP AL,'D'
JE DIV
CMP AL,'R'
JE START
CMP AL,'E'
JE EXIT
ADD: ; PERFORMING ADDITION
MOV AH,09H
MOV DX,OFFSET ADD1
INT 21H
;FIRST OPERAND
MOV AH,09H
MOV DX,OFFSET NUM1
INT 21H
MOV AH,01H
[15B-145-EL] SamiULLAH
INT 21H
MOV OP1,AL
;SECOND OPERAND
MOV AH,09H
MOV DX,OFFSET NUM2
INT 21H
MOV AH,01H
INT 21H
MOV OP2,AL
MOV AH,09H
MOV DX, OFFSET ANS
INT 21H
MOV AL,OP1
MOV BL,OP2
ADD AL,BL
AAS
OR AX, 3030H
; PRINT RESULT
MOV AH,0EH
INT 10H
;FOR CONTINUE
MOV AH,09H
MOV DX,OFFSET CONTINUE
INT 21H
MOV AH,01H
INT 21H
MOV CON,AL
MOV AL,CON
CMP AL,'Y'
JE START
CMP AL,'N'
JE EXIT
SUB: ; PERFORMING SUBTRACTION
MOV AH,09H
MOV DX,OFFSET SUB1
INT 21H
;FIRST OPERAND
MOV AH,09H
MOV DX,OFFSET NUM1
INT 21H
MOV AH,01H
INT 21H
MOV OP1,AL
;SECOND OPERAND
MOV AH,09H
MOV DX,OFFSET NUM2
INT 21H
MOV AH,01H
INT 21H
MOV OP2,AL
MOV AH,09H
MOV DX, OFFSET ANS
INT 21H
MOV AL,OP1
MOV BL,OP2
SUB AL,BL
AAS
OR AX, 3030H
; PRINT RESULT
MOV AH,0EH
[15B-145-EL] SamiULLAH
INT 10H
;FOR CONTINUE
MOV AH,09H
MOV DX,OFFSET CONTINUE
INT 21H
MOV AH,01H
INT 21H
MOV CON,AL
MOV AL,CON
CMP AL,'Y'
JE START
CMP AL,'N'
JE EXIT
MUL: ; PERFORMING MULTIPLICATION
MOV AH,09H
MOV DX,OFFSET MUL1
INT 21H
;FIRST OPERAND
MOV AH,09H
MOV DX,OFFSET NUM1
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H
MOV OP1,AL
;SECOND OPERAND
MOV AH,09H
MOV DX,OFFSET NUM2
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H
MOV OP2,AL
MOV AH,09H
MOV DX, OFFSET ANS
INT 21H
MOV AL,OP1
MOV BL,OP2
MUL BL
ADD AL,30H
; PRINT RESULT
MOV AH,0EH
INT 10H
;FOR CONTINUE
MOV AH,09H
MOV DX,OFFSET CONTINUE
INT 21H
MOV AH,01H
INT 21H
MOV CON,AL
MOV AL,CON
CMP AL,'Y'
JE START
CMP AL,'N'
JE EXIT
DIV: ; PERFORMING DIVISION
MOV AH,09H
MOV DX,OFFSET DIV1
INT 21H
;FIRST OPERAND
[15B-145-EL] SamiULLAH
MOV AH,09H
MOV DX,OFFSET NUM1
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H
MOV OP1,AL
;SECOND OPERAND
MOV AH,09H
MOV DX,OFFSET NUM2
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H
MOV OP2,AL
MOV AH,09H
MOV DX, OFFSET ANS
INT 21H
MOV AX,0000H
MOV AL,OP1
MOV BL,OP2
DIV BL
ADD AL,30H
; PRINT RESULT
MOV AH,0EH
INT 10H
;FOR CONTINUE
MOV AH,09H
MOV DX,OFFSET CONTINUE
INT 21H
MOV AH,01H
INT 21H
MOV CON,AL
MOV AL,CON
CMP AL,'Y'
JE START
CMP AL,'N'
JE EXIT
EXIT: ; SAY GOOD BYE AND THEN EXIT
MOV AH,09H
MOV DX,OFFSET EX
INT 21H
.EXIT
END
[15B-145-EL] SamiULLAH
OUTPUT
ADDITION
SUBTRACTION
MULTIPLICATION
DIVISION
[15B-145-EL] SamiULLAH

More Related Content

What's hot

Program control instructions
Program control instructionsProgram control instructions
Program control instructions
Dr. Girish GS
 
Logic gates
Logic gatesLogic gates
Logic gates
prasanna chitra
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
Ibrahimcommunication Al Ani
 
Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)
Fatima Kate Tanay
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Bilal Amjad
 
SOP POS, Minterm and Maxterm
SOP POS, Minterm and MaxtermSOP POS, Minterm and Maxterm
SOP POS, Minterm and Maxterm
Self-employed
 
Chapter 6 Flow control Instructions
Chapter 6 Flow control InstructionsChapter 6 Flow control Instructions
Chapter 6 Flow control Instructions
warda aziz
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
ihsanjamil
 
boolean algebra and logic simplification
boolean algebra and logic simplificationboolean algebra and logic simplification
boolean algebra and logic simplification
Unsa Shakir
 
Qoestion Bank Big Questions
Qoestion  Bank Big QuestionsQoestion  Bank Big Questions
Qoestion Bank Big Questions
ccet
 
Karnaugh map
Karnaugh mapKarnaugh map
Karnaugh map
Vanitha Chandru
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
warda aziz
 
multiplexers and demultiplexers
 multiplexers and demultiplexers multiplexers and demultiplexers
multiplexers and demultiplexers
Unsa Shakir
 
Logical instruction of 8085
Logical instruction of 8085 Logical instruction of 8085
Logical instruction of 8085
Nemish Bhojani
 
Logic simplification sop and pos forms
Logic simplification sop and pos formsLogic simplification sop and pos forms
Logic simplification sop and pos forms
Manesh T
 
Nand and nor as a universal gates
Nand and nor as a universal gatesNand and nor as a universal gates
Nand and nor as a universal gates
Kaushal Shah
 
Introduction to ibm pc assembly language
Introduction to ibm pc assembly languageIntroduction to ibm pc assembly language
Introduction to ibm pc assembly language
warda aziz
 
8085 lab
8085 lab8085 lab
8085 lab
Nithin Mohan
 
Assembly Langauge Chap 1
Assembly Langauge Chap 1Assembly Langauge Chap 1
Assembly Langauge Chap 1
warda aziz
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithm
Gaurav Subham
 

What's hot (20)

Program control instructions
Program control instructionsProgram control instructions
Program control instructions
 
Logic gates
Logic gatesLogic gates
Logic gates
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
 
Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
 
SOP POS, Minterm and Maxterm
SOP POS, Minterm and MaxtermSOP POS, Minterm and Maxterm
SOP POS, Minterm and Maxterm
 
Chapter 6 Flow control Instructions
Chapter 6 Flow control InstructionsChapter 6 Flow control Instructions
Chapter 6 Flow control Instructions
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
boolean algebra and logic simplification
boolean algebra and logic simplificationboolean algebra and logic simplification
boolean algebra and logic simplification
 
Qoestion Bank Big Questions
Qoestion  Bank Big QuestionsQoestion  Bank Big Questions
Qoestion Bank Big Questions
 
Karnaugh map
Karnaugh mapKarnaugh map
Karnaugh map
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
 
multiplexers and demultiplexers
 multiplexers and demultiplexers multiplexers and demultiplexers
multiplexers and demultiplexers
 
Logical instruction of 8085
Logical instruction of 8085 Logical instruction of 8085
Logical instruction of 8085
 
Logic simplification sop and pos forms
Logic simplification sop and pos formsLogic simplification sop and pos forms
Logic simplification sop and pos forms
 
Nand and nor as a universal gates
Nand and nor as a universal gatesNand and nor as a universal gates
Nand and nor as a universal gates
 
Introduction to ibm pc assembly language
Introduction to ibm pc assembly languageIntroduction to ibm pc assembly language
Introduction to ibm pc assembly language
 
8085 lab
8085 lab8085 lab
8085 lab
 
Assembly Langauge Chap 1
Assembly Langauge Chap 1Assembly Langauge Chap 1
Assembly Langauge Chap 1
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithm
 

More from Sami Ullah

The Earliest Applications Of Linear Algebra
The Earliest Applications Of Linear AlgebraThe Earliest Applications Of Linear Algebra
The Earliest Applications Of Linear Algebra
Sami Ullah
 
Equilibrium Temperature Distributions Application In Linear Algebra
Equilibrium Temperature Distributions Application In Linear AlgebraEquilibrium Temperature Distributions Application In Linear Algebra
Equilibrium Temperature Distributions Application In Linear Algebra
Sami Ullah
 
Electrical Networks Application in linear algebra
Electrical Networks Application in linear algebraElectrical Networks Application in linear algebra
Electrical Networks Application in linear algebra
Sami Ullah
 
Applications of matrices in Real\Daily life
Applications of matrices in Real\Daily lifeApplications of matrices in Real\Daily life
Applications of matrices in Real\Daily life
Sami Ullah
 
cryptography Application of linear algebra
cryptography Application of linear algebra cryptography Application of linear algebra
cryptography Application of linear algebra
Sami Ullah
 
ROL ROR SHL SHR Assembly Language Programmin 8086
ROL ROR SHL SHR Assembly Language Programmin 8086ROL ROR SHL SHR Assembly Language Programmin 8086
ROL ROR SHL SHR Assembly Language Programmin 8086
Sami Ullah
 
Assembly Language Voltage Divider Bias Program 8086
Assembly Language Voltage Divider Bias Program 8086Assembly Language Voltage Divider Bias Program 8086
Assembly Language Voltage Divider Bias Program 8086
Sami Ullah
 

More from Sami Ullah (7)

The Earliest Applications Of Linear Algebra
The Earliest Applications Of Linear AlgebraThe Earliest Applications Of Linear Algebra
The Earliest Applications Of Linear Algebra
 
Equilibrium Temperature Distributions Application In Linear Algebra
Equilibrium Temperature Distributions Application In Linear AlgebraEquilibrium Temperature Distributions Application In Linear Algebra
Equilibrium Temperature Distributions Application In Linear Algebra
 
Electrical Networks Application in linear algebra
Electrical Networks Application in linear algebraElectrical Networks Application in linear algebra
Electrical Networks Application in linear algebra
 
Applications of matrices in Real\Daily life
Applications of matrices in Real\Daily lifeApplications of matrices in Real\Daily life
Applications of matrices in Real\Daily life
 
cryptography Application of linear algebra
cryptography Application of linear algebra cryptography Application of linear algebra
cryptography Application of linear algebra
 
ROL ROR SHL SHR Assembly Language Programmin 8086
ROL ROR SHL SHR Assembly Language Programmin 8086ROL ROR SHL SHR Assembly Language Programmin 8086
ROL ROR SHL SHR Assembly Language Programmin 8086
 
Assembly Language Voltage Divider Bias Program 8086
Assembly Language Voltage Divider Bias Program 8086Assembly Language Voltage Divider Bias Program 8086
Assembly Language Voltage Divider Bias Program 8086
 

Recently uploaded

CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
Addu25809
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
amsjournal
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 

Recently uploaded (20)

CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 

Calculator 8086 Assembly Language Programming

  • 1. [15B-145-EL] SamiULLAH .MODEL SMALL .STACK 100H .DATA MAIN_MENU DB ,0DH,0AH,"Calculater",0DH,0AH DB "Press 'A' For ADDITION",0DH,0AH DB "Press 'S' For SUBTRACTION",0DH,0AH DB "Press 'M' For MULTIPLICATION",0DH,0AH DB "Press 'D' For DIVISION",0DH,0AH DB "Press 'E' For EXIT",0DH,0AH DB "Press 'R' For RETURN to Main Menu",0DH,0AH DB "*******************************",0DH,0AH DB "*******************************",0DH,0AH DB "Enter Your CHOICE",0DH,0AH,'$' NUM1 DB "Enter First Number",0DH,0AH,'$' NUM2 DB ,0DH,0AH,"Enter Second Number",0DH,0AH,'$' ADD1 DB ,0DH,0AH,"FOR ADDITION",0DH,0AH,'$' SUB1 DB ,0DH,0AH,"FOR SUBTRACTION",0DH,0AH,'$' MUL1 DB ,0DH,0AH,"FOR MULTIPLICATION",0DH,0AH,'$' DIV1 DB ,0DH,0AH,"FOR DIVISION",0DH,0AH,'$' EX DB ,0DH,0AH,"GOOD BYE AND HAVE A NICE TIME :)",0DH,0AH,'$' ANS DB ,0DH,0AH,"ANSWER ",0DH,0AH,'$' CONTINUE DB ,0DH,0AH,"DO YOU WANT TO CONTINUE",0DH,0AH,'$' OP1 DB ? OP2 DB ? Operand DB ? CON DB ? .CODE .STARTUP START: MOV AH,09H MOV DX, OFFSET MAIN_MENU INT 21H MOV AH,01H INT 21H MOV Operand,AL MOV AL,Operand CMP AL,'A' JE ADD CMP AL,'S' JE SUB CMP AL,'M' JE MUL CMP AL,'D' JE DIV CMP AL,'R' JE START CMP AL,'E' JE EXIT ADD: ; PERFORMING ADDITION MOV AH,09H MOV DX,OFFSET ADD1 INT 21H ;FIRST OPERAND MOV AH,09H MOV DX,OFFSET NUM1 INT 21H MOV AH,01H
  • 2. [15B-145-EL] SamiULLAH INT 21H MOV OP1,AL ;SECOND OPERAND MOV AH,09H MOV DX,OFFSET NUM2 INT 21H MOV AH,01H INT 21H MOV OP2,AL MOV AH,09H MOV DX, OFFSET ANS INT 21H MOV AL,OP1 MOV BL,OP2 ADD AL,BL AAS OR AX, 3030H ; PRINT RESULT MOV AH,0EH INT 10H ;FOR CONTINUE MOV AH,09H MOV DX,OFFSET CONTINUE INT 21H MOV AH,01H INT 21H MOV CON,AL MOV AL,CON CMP AL,'Y' JE START CMP AL,'N' JE EXIT SUB: ; PERFORMING SUBTRACTION MOV AH,09H MOV DX,OFFSET SUB1 INT 21H ;FIRST OPERAND MOV AH,09H MOV DX,OFFSET NUM1 INT 21H MOV AH,01H INT 21H MOV OP1,AL ;SECOND OPERAND MOV AH,09H MOV DX,OFFSET NUM2 INT 21H MOV AH,01H INT 21H MOV OP2,AL MOV AH,09H MOV DX, OFFSET ANS INT 21H MOV AL,OP1 MOV BL,OP2 SUB AL,BL AAS OR AX, 3030H ; PRINT RESULT MOV AH,0EH
  • 3. [15B-145-EL] SamiULLAH INT 10H ;FOR CONTINUE MOV AH,09H MOV DX,OFFSET CONTINUE INT 21H MOV AH,01H INT 21H MOV CON,AL MOV AL,CON CMP AL,'Y' JE START CMP AL,'N' JE EXIT MUL: ; PERFORMING MULTIPLICATION MOV AH,09H MOV DX,OFFSET MUL1 INT 21H ;FIRST OPERAND MOV AH,09H MOV DX,OFFSET NUM1 INT 21H MOV AH,01H INT 21H SUB AL,30H MOV OP1,AL ;SECOND OPERAND MOV AH,09H MOV DX,OFFSET NUM2 INT 21H MOV AH,01H INT 21H SUB AL,30H MOV OP2,AL MOV AH,09H MOV DX, OFFSET ANS INT 21H MOV AL,OP1 MOV BL,OP2 MUL BL ADD AL,30H ; PRINT RESULT MOV AH,0EH INT 10H ;FOR CONTINUE MOV AH,09H MOV DX,OFFSET CONTINUE INT 21H MOV AH,01H INT 21H MOV CON,AL MOV AL,CON CMP AL,'Y' JE START CMP AL,'N' JE EXIT DIV: ; PERFORMING DIVISION MOV AH,09H MOV DX,OFFSET DIV1 INT 21H ;FIRST OPERAND
  • 4. [15B-145-EL] SamiULLAH MOV AH,09H MOV DX,OFFSET NUM1 INT 21H MOV AH,01H INT 21H SUB AL,30H MOV OP1,AL ;SECOND OPERAND MOV AH,09H MOV DX,OFFSET NUM2 INT 21H MOV AH,01H INT 21H SUB AL,30H MOV OP2,AL MOV AH,09H MOV DX, OFFSET ANS INT 21H MOV AX,0000H MOV AL,OP1 MOV BL,OP2 DIV BL ADD AL,30H ; PRINT RESULT MOV AH,0EH INT 10H ;FOR CONTINUE MOV AH,09H MOV DX,OFFSET CONTINUE INT 21H MOV AH,01H INT 21H MOV CON,AL MOV AL,CON CMP AL,'Y' JE START CMP AL,'N' JE EXIT EXIT: ; SAY GOOD BYE AND THEN EXIT MOV AH,09H MOV DX,OFFSET EX INT 21H .EXIT END