Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > MEmory Addres of DOS screen

Reply
Thread Tools

MEmory Addres of DOS screen

 
 
Arun
Guest
Posts: n/a
 
      03-20-2006
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.

 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      03-20-2006
"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.


 
Reply With Quote
 
 
 
 
santosh
Guest
Posts: n/a
 
      03-20-2006
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.

 
Reply With Quote
 
Rod Pemberton
Guest
Posts: n/a
 
      03-21-2006

"Arun" <> wrote in message
news: 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





 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      03-21-2006
"Rod Pemberton" <> writes:
> "Arun" <> wrote in message
> news: 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) kst- <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.
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      03-21-2006
Keith Thompson wrote:

> "Rod Pemberton" <> 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
 
Reply With Quote
 
Rod Pemberton
Guest
Posts: n/a
 
      03-21-2006

"Keith Thompson" <kst-> wrote in message
news:...
> "Rod Pemberton" <> writes:
> > "Arun" <> wrote in message
> > news: 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


 
Reply With Quote
 
Rod Pemberton
Guest
Posts: n/a
 
      03-21-2006

"Default User" <> wrote in message
news:...
> Keith Thompson wrote:
>
> > "Rod Pemberton" <> 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


 
Reply With Quote
 
Al Balmer
Guest
Posts: n/a
 
      03-21-2006
On Tue, 21 Mar 2006 16:38:26 -0500, "Rod Pemberton"
<> wrote:

>
>"Keith Thompson" <kst-> wrote in message
>news:...
>> "Rod Pemberton" <> writes:
>> > "Arun" <> wrote in message
>> > news: 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
 
Reply With Quote
 
Vladimir S. Oka
Guest
Posts: n/a
 
      03-21-2006
Al Balmer opined:

> On Tue, 21 Mar 2006 16:38:26 -0500, "Rod Pemberton"
> <> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Discover ip addres of a msn user? Roaming Penguin Computer Security 14 10-28-2007 11:51 AM
Can I pass addres of constant reference to a function in c++. Joyti C++ 5 06-01-2006 04:03 PM
importing OE mess/setting/addres book beenthere Computer Support 1 04-03-2006 08:00 PM
Address list on MAC addres Walter Roberson Cisco 3 02-21-2005 08:21 PM
reactivating email addres peter jones Computer Support 3 06-05-2004 09:51 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57