Computer System Organization with Assembly Language
EXPERIMENT 3
ADVANCE SCREEN OPERATION
I. OBJECTIVES
1. To cover advance feature of screen handling
II. INSTRUCTIONS / SERVICES
A. INT 10H SERVICE 00: Setting Mode
MOV AH, 00 ; request set mode
MOV AL, 03 ; 80 x 25 standard color text
INT 10H ; call BIOS
B. INT 10H SERVICE 02: Set cursor position
MOV AH, 02 ; request cursor position
MOV DH, row ; cursor row position
MOV DL, column ; cursor column position
INT 10H
C. INT 10H SERVICE 09: Display character with attribute at cursor position
MOV AH, 09 ; request display
MOV AL, character ; character to display
MOV BH, page # ; page number
MOV BL, attribute ; screen attribute
MOV CX, repetition ; number of repeated characters
ATTRIBUTE BYTE
BL R G B INT R G B
BACKGROUND COLOR FOREGROUND COLOR
D. INT 10H SERVICE 0AH: Display character at cursor position
MOV AH, 0AH ; request display
MOV AL, character ; character to display
MOV BH, page # ; page number
MOV CX, repetition ; number of repeated characters
INT 10H
1 | University of the East - Caloocan
Computer System Organization with Assembly Language
E. INT 10H SERVICE 13H: Display character string
MOV AH, 13H ; request display
MOV AL, function ; 0, 1, 2, or 3
MOV BH, page # ; page number
MOV BL, attribute ; screen attribute
LEA BP, address ; address of string in ES:BP
MOV CX, length ; length of string
MOV DH, row ; row position of string
MOV DL, column ; column position of string
INT 10h
2 | University of the East - Caloocan
Computer System Organization with Assembly Language
EXERCISE
NAME: INSTRUCTOR:
SECTION: DATE: GRADE:
ENCODE THE GIVEN ASSEMBLY LANGAUGE PROGRAM, ASSEMBLE, LINK AND
EXECUTE.
sseg segment para stack ‘stack’
dw 200h
sseg ends
dseg segment para ‘data’
str1 db ‘NCP311$’
dseg ends
cseg segment para ‘code’
main proc far
assume cs:cseg, ss:sseg, ds:dseg
mov ax, dseg
mov ds, ax
mov es, ax
;BLOCK A
mov ah, 00
mov al, 01
int 10h
mov ah, 4ch
int 21h
main endp
cseg ends
end main
1. Modify the content of AL with 03. Compare the output of 01 and 03.
3 | University of the East - Caloocan
Computer System Organization with Assembly Language
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:
4 | University of the East - Caloocan
Computer System Organization with Assembly Language
3. Add the following instructions before the set of instruction in #2.
mov ah, 02
mov dh, 1
mov dl, 37
int 10h
Output:
5 | University of the East - Caloocan
Computer System Organization with Assembly Language
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:
6 | University of the East - Caloocan
Computer System Organization with Assembly Language
7 | University of the East - Caloocan
Computer System Organization with Assembly Language
ACTIVITY
NAME: INSTRUCTOR:
SECTION: DATE: GRADE:
DESIGN AN ASSEMBLY PROGRAM THAT WILL DISPLAY THE GIVEN OUTPUT
FORMAT
*********************
I
WILL
PASS
NCP 312
*********************
Characteristics:
* - No Attribute, repeated 21 times
I – TEXT: BLUE, BACKGROUND: LIGHT RED
WILL – NO ATTRIBUTE
PASS – TEXT: RED, BACKGROUND: GREEN
NCP 312 – TEXT: RED, BACKGROUND: LIGHT BLUE
8 | University of the East - Caloocan