0% found this document useful (0 votes)
66 views14 pages

8086 Alp Programs: Presented by C.Gokul, Ap/Eee Velalar College of Engg & Tech

This document presents 16 assembly language programs for performing basic operations on 8-bit and 16-bit numbers using the 8086 processor. The programs demonstrate how to increment, decrement, take the one's complement, take the two's complement, add, subtract, multiply and divide 8-bit and 16-bit numbers using instructions like MOV, INC, DEC, NOT, ADD, SUB, MUL, DIV. The full presentation provides more detailed coding examples for 16-bit addition and subtraction operations.

Uploaded by

ROHIT RAWAT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views14 pages

8086 Alp Programs: Presented by C.Gokul, Ap/Eee Velalar College of Engg & Tech

This document presents 16 assembly language programs for performing basic operations on 8-bit and 16-bit numbers using the 8086 processor. The programs demonstrate how to increment, decrement, take the one's complement, take the two's complement, add, subtract, multiply and divide 8-bit and 16-bit numbers using instructions like MOV, INC, DEC, NOT, ADD, SUB, MUL, DIV. The full presentation provides more detailed coding examples for 16-bit addition and subtraction operations.

Uploaded by

ROHIT RAWAT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

8086 ALP PROGRAMS

Presented by
C.GOKUL,
AP/EEE
Velalar College of Engg & Tech
Assembly Language
Programming(ALP)
8086
Program 1: Increment an 8-bit number

• MOV AL, 05H Move 8-bit data to AL.


• INC AL Increment AL.

Program 2: Increment an 8-bit number

• MOV AX, 0005H Move 16-bit data to AX.


• INC AX Increment AX.
Program 3: Decrement an 8-bit number

• MOV AL, 05H Move 8-bit data to AL.


• DEC AL Decrement AL.

Program 4: Decrement an 8-bit number

• MOV AX, 0005H Move 16-bit data to AX.


• DEC AX Decrement AX.
Program 5: 1’s complement of an 8-bit
number.
• MOV AL, 05H Move 8-bit data to AL.
• NOT AL Complement AL.
Program 6: 1’s complement of a 16-bit
number.
• MOV AX, 0005H Move 16-bit data to AX.
• NOT AX Complement AX.
Program 7: 2’s complement of an 8-bit
number.
• MOV AL, 05H Move 8-bit data to AL.
• NOT AL Complement AL.
• INC AL Increment AL

Program 8: 2’s complement of a 16-bit


number.
• MOV AX, 0005H Move 16-bit data to AX.
• NOT AX Complement AX.
• INC AX Increment AX
Program 7: 2’s complement of an 8-bit
number.
• MOV AL, 05H Move 8-bit data to AL.
• NOT AL Complement AL.
• INC AL Increment AL

Program 8: 2’s complement of a 16-bit


number.
• MOV AX, 0005H Move 16-bit data to AX.
• NOT AX Complement AX.
• INC AX Increment AX
Program 9: Add two 8-bit numbers
MOV AL, 05H Move 1 8-bit number to AL.
st

MOV BL, 03H Move 2nd 8-bit number to BL.


ADD AL, BL Add BL with AL.

Program 10: Add two 16-bit numbers


MOV AX, 0005H Move 1 16-bit number to AX.
st

MOV BX, 0003H Move 2nd 16-bit number to BX.


ADD AX, BX Add BX with AX.
Program 11: subtract two 8-bit numbers
MOV AL, 05H Move 1 8-bit number to AL.
st

MOV BL, 03H Move 2nd 8-bit number to BL.


SUB AL, BL subtract BL from AL.

Program 12: subtract two 16-bit numbers


MOV AX, 0005H Move 1 16-bit number to AX.
st

MOV BX, 0003H Move 2nd 16-bit number to BX.


SUB AX, BX subtract BX from AX.
Program 13: Multiply two 8-bit unsigned
numbers.
MOV AL, 04H Move 1st 8-bit number to AL.
MOV BL, 02H Move 2nd 8-bit number to BL.
MUL BL Multiply BL with AL and the result will
be in AX.

Program 14: Multiply two 8-bit signed


numbers.
MOV AL, 04H Move 1st 8-bit number to AL.
MOV BL, 02H Move 2nd 8-bit number to BL.
IMUL BL Multiply BL with AL and the result will
be in AX.

Presented by C.GOKUL,AP/EEE
Program 15: Multiply two 16-bit unsigned
numbers.
MOV AX, 0004H Move 1st 16-bit number to AL.
MOV BX, 0002H Move 2nd 16-bit number to BL.
MUL BX Multiply BX with AX and the result will
be in DX:AX {4*2=0008=> 08=> AX , 00=> DX}

Program 16: Divide two 16-bit unsigned


numbers.
MOV AX, 0004H Move 1st 16-bit number to AL.
MOV BX, 0002H Move 2nd 16-bit number to BL.
DIV BX Divide BX from AX and the result will be in AX & DX
{4/2=0002=> 02=> AX ,00=>DX}
(ie: Quotient => AX , Reminder => DX )
Detailed coding
16 BIT ADDITION
Detailed coding
16 BIT SUBTRACTION
Interesting, right?
This is just a sneak preview of the full presentation. We hope you like it!
To see the rest of it, just click here to view it in full on PowerShow.com.
Then, if you’d like, you can also log in to PowerShow.com to download
the entire presentation for free.

You might also like