0% found this document useful (0 votes)
15 views4 pages

Lab Sheets #05

Uploaded by

minanessim100
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)
15 views4 pages

Lab Sheets #05

Uploaded by

minanessim100
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/ 4

DELTA TECHNOLOGICAL UNVERISITY Microprocessor

Faculty of Technological Industry and Energy Dr. Hassanein Shaban Ahmed


Information Technology Dept.

Lab Sheets #05

[1] Write and run the following program using Emu8086 software, what does this
program works
.MODEL SMALL
.STACK 64h
.DATA
.CODE
MAIN PROC
mov dl,-80
sar dl,1 ; DL = -40
sar dl,2
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN

[2] Write and run the following program using Emu8086 software, what does this
program works
.MODEL SMALL
.STACK 64h
.DATA
.CODE
MAIN PROC
mov dl,-10
sal dl,1; DL = -20
sal dl,2
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN

|Page1
[3] Write an assembly program to accept your name (set of characters end with carriage
return and display it reversed in a new line). Write and run the following program
using Emu8086 software:
.model small
.stack 100h
.data
Mes DB ‘enter your name:$’
.code
main proc
Mov ax,@data
Mov ds,ax
LEA Dx,Mes
Mov ah,9
Int 21h ;display Mes
Mov cx,0 ;initialize a counter
Mov ah,1
Top :
Int 21h
Cmp al,0dh ;carriage return
JE display
Inc cx
Push ax
Jmp top
Display:
Mov ah,2
Jcxz End ;if cx=0 go to end
Mov dl,0dh ; display
Int 21h ; carriage return
Mov dl,0ah ; display line feed
Int 21h
L1:
Pop DX
Int 21h
Loop L1
End:
Mov ah,4ch
Int 21h
Main endp
End main

|Page2
[4] Write and run the following program using Emu8086 software, what does this
program works
.MODEL SMALL
.STACK 100H
.CODE
MAIN PROC
MOV AX,7
MOV BX,13
MOV DX,0
CALL MULTIPLY
MOV AH,4CH
INT 21H
MAIN ENDP
MULTIPLY PROC
PUSH AX
PUSH BX
REPEAT:
TEST BX,1
JZ END_IF
ADD DX,AX
END_IF:
SHL AX,1
SHR BX,1
JNZ REPEAT
POP BX
POP AX
RET
MULTIPLY ENDP
END MAIN

[5] Write and run the following program using Emu8086 software, what does this
program works
.model small
.stack 100h
.code
main proc
MOV AH,01H
INT 21H
CALL P1
INT 21H
CALL P1
Mov ah,4ch
Int 21h
Main endp
P1 PROC
MOV DL,AL
MOV AH,02h
|Page3
INT 21H
RET ; return to caller.
P1 ENDP
END main

[6] Write a procedure receives two parameters in AL and BL registers, multiplies these
parameters and returns the result in AX register. Write and run the program using
Emu8086 software
.model small
.stack 100h
.code
main proc
MOV AL, 4
MOV BL, 2
CALL P2
CALL P2
Mov ah,4ch
Int 21h
Main endp
P2 PROC
MUL BL
RET
P2 ENDP
End main

|Page4

You might also like