473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MEmory Addres of DOS screen

Hi,

I thought that the memory address of DOS screen is 0x0b00.
But this didnt work for me.
Can anyone help in accessing the screen by using this address.

Mar 20 '06 #1
13 2501
"Arun" writes:
I thought that the memory address of DOS screen is 0x0b00.
But this didnt work for me.
Can anyone help in accessing the screen by using this address.


This is the wrong newsgroup. The right one probably has ms-dos or some
variant of that in it's name. It seems reasonable that a search of Google
groups might find the answer already posted. At the very least it will tell
you which groups are active and likely to be useful.
Mar 20 '06 #2
Arun wrote:
Hi,

I thought that the memory address of DOS screen is 0x0b00.
But this didnt work for me.
Can anyone help in accessing the screen by using this address.


It is not the memory address of the "DOS screen", whatever that may be,
but the start of the video memory in the PC's address space. As such,
your query is highly off-topic to this group. alt.lang.asm would be a
better group for instance.

Mar 20 '06 #3

"Arun" <pr******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Hi,

I thought that the memory address of DOS screen is 0x0b00.
But this didnt work for me.
Can anyone help in accessing the screen by using this address.


Sigh... yes. You didn't state compiler you use. This works for DJGPPv2.03
and OWv1.3.

#include <stdio.h>
#include <stdlib.h>
#ifdef __DJGPP__
#include <sys/nearptr.h>
#endif
#ifdef __WATCOMC__
#include <i86.h>
#endif

#define BSCR 0xB8000
#ifdef __I86__
#undef BSCR
#define BSCR 0xB800
#endif

void twiddle(void)
{
#ifdef __I86__
unsigned char __far *screen=MK_FP(BSCR,0);
#else
unsigned char *screen=(void *)BSCR;
#endif

#ifdef __DJGPP__
__djgpp_nearptr_enable();
screen+=__djgpp_conventional_base;
#endif

*(screen)+=1;
*(screen+1)+=1;
}

int main(void)
{
unsigned long i;

for (i=0;i<100000;i++)
twiddle();

exit(EXIT_SUCCESS);
#ifdef __WATCOMC__
return(0);
#endif
}
Rod Pemberton

Mar 21 '06 #4
"Rod Pemberton" <do*********@sorry.bitbuck.cmm> writes:
"Arun" <pr******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Hi,

I thought that the memory address of DOS screen is 0x0b00.
But this didnt work for me.
Can anyone help in accessing the screen by using this address.

Sigh... yes. You didn't state compiler you use. This works for DJGPPv2.03
and OWv1.3.

#include <stdio.h>
#include <stdlib.h>
#ifdef __DJGPP__
#include <sys/nearptr.h>
#endif

[snip] exit(EXIT_SUCCESS);
#ifdef __WATCOMC__
return(0);
#endif
}


Can you *please* take this to a newsgroup where it's topical? Posting
this code in a forum that's lacking in DOS experts who can confirm
whether it's correct is not helpful to the original poster. In a
system-specific newsgroup, they might know better approaches for
whatever task the OP is trying to accomplish.

(Watcom C needs a "return(0);" *after* a call to
"exit(EXIT_SUCCESS);"???)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Mar 21 '06 #5
Keith Thompson wrote:
"Rod Pemberton" <do*********@sorry.bitbuck.cmm> writes:
[troll stuff]
Can you please take this to a newsgroup where it's topical?


He's trolling, just killfile or at least stop replying to him. He's
made it clear that he cares not about topicality.

Brian
Mar 21 '06 #6

"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
"Rod Pemberton" <do*********@sorry.bitbuck.cmm> writes:
"Arun" <pr******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Hi,

I thought that the memory address of DOS screen is 0x0b00.
But this didnt work for me.
Can anyone help in accessing the screen by using this address.

Sigh... yes. You didn't state compiler you use. This works for DJGPPv2.03 and OWv1.3.

Can you *please* take this to a newsgroup where it's topical?


He posted here for whatever reason. Many other newsgroups seem to be dead
lately. So perhaps this group was his only hope. Feel free to complain to
the OP. It has never stopped you yet.
Posting
this code in a forum that's lacking in DOS experts who can confirm
whether it's correct is not helpful to the original poster.
There is no need to confirm whether it is correct or not. You should assume
I'm the "DOS expert" because I posted it.
In a
system-specific newsgroup, they might know better approaches for
whatever task the OP is trying to accomplish.
Perhaps. But, he chose to post here for whatever reason.
(Watcom C needs a "return(0);" *after* a call to
"exit(EXIT_SUCCESS);"???)


Yes, version 1.3 of OW generates warnings if any function including main()
doesn't contain a return. Hopefully, they've fixed it in 1.4 or 1.5 or soon
to be 1.6.
Rod Pemberton
Mar 21 '06 #7

"Default User" <de***********@yahoo.com> wrote in message
news:48************@individual.net...
Keith Thompson wrote:
"Rod Pemberton" <do*********@sorry.bitbuck.cmm> writes:


[troll stuff]
Can you please take this to a newsgroup where it's topical?


He's trolling, just killfile or at least stop replying to him. He's
made it clear that he cares not about topicality.


I'm being the troll? You didn't need to post. You knew the thread was
off-topic for you from subject line of his post. I'm helping someone who
apparently needs help in an area where I can help. It doesn't harm anyone
to respond to his post here. If you don't like off-topic posts please go to
a moderated newsgroup.
Rod Pemberton
Mar 21 '06 #8
On Tue, 21 Mar 2006 16:38:26 -0500, "Rod Pemberton"
<do*********@sorry.bitbuck.cmm> wrote:

"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
"Rod Pemberton" <do*********@sorry.bitbuck.cmm> writes:
> "Arun" <pr******@gmail.com> wrote in message
> news:11**********************@j33g2000cwa.googlegr oups.com...
>> Hi,
>>
>> I thought that the memory address of DOS screen is 0x0b00. <snip> > Can you *please* take this to a newsgroup where it's topical?


He posted here for whatever reason.


For a first-time poster, we generally assume he didn't know any
better, and direct him to a more suitable forum. In this case, that
was done, two days ago. Since he seems to be gone, we assume he found
the more suitable forum, or wasn't interested enough to pursue it.
<snip>
Posting
this code in a forum that's lacking in DOS experts who can confirm
whether it's correct is not helpful to the original poster.
There is no need to confirm whether it is correct or not. You should assume
I'm the "DOS expert" because I posted it.


Hah. I sincerely hope you're more of an expert on DOS than on
topicality.

<snip>

--
Al Balmer
Sun City, AZ
Mar 21 '06 #9
Al Balmer opined:
On Tue, 21 Mar 2006 16:38:26 -0500, "Rod Pemberton"
<do*********@sorry.bitbuck.cmm> wrote:

There is no need to confirm whether it is correct or not. You should
assume I'm the "DOS expert" because I posted it.


Hah. I sincerely hope you're more of an expert on DOS than on
topicality.


Ah, now I see what I'm missing, courtesy of the killfile...

So, if I now start posting about particle physics (in the context of C,
of course), that makes me an expert in it. It's good to know. LoL

--
BR, Vladimir

The goys have proven the following theorem...
-- Physicist John von Neumann, at the start of a classroom
lecture.

Mar 21 '06 #10
On Tue, 21 Mar 2006 16:45:50 -0500, in comp.lang.c , "Rod Pemberton"
<do*********@sorry.bitbuck.cmm> wrote:

"Default User" <de***********@yahoo.com> wrote in message
news:48************@individual.net...
Keith Thompson wrote:
> "Rod Pemberton" <do*********@sorry.bitbuck.cmm> writes:
[troll stuff]
> Can you please take this to a newsgroup where it's topical?


He's trolling, just killfile or at least stop replying to him. He's
made it clear that he cares not about topicality.


I'm being the troll?


Yes. You're posting offtopic posts, deliberately and knowing full well
they're offtopic. Why do you do that, if its not with the purpose of
annoying people?
You didn't need to post. You knew the thread was
off-topic for you from subject line of his post. I'm helping someone who
apparently needs help in an area where I can help.
No, you're making the classic mistake of helping him in exactly the
place you shouldn't. Again, why do you do that, if its not with the
purpose of actually being UNhelpful?

It doesn't harm anyone
to respond to his post here. If you don't like off-topic posts please go to
a moderated newsgroup.


Expect to get flamed more often.
Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Mar 21 '06 #11
On Tue, 21 Mar 2006 16:38:26 -0500, in comp.lang.c , "Rod Pemberton"
<do*********@sorry.bitbuck.cmm> wrote:

"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
Posting
this code in a forum that's lacking in DOS experts who can confirm
whether it's correct is not helpful to the original poster.
There is no need to confirm whether it is correct or not. You should assume


Why? Because you say so? Don't make me laugh.
I'm the "DOS expert" because I posted it.
Well, I'm a real DOS expert, and your code was utter, complete
nonsense. You apparently have absolutely no idea what you're talking
about.
Of course, neither your ridiculous statement nor mine is even remotely
verifiable. Here in CLC, there's nobody to peer-review our claims. So
they're worthless.
Perhaps. But, he chose to post here for whatever reason.


Because unlike you, he knew no better. He's blameless. You're not.

Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Mar 21 '06 #12
Al Balmer wrote:
"Rod Pemberton" <do*********@sorry.bitbuck.cmm> wrote:

.... snip ...

There is no need to confirm whether it is correct or not. You
should assume I'm the "DOS expert" because I posted it.


Hah. I sincerely hope you're more of an expert on DOS than on
topicality.


It's all in the sig!

--

+-------------------+ .:\:\:/:/:.
| PLEASE DO NOT F :.:\:\:/:/:.:
| FEED THE TROLLS | :=.' - - '.=:
| | '=(\ 9 9 /)='
| Thank you, | ( (_) )
| Management | /`-vvv-'\
+-------------------+ / \
| | @@@ / /|,,,,,|\ \
| | @@@ /_// /^\ \\_\
@x@@x@ | | |/ WW( ( ) )WW
\||||/ | | \| __\,,\ /,,/__
\||/ | | | jgs (______Y______)
/\/\/\/\/\/\/\/\//\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
================================================== ============

fix (vb.): 1. to paper over, obscure, hide from public view; 2.
to work around, in a way that produces unintended consequences
that are worse than the original problem. Usage: "Windows ME
fixes many of the shortcomings of Windows 98 SE". - Hutchison
Mar 22 '06 #13
Rod Pemberton wrote
(in article <dv***********@news3.infoave.net>):

"Arun" <pr******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Hi,

I thought that the memory address of DOS screen is 0x0b00.
But this didnt work for me.
Can anyone help in accessing the screen by using this address.


Sigh... yes. You didn't state compiler you use. This works for DJGPPv2.03
and OWv1.3.


Not only is it Off-topic here, but it's incorrect as a solution
for all DOS systems. Monochrome adapters used b000, color b800.
You need to detect which is present, and do the right thing.


--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Mar 24 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Tron Thomas | last post by:
Given the following information about memory management in C++: ----- The c-runtime dynamic memory manager (and most other commercial memory managers) has issues with fragmentation similar to a...
13
by: lupher cypher | last post by:
Hi, I'm trying to access memory directly at 0xb800 (text screen). I tried this: char far* screen = (char far*)0xb8000000; but apparently c++ compiler doesn't know "far" (says "syntax error...
2
by: Alan Brown | last post by:
Subject: Setting Pointer to Video memory Newsgroups: Optus:comp.lang.c++.moderated Hi People, I am trying to create a Help Screen in a program. I want to swap out the video memory, use...
5
by: Nadav | last post by:
Hi, I am trying to get a direct pointer to the address of the screen ( something like 0x0b00 in the happy DOS days ), how can I do that? Should this be done in the kernel or it can also be done...
8
by: Beam_Us_Up_Scotty | last post by:
Hello all, I am trying to write a "simple" animation using C#, and I've tried many things but nothing seems to work for me without leaking memory. Here's a very simple piece of code that uses a...
8
by: LM-Krav | last post by:
Hey all, i'm trying to access the screen memory, and generaly - enter the graphic mode. and do not know it's address or the commandline for it, please tell me what it is (the address or command...
29
by: tele-commuter | last post by:
Hi folks, I want to understand how exactly is an image(compiled c code and loaded into memory) stored in memory. What exactly is a linker script? I work with a lot of c code on a daily...
5
by: mehafi | last post by:
Hi, Why this program work? #include<iostream.h> class test { public: char *ptr; void setPtr(char* p){
2
by: Suvarna Kale | last post by:
Hi ,I want to find IP addres of Web Server in ASP.Net. For example,in one application, when i click on button control , i want IP address of www.yahoo.com website.How will i do this . If any one is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.