Why assembler insert some strange instructions at my code?
I written some code for meet requirements registers preservation for some third party boot loader kernel system On Time RTOS-32. You can see requirements at url at code for MASM32 below. Need MZ-file. Code will run at x86 16bit real segmented mode at modern CPUs. I try use MASM32 and fasm. Both insert nearly same strange instructions at my code, that I not written there. Why is this happened?
My code:
;See table with columns "Register Contains Preserve" at and of document:
; http://www.on-time.com/rtos-32-docs/rttarget-32/programming-manual/rtloc/initializing-target-hardware/initcode.htm
;assembler commandline:
; ml /c f.asm
; link16 f
.686
.model tiny
ASSUME SS:NOTHING, DS:NOTHING, CS:ERROR, ES:ERROR, GS:ERROR, FS:ERROR
.code; code segment
main:;entry point to program
jmp cseg; jump to code get over data
; global variables:
ss_ dd ?
esp_ dd ?
;stack:
stack_reserved db 60 dup (?)
stacktop dd ?
;save register for meet requirements RTOS and
;intialize registers for work:
cseg:
mov eax, cs
mov edx, ds;ds saved at edx. edx and eax not preserved, because needn't.
mov ds, eax
mov eax, ss
mov ss_, eax
mov eax, esp
mov esp_, eax
mov eax, ds
mov ss, eax
mov esp, DWORD PTR stacktop
pushfd
pushad
mov eax, es
push eax;
mov eax, fs
push eax;
mov eax, gs
push eax;
;do work:
;...
;do some work. omit it.
;...
;restore preserved registers:
pop eax
mov gs, eax
pop eax
mov fs, eax
pop eax
mov es, eax
popad
popfd
mov eax, esp_
mov esp, eax
mov eax, ss_
mov ss, eax
mov ds, edx
jmp ebx;return to near absolute address
end main
I use hiew disassembler (and debug.com and debugx.com) for see output of assembler.
Also I try trace at debugx.com. That strange instructions realy executed. It is not disassembler's decode error (if debugx not have emulator for trace).
disassembler result at hiew:
00000200: EB48 jmps 00000024A
;it is ok. it data segment with zero initialized.
00000202: 0000 add [bx][si],al
00000204: 0000 add [bx][si],al
...
00000246: 0000 add [bx][si],al
00000248: 0000 add [bx][si],al
0000024A: 8CC8 mov ax,cs
0000024C: 8CDA mov dx,ds
0000024E: 8ED8 mov ds,ax
00000250: 8CD0 mov ax,ss
00000252: 2EA30200 mov cs:[00002],ax
;what is happened? add ... [si]...? I not written it.
00000256: 0000 add [bx][si],al
00000258: 8BC4 mov ax,sp
0000025A: 2EA30600 mov cs:[00006],ax
;same
0000025E: 0000 add [bx][si],al
00000260: 8CD8 mov ax,ds
00000262: 8ED0 mov ss,ax
;same oh ... five lines...
00000264: 2E8B25 mov sp,cs:[di]
00000267: 46 inc si
00000268: 0000 add [bx][si],al
0000026A: 009C608C add [si][-073A0],bl
0000026E: C0508CE0 rcl b,[bx][si][-074],0E0 ;'р'
;why all it is happened?
00000272: 50 push ax
00000273: 8CE8 mov ax,gs
00000275: 50 push ax
00000276: 58 pop ax
00000277: 8EE8 mov gs,ax
00000279: 58 pop ax
0000027A: 8EE0 mov fs,ax
0000027C: 58 pop ax
0000027D: 8EC0 mov es,ax
0000027F: 61 popa
00000280: 9D popf
00000281: 2EA10600 mov ax,cs:[00006]
00000285: 0000 add [bx][si],al
00000287: 8BE0 mov sp,ax
00000289: 2EA10200 mov ax,cs:[00002]
0000028D: 0000 add [bx][si],al
0000028F: 8ED0 mov ss,ax
00000291: 8EDA mov ds,dx
00000293: FFE3 jmp bx
How I can fix it?
Try another debugger (http://masm32.com/board/index.php?topic=2327.msg24121#msg24121). Debuggers are often confused about strange mixes of 16- and 32-bit code ;-)
And welcome to the forum :icon14:
00000252: 2EA30200 mov cs:[00002],ax
00000256: 0000 add [bx][si],al
is actually
00000252: 2EA302000000 mov cs:[000000002],ax
but - you want to write code for 16-bit real mode
it thinks you are writing to a 32-bit address
this doesn't seem right - comment it out to see what happens
; ASSUME SS:NOTHING, DS:NOTHING, CS:ERROR, ES:ERROR, GS:ERROR, FS:ERROR
this doesn't seem valid, either
mov eax, ss
Quote from: kyoto008 on December 13, 2013, 09:34:32 PM
How I can fix it?
You have to modify your code like this:
.model tiny
.686
That is,
first the .model directive and the cpu directive line
behind .model.
It's because the assembler, when it encounters the .model directive, determines the default segment size based on the current cpu setting. And you want your segments to be 16-bit.
Quote from: jj2007 on December 13, 2013, 10:07:32 PM
Try another debugger
I will try it.
Quote
And welcome to the forum :icon14:
A big thanks, peoples. ::)
Quote from: dedndave on December 13, 2013, 10:23:09 PM
but - you want to write code for 16-bit real mode
it thinks you are writing to a 32-bit address
this doesn't seem right - comment it out to see what happens
How I can change 32bit mode of assembler masm32 to 16bit? Need I will swap directivities .model tiny and .686, same as answered below?
Quote
mov eax, ss
Should I will remove e-prefix at register name eax, e.g. ax? I not want remove e-prefix at register mnemonic name. I want preserve all used registers with full size 32bit, not with - 16bit. Preserve registers at program's begin and restore at end of program. It's may be not required, but I want it for safety. Is you see another error at this command? For example, is it command not combined correctly with my ASSUME settings?
Quote
; ASSUME SS:NOTHING, DS:NOTHING, CS:ERROR, ES:ERROR, GS:ERROR, FS:ERROR
this doesn't seem valid
I unknown name directive for .code segment at assembler masm32. I wanted write ASSUME SS:CODE, DS:CODE, CS:CODE, ES:ERROR, GS:ERROR, FS:ERROR, but I short handed. I think directive ASSUME assign default segment prefix for CPU instructions and operands at instruction able not fully qualified.
Japheth is correct - he's pretty sharp - lol
i forgot about the .MODEL behaviour, because i use code templates :P
then, you can remove the comment on ASSUME
the segment registers are always 16 bits wide, whether you are writing 16-bit or 32-bit code
Thanks to all. Bugs was corrected.
Correct version of code:
;See table with columns "Register Contains Preserve" at and of document:
;http://www.on-time.com/rtos-32-docs/rttarget-32/programming-manual/rtloc/initializing-target-hardware/initcode.htm
.model tiny
.686
.code; code segment
main:;entry point to program
jmp cseg; jump to code get over data
; global variables:
STACKSIZE EQU 0076h
ss_ dd ?
esp_ dd ?
;stack:
stack_reserved db STACKSIZE dup (?)
stacktop:
;save register for meet requirements RTOS and
;intialize registers for work:
cseg:
mov eax, cs
mov edx, ds; ds saved at edx. edx and eax not preserved, because not required.
mov ds, eax
mov eax, ss
mov ss_, eax
mov eax, esp
mov esp_, eax
mov eax, ds
mov ss, eax
mov eax, stacktop
mov esp, eax
pushad
mov eax, es
push eax
mov eax, fs
push eax
mov eax, gs
push eax
mov eax, ds
mov es, eax
;do work:
;...
;do some work.
;...
;restore preserved registers:
pop eax
mov gs, eax
pop eax
mov fs, eax
pop eax
mov es, eax
popad
mov eax, esp_
mov esp, eax
mov eax, ss_
mov ss, eax
mov ds, edx
;jmp ebx;return to near absolute address
end main
Change "mov esp, DWORD PTR stacktop" to "mov eax, stacktop". It's my bug.
Remove pushfd\popfd. Why it helped me? Boot system at my VMWare virtual machine has gone to reboot before this instructions removed.
______
Other complex question for topic reuse:
I want initialize Flat Panel Display at boot loader at real CPU mode before kernel On Time RTOS-32 gone to virtual protected CPU mode.
I want use VESA BIOS Extension/ Flat Panel Interface (VBE/FP).
http://www.codon.org.uk/~mjg59/tmp/VBEFP_32.PDF
Is it actualy BIOS service and can be supported on my machine?
I use HSD100IFW1_F01 LVDS display with SOM-7562 B1 embeded system with Intel N455 and ICH8M (82801HBM).
http://www.anewtech.net/pdf/Anewtech-AD-SOM-7562-B1.pdf
Running under Windows XP on a Dell system from ~2003 that shipped with a FP display, if I use the Run command to start Debug, enter assembly mode, and key in the following code:
mov ax, 4F11
mov bx, 0
mov di, 200
int 10
Then exit assembly mode and use the Proceed command (P) to execute everything through the interrupt call, I get AX = 014F, and according to the PDF under VBE/FP Completion Codes:
VBE RETURN STATUS
AL == 4Fh: Function is supported
AL != 4Fh: Function is not supported
AH ==00h: Function call successful
AH ==01h: Function call failed
AH ==02h: Function is not supported in the current hardware configuration
AH ==03h: Function call invalid in current video mode
This means that the function is supported, but that it failed. The system originally had a 17" FP with a VGA connection IIRC, but now has a ~2-year old 27" wide screen display with a DVI connection, and this could be the reason the function failed.
i tried it under SymDeb...
the first time, it returned 0 in AX
ran it again, it went full-screen and returned 4F11h in AX :redface:
oh - that's under XP MCE2005 SP3
Entered and proceed in debug - code goes full screen, AX is zero. XPSP2 is the OS.
Quote from: MichaelW on December 14, 2013, 11:28:16 PMRunning under Windows XP on a Dell system
Quote from: dedndave on December 15, 2013, 02:37:01 AMi tried it under SymDeb...
VBE/FP and all BIOS entry points from interrupt 10h shouldn't work on virtual or protected mode CPU under Windows or Linux. I plan to use my above code to run screen initialization code through VBE/FP on real mode CPU boot loader before switch to protected mode. Real mode CPU can be obtained for any peoples by running in DOS without memory extenders emm386.sys or himem.sys.
Quote from: kyoto008 on December 15, 2013, 05:43:58 AM
VBE/FP and all BIOS entry points from interrupt 10h shouldn't work on virtual or protected mode CPU under Windows or Linux. I plan to use my above code to run screen initialization code through VBE/FP on real mode CPU boot loader before switch to protected mode. Real mode CPU can be obtained for any peoples by running in DOS without memory extenders emm386.sys or himem.sys.
For Windows XP 16-bit apps run under NTVDM, and while NTVDM will block some of the BIOS functions, for example those that do low-level access to a hard disk, it will allow most of them to work, more or less.
Quote from: MichaelW on December 15, 2013, 09:19:53 AM
For Windows XP 16-bit apps run under NTVDM, and while NTVDM will block some of the BIOS functions, for example those that do low-level access to a hard disk, it will allow most of them to work, more or less.
NTVDM not use BIOS. NTVDM translate all BIOS functions calls to system drivers.
Quote from: kyoto008 on December 15, 2013, 10:09:09 AM
NTVDM not use BIOS. NTVDM translate all BIOS functions calls to system drivers.
I have no way to monitor any of that so I can't know how it works at a low level. Most BIOS functions
will work under NTVDM, more or less. I added the more or less qualification because some of them do not work the same way as they do in RM, counters tend to run faster than normal, the BIOS "sees" serial and parallel ports that do not exist in the hardware, etc. It's not an ideal way to run RM code, but it's generally workable for a quick test, which is what I used it for. I was not trying to start an argument I was trying to help you.
Quote from: MichaelW on December 15, 2013, 10:56:37 AMI was not trying to start an argument I was trying to help you.
Sorry. I see. Thanks.
To make the task easy I created a FreeBASIC DOS (DPMI) app that calls the first two functions. On my test system, running under Windows XP, the first function fails and the second function succeeds, although the output does not make sense.
Edit: For allocating the buffer in RM memory the size is supposed to be specified in paragraphs, so the instruction that loads BX should have been:
mov bx, 256/16
256
32
0000 0953 01CF
014F
0000
00000000
0000
00000000
00000000
00000000
00000000
004F
80
255
0000000000111110
0
55
54
0
0
00000000
I tabbed the output away from the left edge so I could read the first character. I tried the app from a MS-DOS 6.22 boot diskette using hdpmi32 as a DPMI host, on the same system, but I could not get the display to work at all.
Hi,
Two results from my P-III, and one from a laptop. Nulls were
replaced by ^@ characters.
Regards,
Steve
P_III, Matrox, NTVDM
256
32
0000 0AA1 01CF
FFFF
^@^@^@^@^@^@^@
0000
00000000
0000
00000000
00000000
00000000
00000000
FFFF
0
0
0000000000000000
0
0
0
0
0
00000000
P-III, Matrox, VDM
256
32
0000 1777 00F7
FFFF
^@^@^@^@^@^@^@
0000
00000000
0000
00000000
00000000
00000000
00000000
FFFF
0
0
0000000000000000
0
0
0
0
0
00000000
Intel(R) Pentium(R) M processor 1.70GHz, ATI, NTVDM
256
32
0000 12FA 01CF
004F
VBE/FP
0100
10100011
0100
C0004F8C
C0004FA2
C0004FA7
C0000188
004F
1024
768
0000000000000101
6
6
6
0
587270700
000000F4
i keep forgetting to examine the CF after DOS calls - lol
xp mce2005 sp3, P4 prescott w/htt
256
32
0000 09F6 01CF
4F11
0000
00000000
0000
00000000
00000000
00000000
00000000
4F11
0
0
0000000000000000
0
0
0
0
0
00000000
On my P3, with an old Matrox G400, I get AX unchanged AX=FFFFh and nulls for everything else.
What is needed is a copy of the published standard, and I don't see it listed here (http://www.vesa.org/vesa-standards/standards-summaries/). It may have ended as a proposal, and never became a standard.
Quote from: MichaelW on December 16, 2013, 11:42:06 AMI don't see it listed here (http://www.vesa.org/vesa-standards/standards-summaries/).
I am too. :icon_confused: I will try something another when will fail to use BIOS FP, e.g. direct IO ports programming of LVDS flat panel on Intel GMA 3150. I don't know anything about it. It is very pity. What to study about it? Where Intel GMA 3150 specification?
All I could find about VBE/FP is here (http://manpages.ubuntu.com/manpages/maverick/man1/vbetool.1.html).
QuoteThe VESA flat panel interface ceased development at the proposal stage.
panelid and panelsize will work on many machines, but the other
arguments are unlikely to be implemented on available hardware.
Disassembly of my video BIOS for AX=4F11 (NVidia GTX 580 with VBE 3)
seg001:5B4B mov ax, 14Fh
seg001:5B4E retn
That's a generic return for functions 4F0C-4F0F, 4F11-4F13 and 4F16+
mine returned what was passed in AX
probably doesn't change it on the stack unless it fails
never played with VESA, much
but - isn't the status returned in the carry flag ?
we are so used to win32 results in EAX :P
Hi Dave,
VESA status is returned in AX, or AH and AL depending on
how you want to look at it.
Regards,
Steve N.
it seems that every implementation of it works differently, too
probably why i haven't messed with it, much
in the days before win32, i remember writing code for a handful of different graphics chip-sets ::)
Quote from: dedndave on December 17, 2013, 04:21:13 AM
in the days before win32, i remember writing code for a handful of different graphics chip-sets ::)
Hi,
The plethora of different video chips that had little, if anything,
in common was the reason VESA was formed to create a more
uniform programing environment. And it seems to be better
documented than the chip sets were by the manufacturers. There
was a steep leaning curve for me at the start. But once I got things
straightened out a bit, the VESA calls ended up easier than some of
the screen addressing problems.
Regards,
Steve N.
right - i knew it was more standardized
but, as it became better developed, i got away from graphics programming - lol
at the time, i didn't have any books on VESA
the book i had did cover the popular chip-sets though
I failed to use VESA BIOS FP for my display with my bios and my videocard. :(
Quote from: kyoto008 on December 18, 2013, 07:41:21 PM
I failed to use VESA BIOS FP for my display with my bios and my videocard. :(
Hi,
Just out of curiosity, what VESA/FP function do you require?
The functions seem a bit specialized. I just want to know what
the video card BIOS and VESA extensions does not provide that
you need.
Regards,
Steve N.
Quote from: FORTRANS on December 20, 2013, 12:03:13 AM
Just out of curiosity, what VESA/FP function do you require?
Some not popular and not Linux-like embedded system was started with off lvds display. I want to switch-on this display. It is failed. On Linux Mint 14 Cinnamon on Live CD is this lvds display on and work. On Linux Mint 16 Cinnamon this display not work and off. Only vga display was worked anyway.
VESA BIOS FP function 0 report that 0, 1, 2, 7 function only supported by my BIOS. BIOS is AMI BIOS 2.01. Display is HSD100IFW1 F01 with 1024x600 resolution. My PC is technical SOM-7562 B1 embedded device with Intel N455 and ICH8M (82801HBM).
CPU have integrated graphic card. I think is Intel GMA 3150.
from what i remember of the timeline, the type of display you are using
came out about the same time that VESA became obsolete
are you "locked" into 16-bit code ?
what is the windows OS ?
Hi,
Have you tried to set a VESA video mode that has a similar
resolution as your display? Is this the primary display?
Outside of the back light, the VESA/FP functions don't seem
to "turn on" a display.
Regards,
Steve N.
Quote from: dedndave on December 21, 2013, 08:50:21 PM
VESA became obsolete
o_o Expected.
Quoteare you "locked" into 16-bit code ?
No. I insert 16 bit code for "turn on" display before load OS. VESA FP work only in 16 bit real mode. I have 32 bit protected mode with virtual paging after load.
Quotewhat is the windows OS ?
I don't try it. Windows can't help me.
Quote from: FORTRANS on December 22, 2013, 12:48:57 AM
Have you tried to set a VESA video mode that has a similar resolution as your display?
No. I will try it.
QuoteIs this the primary display?
I don't known. I can't ask or change it's primacy. I can't enter to BIOS, because haven't PS/2 keyboard. USB should was supported, but not work.
i found a user manual for that embedded system - it says windows ce 5/6
i guess i can understand wanting to be in real mode to turn on the display
but for 32-bit graphics, i would use windows API - much easier/better than farting around with VESA
there is probably a way to turn on the display from 32-bit code
i guess it's a matter of knowing the graphics drivers for the display
otherwise, you could run a 16-bit program to turn it on, then run a 32-bit GUI app :P
i don't really find much in the way of ASM code for that device
that doesn't mean it can't be done - it just means they are keeping it to themselves
I don't know if this is of any value here, but the DOS version of FreeBASIC uses the available VESA modes for graphics, and one useful function that it provides is ScreenList (http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgScreenlist). The two DOS DPMI apps in the attachment display the available modes for the system they are running on.
Running on my P3 system (Matrox G400) under the Windows XP NTVDM:
80x80x8
160x120x8
256x256x8
320x100x8
320x200x8
320x240x8
640x400x8
640x480x8
800x600x8
640x480x15
800x600x15
640x480x16
800x600x16
640x480x24
800x600x24
640x480x32
800x600x32
Running on an old Micron P2 system (Diamond Viper V330) under MS-DOS 6.22, HDPMI32:
80x80x8
160x120x8
256x256x8
320x100x8
320x200x8
320x240x8
320x400x8
400x300x8
480x360x8
512x384x8
640x400x8
640x480x8
800x600x8
960x720x8
1024x768x8
1152x864x8
1280x1024x8
1600x1200x8
320x200x15
320x240x15
320x400x15
400x300x15
480x360x15
512x384x15
640x400x15
640x480x15
800x600x15
960x720x15
1024x768x15
1152x864x15
1280x1024x15
1600x1200x15
320x200x16
320x240x16
320x400x16
400x300x16
480x360x16
512x384x16
640x400x16
640x480x16
800x600x16
960x720x16
1024x768x16
1152x864x16
1280x1024x16
1600x1200x16
320x200x24
320x240x24
320x400x24
400x300x24
480x360x24
512x384x24
640x400x24
640x480x24
800x600x24
960x720x24
1024x768x24
1152x864x24
320x200x32
320x240x32
320x400x32
400x300x32
480x360x32
512x384x32
640x400x32
640x480x32
800x600x32
960x720x32
1024x768x32
1152x864x32
I think modes like 80x80x8 are likely to be text modes.
Hi,
My P-III and Matrox G400 in a Windows 2000 NTVDM.
In a window.
F:\TEMP>list
80x80x8
160x120x8
256x256x8
320x100x8
320x200x8
320x240x8
done...
Full screen
F:\TEMP>list
80x80x8
160x120x8
256x256x8
320x100x8
320x200x8
320x240x8
640x400x8
640x480x8
800x600x8
640x480x15
800x600x15
640x480x16
800x600x16
640x480x24
800x600x24
640x480x32
800x600x32
done...
F:\TEMP>
Just as an aside, one feature of the Matrox card I am using more
and more is its 2x and 4x zoom feature. The Windows VESA support
seems to be what is built into the card's BIOS. Also a DOS program
cannot set a VESA mode. If you can do this, I would like to know
your driver version.
There is a TSR that supports higher resolutions in a VDM. So the
card has more capability using a driver. And Windows does support
desktop resolutions up to 1280 x 1024.
A Pentium laptop in a full screen OS/2 VDM. And a VESA utility
report of that system.
80x80x8
160x120x8
256x256x8
320x100x8
320x200x8
320x240x8
640x400x8
640x480x8
800x600x8
320x200x15
640x480x15
320x200x16
640x480x16
Super VGA BIOS extension version 1.02 is installed
OEM string is 'MagicGraph NM2070 40K SVGA BIOS'
Device capabilities are 0
Mode Attr Window WindowA WindowB Mapping Bytes Resolution Char BPP Banks Type
Grn Siz Seg att Seg att Function /line Cell Planes
0100 IBCG 64 64 A000 RW C000:1A63 640 640x400 8x16 8 1 1 VGA
0101 IBCG 64 64 A000 RW C000:1A63 640 640x480 8x16 8 1 1 VGA
010D IBCG 64 64 A000 RW C000:1A63 640 320x200 8x8 15 1 1 VGA
010E IBCG 64 64 A000 RW C000:1A63 640 320x200 8x8 16 1 1 VGA
0110 IBCG 64 64 A000 RW C000:1A63 1280 640x480 8x1615 1 1 VGA
0111 IBCG 64 64 A000 RW C000:1A63 1280 640x480 8x1616 1 1 VGA
0102 IBCG 64 64 C000:1A63 100 800x600 8x16 4 4 1 EGA
0103 IBCG 64 64 A000 RW C000:1A63 800 800x600 8x16 8 1 1 VGA
The 320x240x8 mode can be (is) a tweaked VGA mode. The
320x200x8 is a standard VGA mode. The other non-VESA modes
may be made by plotting more than one pixel as a logical pixel.
They do not seem to correspond to a text mode.
Regards,
Steve N.
Hi,
I was working on a program to try out the VBE/FP functions
on my laptops. The next couple of days are occupied, so I am
posting the EXE as it is now. Michael posted a program in Reply
#15 that called functions 1 and 2. I did function 1 with some
different formatting. Doesn't do anything on systems that don't
have VBE/FP.
I Googled on VBE/FP and did not find anything on display
activation or switching between displays. But another system
that has two displays and uses VBE/FP had its own extensions
to the Video BIOS that enabled the second view or a dual view
using function 5F as VESA uses 4F. Dave, did the technical manual
you found have anything like that?
Regards,
Steve N
Hi,
Here is a somewhat better version of the above program.
Two versions, a regular version and a debug version that shows
some register contents. Tested on four laptops. One had a
faulty implementation that did not return good information for
some functions. The results for the most part were interesting,
but not particularly useful.
Let me know if you find something interesting.
Cheers,
Steve N.
XP mce2005 SP3
goes full-screen, then crashes with no visible error message
Hi Dave,
Neat. Well it does go full screen on the XP laptops here.
Not so on the others. Can you run it in DEBUG or SYMDEB?
If it crashes, it should be in the BIOS, which would be rather
crummy. My program is rather brain dead formatting of
returned results.
Thanks,
Steve
i cheated the program
the call to INT 10h, 4F11h returns 4F11h
so, i set a breakpoint and forced AX = 4Fh
this is the debug version of the program...
1073:0017 CD21 INT 21
1073:0019 B8114F MOV AX,4F11
1073:001C 33DB XOR BX,BX
1073:001E BF0000 MOV DI,0000
1073:0021 CD10 INT 10
1073:0023 E8F508 CALL 091B
-bp0 23
-g
VESA BIOS Extension/Flat Panel Interface (VBE/FP) Function Test Program.
Paused, hit a key.
AX returned from function request = AX=4F11 BX=0000 CX=1A9F DX=0197 SP=0200
BP=0000 SI=0000 DI=0000
DS=0F88 ES=0F88 SS=0F68 CS=1073 IP=0023 NV UP EI PL ZR NA PE NC
1073:0023 E8F508 CALL 091B ;BR0
-rax 4f
-g
004F
VESA BIOS Extension/Flat Panel Interface Function 0 is supported.
AH = 00: Function call successful.
Supplemental VBE Signature =
Supplemental VBE Version
Major version, Minor version = 00, 00
Bitfield of supported subfunctions
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
OEM Software Revision
Major version, Minor version = 00, 00
Pointer to Vendor Name String = 0000:0000
Pointer to Product Name String = 0000:0000
Pointer to Product Revision String = 0000:0000
Pointer to OEM String = 0000:0000
End function 0 display. Paused, hit a key.
AX returned from function request = 4F11
VESA BIOS Extension/Flat Panel Interface Function 0 is not supported.
Program terminated normally (1)
-q
here is what i get if i don't cheat
but - the window closes too fast to catch it
under symdeb, i can catch it
VESA BIOS Extension/Flat Panel Interface (VBE/FP) Function Test Program.
Paused, hit a key.
VESA BIOS Extension/Flat Panel Interface Function 0 is not supported.
Program terminated normally (1)
-q
Hi,
Okay. I guess I could have put in another pause. I run this
at the command prompt, so I didn't have to worry about the
window closing. Let's me redirect the output to help clean up
the formatting. I will try and remember that for next time.
Thanks,
Steve N.
i sometimes use a macro to put text into a buffer - it acts like a replacement for the "print" macro
then display the buffer in a message box or output to a file
deleted
VESA Super VGA Informatione Block
Sinature VESA
Version 3.0
Total Memmory -16384 kb
OEM - String Intel(r)915G/915GV/910GL Graphics Chip Accelerated VGA BIOS
Capabilities 01 00 00 00
Supported Super VGA modes
316 (013C) 333 (014D) 348 (015C) 314 (013A) 331 (014B)
346 (015A) 263 (0107) 282 (011A) 283 (011B) 261 (0105)
279 (0117) 280 (0118) 274 (0112) 276 (0114) 277 (0115)
257 (0101) 259 (0103) 273 (0111)
i have negative memory - you don't know how accurate that is - lol
Hi,
Since Dave pointed out a faux pas, I redid the VESA Flat Panel
Extensions program to pause before exiting. Very lightly tested.
Also added a pause to my basic VESA information program.
Main idea was to display as much information as possible without
scrolling off the CGA mode 3 test display.
VESA version number 2.0 OEM String: Matrox Graphics Inc.
Capabilities of the video environment;
0 = DAC is fixed width, 1 = DAC width is switchable. 1
Number of 64kb memory blocks on board 512
Supported VESA video modes.
0100 0101 0102 0103 0110 0111 0112 0113 0114 0115 010A
Information for VESA video mode 0100
Mode attributes 009B LFBWnVGAGr Co 1 Hw
Window A attributes 07 Window B attributes 00
Window granularity 64 KB Window size 64 KB
Window A start segment A000 Window B start segment 0000
Window function pointer C000:7153
Bytes per scan line 640
APA Resolution 640 x 400 Character Cell 8 x 16
Number of planes 1 Bits per pixel 8
Memory model type 4 Packed pixel
Number of banks 1 Bank size 0 KB
Additional image pages 63
Paused, hit a key to exit.
Enjoy,
Steve N.
Steve,
Quote from: FORTRANS on January 06, 2014, 12:40:42 AM
Also added a pause to my basic VESA information program.
Main idea was to display as much information as possible without
scrolling off the CGA mode 3 test display.
But why not split the information into 2 screens?
Gunther
i don't think my version supports the 4F11h function
even though it reports Vesa version 3, the returned values are all 0's :(
but, let me try your new programs to see what happens
ok - VesaInf works - but the last pause does not for some reason
still, i was able to make it work by running it from the command prompt, then using Alt-Enter to exit full-screen
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
VESA version number 3.0 OEM String: Intel(r)915G/915GV/910GL Graphics Chip Accelerated VGA BIOS
Capabilities of the video environment;
0 = DAC is fixed width, 1 = DAC width is switchable. 1
Number of 64kb memory blocks on board 3840
Supported VESA video modes.
013C 014D 015C 013A 014B 015A 0107 011A 011B 0105 0117 0118
0112 0114 0115 0101 0103 0111
Information for VESA video mode 013C
Mode attributes 009B LFBWnVGAGr Co 1 Hw
Window A attributes 07 Window B attributes 00
Window granularity 64 KB Window size 64 KB
Window A start segment A000 Window B start segment 0000
Window function pointer C000:55AE
Bytes per scan line 1920
APA Resolution 1920 x 1440 Character Cell 8 x 16
Number of planes 1 Bits per pixel 8
Memory model type 4 Packed pixel
Number of banks 1 Bank size 0 KB
Additional image pages 90
Paused, hit a key to exit. (no key was pressed)
it says i have 1 bank at 0 KB :P
Quote from: Gunther on January 06, 2014, 03:32:08 AM
Steve,
Quote from: FORTRANS on January 06, 2014, 12:40:42 AM
Also added a pause to my basic VESA information program.
Main idea was to display as much information as possible without
scrolling off the CGA mode 3 test display.
But why not split the information into 2 screens?
Hi Gunther,
Well, then you need to change from one screen to the other.
So if it all fit into one screen, it would be easier and perhaps
more usable.
Regards,
Steve N.
for VbeFp, all pauses do work
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Dave\Desktop\FortransVBEFP2 => vbefp
VESA BIOS Extension/Flat Panel Interface (VBE/FP) Function Test Program.
Paused, hit a key.
VESA BIOS Extension/Flat Panel Interface Function 0 is not supported.
Paused, hit a key to exit.
C:\DOCUME~1\Dave\Desktop\FORTRA~1 =>
Quote from: dedndave on January 06, 2014, 03:44:36 AM
i don't think my version supports the 4F11h function
even though it reports Vesa version 3, the returned values are all 0's :(
but, let me try your new programs to see what happens
Hi Dave,
Of all the computers I have tried, only laptops support 4F11H
VESA function calls. Of course, a display manufacturer could make
a TSR to support their displays. But the idea seems that they want
to "play" around with the hardware settings, and unless you build
the display into your computer, you can't know how to change
anything.
Regards,
Steve N.
Quote from: dedndave on January 06, 2014, 03:50:46 AM
ok - VesaInf works - but the last pause does not for some reason
still, i was able to make it work by running it from the command prompt, then using Alt-Enter to exit full-screen
Rats, will fix it. Until then run it inside a BATch file.
@ECHO OFF
VESAINF %1
PAUSE
Quoteit says i have 1 bank at 0 KB :P
Yeah, so does mine with Windows 2000. Looks like something
else to fix. Oops. Thanks for pointing that out.
Regards,
Steve N.
Hi,
Here is a (hopefully) fixed VESAINF.
Bank size (and number of banks) is weird.
Quote
The BankSize field specifies the size of a bank (group of scan
lines) in units of 1 KB. For CGA and Hercules graphics modes
this is 8, as each bank is 8192 bytes in length. For modes that
do not have scanline banks (such as VGA modes 0Dh-13h), this
field should be set to 0.
So, if I take Gunther's advice, and rewrite it to display more
information, I will delete reporting that information if BankSize
is zero. And since I now have the pause in the program, I
probably don't have an excuse not to do it.
Regards,
Steve N.
Edit Updated ZIP.
another approach might be to...
if the number of banks is non-zero and the bank size is 0,
calculate the correct number of KB, based on the other parameters
(essentially what we might do in a program)
now, no pause at all - lol
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Dave\Desktop\FortransVESAINF\VESAINFupdated => vesainf
VESA version number 3.0 OEM String: Intel(r)915G/915GV/910GL Graphics Chip A
ccelerated VGA BIOS
Capabilities of the video environment;
0 = DAC is fixed width, 1 = DAC width is switchable. 1
Number of 64kb memory blocks on board 3840
Supported VESA video modes.
013C 014D 015C 013A 014B 015A 0107 011A 011B 0105 0117 0118
0112 0114 0115 0101 0103 0111
Information for VESA video mode 013C
Mode attributes 009B LFBWnVGAGr Co 1 Hw
Window A attributes 07 Window B attributes 00
Window granularity 64 KB Window size 64 KB
Window A start segment A000 Window B start segment 0000
Window function pointer C000:55AE
Bytes per scan line 1920
APA Resolution 1920 x 1440 Character Cell 8 x 16
Number of planes 1 Bits per pixel 8
Memory model type 4 Packed pixel
Number of banks 1 Bank size 0 KB
Additional image pages 90
C:\DOCUME~1\Dave\Desktop\FORTRA~2\VESAIN~1 =>
Steve,
I've tested the program. Works fine, here are the results:
DosBox
VESA version number 2.0 OEM String: S3 Incorporated. Trio64
Capabilities of the video environment;
0 = DAC is fixed width, 1 = DAC width is switchable. 0
Number of 64kb memory blocks on board 32
Supported VESA video modes.
0100 0101 0102 0103 0104 0105 0106 0107 010D 010E 010F 0110
0111 0112 0113 0114 0115 0116 0117 0150 0151 0152 0153 0160
0161 0162 0165 0170 0171 0172 0175 0190 0191 0192 0207 0209
020A 0213 0222 0223 0224 0225
Information for VESA video mode 0100
Mode attributes 009B LFBWnVGAGr Co 1 Hw
Window A attributes 07 Window B attributes 00
Window granularity 64 KB Window size 64 KB
Window A start segment A000 Window B start segment 0000
Window function pointer F000:1320
Bytes per scan line 640
APA Resolution 640 x 400 Character Cell 8 x 16
Number of planes 1 Bits per pixel 8
Memory model type 4 Packed pixel
Number of banks 1 Bank size 0 KB
Additional image pages 7
VirtualBox
VESA version number 2.0 OEM String: VirtualBox VESA BIOS
Capabilities of the video environment;
0 = DAC is fixed width, 1 = DAC width is switchable. 1
Number of 64kb memory blocks on board 144
Supported VESA video modes.
0100 0101 0102 0103 0104 0105 0106 0107 010D 010E 010F 0110
0111 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 0140
0141 0142 0143 0144 0145 0146 0147 0148 0149 014A 014B 014C
Information for VESA video mode 0100
Mode attributes 009B LFBWnVGAGr Co 1 Hw
Window A attributes 07 Window B attributes 00
Window granularity 64 KB Window size 64 KB
Window A start segment A000 Window B start segment 0000
Window function pointer C000:0605
Bytes per scan line 640
APA Resolution 640 x 400 Character Cell 8 x 16
Number of planes 1 Bits per pixel 8
Memory model type 4 Packed pixel
Number of banks 1 Bank size 0 KB
Additional image pages 35
Native DOS 7
VESA version number 3.0 OEM String: AMD ATOMBIOS
Capabilities of the video environment;
0 = DAC is fixed width, 1 = DAC width is switchable. 1
Number of 64kb memory blocks on board 256
Supported VESA video modes.
0100 0101 0103 0105 0107 0110 0111 0113 0114 0116 0117 0119
011A 010D 010E 0120 0193 0195 0196 01B3 01B5 01B6 01C3 01C5
01C6 0133 0135 0136 0153 0155 0156 0163 0165 0166 0121 0122
0123 0124 0143 0145 0146 0173 0175 0176 0183 0185 0186 01D3
01D5 01D6 01E3 01E5 01E6
Information for VESA video mode 0100
Mode attributes 00BB LFBWn- Gr Co 1 Hw
Window A attributes 07 Window B attributes 00
Window granularity 64 KB Window size 64 KB
Window A start segment A000 Window B start segment 0000
Window function pointer C000:5317
Bytes per scan line 640
APA Resolution 640 x 400 Character Cell 8 x 16
Number of planes 1 Bits per pixel 8
Memory model type 4 Packed pixel
Number of banks 1 Bank size 0 KB
Additional image pages 63
It's always the same machine but other environments.
Gunther
Hi,
Sigh. Updated in Reply #55.
@Gunther
Interesting that the virtual environments are not the same
as the native one. Are there noticeable speed differences as
well?
Regards,
Steve
Steve,
Quote from: FORTRANS on January 06, 2014, 06:29:14 AM
Interesting that the virtual environments are not the same
as the native one. Are there noticeable speed differences as
well?
Regards,
Steve
yes, of course. These are emulations; the code must be morphed through a lot of layers.
Gunther
hmmm - the 2 new attachments have the same name ??? :biggrin:
don't feel bad, Steve, i'm getting older, too
both programs yield the same results
the second program (slightly larger ZIP file) has a working "inkey" pause at the end
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Dave\Desktop\2VESAINF => vesainf
VESA version number 3.0 OEM String: Intel(r)915G/915GV/910GL Graphics Chip A
ccelerated VGA BIOS
Capabilities of the video environment;
0 = DAC is fixed width, 1 = DAC width is switchable. 1
Number of 64kb memory blocks on board 3840
Supported VESA video modes.
013C 014D 015C 013A 014B 015A 0107 011A 011B 0105 0117 0118
0112 0114 0115 0101 0103 0111
Information for VESA video mode 013C
Mode attributes 009B LFBWnVGAGr Co 1 Hw
Window A attributes 07 Window B attributes 00
Window granularity 64 KB Window size 64 KB
Window A start segment A000 Window B start segment 0000
Window function pointer C000:55AE
Bytes per scan line 1920
APA Resolution 1920 x 1440 Character Cell 8 x 16
Number of planes 1 Bits per pixel 8
Memory model type 4 Packed pixel
Number of banks 1 Bank size 0 KB
Additional image pages 90
Paused, hit a key to exit.
C:\DOCUME~1\Dave\Desktop\2VESAINF =>
Hi,
Quote from: dedndave on January 06, 2014, 11:57:54 AM
hmmm - the 2 new attachments have the same name ???
Yeah, lazy, and clumsy I guess. Fixed, it pays to double
check (maybe).
Quote
don't feel bad, Steve, i'm getting older, too
both programs yield the same results
? They should, except for a working pause. I may delete
the BankSize and related entries as no one in their right mind
would make interleaved video memory like the modes 4, 5, and
6 CGA graphics in a modern video chip. Or have you noticed
something else?
Quotethe second program (slightly larger ZIP file) has a working "inkey" pause at the end
Finally.
Suggestions (anyone)?
Cheers,
Steve
looks good
i guess some masochists may write banked code - lol
if so, they can also write the code to see what's available :P
i was happy just to see that this machine does something in vesa
Hi,
Quote from: dedndave on January 07, 2014, 01:48:40 AM
i was happy just to see that this machine does something in vesa
QuoteNumber of 64kb memory blocks on board 3840
Wow. Do you want a VESA program (DOS) to try out?
Or there were a lot of DOS image viewer programs that use
VESA graphic modes.
Regards,
Steve N.
oh no, Steve - i was just interested to see my machine do something
i don't really see much future in VESA - it's more about running pre-existing game programs :P