Upload
wilfrid-fowler
View
215
Download
0
Tags:
Embed Size (px)
Citation preview
Text-Mode Programming
Question #1
• What are the three levels of access to the video display when writing characters on the screen in text mode?
Text-Mode Programming
Question #1
• What are the three levels of access to the video display when writing characters on the screen in text mode?
MS-DOS-level
BIOS level
Direct video access
Text-Mode Programming
Question #2
• Which level of access produces the fastest output?
Text-Mode Programming
Question #2
• Which level of access produces the fastest output?
Direct Video - characters are moved directly to video RAM, so the execution is instantaneous.
(Full screen mode must be used under Windows NT, 2000, and XP)
Text-Mode Programming
Question #3
• How do you run a program in full-screen mode?
Text-Mode Programming
Question #3
• How do you run a program in full-screen mode?
1.Use ALT-Enter or
2. create a shortcut to the program’s .EXE file. Then open properties dialog for the shortcut, select Screen properties, and select Full-screen mode.
Text-Mode Programming
Question #4
• When a computer is booted in MS-DOS, what is the default video mode?
Text-Mode Programming
Question #4
• When a computer is booted in MS-DOS, what is the default video mode?
Video mode 3 -
(text mode,16 colors,
80 columns x 25 rows)
Text-Mode Programming
Question #5
• Each position on the video display holds what information for a single character?
• How many bytes are needed in memory for each character?
Text-Mode Programming
Question #5
• Each position on the video display holds what information for a single character?– Attribute (color)
• How many bytes are needed in memory for each character?– 2 – one for the character, one for the attribute.
Text-Mode Programming
Question #6
• Which electron beams are required to generate any color on a video display?
Text-Mode Programming
Question #6
• Which electron beams are required to generate any color on a video display?
intensity ,red, green, and blue
Text-Mode Programming
Question #7
• Show the mapping of foreground and background colors in the video attribute byte.
Text-Mode Programming
Question #7
• Show the mapping of foreground and background colors in the video attribute byte.
I R G B I R G B
background foreground
Blink R G B I R G B
Text-Mode Programming
Question #8
• Which INT 10h function positions the cursor on the screen?
• What parameters are required when setting the cursor position with INT 10h?
Text-Mode Programming
Question #8
• Which INT 10h function positions the cursor on the screen?
Function 2
• What parameters are required when setting the cursor position with INT 10h?
DH, DL = row, column values
BH = video page
Text-Mode Programming
Question #9
• Which INT 10h function scrolls text in a rectangular window upward?
• What parameters are required when scrolling text in a window upward?
Text-Mode Programming
Question #9
• Which INT 10h function scrolls text in a rectangular window upward?
Function 6• What parameters are required when scrolling
text in a window upward?AL = number of lines to scroll ( 0=all)BH = video attribute for blanked areaCH, CL = row, column of upper left window
cornerDH, DL = row, column of lower right
window corner
Text-Mode Programming
Question #10
• Which INT 10h function writes a character and attribute at the current cursor position?
• What parameters are required when writing a character and attribute at the current cursor position?
Text-Mode Programming
Question #10• Which INT 10h function writes a character and
attribute at the current cursor position?Function 9
• What parameters are required when writing a character and attribute at the current cursor position?
AL = ASCII code of characterBH = video pageBL = attributeCX = repetition count
Text-Mode Programming
Question #11
• Which INT 10h function sets the cursor size?
Text-Mode Programming
Question #11
• Which INT 10h function sets the cursor size?
Function 1
Text-Mode Programming
Question #12
• Which INT 10h function gets the current video mode?
• What is returned when the function that gets the current video mode is called?
Text-Mode Programming
Question #12
• Which INT 10h function gets the current video mode?
Function 0Fh
• What is returned when the function that gets the current video mode is called?
AL = current display mode
Ah = number of columns
BH = active video page
Text-Mode Programming
Question #13
• Which INT 10h function toggles the blinking and intensity mode bit?
Text-Mode Programming
Question #13
• Which INT 10h function toggles the blinking and intensity mode bit?
Function 10h
Text-Mode Programming
Question #14
• Write the ASM code to clear the screen using INT 10h, function 6?
Text-Mode Programming
Question #14
• Write the ASM code to clear the screen using INT 10h, function 6?
Mov ah, 6 ;function 6
mov al, 0 ;scroll entire screen up
int 10h ;use int 10h