Real time clock access

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Real time clock access

Post by SebMcClouth »

Is there any way to access the real time clock through qb? If so, how can this be achieved?

grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

No, no way that would give you anything useful.

QB is too slow..


There's the DOS clock, and there's the windows API clock..

But QB is too slow to take advantage of it..
I have left this dump.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

I need quickbasic just to get the time from the RTC, so my program runs with the BIOS time...

grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
mennonite

er, time$?

Post by mennonite »

actually there's a routine somewhere on the qbasic forum about how the data is stored for the RTC, similar to information about how integers and floating point vars are stored in memory, but i'm not sure what you want it for.

z!re's right, qbasic's timing features are far from ideal, but if you're not counting on precision (i mean, the bios rtc doesn't keep time as well as an ordinary wristwatch anyway) you can just use time$ which (i assume you know... i'm confused about your question) returns a string with "hh:mm:ss" in 24 hour format.

timer, which returns a floating point variable consisting of the seconds past midnight (0 to 86400) but also the 1/10 and 1/100 seconds after the decimal point. what exactly were you accessing the RTC for, and do you need the raw data from memory? if you do, i might be able to find the 16 bit code for you, it might even be in the qbasic forum faq. whether it's worth it really depends on what you need it for, but... dunno, time$ should suit most purposes outside of animation...
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

I dunno about you, but time$ doesn't work for me... it like... gets a wronge time, while dos says the right time... like... yeah...
Image
mennonite

that's insane

Post by mennonite »

when you say "wrong time"... no, i can't imagine.
god, the more i hear about dos emulation (more like mutilation) in xp...
what about timer? does it return the wrong number of seconds too? god damn you, bill.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

I know I can use time$ but my program requires (for the dull reason that it is still is based upon Linux) time & date from the RTC.

grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
mennonite

i was unable to find what i thought was on the qbasic forum

Post by mennonite »

but i found this:
http://support.novell.com/techcenter/ar ... 40103.html

which not only has the interrupts you need, but example basic code.

be sure to use it as an outline. the page is copyrighted.

not that the code is complex enough to protect, "print hello world" but i'd be careful to make sure mine was original.

i'm glad you're basing your shell on linux. that's what makes it unique in the long running joke of shells and "os's" in qb. i'm all for it, and look forward to learning more about it / seeing it work. i just hope for your sake that xp actually allows you to access the part of memory that the clock is in. win xp turns off a lot of 16 bit access. i wonder if vista or what comes after will turn off a lot of 32 bit access. assholes.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

The best thing would be, if qbinux ever becomes bigger, that ms-programs can be run through the GUI and then you don't have to worry about the rest of the windows envirment. It is possible, I've seen in Linux, so it's worth a try. Until then, I hope to first have a stable text-mode and hopefully, internet access too...

grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
mennonite

will there be a website?

Post by mennonite »

as i understand right now the only way to get a copy is by email. is it that you prefer not too many copies to float around right now, or is it more that you just haven't gotten around to putting stuff about it online?

if it's the latter, i admire your project and would be happy to maintain a small site about it. people could then download the latest beta (which i'm sure you know is the surest way to get feedback/suggestions/bugalerts/bugfixes) and could find out about it easily.

if and when you're ready to take over the site at some point, i could just give you the password and user, like handing over the keys to a car.

i'd like to see a qbinux site though, whether i'm part of it or not. you're making it too big to keep teasing everyone without a place they read about it :)

oh and as far as design goes, please ignore my own site, would you? it's no example- i've never had something central to organize it around. i've been thinking about tidying it up a bit, but a single project is a lot easier to design a site around. mine is something i'm letting grow into it's own natural shape, and i'm still finding out that is. it wasn't intentional, but i looked at the 4 big links at the top and the vaporware box on the side today and was shocked at how much i unconsciously ripped off pete's format. (now all it needs is side navigation, something i've been planning to never put in.) if it's original at all, though, i'm happy. i love pete's site. the only place i'm more likely to look for stuff on qbasic is the qbasic forum and google.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

There will be a site, give me about two weeks... I got storage but I'm realling trying to develop qbinux more. Meanwhile I can get some stuff for the site.


grtz
Seb McClouth
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Re: i was unable to find what i thought was on the qbasic fo

Post by Nodtveidt »

mennonite wrote:i'm glad you're basing your shell on linux. that's what makes it unique in the long running joke of shells and "os's" in qb. i'm all for it, and look forward to learning more about it / seeing it work.
Novix was also based on linux.
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post by MystikShadows »

What's the Novix URL?
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
DrV
Veteran
Posts: 63
Joined: Thu Jun 02, 2005 9:44 pm

Post by DrV »

novix.tk
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post by MystikShadows »

yeah it's what I thought but it tells me that it could not be found.
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

try www.novix.tk

grtz

seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

Novix will be implented as a part of qbinux.

grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
User avatar
Zamaster
Veteran
Posts: 174
Joined: Wed Jun 15, 2005 1:51 pm

Post by Zamaster »

What does "GRTZ" mean?!!!!!
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

GRTZ = short for greets, an expression for a salution...

so...

Grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

I have another question. I can get the time but how can I get the date through this:

Code: Select all

CLS
OUT &H70, 0
SEC = INP(&H71)
OUT &H70, 2
MIN = INP(&H71)
OUT &H70, 4
HOUR = INP(&H71)
PRINT HEX$(HOUR); ":";HEX$(MIN); ":";HEX$(SEC)
grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Post Reply