How to show bmp
(1)I what make a dos exe to show a bmp file use masm5.0 .

who can give me the asm code ,thank u first!

(2)who know where hava free asp space that space sppourt ftp,databace.
Posted on 2003-08-24 03:00:26 by tomorrow
about the free space: , but getting an account isn't easy
about the bitmap: I'll try to help, make some code, though I've never done DOS graphics :grin:. In other words, I'll explore that area and post whatever I've done :). But first, I'm going to the beach :grin: . Check for info on the file structure of .bmp ;) .
Posted on 2003-08-25 00:19:05 by Ultrano
thank you very much
Posted on 2003-08-25 00:31:54 by tomorrow
blah. I'll never ever return to code for DOS. This was my first and last time, though successful. I wrote it in FASM, though. I think you'll have almost no problems in converting it to masm.
mov eax,var1 -> mov eax,offset var1
mov eax, -> mov eax,var1
- these are the only things you need. sorry , but I'm very tired: could not startup VESA, then files, then alignment of dib..... all easy things got me too much time. today I studied too much dos programming to do the task. sorry for no full comments.
replace the uli.bmp with any 8-bit bitmap with size <= 320x200
Posted on 2003-08-25 15:14:33 by Ultrano
Posted on 2003-08-25 15:40:16 by Hiroshimator
Now I feel a little better, so I'll say how the code works. To display things in DOS, one has to command VESA2, as I learnt. Commanding usually goes with int 10h. I decided to show only 8-bit pictures, and I viewed some bmps with a hex editor. After offset 54, comes a 1024-byte array of palette (256 entries of 4 bytes each). The Palette is in fact an array of 24-bit color values, that are used for reference later. We usually don't want to be limited to only 256 generic colors, so we can define which 256 colors we're gonna use into that palette. For example, if the 3rd (Palette[2]) entry is pink, and one byte from the picture is 02h, then this byte will be displayed as pink.
After that palette data, comes the array of bytes for the picture.
Now, in DOS, there is no simple way to do memory allocation and stuff, so for the most convenient way I chose to put the data, that we load from uli.bmp into the space that is exactly after the end of the file. This proved to work ok. My code is bad, I found out that I can't load more than 32k of file, coz if I specify 33k to the interrupt to read file data, it is assumed as -31k. I should have used AX:DX or thing like that. Anyway, after I open and load the file, I see at offsets 12h and 16h for width and height of picture. Then, I call video interrupt to start DAC loading of palette, and begin loading the video card with palette entries, 256 of them. Right after that data, comes the bitmap data, but it's sorted in a weird way - damn MS. I hate MS only for this thing. But well, we can handle it :) . I set ESI to be the pointer to the source for bitmap data, and EDI - destination. I set EDI to point to the bottom left corner, not the top left, and on each line of data movsb-ed, I subtract 320 from edi, and the number in ecx for that movsb . Thus, I invert vertically the bitmap, so that it is well-positioned. After that, I call int16h for waiting one to slam the keyboard in anger how dumb the proggie is :grin:
Posted on 2003-08-26 11:12:13 by Ultrano