RDTIME: READS COMPUPRO SYSTEM SUPPORT CLOCK IF CLOCK ;SUPPLY YOUR OWN ROUTINE CLKCP EQU 50H+10 ;CLOCK COMMAND PORT ;DATESTR:DB 'MM/DD/YY HH:MM:SS' ;DATE STRING FORMAT LXI H,DATESTR ;POINT TO DATE STRING LXI D,DIGTAB ;POINT TO DIGIT TABLE MVI C,6 ;READ TWO COUNTER RTWO: MVI B,2 ;READ ONE COUNTER ; ; READ A DIGIT FROM CLOCK CHIP ; ENTRY: DE => DIGIT TABLE DATA ENTRY ; HL => STRING POSITION ; EXIT: ASCII DIGIT LOADED IN STRING ; DE & HL INCREMENTED ; RONE LDAX D ;GET DIGIT TABLE DATA INX D ;BUMP TO NEXT ENTRY ADI 10H ;SET READ BIT OUT CLKCP ;OUTPUT DIGIT DATA CPI 15H ;CHECK FOR HOURS 10 DIGIT IN CLKCP+1 ;READ BCD DIGIT FROM CLOCK JNZ NOHOUR SUI 8 NOHOUR: ADI '0' ;MAKE ASCII MOV M,A INX H ;POINT TO NEXT STR POSITION DCR B JNZ RONE ;GET SECOND DIGIT INX H ;BUMP OVER SEPERATOR MOV A,C CPI 4 JNZ NOBUMP INX H ;BUMP OVER WHITE SPACE NOBUMP: DCR C JNZ RTWO ;READ TWO MORE DIGITS RET ;RETURN TO CALLER DIGTAB: DB 10,9,8,7,12,11,5,4,3,2,1,0 ;CLOCK DIGIT TABLE ENDIF ;CLOCK RET