Jump to content

Is there an easy way to adjust the clock?

- - - - -

  • Please log in to reply
6 replies to this topic

#1
darwin-t

darwin-t

    Newbie

  • Members
  • Pip
  • 3 posts
I have done some programming with TASM in DOS several years ago. It involved capturing interrupts and using the printer port to turn the computer into a learning remote and wrote a program to turn the computer into a DVR. I also modified the program, using parts of it to run a stepper motor at varying speeds.

What I am looking for now is a way to adjust the computer's clock in small increments - like 1/10th of second by pressing two keys - one to set it ahead and another to set it back.

I use my computer to track the International Space Station with my telescope. Sometimes the computer's tracking is a little ahead or behind. Rather than using a joystick to try to correct larger errors, I'd like to be able to adjust the clock a bit to make adjustments.

Can one still use old methods with modern computers? I'm running XP.

Thanks.

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
There are several things you can mean by "clock." Do you mean the system clock, the interrupt timer, or XP's clock?
sudo rm -rf /

#3
darwin-t

darwin-t

    Newbie

  • Members
  • Pip
  • 3 posts
System clock. I found my old program I wrote 10 years ago and lifted some code out of that, but it isn't working. I ran it through Tasm Debug and the AX register comes up with zero when it should be holding a value.Here's what I'm trying

mov ah,2ch ;get current time
int 21h ;ch=hour cl=minutes dh=seconds, dl= 1/100 second

Then I add or subtract 10 to dl and then

mov ah,2dh ;set time
int 21h


Should that work?

Thanks.

It sounds like I need to be working on XP'S clock, maybe?

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
This shouldn't run properly on modern Windows machines. In fact, your program should segfault; programs can't use interrupts like that in protected mode.
sudo rm -rf /

#5
darwin-t

darwin-t

    Newbie

  • Members
  • Pip
  • 3 posts
Well, that answers my question. I'll abandon the idea.

Thanks.

My original program DID work with Windows 10 years ago. I used it along with an interface with an infrared LED to control my satellite receivers. That may have been Windows 98 back then.

#6
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
There may be a way to do it with the Windows API, although my searches proved fruitless. If you were to use the Windows API, you would need an assembler with the libraries and include files for it (I don't know whether TASM has these or not).
Latinamne loqueris?

#7
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
There's definitely a way to do it with WinAPI. It'd be a pain, though; for that you might as well write a C/C++ program to do it.
sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users