SlideShare a Scribd company logo
1 of 4
AAA (ASCII AdjustAfter Addition)
Syntax :-- AAA
• This instruction is used to convert the result in AL after the addition of unpacked
ASCII operands to unpacked decimal digits.
• The higher nibble of AL is filled with zeros.
• The instruction should be used after ADD and result is placed in the AL register.
• Before the execution of this instruction AH should be loaded with 00H.
• Flags affected : AF and CF.
Operation Performed :--
– If Lower nibble of AL<=9, or AF = 0 then
• AL = AL AND 0FH
– If Lower nibble of AL<=9 & AF = 1 or Lower nibble of AL>9 then
• AL = AL AND 0FH
• AL = AL + 06H
• AH = AH + 1
• AF = CF = 1
Note :-- The instruction does not give exact ASCII codes of the sum, but then can be obtained
by adding 3030 to AX.
• Example :--
– If AH = 0, AL = 38h , BL = 34h
• After ADD AL, BL ; AL 6C , AF =0
AAA ; AL  6C AND 0FH
; AL  0CH
;C>9, AL AL +06H
;AL  02
;AH  01
» AH = 01h AL = 02h
» Adding 3030H will give 31 32 ASCII result.
• AAS (ASCII AdjustAfter Subtraction )
Syntax :-- AAS
• This instruction is used to convert the result in AL after the subtraction of unpacked
ASCII operands to unpacked decimal digits..
• The higher nibble of AL is filled with zeros.
• The instruction should be used after SUB and result is placed in the AL register.
• Before the execution of this instruction AH should be loaded with 00H.
• Flags affected : AF and CF.
Operation Performed :--
– If Lower nibble of AL<=9, or AF = 0 then
• AL = AL AND AL 0FH
– If Lower nibble of AL<=9 & AF = 1 or Lower nibble of AL>9 then
• AL = AL AND AL 0FH
• AL = AL - 06H
• AH = AH - 1
• AF = CF = 1
Note :-- The instruction does not give exact ASCII codes of the difference, but then can be
obtained by adding 3030 to AX.
• Example1 :--
– If AH = 0, AL = 39h , BL = 35h
• After SUB AL, BL ; AL 04H , AF =0
AAS ; AL  04H AND 0FH
; AL  04H
; AH = 00h AL = 04h
» Adding 3030H will give 30 34 ASCII result.
• Example 2:--
– If AH = 0, AL = 35h , BL = 39h
• After SUB AL, BL ; AL FCH , AF =1
» AAS ; AL  FCH AND 0FH
; AL  0CH
; C>9 AL  AL -06
; AH  00 – 01
; AH FFH
; AL 04
AAM (ASCII AdjustAfter Multiplication)
Syntax :-- AAM
• This instruction is used to convert the product in AL after the multiplication into
unpacked BCD format.
• The higher nibble of multiplication operands is filled with zeros.
• The instruction should be used after MUL and result is placed in the AX register.
• The binary number in AL register is divided by 10 and quotient is stored in the register
AH, Remainder in AL.
• Flags affected : PF, SF and ZF
Operation Performed :--
• AL = AL MOD 10
• AH = AL / 10
• Example :--
1. If AH = 0, AL = 06h , BL = 08h
• After MUL BL ; AL 30H
AAM ; AL  30H MOD 10 (48/10)
; AL 08
; AH  AL / 10 (48 /10)
; AH  04 Hence AH = 04h AL = 08h
AAD (ASCII AdjustBeforeDivision)
Syntax :-- AAD
• This instruction is used to convert the unpacked BCD digitS in AH and AL
to the equivalent binary number in the AL register.
• The higher nibble of AH and AL are filled with zeros.
• The instruction should be used before division instruction.
• The instruction will place the quotient in AL register and Remainder in
AH.
• Flags affected : PF, SF and ZF
Operation Performed :--
• AL = AH * 10 + AL
• AH = 00
• Example:--
1. If AH = 05, AL = 08 , BL = 07H
• After AAD ; AL 05 * 10 + 08
; AL  3AH
; AH  00H
DIV BL ; Quo  08H , Rem  02H
AH = 02h
AL = 08h

More Related Content

Similar to Notes aaa aa

Ascii arithmetic instructions
Ascii arithmetic instructionsAscii arithmetic instructions
Ascii arithmetic instructionsDr. Girish GS
 
8086 instructions
8086 instructions8086 instructions
8086 instructionsRavi Anand
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Vijay Kumar
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)AmitPaliwal20
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptssuser2b759d
 
Microprocessor 8086 instruction description
Microprocessor 8086 instruction descriptionMicroprocessor 8086 instruction description
Microprocessor 8086 instruction descriptionDheeraj Suri
 
Conditional Processing Boolean and Comparison Instructions-converted.pptx
Conditional Processing Boolean and Comparison Instructions-converted.pptxConditional Processing Boolean and Comparison Instructions-converted.pptx
Conditional Processing Boolean and Comparison Instructions-converted.pptxJawadHaider36
 
Microprocessor.pptx
Microprocessor.pptxMicroprocessor.pptx
Microprocessor.pptxNishatNishu5
 
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
 
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
 
Arithmetic instructions
Arithmetic instructionsArithmetic instructions
Arithmetic instructionsRobert Almazan
 
Instruction set class
Instruction set   classInstruction set   class
Instruction set classshiji v r
 

Similar to Notes aaa aa (20)

Ascii arithmetic instructions
Ascii arithmetic instructionsAscii arithmetic instructions
Ascii arithmetic instructions
 
Module 2 (1).pptx
Module 2 (1).pptxModule 2 (1).pptx
Module 2 (1).pptx
 
Mod-2.pptx
Mod-2.pptxMod-2.pptx
Mod-2.pptx
 
Al2ed chapter11
Al2ed chapter11Al2ed chapter11
Al2ed chapter11
 
Hemanth143
Hemanth143 Hemanth143
Hemanth143
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.ppt
 
Microprocessor 8086 instruction description
Microprocessor 8086 instruction descriptionMicroprocessor 8086 instruction description
Microprocessor 8086 instruction description
 
Conditional Processing Boolean and Comparison Instructions-converted.pptx
Conditional Processing Boolean and Comparison Instructions-converted.pptxConditional Processing Boolean and Comparison Instructions-converted.pptx
Conditional Processing Boolean and Comparison Instructions-converted.pptx
 
Microprocessor.pptx
Microprocessor.pptxMicroprocessor.pptx
Microprocessor.pptx
 
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,...
 
Chapter3 8086inst logical 2
Chapter3 8086inst logical 2Chapter3 8086inst logical 2
Chapter3 8086inst logical 2
 
Chap3 8086 logical
Chap3 8086 logicalChap3 8086 logical
Chap3 8086 logical
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
 
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...
 
Arithmetic instructions
Arithmetic instructionsArithmetic instructions
Arithmetic instructions
 
Instruction set class
Instruction set   classInstruction set   class
Instruction set class
 

More from HarshitParkar6677 (20)

Wi fi hacking
Wi fi hackingWi fi hacking
Wi fi hacking
 
D dos attack
D dos attackD dos attack
D dos attack
 
Notes chapter 6
Notes chapter  6Notes chapter  6
Notes chapter 6
 
Interface notes
Interface notesInterface notes
Interface notes
 
Chapter6 2
Chapter6 2Chapter6 2
Chapter6 2
 
Chapter6
Chapter6Chapter6
Chapter6
 
8086 cpu 1
8086 cpu 18086 cpu 1
8086 cpu 1
 
Chapter 6 notes
Chapter 6 notesChapter 6 notes
Chapter 6 notes
 
Chapter 5 notes
Chapter 5 notesChapter 5 notes
Chapter 5 notes
 
Chap6 procedures &amp; macros
Chap6 procedures &amp; macrosChap6 procedures &amp; macros
Chap6 procedures &amp; macros
 
Chapter 5 notes new
Chapter 5 notes newChapter 5 notes new
Chapter 5 notes new
 
Notes arithmetic instructions
Notes arithmetic instructionsNotes arithmetic instructions
Notes arithmetic instructions
 
Notes all instructions
Notes all instructionsNotes all instructions
Notes all instructions
 
Notes 8086 instruction format
Notes 8086 instruction formatNotes 8086 instruction format
Notes 8086 instruction format
 
Misc
MiscMisc
Misc
 
Chapter3 program flow control instructions
Chapter3 program flow control instructionsChapter3 program flow control instructions
Chapter3 program flow control instructions
 
Chapter3 8086inst stringsl
Chapter3 8086inst stringslChapter3 8086inst stringsl
Chapter3 8086inst stringsl
 
Chap3 program flow control instructions
Chap3 program flow control instructionsChap3 program flow control instructions
Chap3 program flow control instructions
 
Chap3 8086 data transfer
Chap3 8086 data transferChap3 8086 data transfer
Chap3 8086 data transfer
 
Chap 8086 string
Chap 8086 stringChap 8086 string
Chap 8086 string
 

Recently uploaded

Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
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
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 

Recently uploaded (20)

Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
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
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
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
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 

Notes aaa aa

  • 1. AAA (ASCII AdjustAfter Addition) Syntax :-- AAA • This instruction is used to convert the result in AL after the addition of unpacked ASCII operands to unpacked decimal digits. • The higher nibble of AL is filled with zeros. • The instruction should be used after ADD and result is placed in the AL register. • Before the execution of this instruction AH should be loaded with 00H. • Flags affected : AF and CF. Operation Performed :-- – If Lower nibble of AL<=9, or AF = 0 then • AL = AL AND 0FH – If Lower nibble of AL<=9 & AF = 1 or Lower nibble of AL>9 then • AL = AL AND 0FH • AL = AL + 06H • AH = AH + 1 • AF = CF = 1 Note :-- The instruction does not give exact ASCII codes of the sum, but then can be obtained by adding 3030 to AX. • Example :-- – If AH = 0, AL = 38h , BL = 34h • After ADD AL, BL ; AL 6C , AF =0 AAA ; AL  6C AND 0FH ; AL  0CH ;C>9, AL AL +06H ;AL  02 ;AH  01 » AH = 01h AL = 02h » Adding 3030H will give 31 32 ASCII result.
  • 2. • AAS (ASCII AdjustAfter Subtraction ) Syntax :-- AAS • This instruction is used to convert the result in AL after the subtraction of unpacked ASCII operands to unpacked decimal digits.. • The higher nibble of AL is filled with zeros. • The instruction should be used after SUB and result is placed in the AL register. • Before the execution of this instruction AH should be loaded with 00H. • Flags affected : AF and CF. Operation Performed :-- – If Lower nibble of AL<=9, or AF = 0 then • AL = AL AND AL 0FH – If Lower nibble of AL<=9 & AF = 1 or Lower nibble of AL>9 then • AL = AL AND AL 0FH • AL = AL - 06H • AH = AH - 1 • AF = CF = 1 Note :-- The instruction does not give exact ASCII codes of the difference, but then can be obtained by adding 3030 to AX. • Example1 :-- – If AH = 0, AL = 39h , BL = 35h • After SUB AL, BL ; AL 04H , AF =0 AAS ; AL  04H AND 0FH ; AL  04H ; AH = 00h AL = 04h » Adding 3030H will give 30 34 ASCII result.
  • 3. • Example 2:-- – If AH = 0, AL = 35h , BL = 39h • After SUB AL, BL ; AL FCH , AF =1 » AAS ; AL  FCH AND 0FH ; AL  0CH ; C>9 AL  AL -06 ; AH  00 – 01 ; AH FFH ; AL 04 AAM (ASCII AdjustAfter Multiplication) Syntax :-- AAM • This instruction is used to convert the product in AL after the multiplication into unpacked BCD format. • The higher nibble of multiplication operands is filled with zeros. • The instruction should be used after MUL and result is placed in the AX register. • The binary number in AL register is divided by 10 and quotient is stored in the register AH, Remainder in AL. • Flags affected : PF, SF and ZF Operation Performed :-- • AL = AL MOD 10 • AH = AL / 10 • Example :-- 1. If AH = 0, AL = 06h , BL = 08h • After MUL BL ; AL 30H AAM ; AL  30H MOD 10 (48/10) ; AL 08 ; AH  AL / 10 (48 /10) ; AH  04 Hence AH = 04h AL = 08h
  • 4. AAD (ASCII AdjustBeforeDivision) Syntax :-- AAD • This instruction is used to convert the unpacked BCD digitS in AH and AL to the equivalent binary number in the AL register. • The higher nibble of AH and AL are filled with zeros. • The instruction should be used before division instruction. • The instruction will place the quotient in AL register and Remainder in AH. • Flags affected : PF, SF and ZF Operation Performed :-- • AL = AH * 10 + AL • AH = 00 • Example:-- 1. If AH = 05, AL = 08 , BL = 07H • After AAD ; AL 05 * 10 + 08 ; AL  3AH ; AH  00H DIV BL ; Quo  08H , Rem  02H AH = 02h AL = 08h