Lecture 11 Text mode video

Slides:



Advertisements
Similar presentations
Video Cards CS431 Class Presentation Ashish Bhat ( ) Nilesh Meshram ( )
Advertisements

DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
There are two types of addressing schemes:
1 Graphic adapters and monitors – the summary. 2 Outline The summary of principles of displaying the information – adapters and monitors. Black and white.
Video systems (continue). Practice Modify the program to get a string from a keyboard to display the input string on the middle of the screen with reverse.
Assembly Language for Intel-Based Computers Chapter 15: BIOS-Level Programming (c) Pearson Education, All rights reserved. You may modify and.
Output Primitives Computer Graphics.
EET Advanced Digital Display Adapters. A vital part to the system provides the visual part of the Human/Computer interface In boot process, goes.
Chapter 7 Programming with DOS and BIOS Function Calls Objectives: The use of DOS and BIOS function call How to read the PC’s keyboard How to send text.
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Kip Irvine: Assembly Language for Intel-Based Computers
Screen Display Module M15.2 Sections 9.5, 13.1, 13.2.
1 King ABDUL AZIZ University Faculty Of Computing and Information Technology CS 454 Computer graphicsIntroduction Dr. Eng. Farag Elnagahy
Lecture 121 Lecture 12: VGA Video ECE 412: Microcomputer Laboratory.
EET Advanced Digital Display Adapters. A vital part to the system provides the visual part of the Human/Computer interface In boot process, goes.
Topic – string – Ch. 11 [Marut] Ch. 4 [Brey] String Data Transfer Instructions – The Direction Flag – LODS Instructions – STOS Instructions – MOVS Instructions.
Monitors and Sound Systems section 3A This lesson includes the following sections: · Monitors · PC Projectors · Sound Systems.
Video Monitor Uses raster scanning to display images
Basics of a Computer Graphics System Introduction to Computer Graphics CSE 470/598 Arizona State University Dianne Hansford.
ORG ; FOUR INT 21H and INT 10H Programming and Macros Dec Hex Bin
3.7 String Instructions Specifying the Operands’ Size and Address and the String Direction STRING = a data collection in memory. String ELEMENTS can be:
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
Video Monitor Uses raster scanning to display images –Beam of electrons illuminates phosphorus dots on the screen called pixels. Starting at the top of.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Text-mode Video Dr. Dimitrios S. Nikolopoulos CSL/UIUC
1/2002JNM1 Positional Notation (Hex Digits). 1/2002JNM2 Problem The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory.
BIOS and DOS Programming in DOS INT 10 and 21H. Interrupts There are some extremely useful subroutines within BIOS or DOS that are available to the user.
1 Screen and Keyboard Operations Suthida Chaichomchuen
Lab 8 Bit-Mapped Graphics Moving from text-based graphics to bit- mapped graphics. Easy to draw graphic points and lines using INT 10h, Function 0Ch (write.
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?
Lecture 10: BIOS and DOS Programming
ECE291 Lecture 12 Mode 13h Graphics. ECE 291 Lecture 12Page 2 of 27 Lecture outline Color theory Video Hardware Mode 13h Graphics File Formats.
ECE291 Computer Engineering II Lecture 15 Josh Potts University of Illinois at Urbana- Champaign.
Video systems. Lesson plan Review the code for the previous exercise Video systems Review for midterm exam.
ICS312 Lecture13 String Instructions.
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
Color Web Design Professor Frank. Color Displays Based on cathode ray tubes (CRTs) or back- lighted flat-screen Monitors transmit light - displays use.
Video Card CES Industries, Inc. Lesson 10.  Translates computer information of binary digital data into visual information that the monitor can understand.
10H Interrupt. Option 0H – Sets video mode. Registers used: – AH = 0H – AL = Video Mode. 3H - CGA Color text of 80X25 7H - Monochrome text of 80X25 Ex:
Computer Fundamentals MSCH 233 Lecture 5. The Monitor A Monitor is a video screen that looks like a TV. It displays both the input data and instructions,
String Instructions String instructions were designed to operate on large data structures. The SI and DI registers are used as pointers to the data structures.
String Processing Chapter 10 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
4. Kernel and VGA ENGI 3655 Lab Sessions. Richard Khoury2 Textbook Readings  None.
Khaled A. Al-Utaibi  I/O Ports  I/O Space VS Memory Space  80x86 I/O Instructions − Direct I/O Instructions − Indirect I/O Instructions.
Microprocessors Monday, Apr. 16 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
String Instructions String instructions were designed to operate on large data structures. The SI and DI registers are used as pointers to the data structures.
Week 9 Monitors and output to the screen. Monitors, also known as Visual display units (V.D.Us) Desktop computers contain a Cathode Ray Tube (C.R.T.)
Khaled A. Al-Utaibi  Introduction  The MOV Instruction  The LEA Instruction  The Stack Instructions  The String Data Transfer.
Lecture 6 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
Direct-Access Color Graphics Chapter 11. Graphics modes C++ provides a different combination of graphics characteristics. These characteristics include.
ECE291 Computer Engineering II Lecture 12 Josh Potts University of Illinois at Urbana- Champaign.
Chapter 8 String Operations. 8.1 Using String Instructions.
Computer Graphics Lecture 04 Point Taqdees A. Siddiqi
DISPLAY DEVICES CIS 10, Group #1 April 01, 2006 C. X. A. L. K. H. A. V. ((( L. C.
Flowchart of basic interrupt mechanism
BYTE AND STRING MANIPULATON
Morgan Kaufmann Publishers Computer Organization and Assembly Language
9/17/2018 Kiến Trúc Máy Tính.
Microprocessor and Assembly Language
Symbolic Instruction and Addressing
Introduction to Assembly Language
Chapter 4 Data Movement Instructions
8086 Registers Module M14.2 Sections 9.2, 10.1.
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Symbolic Instruction and Addressing
(Array and Addressing Modes)
T opic: S TRING I NSTRUCTION P RESENTED B Y: N OOR FATIMA M AHA AKRAM ASIF.
Data Movement Instructions
(Array and Addressing Modes)
Presentation transcript:

Lecture 11 Text mode video ECE291 Lecture 11 Text mode video

Lecture outline Comments on the exam Video display hardware Text video mode Controlling and accessing video display using DOS and BIOS functions Accessing the video memory directly ECE 291 Lecture 11 Page 2 of 20

Video output Video is the primary form of communication between a computer and a human. The monochrome (single color) monitor uses one wire for video data, one for horizontal sync, and one for vertical sync. A color video monitor uses three video signals: red, green, & blue these monitors are called RGB monitors and convert the analog RGB signals to an optical image. The RGB monitor is available as either an analog or TTL (digital) monitor. ECE 291 Lecture 11 Page 3 of 20

TTL RGB monitor Uses TTL level signals (0 or 5V) as video inputs (RGB) and an extra signal called intensity to allow change in intensity Used in the CGA (Color Graphics adaptor) system found in older computers Can display a total of 16 different colors (eight are generated at high intensity and eight at low intensity) 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 ECE 291 Lecture 11 Page 4 of 20

The analog RGB monitor Uses analog signals - any voltage between 0.0 V and 0.7 V This allow an infinite number of colors to be displayed In practice a finite number of levels is generated (16K, 256K, 16M, colors depending on the standard) Analog displays use a digital-to-analog converter (DAC) to generate each color video voltage A common standard uses a 6-bit DAC to generate 64 different video levels between 0 V and 0.7 V this allows 64x64x64 colors to be displayed, or 262,144 (256 K) colors 8-bit DACs allow 256x256x256 or 16M colors ECE 291 Lecture 11 Page 5 of 20

The analog RGB monitor The Video Adapter converts digital information from the CPU to analog signals for the monitor. VRAM/DRAM Video/Dynamic Random Access Memory Stores screen content Video BIOS Stores character mappings Palette registers Defines R/G/B color values Graphic accelerator Hardware implemented graphic routines DAC Generates analog Red/Green/Blue signals ECE 291 Lecture 11 Page 6 of 20

The analog RGB monitor Example: video generation used in video standards such as EGA (enhanced graphic adapter) and VGA (variable graphics array) A high-speed palette SRAM (access time less than 40ns) stores 256 different codes that represent 256 different hues (18-bit codes) This 18-bit code is applied to the DACs The SRAM is addressed by 8-bit code that is stored in the computer VRAM to specify color of the pixel Once the color code is selected, the three DACs convert it to three video voltages for the monitor to display a picture element (pixel) ECE 291 Lecture 11 Page 7 of 20

The Analog RGB Monitor Example of Video Generation (cont.) Any change in the color codes is accomplished during retrace (moving the electron beam to the upper left-hand corner for vertical retrace and to the left margin of the screen for horizontal retrace) The resolution and color depth of the display (e.g., 640x400) determines the amount of memory required by the video interface card 640x400 resolution with 256 colors (8 bits per pixel) 256K bytes of memory are required to store all the pixels for the display ECE 291 Lecture 11 Page 8 of 20

Text mode video There is not a single common device for supporting video displays There are numerous display adapter cards available for the PC Each supports several different display modes We’ll discuss the 80x25 text display mode which is supported by most of display adapters The 80x25 text display is a two dimensional array of words with each word in the array corresponding a character on the screen Storing the data into this array affects the characters appearing on the display ECE 291 Lecture 11 Page 9 of 20

Text mode video Each text page occupies under 4K bytes of memory 80(columns) x 25 (rows) x 2 (bytes) = 4000 bytes The LO byte contains the ASCII code of the character to display The HO byte contains the attribute byte Display adapters provide 32 K for text displays and let you select one of eight different pages Each display begins on a 4K boundary, at address: B800:0000, B800:1000, B800:2000, …. B800:7000 ECE 291 Lecture 11 Page 10 of 20

Text mode video The attribute byte controls underlying background and foreground colors, intensity and blinking video Choose your colors with care (some combinations of foreground and background colors are not readable) Do not overdo blinking text on the screen ECE 291 Lecture 11 Page 11 of 20

The cursor A pointer to the “insertion point” on the screen When you use DOS/BIOS functions to display a character, it displays where the cursor points The cursor then moves to the next column Other functions let you move backwards or up/down ECE 291 Lecture 11 Page 12 of 20

DOS/BIOS functions revisited Recall INT 21h functions 02h, 06h output characters to screen at current cursor position 09h output ‘$’ terminated string to screen beginning at current cursor position Recall INT 10h functions 02h sets cursor position (including page) 03h reads cursor position (including page) 05h set active display page ECE 291 Lecture 11 Page 13 of 20

Writing characters directly Since the VRAM is memory mapped, you can use MOV instructions to write data directly to the display Typically, we set the ES register to B800h so that the extra segment can be used to address the VRAM Now video display can be accessed just like a 2D word array ECE 291 Lecture 11 Page 14 of 20

Example Calculate the offset from the beginning of the VRAM segment (B8000h) for an arbitrary page (P), row (Y) and column (X) in an 80x25 text display mode Offset = 1000h * page + 160 * Y + 2*X ECE 291 Lecture 11 Page 15 of 20

String instructions Idea: Setup a data transfer and go Do an operation on source [DS:SI] and destination [ES:DI] and change SI and DI depending on the direction flag Transfer data much more quickly than loops and movs Think of the following instructions in terms of their equivalents You can’t do memory to memory operations with other opcodes. The add’s at the end of the equivalent code don’t affect the flags. ECE 291 Lecture 11 Page 16 of 20

String instructions 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 ECE 291 Lecture 11 Page 17 of 20

String instructions 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 ECE 291 Lecture 11 Page 18 of 20

String instructions Each of the instructions should be appended with B, W or D for byte, word, or double word sized transfers. REP – What makes all this useful This is a prefix to the above opcodes REP/REPE/REPZ DEC CX LOOP until CX = 0 while ZF = 1 REPNE/REPNZ Loop until CX = 0 while ZF = 0 ECE 291 Lecture 11 Page 19 of 20

String instructions ; Example: Copying a display buffer to the screen CLD ; clear dir flag so we go up ; setup source MOV SI, DisplayBuffer ; offset with respect to DS ; setup destination MOV AX, VidGrSeg ; B800 MOV ES, AX ; set destination segment as ES MOV DI, 0 ; start of screen ; setup counter MOV CX, (320*200 / 4) ; moving 4 bytes at a time REP MOVSD ; this takes awhile ECE 291 Lecture 11 Page 20 of 20