home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
sigm
/
vol147
/
rdtime86.lib
< prev
next >
Wrap
Text File
|
1984-04-29
|
1KB
|
42 lines
RDTIME: ;READS COMPUPRO SYSTEM SUPPORT CLOCK
IF CLOCK ;SUPPLY YOUR OWN ROUTINE
CLKCP EQU 50H+10 ;CLOCK COMMAND PORT
;DATESTR DB 'DD/MM/YY HH:MM:SS' ;DATE STRING FORMAT
MOV BX,OFFSET DATESTR ;POINT TO DATE STRING
MOV SI,OFFSET DIGTAB ;POINT TO DIGIT TABLE
MOV CL,6 ;READ TWO COUNTER
RTWO: MOV CH,2 ;READ ONE COUNTER
;
; READ A DIGIT FROM CLOCK CHIP
; ENTRY: SI => DIGIT TABLE DATA ENTRY
; BX => STRING POSITION
; EXIT: ASCII DIGIT LOADED IN STRING
; SI & BX INCREMENTED
;
RONE: MOV AL,[SI] ;GET DIGIT TABLE DATA
INC SI ;BUMP TO NEXT ENTRY
ADD AL,10H ;SET READ BIT
OUT CLKCP,AL ;OUTPUT DIGIT DATA
CMP AL,15H ;CHECK FOR HOURS 10 DIGIT
IN AL,CLKCP+1 ;READ BCD DIGIT FROM CLOCK
JNE NOHOUR
SUB AL,8
NOHOUR: ADD AL,'0' ;MAKE ASCII
MOV [BX],AL
INC BX ;POINT TO NEXT STR POSITION
DEC CH
JNZ RONE ;GET SECOND DIGIT
INC BX ;BUMP OVER SEPERATOR
CMP CL,4
JNE NOBUMP
INC BX ;BIG BUMP OVER WHITE SPACE
NOBUMP: DEC CL
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