Google

Nov 30, 2008

Interfacing a real time clock using 58167 IC

Initializing data segment. Next address the port A009 TO SI Register. To specify hours, minutes, seconds initialize the AH register to Two. By INT A2 make spacesbetween horus, minutes and seconds. Next decrement SI for minutes. But secodns to be incremented. So loop to be contiued. Hence the program to be executed successfully.

CODE:

MOV AX,CS; LOAD ITS CONTENTS INTO AX
MOV DS,AX; LAOD ACCUMLATOR CONENTS INTO DS
INT AC; INTERRUPT SERVICE ROUTINE TO CLEAR THE SCREEN
A1 MOV SI, A009; LOAD A009 TO SI
MOV CX,0003
A2 MOV DX,SI
IN AL,DX
MOV DL,AL ; MOVE CONTENTS OF DL TO AL
MOV AL,02
INT AE
MOV DL,20
MOV AH,02
INT A2
DEC SI
DEC SI
LOOP A2 : IF CX IS NOT EQUAL TO ZERO THEN LOOP UP
INT AB
JMP A1 : JUMP TO DOWN LABEL

-----
To change the RTC
A009-horus
A007- minutes
A005- seconds

No comments: