Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
71 views8 pages

Micro Processor and Assembly Language

The document describes a lab task for a microprocessor and assembly language course. It includes sample assembly language programs that demonstrate loading constants and variables into registers using MOV instructions. The programs show loading single byte values into AL and AH registers, word values into AX and BX registers, and using DB and DW directives to define the variables in memory. Students are instructed to modify the sample programs and fill out tables describing the constants, variables, directives and mnemonics used.

Uploaded by

Akasha Ahmad
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)
71 views8 pages

Micro Processor and Assembly Language

The document describes a lab task for a microprocessor and assembly language course. It includes sample assembly language programs that demonstrate loading constants and variables into registers using MOV instructions. The programs show loading single byte values into AL and AH registers, word values into AX and BX registers, and using DB and DW directives to define the variables in memory. Students are instructed to modify the sample programs and fill out tables describing the constants, variables, directives and mnemonics used.

Uploaded by

Akasha Ahmad
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/ 8

THE UNIVERSITY OF LAHORE,DEPARTMENT CS & IT

MICRO PROCESSOR AND ASSEMBLY LANGUAGE

LAB Task
SUBMITTED TO:
IJAZ MEHAR
SUBMITTED BY:
AKASHA AHMAD
70070426
BSCS-4F
Lab Session 03
Single Character Output
MOV AH,02H ; display character function

MOV DL,’?’ ; character is ‘?’

INT 21h ; character will be displayed

Sample Program

OBJECT:
Title a program that displays single character on screen.

SOURCE CODE:
.MODEL SMALL
.STACK 100H
.CODE
MOV AH, 01H ; Character input with echo
INT 21H ; Character in AL
MOV BL, AL ; Save in BL

MOV AH, 01H ; Character input with echo


INT 21H ; Character in AL
MOV CL, AL ; Save in CL

MOV AH, 01H ; Character input with echo


INT 21H ; Character in AL
; MOV DL, AL ; Save in DL
MOV CH, AL ; <============================

MOV AH, 02H ; Display character function

MOV DL, 0DH ; carriage return


INT 21H
MOV DL, 0AH ; line feed
INT 21H

MOV DL, BL ; Get character stored in BL and display


INT 21H
MOV DL, CL ; Get character stored in BL and display
INT 21H
; MOV DL, DL ; Get character stored in BL and display
MOV DL, CH ; <============================
INT 21H

MOV AH, 4CH


INT 21H
END
EMULATOR SCREEN:

DEBUG:
Lab Session 04
Procedure:
Start Emu8086 by selecting its icon.

Write the following codes in the text editor

Modify the codes according to given instructions

Program 1:
org 100h

bytea db 15d

mov al,bytea

ret

Fill in the following table for Program 1

Constant 15d

Variables al

Directive db

Mnemonic MOV

Program 2:
org 100h

bytea db 15d

byteb db 06d

mov al,byte a

mov ah,byte b

ret

Fill in the following table for Program 2


Constant 15d and 06d

Variables al,ah

Directive db

Mnemonic MOV

Program 3:
org 100h

worda dw 12d

wordb dw13d

mov ax,word a

mov bx,word b

ret

Fill in the following table for Program 3

Constant 12d 13d

Variables Ax,Bx

Directive dw

Mnemonic MOV

Program 4:
org 100h

worda dw 120d

wordb dw 121d

mov ax,word a
mov bx,word b

ret

Fill in the following table for Program 4

Constant 120d 121d

Variables Ax,Bx

Directive dw

Mnemonic MOV

You might also like