; This is an example of the structure for a GETTIM.MAC file for EMX v3.0 ; or higher. This structure is NOT the same as the structure for ver- ; ns of EMX that are less than v3.0. ; ; This routine really does only one thing, return two 8-byte ASCII ; strings, one for the date, and one for the time. The EMX program ; itself will convert these strings to binary.... If your clock returns ; an ASCII string then simply place it in the areas indicated. If your ; clock returns bcd then there is a routine in this example that will ; convert them to ASCII, one byte at a time. ; ; See EMX-GT.LBR for files that have already been prepared for various ; configurations... ; ;----------------------------------------------------------------------- ; First equate your ports if needed: ;----------------------------------------------------------------------- ; CLKCTL EQU 5BH CLKDAT EQU 5AH ; ;----------------------------------------------------------------------- ; You MUST have the next section EXACTLY as it is here.... ;----------------------------------------------------------------------- ; ; Must be in indicated formats ; 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 emx) BTIME:: DS 3 ; Binary time storage (filled in by emx) ; GETTIM:: ; ;----------------------------------------------------------------------- ; ; The above label GETTIM:: is needed..... ; ; Your clock routines go here (to get the data into a bcd form is as- ; sumed).... ;----------------------------------------------------------------------- ; ; ====> clock routine. ; ====> places ascii 8 byte time and date strings at time:: and date:: RET ; MUST end with a RET ; ;----------------------------------------------------------------------- ; ; This routine may be useful to you.... ; ; It takes a BCD digit in register A and returns 2 ASCII digits at (HL) ; and (HL)+1 ;----------------------------------------------------------------------- ; BCD2A: PUSH AF RRA ; Move high nibble to low RRA RRA RRA CALL STORE ; Save it POP AF ; Get BCD value back ; STORE: AND 0FH ; Only want lo nibble ADD A,'0' ; Make ASCII LD (HL),A ; Place in string INC HL ; Point to next byte in string RET ; Back to the city.... ;..... ; END