0% found this document useful (0 votes)
16 views

8086 Microprocessor Assembly Language Programs

Uploaded by

yeswanthyash476
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

8086 Microprocessor Assembly Language Programs

Uploaded by

yeswanthyash476
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

8086 microprocessor assembly language

programs
Write a Program For Read a Character From The
Keyboard
MOV ah, 1h //keyboard input subprogram
INT 21h // character input
// character is stored in al
MOV c, al //copy character from alto c

Write a Program For Reading and Displaying a


Character
MOV ah, 1h // keyboard input subprogram
INT 21h //read character into al
MOV dl, al //copy character to dl
MOV ah, 2h //character output subprogram
INT 21h // display character in dl

Write a Program Using General Purpose Registers


ORG 100h
MOV AL, VAR1 // check value of VAR1 by moving it to the AL.
LEA BX, VAR1 //get address of VAR1 in BX.
MOV BYTE PTR [BX], 44h // modify the contents of VAR1.
MOV AL, VAR1 //check value of VAR1 by moving it to the AL.
RET
VAR1 DB 22h
END

Write a Program For Displaying The String Using


Library Functions
include emu8086.inc //Macro declaration
ORG 100h
PRINT ‘Hello World!’
GOTOXY 10, 5
PUTC 65 // 65 – is an ASCII code for ‘A’
PUTC ‘B’
RET //return to the operating system.
END //directive to stop the compiler.
Arithmetic and Logic Instructions
The 8086 processes of arithmetic and logic unit has separated into three
groups such as addition, division, and increment operation.
Most Arithmetic and Logic Instructions affect the processor status
register.
The assembly language programming 8086 mnemonics are in the form of
op-code, such as MOV, MUL, JMP, and so on, which are used to perform
the operations. Assembly language programming 8086 examples

Addition
ORG0000h
MOV DX, #07H // move the value 7 to the register AX//
MOV AX, #09H // move the value 9 to accumulator AX//
Add AX, 00H // add CX value with R0 value and stores the result in
AX//
END
Multiplication
ORG0000h
MOV DX, #04H // move the value 4 to the register DX//
MOV AX, #08H // move the value 8 to accumulator AX//
MUL AX, 06H // Multiplied result is stored in the Accumulator AX //
END
Subtraction
ORG 0000h
MOV DX, #02H // move the value 2 to register DX//
MOV AX, #08H // move the value 8 to accumulator AX//
SUBB AX, 09H // Result value is stored in the Accumulator A X//
END
Division
ORG 0000h
MOV DX, #08H // move the value 3 to register DX//
MOV AX, #19H // move the value 5 to accumulator AX//
DIV AX, 08H // final value is stored in the Accumulator AX //
END
Therefore, this is all bout Assembly Level Programming 8086, 8086
Processor Architecture simple example programs for 8086 processors,
Arithmetic and Logic Instructions.Furthermore, any queries regarding this
article or electronics projects, you can contact us by commenting in the
comment section below.

SHARE THIS POST:


Fa

You might also like