You are on page 1of 9

NCP 312 (Computer Organization With

Assembly Language Laboratory)

EXPERIMENT 3
ADVANCE SCREEN OPERATION
I.

OBJECTIVES
1. To cover advance feature of screen handling
2. To be familiar with the techniques of designing program loops.

II.

INSTRUCTIONS / SERVICES
A. INT 10H SERVICE 00: Setting Mode
MOV AH, 00
MOV AL, 03
INT 10H

; request set mode


; 80 x 25 standard color text
; call BIOS

B. INT 10H SERVICE 02: Set cursor position


MOV AH, 02
MOV DH, row
MOV DL, column
INT 10H

; request cursor position


; cursor row position
; cursor column position

C. INT 10H SERVICE 09: Display character with attribute at cursor position
MOV AH, 09
MOV AL, character
MOV BH, page #
MOV BL, attribute
MOV CX, repetition
INT 10H

; request display
; character to display
; page number
; screen attribute
; number of repeated characters

ATTRIBUTE BYTE
BL

BACKGROUND COLOR

INT

FOREGROUND COLOR

D. INT 10H SERVICE 0AH: Display character at cursor position


MOV AH, 0AH
MOV AL, character
MOV BH, page #
MOV CX, repetition
INT 10H

; request display
; character to display
; page number
; number of repeated characters

1 | Page

NCP 312 (Computer Organization With


Assembly Language Laboratory)

E. INT 10H SERVICE 13H: Display character string


MOV AH, 13H
MOV AL, function
MOV BH, page #
MOV BL, attribute
LEA BP, address
MOV CX, length
MOV DH, row
MOV DL, column
INT 10h

; request display
; 0, 1, 2, or 3
; page number
; screen attribute
; address of string in ES:BP
; length of string
; row position of string
; column position of string

F. LOOP INSTRUCTIONS
FORMAT:

[label] <instruction/s> LOOP near address

G. ADD / SUB INSTRUCTIONS


ADD/SUB
ADD/SUB
ADD/SUB
ADD/SUB
ADD/SUB

{register}, {register}
{memory location}, {register}
{register}, {memory location}
{register}, {immediate}
{memory location}, {immediate}

H. INC / DEC INSTRUCTIONS


FORMAT:

INC/DEC

{register / memory location}

2 | Page

NCP 312 (Computer Organization With


Assembly Language Laboratory)

EXERCISE
NAME:
SECTION:

DATE:

INSTRUCTOR:
GRADE:

1. Encode the given assembly language program, assemble, link and execute.
cseg segment para 'code'
assume cs:cseg, ds:cseg, es:cseg, ss:cseg
org 100h
start:
jmp begin
str1 db 'NCP 311$'
begin:
mov ax, 003h
int 10h
mov ah, 00
mov al, 01
int 10h
int 20h
cseg ends
end start

1. Modify the content of AL with 03. Compare the output of 01 and 03.

2. Modify the bold faced instruction after BLOCK A with the given instructions.
mov ah, 09h
mov al, $
mov bh, 0
mov bl, 61h
mov cx, 8
int 10h
Output:

3 | Page

NCP 312 (Computer Organization With


Assembly Language Laboratory)

2. Add the following instructions before the set of instruction in #4.


mov ah, 02
mov dh, 1
mov dl, 37
int 10h
Output:

4. Replace the original instruction with the following:


mov ah, 13h
mov al, 0
mov bh, 0
mov bl, 0C1h
lea bp, str1
mov cx, 6
mov dh, 0
mov dl, 38
int 10h
Output:

4 | Page

NCP 312 (Computer Organization With


Assembly Language Laboratory)

EXERCISE
NAME:
SECTION:

INSTRUCTOR:
GRADE:

DATE:

DESIGN AN ASSEMBLY PROGRAM THAT WILL DISPLAY THE GIVEN OUTPUT


FORMAT

*********************
I
WILL
PASS
NCP 311
*********************
Characteristics:
I TEXT: BLUE, BACKGROUND: LIGHT RED
WILL NO ATTRIBUTE
PASS TEXT: RED, BACKGROUND: GREEN
NCP 311 TEXT: RED, BACKGROUND: LIGHT BLUE

EXERCISE
NAME:

INSTRUCTOR:

5 | Page

NCP 312 (Computer Organization With


Assembly Language Laboratory)

SECTION:

DATE:

GRADE:

ENCODE THE GIVEN ASSEMBLY LANGUAGE PROGRAM, ASSEMBLE, LINK AND


EXECUTE. WRITE THE OUTPUT WITHIN THE BLOCK.
sseg segment para stack 'stack'
dw 200h
sseg ends
dseg segment para 'data'
char1 db 'A'
char2 db 'a'
dseg ends
cseg segment para 'code'
main proc far
assume cs:cseg, ds:dseg, ss:sseg
mov ax, dseg
mov ds, ax
mov ax, 0003h
int 10h
;BLOCK A
mov cx, 5
x1:
mov ah, 02
mov dl, char1
int 21h
mov dl, char2
int 21h
inc char1
inc char2
loop x1
mov ah, 4Ch
int 21h
main endp
cseg ends
end main
Output:

6 | Page

NCP 312 (Computer Organization With


Assembly Language Laboratory)

CHANGE THE ORIGINAL BOLD FACED INSTRUCTIONS WITH THE FOLLOWING:


mov cx, 5
mov ah, 02h
mov char2 , 'Z'
x1:
mov dl, char2
int 21h
mov dl, 10
int 21h
sub char2, 2
loop x1
Output:

7 | Page

NCP 312 (Computer Organization With


Assembly Language Laboratory)

ACTIVITY
NAME:
SECTION:

DATE:

INSTRUCTOR:
GRADE:

1. Create an assembly program that will generate the given series of letters using
LOOP instruction:
AzByCxDwEv

8 | Page

NCP 312 (Computer Organization With


Assembly Language Laboratory)

2. Modify the answer in #1. with the given output format. Use only the control
characters to position the cursor
A
z
B
y
C
x
D
w
E
v

9 | Page

You might also like