Page 1 of 1

INT 1A time

Posted: Sun Jan 30, 2011 10:03 am
by Holus
There are some interrupt that give you a date or a time.
This is very strange. It give you a decimal value in a hex output.

AH = 0Ch
CH = hours (BCD)
CL = minutes (BCD)
DH = seconds (BCD)
DL = day of month (BCD)

I made a function to convert a 2 BYTE value to a output on screen. But can I get date and time more easy??

Code: Select all

HEX2DATE: ; INPUT AX=VALUE 
	PUSH AX
	XOR CL,CL
DATELOOP:	
	POP AX
	PUSH AX
	SHL AX,CL
	SHR AX,12
	ADD AL,48
	MOV AH,0Eh
	INT 10h 
	ADD CL,4
	CMP CL,16
	JNE DATELOOP
	POP AX
RET
I do not want to use this code if i do not have to!

Re: INT 1A time

Posted: Sun Jan 30, 2011 11:20 am
by Combuster
You're out of luck, real hardware stores BCDs as well.

Apart from that, I doubt writing a driver is ever going to be easier than asking the bios.