Hi!
I wanted to make a assembler program to copy the date and time from the
real-time clock (RTC, the CMOS clock) to the DOS clock, because the DOS
version of Sokoban resets the DOS clock.
I had begun a program in assembler, but I never got around the necessary
conversion from hex to dec. I wonder if someone could help?
-------------8<----------------------------8<-----------------
;
; SETTIME.ASM - Sets The DOS System Clock The Same As The CMOS Clock.
; NOTE: This is for AT-class machines only. Won't work with PC/XT.
;
P8086 ; select the processor
ideal
model tiny ; always must be TINY model
codeseg ; this marks the start of executable code
startupcode
mov ah, 02h ;function 02h - read CMOS clock time
int 1Ah ;call AT BIOS Time of Day Services
; return: CH = hours
; CL = minutes
; DH = seconds
mov ah, 2Dh ;function 2Dh - set DOS system time
int 21h ;call DOS services
; needs conversion from hex value to dec,
; for example from 1997 hex to 1997 dec
; I never got around this problem.
mov ah, 04h ;function 04h - read CMOS clock date
int 1Ah ;call AT BIOS Time of Day Services
; return: CH = Century
; CL = Year
; DH = Month
; DL = Day
mov ah, 2Bh ;function 2Bh - set DOS system date
int 21h ;call DOS services
@exit: exitcode ; terminate the program
end
-------------8<----------------------------8<-----------------
Cheers, Eddy
... * <- Tribble ****************** <- Tribble Orgy
--- MBM v4.12
---------------
* Origin: Speedy Gonsalez (2:500/143.7)
|