Category Archives: 8086

Performing Block Transfer using Assembly Language

In this blog post, we’ll explore how to perform a block transfer using an 8086 assembly language program. The following code snippet demonstrates this process:

DATA SEGMENT
STRING1 DB 01H,02H,03H,04H,05H
STRING2 DB 4 DUP(0)
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV ES,AX
LEA SI,STRING1
LEA DI,STRING2
MOV CX,05H
CLD
REP MOVSB
INT 3
CODE ENDS
END START
Continue reading Performing Block Transfer using Assembly Language

8086 Assembly Program to Search an Element in an Array

In this blog post, we’ll explore how to search for an element in an array using an 8086 assembly language program. The following code snippet demonstrates this process:

DATA SEGMENT
STRING1 DB 11H,22H,33H,44H,55H
MSG1 DB "FOUND$"
MSG2 DB "NOT FOUND$"
SE DB 33H
DATA ENDS

PRINT MACRO MSG
MOV AH, 09H
LEA DX, MSG
INT 21H
INT 3
ENDM

CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV AX, DATA
MOV DS, AX
MOV AL, SE
LEA SI, STRING1
MOV CX, 04H

UP:
MOV BL,[SI]
CMP AL, BL
JZ FO
INC SI
DEC CX
JNZ UP
PRINT MSG2
JMP END1

FO:
PRINT MSG1

END1:
INT 3
CODE ENDS
END START
Continue reading 8086 Assembly Program to Search an Element in an Array

8086 Assembly Program to Print ‘hello’ using 09H

Displaying a string using DOS interrupt 21H function 09H is a straightforward way to print messages to the screen in 8086 assembly language. This blog post explores an 8086 assembly program that prints the string ‘hello’ to the console.

data segment
msg1 db 'hello$'
data ends

code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov sp,0d00h
mov ah,09h
int 21h
mov ax,4c00h
int 21h
int 3
code ends
end start
Continue reading 8086 Assembly Program to Print ‘hello’ using 09H

Interrupting BIOS with 8086 Assembly Program

Interacting with BIOS interrupts in 8086 assembly language is a crucial technique for handling low-level hardware operations. This blog post explores an 8086 assembly language program that invokes BIOS interrupts to manipulate the screen cursor position and handle user input.

code segment
assume cs:code
start:
mov sp, 7000h
mov ah, 01
mov ch, 00
mov cl, 14
int 10h
mov ah, 02
mov bh, 00
mov dh, 23
mov dl, 10
int 10h
mov ax, 4c00h
int 21h
int 3
code ends
end start
Continue reading Interrupting BIOS with 8086 Assembly Program

Implementing JUMP, PUSH, POP, IN & OUT in Assembly Program on 8086

Manipulating registers and memory efficiently using instructions like JUMP, PUSH, POP, IN, and OUT is essential in assembly language programming. This program demonstrates these operations in 8086 assembly, utilizing stack operations and port I/O.

data segment
abc dw 1101H
def dw 0025H
pqr dw 0011H
res dw ?
res1 dw ?
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov ax,abc
mov bx,def
mov cx,pqr
mov dx,0002H
jmp ma
back:
push ax
push bx
push cx
pop cx
pop bx
pop ax
mov ax,abc
inc ax
mov abc,ax
mov bx,def
dec bx
mov def,bx
ma:
add ax,bx
mov res,ax
dec dx
jnz back
in ax,25H
out 30H,ax
mov res1,ax
int 3
code ends
end start
Continue reading Implementing JUMP, PUSH, POP, IN & OUT in Assembly Program on 8086

8086 Assembly Program to Display String ‘hello’

Displaying a string in assembly language is an essential task, often used in debugging or user interaction. This blog post explores an 8086 assembly language program that prints the string ‘hello’ to the console using DOS interrupt 21h.

data segment
msg1 db 'hello'
data ends

code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov sp,0d000h
mov bx,offset msg1
mov cx,0005h
move:
mov ah,02h
mov dl,[bx]
int 21h
inc bx
dec cx
jnz move
mov ax,4c00h
int 21h
int 3
code ends
end start
Continue reading 8086 Assembly Program to Display String ‘hello’

8086 Assembly Program for Subtraction of Two 8 bit Numbers

Subtraction is a fundamental arithmetic operation in assembly language programming. This blog post explores an 8086 assembly language program that performs the subtraction of two 8-bit numbers using the SUB instruction. The result is stored in a 16-bit destination.

data segment
a db 2Ah
b db 13h
c dw ?
data ends

code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov al,a
mov bl,b
sub al,bl
mov c,ax
int 3
code ends
end start
Continue reading 8086 Assembly Program for Subtraction of Two 8 bit Numbers