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