I've seen a couple demos now, usually small byte plasmas, that use the following:
mov al,13h
int 10h
les ax,[bx]
Obviously it's getting into Mode 13h. The next command is setting up ES:AX with whatever is in [CS:BX]. Well, each time that loads 9FFF into the ES register, due to that being the value in the PSP which it's getting its data from. What I have to ask is... when they subsequently use a STOSB instruction to write bytes to that memory segment... it shows graphics... even though VGA graphics are at segment A000. It's driving me nuts. Any idea how writing to segment 9FFF (which is the upper limit of DOS memory) would put graphics on the screen? Any help would be appreciated.
Using 0x9fff:0000 in es:di is like using the physical address 0x9fff0, the processor calculates the registers pair internally by shifting the value of the 1st one (es) to the left and adding the value of the 2nd one (di) to 0x9fff0, so when di reaching 0x10 the address is incremented to 0xa0000 and all subsequent bytes are written on the screen.
Ahh yes, ok that makes sense now. It's been a while since I've messed with x86 ASM, I forgot about the real mode addressing scheme. Thanks for the help!