SlideShare a Scribd company logo
1 of 6
[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

Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...Bilal Amjad
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4Motaz Saad
 
assembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUassembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUEducation
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registerswarda aziz
 
Assembly Language Lecture 5
Assembly Language Lecture 5Assembly Language Lecture 5
Assembly Language Lecture 5Motaz Saad
 
assembly language programming organization of IBM PC chapter 9 part-2(decimal...
assembly language programming organization of IBM PC chapter 9 part-2(decimal...assembly language programming organization of IBM PC chapter 9 part-2(decimal...
assembly language programming organization of IBM PC chapter 9 part-2(decimal...Bilal Amjad
 
Organization of the ibm personal computers
Organization of the ibm personal computersOrganization of the ibm personal computers
Organization of the ibm personal computerswarda aziz
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086COMSATS Abbottabad
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionBadrul Alam
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adderGaditek
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Bilal Amjad
 
Register Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceRegister Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceTransweb Global Inc
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answersvijaybusu
 

What's hot (20)

Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4
 
assembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUassembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YU
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registers
 
Assignment on alp
Assignment on alpAssignment on alp
Assignment on alp
 
Assembly Language Lecture 5
Assembly Language Lecture 5Assembly Language Lecture 5
Assembly Language Lecture 5
 
assembly language programming organization of IBM PC chapter 9 part-2(decimal...
assembly language programming organization of IBM PC chapter 9 part-2(decimal...assembly language programming organization of IBM PC chapter 9 part-2(decimal...
assembly language programming organization of IBM PC chapter 9 part-2(decimal...
 
8086 alp
8086 alp8086 alp
8086 alp
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
 
Organization of the ibm personal computers
Organization of the ibm personal computersOrganization of the ibm personal computers
Organization of the ibm personal computers
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
 
8086 String Instructions.pdf
8086 String Instructions.pdf8086 String Instructions.pdf
8086 String Instructions.pdf
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate Instruction
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adder
 
SQL BASIC QUERIES
SQL  BASIC QUERIES SQL  BASIC QUERIES
SQL BASIC QUERIES
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
 
Sql query [select, sub] 4
Sql query [select, sub] 4Sql query [select, sub] 4
Sql query [select, sub] 4
 
Register Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceRegister Reference Instructions | Computer Science
Register Reference Instructions | Computer Science
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 
SQL BASIC QUERIES SOLUTION ~hmftj
SQL BASIC QUERIES SOLUTION ~hmftjSQL BASIC QUERIES SOLUTION ~hmftj
SQL BASIC QUERIES SOLUTION ~hmftj
 

Similar to Calculator 8086 Assembly Language Programming

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 8086Sami 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 8086Sami Ullah
 
Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)shamim hossain
 
Instalación de emu8086
Instalación de emu8086Instalación de emu8086
Instalación de emu8086Alex Toapanta
 
Taller practico emu8086_galarraga
Taller practico emu8086_galarragaTaller practico emu8086_galarraga
Taller practico emu8086_galarragaFabricio Galárraga
 
Topviewsimulator
TopviewsimulatorTopviewsimulator
TopviewsimulatorRashmi
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051) vijaydeepakg
 
Programs using Microcontrollers.ppt
Programs using Microcontrollers.pptPrograms using Microcontrollers.ppt
Programs using Microcontrollers.pptSasiBhushan22
 
Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086Santy Bolo
 
Instalación de emu8086 y compilados
Instalación de emu8086 y compiladosInstalación de emu8086 y compilados
Instalación de emu8086 y compiladosDiego Erazo
 

Similar to Calculator 8086 Assembly Language Programming (14)

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
 
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
 
Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)Microprocessor and micro-controller lab (assembly programming)
Microprocessor and micro-controller lab (assembly programming)
 
Instalación de emu8086
Instalación de emu8086Instalación de emu8086
Instalación de emu8086
 
Assembler
AssemblerAssembler
Assembler
 
Taller practico emu8086_galarraga
Taller practico emu8086_galarragaTaller practico emu8086_galarraga
Taller practico emu8086_galarraga
 
Topviewsimulator
TopviewsimulatorTopviewsimulator
Topviewsimulator
 
جميع اوامر لغة الاسمبلي
جميع اوامر لغة الاسمبلي جميع اوامر لغة الاسمبلي
جميع اوامر لغة الاسمبلي
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051)
 
Programs using Microcontrollers.ppt
Programs using Microcontrollers.pptPrograms using Microcontrollers.ppt
Programs using Microcontrollers.ppt
 
Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086Lenguaje ensamblador EMU8086
Lenguaje ensamblador EMU8086
 
Instalación de emu8086 y compilados
Instalación de emu8086 y compiladosInstalación de emu8086 y compilados
Instalación de emu8086 y compilados
 
8255
82558255
8255
 
Compiladores emu8086
Compiladores emu8086Compiladores emu8086
Compiladores emu8086
 

Recently uploaded

Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Studentskannan348865
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.benjamincojr
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docxrahulmanepalli02
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AISheetal Jain
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligencemahaffeycheryld
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...Amil baba
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...drjose256
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptamrabdallah9
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfssuser5c9d4b1
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1T.D. Shashikala
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxkalpana413121
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashidFaiyazSheikh
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfJNTUA
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2T.D. Shashikala
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdfAlexander Litvinenko
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.MdManikurRahman
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..MaherOthman7
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)NareenAsad
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksIJECEIAES
 

Recently uploaded (20)

Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Students
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AI
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
 

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