Download presentation
Presentation is loading. Please wait.
Published byJoseph Brent Turner Modified over 9 years ago
1
3 Types of Video Output for Text DOS-level INT (Int 21) Output can be easily redirected to other devices (printer, disk) Slow Speed Cannot control the text color BIOS-level INT (Int 10) Higher speed than DOS (when filling large areas, a slight delay detected). User can control the text color Output cannot be redirected Direct video Access (Memory Mapped Graphics) Characters are moved directly to video RAM, so execution is instantaneous Output cannot be redirected Usage restricted to full-screen mode under Windows NT, 2000, and XP
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 ValueAttributes 07Normal 87Blinking 0FBright(highlight) 70Reverse(inverse) 01Underline 09Bright underline
9
Color Attributes – foreground – chars; background – screen behind chars b 7 b 0
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 = CLKFREQ*1000) –Need to set CLKFREQ = your PC clock frequency
15
CLKFREQ START->Search->Find->FILES/Folders –Find ‘msinfo32.exe’ Programs->Accessories->System Tools- >SystemInfo System Summary Reboot PC – watch BIOS screen information
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.