- #include "stdio.h"
-
#include "conio.h"
-
#include "graphics.h"
-
char far *vidmem=0xB8000000;
-
main()
-
{
-
-
int gm,gd=DETECT;
-
int r,c,i;
-
char message[]="praveen";
-
initgraph(&gd,&gm,"");
-
-
clrscr();
-
for(r=5;r<=20;r++)
-
{
-
for(c=5;c<=50;c++)
-
write2vdu('',64,r,c);
-
}
-
c=10;
-
for(i=0;i<=10;i++)
-
{
-
write2vdu(message[i],77,10,c);
-
c++;
-
}
-
getch();
-
}
-
write2vdu(char ch,char attr,int row,int col)
-
{
-
char far *v;
-
v=vidmem+row*160+col*2;
-
*v=ch;
-
v++;
-
*v=attr;
-
}
when i run this, it just show only white screen..but the author of this program says tat will show a box with some texts..any one help me to get correct output.thankyou....
9 2120
I don't have a compiler old enough to compile thbs code.
I havent't seen far pointers in 20 years. Where did this code come from?
am using xp and intel motherboard..any problems wit tat..
I am not able to compile this code so I can't analyse it for you. Sorry.
@weaknessforcats
it's k..i have one doubt in tat program..tat means in that top of the prgm we are using "char far *vidmem=0XB8000000;"
will u tell why we are using this..?,...thk u...
vidmem is used in a calculation. The 0XB8000000 must have somethibng to do with the amount of video memory.
The fact that vidmen is a char far* means the pointer is located outside the current code segment. For this to work you need a compiler old enough to use segmented memory models which went out of existence about 1990.
Basically, I don't believe the code is going to work using any modern computer/compiler/video driver.
@weaknessforcats
gcc will. I'm pretty sure that video address is still used though I don't know how Windows would react to it. I still see assembly code passed around using that on the assembly forums I visit. I haven't paid attention to this stuff in a few years though.
In real mode (including emulation of it in dos box in windows), 0xB800:0000 is the starting address of display buffer of cga (ega, vga) adapter in text mode. The problem is that write2vdu expects the text mode to be on, but initgraph puts the adapter into graphics mode.
thanks friends at last i got a correct output with windows xp also........thk you for all.......
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jean-Philippe Martin |
last post by:
Hi all,
It's my first post here, so you doubt I have a question :o)
I want to develop a mini graphical editor. Imagine that I have 2 JFrame, I
want to have one with a list of JToggleButton...
|
by: Sanjay |
last post by:
hi,
We are currently porting our project from VB6 to VB .NET.
Earlier we used to make scale transformations on objects like pictureBox ,
forms etc.Now Such transformations are made on the...
|
by: Anand Ganesh |
last post by:
Hi All,
I have an image which is made to fit in a Window. The user can Zoom In or
Zoom Out and Pan the image.
These images are Engineering drawings which has been drawn to scale say 1
inch =...
|
by: Aykut |
last post by:
Hi,
we plan to develop an app. that will involve lots graphics operations like
open, zoom rotate ect.
and there will be a lot of math in it because of filters ,noise corrections
ect. on image....
|
by: Danny van Kasteel |
last post by:
Hi,
I'm trying to make an ownerdrawn ListBox that can display a custom graphic
and 2 lines of text per item.
I have tried to set the following properties on a standard ListBox control:
...
|
by: SamSpade |
last post by:
Public Function PicCreateGraphics() As Graphics
'Client should dispose this
PicCreateGraphics = Graphics.FromImage(mDocumentImage)
mPicCreateGraphicsSaved = PicCreateGraphics 'Saved so I can...
|
by: Charles A. Lackman |
last post by:
Hello,
I have created a complete PrintDocument and need to create an image from it.
How is this done?
e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality...
|
by: Hari Shankar |
last post by:
Hello Guyz
We are planning to simulate the front panel of a Car Radio in PC. We want to
use it for demo purposes. Especially in situations where we don't have the
actual hardware available, we...
|
by: Xah Lee |
last post by:
Of Interest:
Introduction to 3D Graphics Programing
http://xahlee.org/3d/index.html
Currently, this introduction introduces you to the graphics format of
Mathematica, and two Java Applet...
|
by: =?Utf-8?B?TW9oYW1tYWQtUmV6YQ==?= |
last post by:
Hi everyone.
We're trying to diplay a message on the screen, and we want it to be always
there, regardless of whether a new application is run, which may occupy that
portion of the screen.
Put...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |