0% found this document useful (0 votes)
136 views16 pages

By Heshalini Rajagopal

The document provides several assembly language programming prompts. The third prompt asks the writer to write a program that adds two words located at offset addresses 0800H and 0700H in segment 3000H, stores the result at 0900H, and stores the carry at 0902H. The program initializes the data segment, moves the first word to 0800H, adds it to the second word, stores the result at 0900H, checks and stores the carry at 0902H, and ends.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views16 pages

By Heshalini Rajagopal

The document provides several assembly language programming prompts. The third prompt asks the writer to write a program that adds two words located at offset addresses 0800H and 0700H in segment 3000H, stores the result at 0900H, and stores the carry at 0902H. The program initializes the data segment, moves the first word to 0800H, adds it to the second word, stores the result at 0900H, checks and stores the carry at 0902H, and ends.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

ALP

By
Heshalini Rajagopal
Write an assembly language to compare two data
and print the message that the data is equal or not
equal.
Second Option
Third Option:
Write an assembly language to add two data and
print the message that the addition result has
carry.
Second Option
Write a program to add two words located at offset address 0800H and 0700H in the
segment address 3000H and the result has to be stored at 0900H in the same
segment and carry will be stored at 0902H in the same segment.

Intialize data segment


MOV AX, 3000H
MOV DS, AX
Move the first word to 0800H
MOV AX, [0800H]
Add AX with the second word
ADD AX, [0700H]
•Store AX at the offset address (0900H)
MOV [0900H], AX
If carry = 1, jump to CARRY
JC CARRY
If carry = 0, store 00H at 0902H
MOV [0902H], 00H
To End the program
JMP END
Write a program to move a word string 100 words long from the offset address
1000H to the offset address 3000H in the segment 5000H.

MOV AX, 5000H


MOX DS, AX
MOV ES, AX ; segment intialization
MOV SI, 1000H
MOV DI, 3000H; index segment initialization
MOV CX, 100
CLD ; setting the counter and clearing the D flag for auto incremental mode
REP MOVSW ; repeat moving the word
HLT
Write a program to find the smallest word in an array of 100 words stored
sequentially in the memory, starting at the offset address 1000H in the segment
address 5000H. Store the result at the offset address 2000H in the same segment.
Write a program to find the number of positive and negative data items in an array
of 100 bytes of data stored from the memory location 3000H: 4000H. Store the
result in the offset address 1000H and 1001H in the same segment. Assume that the
negative numbers are represented in 2’s complement form.
Write the 8086 assembler program to execute LED display which
displays sequentially 0 to 100.

#start=led_display.exe#
#make_bin#
name "led"
MOV AX, 0
x1:
OUT 199, AX
INC AX
CMP AX,101
JE exit
JMP x1
exit:
HLT
Write a programe to display “Hello World!”
character by character on the EMU 8086 screen
ORG 100H
JMP START
MSG DB ‘Hello World!’, 0
START:
MOV SI, 0
NEXT_CHAR:
MOV AL, MSG[SI]
CMP AL, 0
JE STOP
MOV AH, OEH; PRINT CHARACTER IN TELETYPE MODE
INT 10H
INC SI
JMP NEXT_CHAR
STOP:
MOV AH, 0; WAIT FOR ANY KEY TO PRESS
INT 16H
RET; EXIT HERE AND RETURN CONTROL TO OS
END; STOP THE COMPILER
Option 2
org 100h
mov cx,12d
jmp start
msg db 'Hello World!'
start:
mov si, 0
nxt:
mov al, msg[si]
mov ah, 0eh ; print character in teletype mode
int 10h
inc si
loopne nxt
hlt
Write a program to add two BCD data 29H and 98H and store
the result in BCD form in the memory location 2000H:3000H
and carry in 2000H:3001H

You might also like