Inspecting the Video Refresh Buffer with DEBUG in VS .NET

Generation QR Code 2d barcode in VS .NET Inspecting the Video Refresh Buffer with DEBUG
Inspecting the Video Refresh Buffer with DEBUG
QR Code JIS X 0510 Decoder In VS .NET
Using Barcode Control SDK for Visual Studio .NET Control to generate, create, read, scan barcode image in .NET framework applications.
One good way to help your knowledge of memory addressing sink in is to use DEBUG to take a look at some interesting places in the PC's memory space One easy thing to do is look at the PC's video display adapter's text screen video refresh buffer A video refresh buffer is a region of memory with a difference: Any characters written to buffer memory are instantly displayed on the computer's screen This is accomplished electrically through special use of the information that comes out of the memory data pins Precisely how it is done is outside the scope of this book For now, simply understand that writing a character to your text mode display screen (which is not the Windows graphical UI screen!) can be done by writing the ASCII code for that character into the correct address in the video refresh buffer portion of memory The text mode display buffer is the screen that appears when you're running DOS or else working in a DOS window (or "DOS box") from within MS Windows It consists not of icons or graphical images or figures but simple textual characters, arranged in a matrix typically 25 high and 80 wide This used to be the mainstay of all computing; now, text screens seem downright quaint to most people As with any memory location anywhere within the PC, the video refresh buffer has a segment address What that segment address is depends on the kind of display installed in the PC There are two separate possibilities, and which is present is easy enough to determine: If your PC has a color screen, the segment address of the video refresh buffer is 0B800H If you have a monochrome screen (a situation now becoming vanishingly rare), the segment address is 0B000H instead It takes 2 bytes in the buffer to display a character The first of the two (that is, first in memory) is the ASCII code of the character itself For example, an A would require the ASCII code 41H; a B would require the ASCII code 42H, and so on (The full ASCII code set is shown in Appendix D) The second of the two bytes is the character's attribute Think of it this way: In the display of a character on the screen, the ASCII code says what and the attribute says how The attribute dictates the color of a character and its background cell on a color screen On a monochrome screen, the attribute specifies whether a character is underlined or displayed in reverse video (Reverse video is a character display mode in which a dark character is shown on a light background, rather than the traditional light character on a dark or black background) Every character byte has an attribute byte and every attribute byte has its character byte; neither can ever exist alone The very first character/attribute pair in the video refresh buffer corresponds to the character you see in the upper-left-hand corner of the text screen The next character/attribute pair in the buffer is the character on the second position on the top line of the screen, and so on I've drawn a diagram of the relationship between characters on the screen and byte values in the video refresh buffer in Figure 611
Paint QR In .NET
Using Barcode encoder for Visual Studio .NET Control to generate, create Denso QR Bar Code image in .NET framework applications.
Figure 611: The PC's video refresh buffer In Figure 611, the three letters "ABC" are displayed in the upper-left corner of the screen Notice that the "C" is underlined The screen shown in Figure 611 is a monochrome screen The video refresh buffer therefore begins at 0B000:0 The byte located at address 0B000:0 is ASCII code 41H, corresponding to the letter "A" The byte at address 0B00:0001 is the corresponding attribute value of 07H The 07H value as an attribute dictates normal text in both color and monochrome displays, in which normal means white characters on a black background The byte at 0B000:0005 is also an attribute byte, but its value is 01H On a monochrome screen, 01H makes the corresponding character underlined On a color display, 01H makes the character blue on a black background There is nothing about the video refresh buffer to divide it into the lines you see on the display The first 160 characters (80 ASCII codes plus their 80 attribute bytes) are shown as the first line, and the subsequent 160 characters are shown on the next line down the screen You might rightfully ask what ASCII code is in the video refresh buffer for locations on the screen that show no character at all The answer, of course, is that there is a character there in every empty space: the space character, whose ASCII code is 20H You can inspect the memory within the video refresh buffer directly, through DEBUG Take the following steps: 1 Clear the screen by entering CLS at the DOS prompt and pressing Enter 2 Invoke DEBUG 3 Decide where your video refresh buffer is located, and enter the proper segment address into the ES register through the R command Remember: Color screens use the 0B800H segment address, while monochrome screens use the 0B000H segment address (In the year 2000, it's a 98 percent chance that your screen is color and not monochrome) Note from the following session dump that 0B800H must be entered into DEBUG as "B800," without the leading zero NASM (your assembler) must have that leading zero, and DEBUG cannot have it Sadly, no one ever said that all parts of this business had to make perfect sense 4 Dump the first 128 bytes of the video refresh buffer by entering D ES:0 and pressing Enter 5 Dump the next 128 bytes of the video refresh buffer simply by entering the D command by itself a second time (I won't say "press Enter" every time It's assumed: You must follow a command by pressing Enter) What you'll see should look a lot like the following session dump:
Recognize QR Code In .NET Framework
Using Barcode reader for .NET framework Control to read, scan read, scan image in VS .NET applications.
C:\ASM>debug - r es ES 1980 :b800 - d es:0 B800:0000 20 B800:0010 20 B800:0020 20 B800:0030 20 B800:0040 20 B800:0050 20 B800:0060 20 B800:0070 20 - d B800:0080 20 B800:0090 20 B800:00A0 43 B800:00B0 65 B800:00C0 20 B800:00D0 20 B800:00E0 20 B800:00F0 20
Painting Bar Code In .NET Framework
Using Barcode creation for .NET framework Control to generate, create bar code image in .NET framework applications.
07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
Reading Bar Code In .NET Framework
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
20 20 20 20 20 20 20 20 20 20 3A 62 20 20 20 20
QR Code Encoder In Visual C#.NET
Using Barcode generation for Visual Studio .NET Control to generate, create QR Code ISO/IEC18004 image in Visual Studio .NET applications.
07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
Painting QR Code JIS X 0510 In .NET Framework
Using Barcode drawer for ASP.NET Control to generate, create QR Code JIS X 0510 image in ASP.NET applications.
20 20 20 20 20 20 20 20 20 20 5C 75 20 20 20 20
Draw Denso QR Bar Code In VB.NET
Using Barcode encoder for .NET framework Control to generate, create QR Code 2d barcode image in .NET applications.
07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
Print USS Code 39 In .NET
Using Barcode generation for .NET framework Control to generate, create USS Code 39 image in Visual Studio .NET applications.
20 20 20 20 20 20 20 20 20 20 41 67 20 20 20 20
Barcode Creator In VS .NET
Using Barcode printer for Visual Studio .NET Control to generate, create bar code image in VS .NET applications.
07-20 07-20 07-20 07-20 07-20 07-20 07-20 07-20 07-20 07-20 07-53 07-20 07-20 07-20 07-20 07-20
Generate UCC - 12 In .NET
Using Barcode drawer for Visual Studio .NET Control to generate, create UPC Code image in .NET applications.
07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
Identcode Creation In .NET
Using Barcode drawer for .NET Control to generate, create Identcode image in .NET applications.
20 20 20 20 20 20 20 20 20 20 4D 20 20 20 20 20
UPC-A Supplement 5 Creation In C#.NET
Using Barcode encoder for Visual Studio .NET Control to generate, create UPC A image in .NET framework applications.
07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
Recognizing Code128 In .NET Framework
Using Barcode scanner for VS .NET Control to read, scan read, scan image in .NET applications.
20 20 20 20 20 20 20 20 20 20 3E 20 20 20 20 20
EAN-13 Supplement 5 Maker In Java
Using Barcode generator for Java Control to generate, create EAN-13 Supplement 5 image in Java applications.
07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07
Painting Code-39 In C#
Using Barcode creator for Visual Studio .NET Control to generate, create Code 39 image in .NET applications.
20 20 20 20 20 20 20 20 20 20 64 20 20 20 20 20
Make GS1-128 In VS .NET
Using Barcode creator for ASP.NET Control to generate, create UCC-128 image in ASP.NET applications.
07 07 07 07 07 07 07 07
Data Matrix Generator In Java
Using Barcode printer for Java Control to generate, create DataMatrix image in Java applications.
Create UPC-A In .NET Framework
Using Barcode maker for ASP.NET Control to generate, create UCC - 12 image in ASP.NET applications.