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
Showing posts with label real time clock. Show all posts
Showing posts with label real time clock. Show all posts
Nov 30, 2008
Labels:
real time clock
Nov 28, 2008
Assembly program for a real time clock
Following is the Assembly language program for a real time clock
Code:
LCALL 061D
AGAIN MOV DPTR, #2845
REPEAT DEC82 ; Decrement DPL
MOVX A,@DPTR
MOV R3,A
MOV R5,#02
LCALL 059E
MOV A,20
LCALL 2006
MOVA,82
CJNE A,#42; REPEAT (ED)
MOVA,#OD ; OD = ASCII FOR ENTER
LCALL 2006
LJMP; AGAIN ( 6003 )
To change the RTC
2844-hrs
2843-minutes
2842-seconds
Code:
LCALL 061D
AGAIN MOV DPTR, #2845
REPEAT DEC82 ; Decrement DPL
MOVX A,@DPTR
MOV R3,A
MOV R5,#02
LCALL 059E
MOV A,20
LCALL 2006
MOVA,82
CJNE A,#42; REPEAT (ED)
MOVA,#OD ; OD = ASCII FOR ENTER
LCALL 2006
LJMP; AGAIN ( 6003 )
To change the RTC
2844-hrs
2843-minutes
2842-seconds
Labels:
8086,
Assembly Language,
c program,
real time clock
Subscribe to:
Posts (Atom)