Address 13.

Uploaded on:
A shading feature screen utilizes three feature signals: red, green, & blue ... The RGB screen is accessible as either a simple or TTL (computerized) screen. ...
Slide 1

Address 13 Text-mode Video Dr. Dimitrios S. Nikolopoulos CSL/UIUC

Slide 2

Outline Video show equipment Text video mode Controlling and getting to video show utilizing DOS and BIOS capacities Accessing the video memory straightforwardly

Slide 3

It\'s all red green and blue You can get all hues utilizing red, green and blue Red+Green=Yellow Blue+Red = Purple and so forth. Why red, green and blue ? The human eye has sensors for these three hues These are all the hues we can "see" As soon as researchers got some answers concerning human vision we could fabricate shading TV\'s, shading screens and so on

Slide 4

Video yield Video is the essential type of correspondence between a PC and a human. The monochrome (single shading) screen utilizes one wire for video information, one for flat adjust, and one for vertical sync. A shading video screen utilizes three video signals: red, green, & blue these screens are called RGB screens and change over the simple RGB signs to an optical picture. The RGB screen is accessible as either a simple or TTL (advanced) screen.

Slide 5

TTL RGB screen Uses TTL level signs (0 or 5V) as video inputs (RGB) and an additional sign called force to permit change in power Used in the CGA (Color Graphics connector) framework found in more seasoned PCs Can show a sum of 16 distinctive hues (eight are created at high force and eight at low power) Example: Intensity Red Green Blue Color 0 0 0 0 Black 1 0 0 0 Gray 1 0 1 0 Light green 1 1 0 0 Light red 1 1 1 1 Bright white

Slide 6

The simple RGB screen Uses simple signs - any voltage between 0.0 V and 0.7 V This permit a limitless number of hues to be shown by and by a limited number of levels is produced (16K, 256K, 16M, hues relying upon the standard) Analog presentations utilize an advanced to-simple converter (DAC) to produce every shading video voltage A typical standard uses a 6-bit DAC to produce 64 diverse video levels between 0 V and 0.7 V this permits 64x64x64 hues to be shown, or 262,144 (256 K) hues 8-bit DACs permit 256x256x256 or 16M hues

Slide 7

The simple RGB screen The Video Adapter changes over computerized data from the CPU to simple signs for the screen. VRAM/DRAM Video/Dynamic Random Access Memory Stores screen content Video BIOS Stores character mappings Palette registers Defines R/G/B shading values Graphic quickening agent Hardware actualized realistic schedules DAC Generates simple Red/Green/Blue signs

Slide 8

The simple RGB screen Example: video era utilized as a part of video norms, for example, EGA (improved realistic connector) and VGA (variable representation exhibit) A fast palette SRAM (access time under 40ns) stores 256 distinctive codes that speak to 256 diverse tones (18-bit codes) This 18-bit code is connected to the DACs The SRAM is tended to by 8-bit code that is put away in the PC VRAM to indicate shade of the pixel Once the shading code is chosen, the three DACs change over it to three video voltages for the screen to show a photo component (pixel)

Slide 9

The Analog RGB Monitor Example of Video Generation (cont.) Any adjustment in the shading codes is expert amid remember (moving the electron shaft to the upper left-hand corner for vertical follow and to one side edge of the screen for even backtrack) The determination and shading profundity of the showcase (e.g., 640x400) decides the measure of memory required by the video interface card 640x400 determination with 256 hues (8 bits for every pixel) 256K bytes of memory are required to store every one of the pixels for the presentation

Slide 10

Text mode video There is not a solitary basic gadget for supporting video shows There are various showcase connector cards accessible for the PC Each backings a few diverse showcase modes We\'ll examine the 80x25 content presentation mode which is bolstered by a large portion of showcase connectors The 80x25 content presentation is a two dimensional cluster of words with every word in the exhibit comparing a character on the screen Storing the information into this cluster influences the characters showing up on the presentation

Slide 11

Text mode video Each content page involves under 4K bytes of memory 80(columns) x 25 (columns) x 2 (bytes) = 4000 bytes The LO byte contains the ASCII code of the character to show The HO byte contains the property byte Display connectors give 32 K to content shows and let you select one of eight diverse pages Each presentation starts on a 4K limit, at location: B800:0000, B800:1000, B800:2000, … . B800:7000

Slide 12

Text mode video The property byte controls basic foundation and frontal area hues, force and squinting video Choose your hues with consideration (a few mixes of forefront and foundation hues are not discernable) Do not exaggerate flickering content on the screen

Slide 13

The cursor A pointer to the "insertion point" on the screen When you utilize DOS/BIOS capacities to show a character, it shows where the cursor focuses The cursor then moves to the following section Other capacities let you move in reverse or up/down

Slide 14

DOS/BIOS capacities returned to Recall INT 21h capacities 02h, 06h yield characters to screen at current cursor position 09h yield "$" ended string to screen starting at current cursor position Recall INT 10h capacities 02h sets cursor position (counting page) 03h peruses cursor position (counting page) 05h set dynamic presentation page

Slide 15

GLOBAL _placeStr SEGMENT code _placeStr ; setup stack edge and spare state PUSH BP MOV BP, SP PUSH AX PUSH BX PUSH DX ; get current page - returns in BH MOV AH, 0fh INT 10h ; read unsigned args 2 and 3 MOV DL, [BP+10] MOV DH, [BP+8] Example ;set cursor position MOV AH, 02h INT 10h ;point to string MOV BX, [BP+6] ;call outAsc to disp string call outAsc ;restore state POP DX POP BX POP AX POP BP RETF

Slide 16

Writing characters straightforwardly Since the VRAM is memory mapped, you can utilize MOV guidelines to compose information specifically to the showcase Typically, we set the ES register to B800h so that the additional fragment can be utilized to address the VRAM Now video presentation can be gotten to simply like a 2D word exhibit

Slide 17

Example Calculate the balance from the earliest starting point of the VRAM portion (B8000h) for a discretionary page (P), line (Y) and segment (X) in a 80x25 content presentation mode Offset = 1000h * page + 160 * Y + 2*X

Slide 18

String directions Idea: Setup an information exchange and go Do an operation on source [DS:SI] and destination [ES:DI] and change SI and DI relying upon the course signal Transfer information substantially more rapidly than circles and movs Makes your code look more pleasant Think of the accompanying directions regarding their reciprocals You can\'t do memory to memory operations with different opcodes. The include\'s toward the end of the equal code don\'t influence the banners.

Slide 19

String guidelines MOVS – Move source to destination Mov byte [es:di], byte [ds:si] add si, 1 ; if CLD add di, 1 CMPS – Compare source to destination and set ZF if [ES:DI] = [DS:SI] cmp byte [es:di], byte [ds:si] add si, 1  ; If CLD add di, 1

Slide 20

Remember the banners register ? Air conditioning (Alignment check) (VM) Virtual mode (RF) Resume (NT) Nested undertaking (IOPL) Input/yield benefit level (O) Overflow (D) Direction (I) Interrupt (T) Trace (S) Sign (Z) Zero (An) Auxiliary Carry (P) Parity (C) Carry 8086, 8088, 80186 80386, 80486DX 80286 80486SX

Slide 21

String guidelines STOS – Store AL/AX/EAX into destination mov byte [es:di], al add di, 1  ; If CLD LODS – Load destination into AL/AX/EAX mov al, byte [ds:si] add si, 1  ; If CLD SCAS – Compare destination to AL… and set ZF if [ES:DI] = AL… cmp byte [es:di], al add di, 1  ; If CLD

Slide 22

String guidelines Each of the guidelines ought to be added with B, W or D for byte, word, or twofold word estimated exchanges. REP – What makes this helpful This is a prefix to the above opcodes REP/REPE/REPZ DEC CX LOOP until CX = 0 while ZF = 1 REPNE/REPNZ DEC CX Loop until CX = 0 while ZF = 0

Slide 23

String guidelines ; Example 1 ; Copy 123 bytes from source_str to dest_str cld ; clears destination banner, we " re climbing mov si, source_ster mov di, dest_str Mov cx, 123 Rep movsb ; Example 2 ; Compare str1 and str2, strlen(str1)=strlen(str2)=8 ; cld mov cx, 7 mov si, str1 mov di, str2 repe cmpsb ; think about until a character that doesn " t match is discovered

Slide 24

String guidelines ; Example 3 ; Convert a string from capitalized to lower case cld ; clears destination banner, we " re climbing Mov si, Sting2Convert mov di, si ; both point to string to change over mov cx, StrLength Convert2Lower: lodsb ; load from source, si=si+1 cmp al, " A " jb NotUpper cmp al, " Z " ja NotUpper or al, 20h NotUpper: Stosb ; store to destination, di=di+1

Slide 25

String guidelines ; Example: Copying a showcase cushion to the screen CLD ; clear dir hail so we go up ; setup source MOV SI, DisplayBuffer ; balance as for DS ; setup destination MOV AX, VidGrSeg ; B800 MOV ES, AX ; set destination section as ES MOV DI, 0 ; begin of screen ; setup counter MOV CX, (320*200/4) ; moving 4 bytes at once REP MOVSD ; this takes for a moment

Slide 26

Hints for MP3 You will need to utilize interfere/driven I/O to move your worm in all bearings You need to recollect the standards of ISRs they ought to be short and productive, else you won\'t have the capacity to investigate them You will utilize equipment intrudes on, the equipment will push the banners register for you yet you ought to ensure you utilize IRET and you push/pop different registers in your ISR To discover which key the player squeezed you need to utilize the console check codes in the ISR. Just a couple keys are significant for the amusement (bolts, getaway) and this will help you improve the ISR

Slide 27

Hints for MP3 You will utilize memory mapped I/O to yield to the screen Your screen is only a 2-d exhibit got to by balances of

View more...