In real mode (or virtual 8086), when I switch to the vga graphic mode (00DH, 00EH, 012H) and I use the BIOS function to display a character (int 00AH, int 00EH), nothing can be read from 0xA0000 except a bunch of zero. The character is indeed displayed on the screen but it's not apparent from memory. Everything work fine with text mode (1H, 3H, ...) although.
format binary
use16
org 07C00H
_TELETYPE_GRAPHIC_40x25 = 00DH
_TELETYPE_GRAPHIC_80x25 = 00EH
_TELETYPE_GRAPHIC_80x30 = 012H
cli
mov ax, _TELETYPE_GRAPHIC_80x30
int 010H
mov ax, 00E41H
mov bx, 2H
int 010H
mov bx, 0A000H
mov es, bx
xor di, di
xor ax, ax
mov cx, 04000H
cld
rep scasb
jz _always
hlt
jmp $-1H
_always:
; ...
I tried to read videomemory in graphic mode 13h (320*200px) with TurboDebugger in DOSBox on 64bit Windows and it worked as expected: REPE SCASB
stopped with DI=0143h and the value loaded by
MOV AL,[ES:DI-1]
was 2.
The first pixel line at ES:0 (140h bytes) is all 0 (black), the second line starts at ES:0140h with two black pixels (0 bytes), followed by the byte with value AL=2
(blue), which is the tip of capital letter A glyph.
However the videomemory cannot be inspected using Alt-F5 to switch between TurboDebugger user-screen and CPU window) due to imperfection of debugger and DOSBox emulation.
The situation is even more complicated with planar graphic modes 0Dh, 0Eh, 12h. VGA maps all four memory planes (pages) at the same linear address A0000h and you would have to select the page first by direct output to CRT ports (see the link in @fuz first comment).
You may want to load the nonzero byte from videoram and print it with INT 10h
instead of hlt
, just to assure that it's there.
I remember how I debugged my graphic program some 30 years ago with two DOS computers connected by serial ports, using Borland TD.EXE and TDREMOTE.EXE. I was able to step through instructions which wrote to EGA/VGA CRT registers and to watch the effects without having to switch between debugger window and user screen.
I'm not sure what do you want to achieve but in nonemulated DOS with graphic mode 13h you might succeed.