; Example how to temporary modify video BIOS and enable high resolution modes on my NVIDIA GeForce 9600 GSO 512
org 100h
Start: cli
call ChipsetOpen
mov ax,0xC000
mov fs,ax
mov word [fs:4695h],0xC3F8 ;clc / ret - all modes as valid for this monitor
call ChipsetClose
sti
ret
ChipsetOpen: mov ecx,0xC0010010
rdmsr
mov [xC0010010+0],eax
mov [xC0010010+4],edx
or eax,80000h
wrmsr
mov ecx,268h
rdmsr
mov [xC000+0],eax
mov [xC000+4],edx
inc ecx
rdmsr
mov [xC800+0],eax
mov [xC800+4],edx
inc ecx
rdmsr
mov [xD000+0],eax
mov [xD000+4],edx
inc ecx
rdmsr
mov [xD800+0],eax
mov [xD800+4],edx
inc ecx
rdmsr
mov [xE000+0],eax
mov [xE000+4],edx
inc ecx
rdmsr
mov [xE800+0],eax
mov [xE800+4],edx
inc ecx
rdmsr
mov [xF000+0],eax
mov [xF000+4],edx
inc ecx
rdmsr
mov [xF800+0],eax
mov [xF800+4],edx
mov ecx,268h
mov eax,18181818h
mov edx,eax
wrmsr ; C000-C7FF
inc ecx
wrmsr ; C800-CFFF
inc ecx
wrmsr ; D000-D7FF
inc ecx
wrmsr ; D800-DFFF
inc ecx
wrmsr ; E000-E7FF
inc ecx
wrmsr ; E800-EFFF
inc ecx
wrmsr ; F000-F7FF
inc ecx
wrmsr ; F800-FFFF
ret
ChipsetClose: mov ecx,268h
mov eax,[xC000+0]
mov edx,[xC000+4]
wrmsr
inc ecx
mov eax,[xC800+0]
mov edx,[xC800+4]
wrmsr
inc ecx
mov eax,[xD000+0]
mov edx,[xD000+4]
wrmsr
inc ecx
mov eax,[xD800+0]
mov edx,[xD800+4]
wrmsr
inc ecx
mov eax,[xE000+0]
mov edx,[xE000+4]
wrmsr
inc ecx
mov eax,[xE800+0]
mov edx,[xE800+4]
wrmsr
inc ecx
mov eax,[xF000+0]
mov edx,[xF000+4]
wrmsr
inc ecx
mov eax,[xF800+0]
mov edx,[xF800+4]
wrmsr
mov ecx,0xC0010010
mov eax,[xC0010010+0]
mov edx,[xC0010010+4]
wrmsr
ret
xC000 dd ?,?
xC800 dd ?,?
xD000 dd ?,?
xD800 dd ?,?
xE000 dd ?,?
xE800 dd ?,?
xF000 dd ?,?
xF800 dd ?,?
xC0010010 dd ?,?