Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get SVGA Information int10h/AX=4f01h

Status
Not open for further replies.

jshen6

Programmer
Mar 23, 2011
1
US
Hi,

I am trying to get the SVGA information with the following code, but the return value (AH) is always false (1). Can someone point me the error? Much appreciated!


.model small
.stack 200h

.data?
SVGA_ModeInfo STRUC
ModeAttributes dw ?
WinAAttributes db ?
WinBAttributes db ?
WinGranularity dw ?
WinSize dw ?
WinASegment dw ? ; window A start segment
WinBSegment dw ?
WinFuncPtr dd ?
BytesPerScanLine dw ?
XResolution dw ? ; horizontal resolution
YResolution dw ? ; vertical resolution
XCharSize db ? ; character cell width
YCharSize db ? ; character cell height
NumberOfPlanes db ? ; number of memory planes
BitsPerPixel db ? ; bits per pixel
NumberOfBanks db ? ; number of banks
MemoryModel db ? ; memory model type
BankSize db ?
NumberOfImagePages db ?
Reserved1 db ?
RedMaskSize db ?
RedFieldPosition db ?
GreenMaskSize db ?
GreenFieldPosition db ?
BlueMaskSize db ?
BlueFieldPosition db ?
RsvdMaskSize db ?
DirectColorModeInfo db ?
Reserved2 db 216 DUP(?)
SVGA_ModeInfo ENDS

svga_mi SVGA_ModeInfo<>


.code

START:
mov ax, @DATA ; initialize data section
mov ds, ax

; get video mode
mov ax, 4f03h
int 10h

; get VGA Info
mov ax, 4f01h
mov cx, bx ; CX = BX = current mode
mov di, OFFSET svga_mi
int 10h

mov ax, 4C00h
int 21h
END START
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top