Download presentation
Presentation is loading. Please wait.
Published byLenard Francis Modified over 6 years ago
1
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
Describe the architecture and organization of microprocessor along with instruction set format. C404.2 Describe modes and functional block diagram of 8086 along with pins and their functions C404.3 List and describe memory and addressing modes C404.4 List, describe and use different types of instructions, directives and interrupts C404.5 Develop assembly language programs using various programming tools. Visit for more Learning Resources
2
8086 ASSEMBLY LANGUAGE PROGRAMMING
CHAPTER 5 8086 ASSEMBLY LANGUAGE PROGRAMMING
3
Program to display the entered string on screen using DATA SEGMENT ORG 2000H INPUT DB “ENTER THE STRING”,0DH,0AH,“$” OUTPUT DB “THE ENTERED STRING IS:” ,0DH,0AH,“$” S_LENTH DB 0 BUFFER DB 80 DUP(0) DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX XOR CL,CL LEA DX,INPUT MOV AH,09H INT 21H LEA BX,BUFFER
4
REPEAT: MOV AH,01H INT 21H CMP AL,0DH JZ EXIT INC CL MOV [BX],AL INC BX JMP REPEAT EXIT: MOV S_LENTH,CL LEA BX,BUFFER ADD BL,CL MOV AL,’$’ MOV [BX],AL LEA DX,OUTPUT MOV AH,09H INT 21H LEA DX,BUFFER MOV AH,09H INT 21H MOV AH,4CH INT 21H CODE ENDS END START
5
finding the given string as a palindrome or not. using 8086
ASSUME CS:CODE,DS:DATA DATA SEGMENT ORG 2000H STRING DB “MPMC LAB$” S_LENTH EQU $-STRING-1 MSG1 DB “THE GIVEN STRING IS A PALINDROME$” MSG2 DB “THE GIVEN STRING IS NOT A PALINDROME$” DATA ENDS CODE SEGMENT START: MOV AX,DATA MOV DS,AX LEA DX,MSG2 MOV CX,S_LENTH LEA SI,STRING MOV DI,SI ADD DI,S_LENTH-1 SHR CX,1 BACK: MOV AL,[SI] CMP AL,[DI] JNZ NEXT INC SI DEC DI LOOP BACK LEA DX,MSG1 NEXT: MOV AH,09H INT 21H MOV AH,4CH INT 21H CODE ENDS END START
6
Program to sort numbers in ascending order using 8086 (unsigned numbers)
assume cs:code,ds:data data segment org 2000h series db 81h,82h,93h,95h,10h,56h,33h,99h,13h,44h count dw 10d data ends code segment start:mov ax,data mov ds,ax mov dx,count dec dx go:mov cx,dx lea si,series nxt_byte:mov al,[si] cmp al,[si+1] jb next xchg al,[si+1] xchg al,[si] next:inc si loop nxt_byte dec dx jnz go mov ah,4ch int 21h code ends end start
7
Division of two numbers using 8086 in assembly language
assume cs:code,ds:data data segment org 2000h num1 dw 8345h num2 dw 2346h rem dw 2d dup(0h) quo dw 2d dup(0h) data ends code segment start:mov ax,data mov ds,ax mov ax,num1 idiv num2 mov quo,ax mov rem,dx mov ah,4ch int 21h code ends end start For more detail contact us
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.