MEmory Addres of DOS screen

A

Arun

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.
 
O

osmium

Arun said:
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.
 
S

santosh

Arun said:
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.
 
R

Rod Pemberton

Arun said:
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
 
K

Keith Thompson

Rod Pemberton said:
Arun said:
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);"???)
 
R

Rod Pemberton

Keith Thompson said:
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
 
R

Rod Pemberton

Default User said:
Keith said:
"Rod Pemberton" <[email protected]> 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
 
A

Al Balmer

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.
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>
 
V

Vladimir S. Oka

Al Balmer opined:
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.
 
C

CBFalconer

Al said:
.... snip ...

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
 
M

Mark McIntyre

Default User said:
Keith said:
"Rod Pemberton" <[email protected]> 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
 
M

Mark McIntyre

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
 
R

Randy Howard

Rod Pemberton wrote
(in article said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top