Video IO for Text - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Video IO for Text

Description:

Output cannot be replaced unless MRS monitors access to ... Monochrome Attributes. Color Attributes. foreground chars; background screen behind chars ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 16
Provided by: Jan795
Category:
Tags: monochrome | text | video

less

Transcript and Presenter's Notes

Title: Video IO for Text


1
Video I/O for Text
  • Write directly to video memory
  • High speed, medium compatibility
  • (buffer address varies depending on type of
  • Video display and manufacturer)
  • Output cannot be replaced unless MRS monitors
    access to video buffer and reroutes it
  • BIOS-level INT (Int 10)
  • Medium speed, high compatibility
  • Output cannot be redirected unless ISR replaced
  • DOS-level INT (Int 21)
  • Low speed
  • Output can be easily redirected to other devices

2
Basic Text Screen
3
Text Modes (can only display characters from the
IBM extended Character set)
4
Graphics Mode-(can draw any combination of
pixels(dots)
5
BIOS
  • Basic Input Output Service a set of X86
    routines stored in ROM that can be used by any
    operating system for low level I/O to various
    devices.
  • Int 10h Video Services
  • Int 16h Keyboard Services
  • Int 17h Printer Services
  • Int 33h - Mouse Services

6
Bios Interrupt 10h Video Services
7
Lab 7A Positioning the Cursor
  • Irvine Library Function Clrscr
  • Dos Int 21h, Function 7 get char with no echo
  • w- move up - a move left
  • s move down - d move right
  • Procedure Setcur uses BIOS int 10h, function
    2 to set cursor position.

8
Monochrome Attributes
9
Color Attributes foreground chars
background screen behind chars b7
b0
10
BIOS Interrupt 10h- Video Services
11
Lab 7B Character Attributes
  • Procedure setcur positions cursor
  • Procedure wchar writes character with attribute
    at current cursor position (will have to
    increment column)

12
Random Number Generation
  • Irvine Library Functions
  • Randomize Re-seeds the random number generator.
    Current time value is seed value. No input or
    output required. Only needs to be called once at
    the beginning of a program.
  • Random_Range Returns a pseudo-random 32-bit
    integer between 0 and n. Input EAX n.

13
Lab 7C Pseudo-Random Numbers Delay
  • Randomize and Random-Range used for random number
    generation. EAX 10 to produce the values 0-9.
    To display ASCII value, 30h added to returned
    value.
  • Procedure mywait waits the number of
    milliseconds in CX.

14
Mywait Procedure
  • Uses 64-bit timer
  • Timer accessed through timget procedure
  • Uses rdtsc (read time stamp counter)
  • Windows 95 and some 98 versions have problems
    with the timget procedure
  • Inner loop of mywait waits number of timeticks
    equivalent to 1 millisecond (TICS_MS
    CLKFREQ1000)
  • Need to set CLKFREQ your PC clock frequency

15
CLKFREQ
  • START-gtSearch-gtFind-gtFILES/Folders
  • Find msinfo32.exe
  • Programs-gtAccessories-gtSystem Tools-gtSystemInfo
  • System Summary
  • Reboot PC watch BIOS screen information
Write a Comment
User Comments (0)
About PowerShow.com