0% found this document useful (0 votes)
16 views2 pages

Experiment 1

The document describes an experiment involving assembly language instructions like MOV, ADD, LODSW, and STOSW. It includes a sample assembly program and steps to run the program, observe the register values, and modify the program. Key registers and memory addresses used in the program are explained. Memory segmentation and addressing modes are also discussed.

Uploaded by

ahmed alhammad
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)
16 views2 pages

Experiment 1

The document describes an experiment involving assembly language instructions like MOV, ADD, LODSW, and STOSW. It includes a sample assembly program and steps to run the program, observe the register values, and modify the program. Key registers and memory addresses used in the program are explained. Memory segmentation and addressing modes are also discussed.

Uploaded by

ahmed alhammad
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/ 2

Experiment 1

Theory:
1- MOV:
MOV REG,REG
MOV REG,MEM
MOV MEM, REG

REG could be 8 bit [AL, AH, BL, BH, CL, CH, DL, DH] or 16 bit [AX, BX, CX, DX, SP,
BP, SI, DI]

Mem could addressed as:


a- Direct MOV AL, [1200] ; AL := memory (DS:1200)
b- Register indirect MOV AL, [BX] ; AL := memory (DS:BX)
[BX, BP, SI, DI] could be used.
BX, SI, DI are for data segment DS
BP is for Stack segment SS
c- Others (not used in the LAB)

2- ADD
ADD REG, Value : value should be same as REG size
ADD REG,REG
ADD REG,MEM
ADD MEM, REG

3- LODSW
LODSW is one of Load string commands [LODS/LODSB/LODSW/LODSD]
LODSB ;AL:= Memory(DS:SI) then depending on the Direction flag
incrementing/decrementing the SI. (default increment)
LODSW ; AX = Memory(DS:SI)

4- STOSW
STOSW is one of Store string commands [STOS/STOSB/STOSW/STOSD]
STOSSB; Memory(DS:DI) :=AL then depending on the Direction flag
incrementing/decrementing the DI. (default increment)
STOSW; Memory(DS:DI) :=AX
Assembly Program

MOV SI, 1200


LODSW
MOV BX,AX
LODSW
ADD BX,AX
MOV DI, 1300
MOV [DI], BX
INT 3

Procedure

1- Connect the Kit to 101 PS/2 Keyboard


2- Press SB 1200 to enter sub byte mode starting from memory 1200 in the datasegment
3- Insert the bytes (11, 22, 33, 44)
4- Press A followed by Enter
5- Start Address is: 1000
6- Write the program line by line followed by enter
7- End the program by INT 3 instead of HLT
8- Press (.) to return to the Main screen
9- Write R to read the registers, initially the should be 0000
10- Write GO 1000 followed by Enter. The Program should end with BRK PT (Break
point)
11- Write R to read the registers after Executing.
12- Explain the value of each [AL, AH, BX, SI, DI] and memory location word[1300].
13- Modify the program to use STOSW instead of MOV [DI], BX
14- Modify the program to use SUB instead of ADD

Discussion

1- What is the use of CS, DS, SS, ES segments


2- If DS=1000 and SI= 1300, what is the effective memory address of the command
LODSW.
3- What are real mode and protected mode in memory segmentation means.

You might also like