; BDOSHDR.MAC v4.12 ; The Public Bulletin Board System ; AUTHOR: Ian Cottrell ; 44 Lindhurst Cres ; Ottawa, ON, Canada ; K2G 0T7 ; The Information Centre RCPM ; (613) 952-2289 (300/1200/2400) ;----------------------------------------------------------------------- ; P.S. PBBS represents many hours of design, coding and debugging. ; Please help offset the high cost of quality public domain ; software by supporting the USER SUPPORTED CONCEPT. If you ; find PBBS of value to you and decide to implement it on ; your system, please consider a small contribution ($50 ; suggested) to help defray cost of development and support. ; In any case please share this program with others, it is ; free and no form of remuneration may be accepted by anyone ; except its author. ;----------------------------------------------------------------------- ; You MUST have the next section EXACTLY as it is here.... ;----------------------------------------------------------------------- TIME:: DB 'HH:MM:SS',0 ; <== place your ASCII time string here DATE:: DB 'MM/DD/YY',0 ; <== place your ASCII date string here BDATE:: DS 3 ; Binary date storage (filled in by PBBS) BTIME:: DS 3 ; Binary time storage (filled in by PBBS) ;----------------------------------------------------------------------- ; The label GETTIM is needed..... ; The values are returned from BYE as BCD and are converted below. ;----------------------------------------------------------------------- GETTIM::PUSH DE PUSH HL ;; LD C,79 ; Return the RTC buffer pointer LD C,RTCCHK ; Read BYE's TON and return RTC buffer pointer CALL BDOS LD DE,TIME CALL BCD2A ; Convert hours digits INC HL INC DE ; Skip the colon CALL BCD2A ; Convert minutes digits INC HL INC DE ; Skip colon CALL BCD2A ; Convert seconds digits INC HL INC HL ; Skip century INC HL ; Skip year INC DE ; Skip the null between CALL BCD2A ; Convert month digits INC HL INC DE ; Skip the slash CALL BCD2A ; Convert day digits DEC HL ; Skip month DEC HL ; Point to year INC DE ; Skip the slash CALL BCD2A ; Convert year digits POP HL POP DE CALL CTIME ; Convert strings to binary CALL CDATE ; Convert strings to binary RET ;..... BCD2A:: LD A,(HL) PUSH AF RRA ; Move hi nibble to lo RRA RRA RRA CALL SPLAT ; Save it POP AF ; Get BCD value back SPLAT:: AND 0FH ; Only want lo nibble ADD A,'0' ; Make ASCII LD (DE),A ; Place in string INC DE ; Point to next byte in string RET ; Back to the city.... ;.....