0% found this document useful (0 votes)
20 views10 pages

Exp 02 Moving An Array of Data

Moving an array of data using 8086
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views10 pages

Exp 02 Moving An Array of Data

Moving an array of data using 8086
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Department of ECE

23EC2106R
PROCESSORS AND CONTROLLERS
Lab Experiment - 2

MOVING ARRAY OF DATA USING 8086


Exp 2: MOVING ARRAY OF DATA USING 8086

Aim

● To Develop an Assembly Language Program (ALP) to move a 16-bytes long string data
from the starting offset location of 0200H to starting offset location of 0300H in the
segment 7000H.

Software used: 8086 Emulator


Exp 2: MOVING ARRAY OF DATA USING 8086

Theory:
• Write a paragraph about segment address and offset addresses in 8086
microprocessor.
Exp 2: MOVING ARRAY OF DATA USING 8086

Input Data:
• The 16 bytes of data stored in offset location 0200H of segment
location 7000H is
01H, 11H, 21H, 31H,
41H, 51H, 61H, 71H,
81H, 91H, A1H, B1H,
C1H, D1H, E1H, F1H
Exp 2: MOVING ARRAY OF DATA USING 8086
Program Table: (a)
Address Program Comment
0100:0000 MOV AX, 7000H Move the value 7000H into AX register (loading segment address)
0100:0003 MOV DS, AX Move the contents of AX into DS register (data segment register)
0100:0005 MOV CL, 10H Load CL register with the size of the string (10H or decimal 16)
0100:0007 MOV SI, 0200H loading the source data offset address into SI register
0100:000A MOV DI, 0300H loading the destination offset address into DI register
0100:000D BACK: MOV AL, [SI] Move the data from source address into AL register
0100:000F MOV [DI], AL Move the contents of AL register into destination address
0100:0011 INC SI Increase SI contents by 1
0100:0012 INC DI Increase DI contents by 1
0100:0013 DEC CL decrease CL contents by 1
0100:0015 JNZ BACK Jump to BACK if ZF=0 (Keep moving all 16 bytes of data until CL=0)
0100:0017 HLT Halt (stop) the processor.
Exp 2: MOVING ARRAY OF DATA USING 8086
Program Table: (b)
Address Program Comment
0100:0000 MOV AX, 7000H Move the value 7000H into AX register (loading segment address)
0100:0003 MOV DS, AX Move the contents of AX into DS register (data segment register)
0100:0005 MOV CL, 10H Load CL register with the size of the string (10H or decimal 16)
0100:0007 MOV SI, 0200H loading the source data offset address into SI register
0100:000A MOV DI, 0300H loading the destination offset address into DI register
0100:000D BACK: MOV AL, [SI] Move the data from source address into AL register
0100:000F MOV [DI], AL Move the contents of AL register into destination address
0100:0011 INC SI Increase SI contents by 1
0100:0012 INC DI Increase DI contents by 1
0100:0013 LOOP BACK Repeat the loop until CL=0 (Keep moving all 16 bytes of data)
0100:0015 HLT Halt (stop) the processor.
Exp 2: MOVING ARRAY OF DATA USING 8086
Program Table: (c)
Address Program Comment
0100:0000 MOV AX, 7000H Move the value 7000H into AX register (loading segment address)
0100:0003 MOV DS, AX Move the contents of AX into DS register (data segment register)
0100:0005 MOV ES, AX Move the contents of AX into ES register (extra segment register)
0100:0007 MOV CL, 10H Load CL register with the size of the string (10H or decimal 16)
0100:0009 MOV SI, 0200H loading the source data offset address into SI register
0100:000C MOV DI, 0300H loading the destination offset address into DI register
0100:000F CLD Clear direction flag DF =0 (auto incrementing address access)
0100:0010 REP MOVSB Repeatedly move the string of 16 bytes until CL=0
0100:0012 HLT Halt (stop) the processor.
Exp 2: MOVING ARRAY OF DATA USING 8086
Input Data: Output Data:
Observation Values:
Memory Data Memory Data
Location Byte Location Byte
0200H 01 0300H 01
0201H 11 0301H 11
. .
. .
. .
020FH F1 030FH F1

FLAG Register After Addition:


OF DF IF TF SF ZF AF PF CF

x X X X 0 0 1 - 0 1 X 0 X 1 X 0
Exp 2: MOVING ARRAY OF DATA USING 8086
Result:

● An Assembly Language Program (ALP) is developed to move a 16-bytes long string


data from the starting offset location of 0200H to starting offset location of 0300H in
the segment 7000H.
THANK YOU

N L PRASAD

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy