This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Chapter 15Chapter 15 Memory MappedChapter 15 Text Mode Programming1. What are the three levels of access to the video display when writing characters on the screen in text mode?MS-DOS-levelBIOS levelDirect video access 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) 3. How do you run a program in full-screen mode?1.Use ALT-Enter or2. create a shortcut to the program’s .EXE file. Then open properties dialog for the shortcut, select Screen properties, and select Full-screen mode.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)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.6. Which electron beams are required to generate any color on a video display?intensity ,red, green, and blue7. Show the mapping of foreground and background colors in the video attribute byte.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 valuesBH = video page9. 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 corner10. Which INT 10h function writes a character and attribute atthe current cursor position?Function 9•What parameters are required when writing a character and attributeat the current cursor position?AL = ASCII code of characterBH = video pageBL = attributeCX = repetition count11. Which INT 10h function sets the cursor size?Function 112. 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 modeAh = number of columnsBH = active video page13. Which INT 10h function toggles the blinking and intensity mode bit?Function 10h14. Write the ASM code to clear the screen using INT 10h, function 6?Mov ah, 6 ;function 6mov al, 0 ;scroll entire screen upint 10h ;use int 10hChapter 15Video Graphics_Mode•Which INT 10h function draws a single pixel on the video display?Function 0Ch•When using INT 10h to draw a single pixel, what values must be placed in the AL, BH, CX, and DX registers?AL = pixel valueBH = video pageCX = X-coordinateDX = Y-coordinate•When using INT 10h, function 0Ch to write a pixel, AL holds the pixelvalue. What does that mean – in two-color mode? 0=off (black), 1 = on (white)•How many bits are used in 16-color mode.4 bits (values the same as Table 15-3)•What happens if bit 7 is set in AL for this function? Did you use this in your lab?The bits are XORed (allowing pixel to be erased) •What is the main disadvantage to drawing pixels using INT 10h?•Function 0Ch executes rather slowly, particluarly when drawing a lot of pixels. (Most graphics applications write directly to video memory, after calculating the number of colors per pixel, the horizontal resolution, etc…)•Write ASM statements that set the video adapter to Mode 11h.Mov ah, 00Mov al, 11hInt 10h(note: the text modes are listed in Table 15-5;the graphics modes are listed in Table 15-6)•Which video mode is 800x600 pixels, in 16 colors?Video mode 6Ah•For a video mode having a resolution of 800x600, how many raster lines are displayed?600•For a video mode having a resolution of 800x600, each raster line has _______ number of pixels? 800Chapter 15 Memory Mapped•Which video mode is the easiest to use when using memorymapped graphics?Video mode 13h (320x200, 256 colors)Why?the screen pixels are mapped as a two-dimensional array of bytes, with a separate byte for each pixel.•How many bytes are needed for a whole screen of data?320x200 = 64,000•How are the bytes arranged in memory for video mode 13h?row-major order (the array begins with the pixel in the upper left corner of the screen, and continues across the top of the screen for 320 bytes. The next byte maps to the first pixel on the second screen line, and so on. The last byte in the array maps to thepixel in the lower right corner of the screen.•What is the formula to convert a Cartesian X cordinate to screen pixel coordinates? (use the variable sx for the screen column, and use sOrigX for the screen column where the Cartesian origin point (0,0) is located.)sx = (sOrigX + X)sy = (sOrigY – Y)•If a Cartesian origin point is located at screen coordinates sy = 250, sx = 350, convert the following Cartesian points in the form (X,Y) into screen coordinates (sx, sy).•a.(0, 100) (350+0, 250-100)=(350,150)b.(25,25) (350+25, 250-25)=(375,225)c.(-200, -150) (350-200,250+150)=(150,400)•Why use a whole byte for each pixel?to allow for 256 different integer values to represent each of the available colors.•In video mode 13h, each screen row uses 320 bytes of storage? (True/False)•Explain how video mode 13h sets the colors of pixels.•How is the color index used in video mode 13h?•In video mode 13h, what is contained in each element of thecolor palette?•What are the three RGB values for dark gray?••What are the three RGB values for white?••What are the three RGB values for bright red?•Write the ASM statements needed to set the screen background color in video mode 13h to green.•Write the ASM statements needed to set the screen background color in video mode 13h to white.Chapter 15Mouse Functions•Which INT number is used for the mouse?33h•Unlike DOS INT 21h, or BIOS INT10h, with the mouse BIOS functions, the function number is selected through the ____AL_____ register.•Which INT 33h function handles resetting the mouse and getting the status?–Look at slides –Look in book – page 566-574Write ASM statements that reset the mouse and get the mouse status.••Mov ax, 0 ;int 33h, function 0•Int 33h ;status returned in ax•Cmp ax, 0 ;if ax=0, mouse not available•If mouse is found: –It is centered on the screen–It’s display page is set to video page 0–It’s pointer is hidden–It’s mickey’s are set to


View Full Document

MSU ECE 3724 - Text Mode Programming

Documents in this Course
Timers

Timers

38 pages

TEST 4

TEST 4

9 pages

Flags

Flags

6 pages

Timers

Timers

6 pages

Timers

Timers

54 pages

TEST2

TEST2

8 pages

Load more
Download Text Mode Programming
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Text Mode Programming and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Text Mode Programming 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?