; MSXRT3.ASM MSXRTC.ASM Version 03 ; ; This time/alarm read and/or set program is for the ELEKTOR magazine ; MSX Real-Time Clock board (utilizing the Intersil ICM7170 chip) and ; Z80 or 6502 (and possibly other) computers. Consult the MSXRTC.INF ; file for more information. ; ; MSXRTC.ASM MSX Real-Time Clock v.03 25 Sep 86 ; v.03 Added test/normal mode options and a built in help menu. ; The test mode may be handy for testing of other software ; which reads the time/date. Normal (or set) mode cancels ; the test mode. Password required for N, T, or S options. ; by G.F.Reding [72436,45] ; ; MSXRTC.ASM MSX Real-Time Clock v.02 13 Sep 86 ; v.02 Optionally also displays alarm. Added alarm set/display ; capability. Set routine is used for clock and/or alarm. ; Individual items (eg, just hours or seconds, etc) may be ; set - handy for spring/fall hour changes. Read routine ; now reads the alarm in addition to the clock. Several ; other changes. by G.F.Reding [72436,45] ; ; MSXRTC.ASM MSX Real-Time Clock 02 Sep 86 ; Original version. by G.F.Reding [72436,45] ; BDOS EQU 05H FCB EQU 5CH CONOUT EQU 02H ; Console output DIRCIO EQU 06H ; Direct console i/o ; CTRLC EQU 03H ; Ctrl c BEL EQU 07H ; Bell BS EQU 08H ; Backspace TAB EQU 09H ; Horizontal tab CR EQU 0DH ; Carriage return LF EQU 0AH ; Linefeed ESC EQU 1BH ; Escape DEL EQU 7FH ; Delete ; ;---------------------------------------------------------------------- ; ; These are i/o ports available at "J5" on the Morrow hard disk systems. ; If you desire to use "J5" for your connections, you will have to hard ; wire, or preferably (as I did), install a 40-pin header strip at that ; location then use a female 40-pin ribbon cable connector. ; IO00 EQU 00H ; Remark these out or IO10 EQU 10H ; Simply ignore them IO20 EQU 20H ; If you are not using a IO30 EQU 30H ; Morrow hard disk computer. ; ; ; These are port addresses to use. Set appropriately for your computer. ; RTCIOP EQU IO00+1 ; Rtc port RLATCH EQU IO00 ; Register latch ; ;---------------------------------------------------------------------- ; INTMSK EQU 10H ; Interrupt status/mask register ; ;---------------------------------------------------------------------- ; COMAND EQU 11H ; Command register ; ; For the following equates see the bit explanation below them ; RUN EQU 00001100B ; Run in normal mode STOP EQU 00000100B ; Stop clock TEST EQU 00101100B ; Run in test mode ; ; BIT USAGE DEFINITIONS AND VALUES ; --- --------- ------------------------------------------ ; 0 crystal \ / 00h = 32.768 kHz 10h = 2.097152 MHz ; 1 crystal / \ 01h = 1.048576 MHz 11h = 4.194304 MHz ; 2 12/24 hr 1 = 24 hour mode 0 = 12 hour mode ; 3 run/stop 1 = run 0 = stop ; 4 interrupt 1 = enabled 0 = disabled ; 5 test bit 1 = test mode 0 = normal mode ; 6 unused 0 ; 7 unused 0 ; ;---------------------------------------------------------------------- ; ; Program starts here. ; ORG 100H ; START: LXI H,0 DAD SP SHLD OLDSTK ; Save old stack LXI SP,STACK ; Set up new ; LXI H,SIGNON ; Program title msg CALL PRNTL CALL READT ; Read clock CALL SHOW1 ; Display time ; LDA FCB+1 ; Command given at start? CPI ' ' ; Test for none JZ EXIT ; If no option, exit CALL UCASE ; Make sure uppercase CPI 'A' ; Want the alarm displayed too? JZ DONE1 ; Yes, show it and quit CPI 'N' ; Want the normal mode? JZ MODEN ; Yes, turn off test mode CPI 'T' ; Want the test mode? JZ MODET ; Yes, if password ok do it CPI 'S' ; Want to set? JZ MODES ; Yes, go do it, else give help ; MODEH: LXI H,HELPM ; Help menu CALL PRNTL JMP EXIT ; Then exit ; MODEN: CALL PASGET ; Get a password JNZ EXIT ; If bad then exit MVI A,COMAND ; Get clock's attention OUT RLATCH ; Send it MVI A,RUN ; Run clock in normal mode now OUT RTCIOP ; Send to rtc port LXI H,NORMM ; Normal mode msg CALL PRNTL LXI H,RESETM ; Reset msg CALL PRNTL JMP EXIT ; MODET: CALL PASGET ; Get a password JNZ EXIT ; If bad then exit MVI A,COMAND ; Get clock's attention OUT RLATCH ; Send it MVI A,TEST ; Run clock in test mode now OUT RTCIOP ; Send to rtc port LXI H,TESTM ; Test mode/reset msg CALL PRNTL JMP EXIT ; MODES: CALL PASGET ; Yes, so get a password JNZ EXIT ; If bad then exit ; ;---------------------------------------------------------------------- ; ; The function number is actually a byte which is sent to the clock to ; specify the item(s) we are setting (eg, clock 1/100 secs = 0, clock ; hours = 1, clock minutes = 2, alarm 1/100 secs = 8, alarm hours = 9, ; and so on) and for that reason the order of STABLM cannot be changed ; unless this and other routines are suitably changed. This routine ; will store the function number(s) followed by our desired value(s)s ; in an output buffer for sending to the clock by the DOSET routine. ; ; ; This routine does prompting for clock/alarm setting and for specific ; items (ie, hours, mins, etc), checks the values entered, prompts for ; a retry/quit/no entry, and stores any desired values. ; SETTER: XRA A ; Initialize STA FUNCCT ; Function counter STA FUNCNO ; Function number CALL INTOBF ; Initialize output buffer ; LXI H,SETCLM ; Ask if setting clock CALL PRNTL CALL GETYN ; Get yes or no CALL CRLF ; Cr/lf JZ SETV2 ; If yes, go get values desired MVI A,8 ; Else setup for alarm STA FUNCNO ; Put in function number ; ; Get a value starting at this point ; SETV1: LDA FUNCNO ; Get function number CPI 8 ; First item in alarm routine JNZ SETV2 ; No, go get values LXI H,SETALM ; Yes, ask if we want to set it CALL PRNTL CALL GETYN ; Get yes or no CALL CRLF ; Cr/lf JNZ SETV5 ; If no, we're done with clock ; ; Try (or retry) to get a value ; SETV2: LXI H,ENTERM ; Enter msg CALL PRNTL CALL FNDMS ; Get appropriate prompt msg CALL PRNTL ; Print it PUSH H ; Save string end addr CALL INPTN ; Get 2 digits max MOV B,A ; Save value (for storing below) POP H ; Restore string end addr ; INX H ; Bump to the low value CMP M ; Compare values JC SETV3 ; If < low value, ask for retry ; INX H ; Bump to the high value CMP M ; Compare values JC SETV4 ; If < high value, then ok so go store it ; Else ask for retry ; ; If no value or invalid value, prompt for quit or retry ; SETV3: LXI H,RETRYM ; Quit/retry/no set msg CALL PRNTL SETV3A: CALL GETKY1 ; Get input CALL UCASE ; Make uppercase ; CPI 'Q' ; Q for quit? JNZ SETV3B ; No, check again CALL PCHAR ; Yes, echo it JMP EXIT ; And exit ; SETV3B: CPI CR ; Cr? JNZ SETV3C ; No, check again CALL ERASLN ; Yes, erase the whole line JMP SETV4A ; Bump func # only and loop ; SETV3C: CPI LF ; Lf? JNZ SETV3D ; No, check again CALL ERASLN ; Yes, erase the whole line JMP SETV4A ; Bump func # only and loop ; SETV3D: CPI 'R' ; R for retry? JNZ SETV3E ; No, check again CALL ERASLN ; Yes, erase the whole line JMP SETV2 ; Go retry ; SETV3E: CPI 'A' ; If less than a JC SETV3A ; No echo, get valid response CPI 'Z'+1 ; If > z JNC SETV3A ; No echo, get valid response ; Was alpha char, but wrong CALL PCHAR ; So echo it MVI A,BS ; And back up CALL PCHAR JMP SETV3A ; And try for a valid response ; ; We got a valid number in b. Store our function number and ; then it in the output buffer. ; SETV4: CALL CRLF ; Else add cr/lf to end of line LDA FUNCCT ; Get function counter PUSH PSW ; Save it LXI H,0 MOV L,A DAD H ; * 2 LXI D,OUTBUF ; Point to output buffer start DAD D ; Hl = addr for storage LDA FUNCNO ; Get function number (for latch) MOV M,A ; Store it INX H ; Bump address MOV M,B ; Store our desired value ; POP PSW ; Restore function counter INR A ; Bump it STA FUNCCT ; Put in function counter ; ; Bump the function number ; SETV4A: LDA FUNCNO ; Get function number INR A ; Bump it STA FUNCNO ; Put function number CPI 16 ; If doing alarm, test if done JNZ SETV1 ; If not, then do more ; ; ; Confirm correctness and wait for key to start set or quit ; SETV5: LDA FUNCCT ; Get function counter ORA A ; If zero, then not setting anything JZ EXIT ; So just exit ; LXI H,CORMSG ; Else ask if all correct? msg CALL PRNTL CALL GETYN ; Get answer CALL CRLF ; Cr/lf JNZ SETTER ; If no, then start over ; LXI H,TOSETM ; Hit to set msg CALL PRNTL CALL GETKY1 ; Get input CALL UCASE ; Make uppercase CPI CTRLC ; Ctrl c? JZ EXIT ; Exit if so CPI 'Q' ; If not q JNZ DOSET ; Then go set it CALL PCHAR ; Else echo it JMP EXIT ; And just exit ; ;---------------------------------------------------------------------- ; ; Start the clock or ensure that it is running first. Then do ; the setting of the clock/alarm, providing we had entered any ; data, by sending the function (latch) number to the register ; latch, then the value which we had entered to the clock data ; port. Output buffer structure is: latch number then value. ; DOSET: MVI A,COMAND ; Get clock's attention OUT RLATCH ; Send it MVI A,RUN ; Start clock or ensure it's running OUT RTCIOP ; Send to rtc port ; LXI H,OUTBUF ; Point to output buffer start DOSET1: MOV A,M ; Get the byte CPI '$' ; Is it end marker? JZ DONE ; Yes, done setting OUT RLATCH ; Set the register latch INX H ; Point to our value MOV A,M ; Get the value OUT RTCIOP ; Send to rtc port INX H ; Point to next byte JMP DOSET1 ; Loop ; ;---------------------------------------------------------------------- ; DONE: CALL CRLF CALL READT ; Read clock CALL SHOW1 ; Display time DONE1: CALL SHOW2 ; Display alarm ; EXIT: CALL CRLF ; Cr/lf LHLD OLDSTK ; Get old stack SPHL RET ; Soft exit to system ; ;---------------------------------------------------------------------- ; ; Read binary info from clock. First the clock then the alarm. ; The reading for clock and alarm is in the following order of: ; 1/100 secs, hours, minutes, seconds, month, day, year, weekday ; READT: MVI C,0 ; Initialize MVI B,16 ; 16 values to read LXI H,BINTIM ; Point to binary input buffer READT1: MOV A,C ; OUT RLATCH ; Send it IN RTCIOP ; Get binary value MOV M,A ; Store it INX H ; Bump input buffer addr INR C ; Bump value for latch DCR B ; Decr loop counter JNZ READT1 ; Loop if not zero RET ; ;---------------------------------------------------------------------- ; ; Converts the binary data to a zero terminated ascii string. ; ; ; Formatted display of the CLOCK time, weekday, date. ; SHOW1: LXI H,BINTIM+1 ; Source at binary time hour LXI D,INPBUF ; Destination is buffer MVI B,6 ; Loop counter CALL SHOW3 ; Convert it ; LXI H,SHOTIM ; Time msg CALL PRNTL LXI H,INPBUF ; Point to ascii hour CALL SHOW4 ; Formatted time display PUSH H ; Save our place in string LDA BINTIM+7 ; Get binary weekday CALL SHOW5 ; Display weekday as a word POP H ; Get back our place in string CALL SHOW6 ; Formatted date display CALL CRLF ; Cr/lf RET ; ; ; Formatted display of ALARM time, weekday, date, 1/100 secs. ; SHOW2: LXI H,BINALM+1 ; Source at binary alarm hour LXI D,INPBUF ; Destination is buffer MVI B,6 ; Loop counter CALL SHOW3 ; Convert it ; LXI H,SHOALM ; Alarm msg CALL PRNTL LXI H,INPBUF ; Point to ascii hour CALL SHOW4 ; Formatted time display PUSH H ; Save our place in string LDA BINALM+7 ; Get binary alarm weekday CALL SHOW5 ; Display weekday as a word POP H ; Get back our place in string CALL SHOW6 ; Formatted date display MVI A,' ' ; Space CALL PCHAR MVI A,' ' ; Space CALL PCHAR LXI H,BINALM ; Source at binary alarm 1/100 secs LXI H,INPBUF ; Destination is buffer MVI B,1 ; Just the one CALL SHOW3 ; Convert it LXI H,INPBUF ; Point to ascii 1/100 secs CALL PRNT2 ; Print 1/100 secs LXI H,DSECSM ; /100 secs msg CALL PRNTL CALL CRLF ; Cr/lf RET ; ; ; Convert the binary data and move to new buffer ; SHOW3: MOV A,M ; Get binary value into a XCHG ; Swap so de=binary hl=buffer PUSH D ; Save addr of binary data PUSH B ; Save loop counter CALL DECIM ; Convert to ascii numbers POP B ; Restore loop counter POP D ; Restore addr of binary data INX H ; Bump addr of destination INX D ; Bump addr of binary data XCHG ; Swap so de=buffer hl=binary DCR B ; Decrement loop counter JNZ SHOW3 ; Loop if more to do RET ; ; Formatted time display ; SHOW4: CALL PRNT2 ; Print hours MVI A,':' ; Colon CALL PCHAR CALL PRNT2 ; Print minutes MVI A,':' ; Colon CALL PCHAR CALL PRNT2 ; Print seconds MVI A,' ' ; Space CALL PCHAR MVI A,' ' ; Space CALL PCHAR RET ; ; Display weekday as a word ; SHOW5: MOV L,A ; Put into l reg MVI H,0 ; Make double length MOV D,H ; Multiply by 3 MOV E,L DAD D DAD D LXI D,WKTBL ; Calculate weekday table addr DAD D ; Hl now points to weekday MOV A,M ; Get first CALL PCHAR ; Print 1st char INX H ; Point to next MOV A,M CALL PCHAR ; Print 2nd char INX H MOV A,M CALL PCHAR ; And 3rd char MVI A,' ' ; Space CALL PCHAR MVI A,' ' ; Space CALL PCHAR RET ; ; Formatted date display ; SHOW6: CALL PRNT2 ; Print month MVI A,'/' ; Slash CALL PCHAR CALL PRNT2 ; Print day MVI A,'/' ; Slash CALL PCHAR CALL PRNT2 ; Print year RET ; ;---------------------------------------------------------------------- ; ; Prompt for quit or retry. Get char. Test for q. ; Returns z set if true. ; RETRY: LXI H,RETRYM ; Quit/retry msg CALL PRNTL CALL GETKY1 ; Get input CALL UCASE ; Make uppercase CPI 'A' ; If less than a JC RETRY2 CPI 'Z'+1 ; Or greater than z JNC RETRY2 ; Then no echo CALL PCHAR ; Else echo it RETRY2: CPI 'Q' ; Is it q for quit? RET ; ;---------------------------------------------------------------------- ; ; Erase current line. Position cursor at start of line. ; (Set string at program end to match your console.) ; ERASLN: MVI A,CR ; Go to start of line CALL PCHAR LXI H,ERAEOL ; Erase to end of line CALL PRNTL RET ; ; Note: If your console doesn't have an "erase-to-end-of-line" code ; then you may use spaces followed by an EQUAL number of backspaces ; for that code (count of spaces and backspaces should be enough to ; "erase" anything that had been printed on the line). ; ;---------------------------------------------------------------------- ; ; Prompt for yes/no. Get char. Test for y. Returns z set if true. ; GETYN: LXI H,GETYNM ; Y/n msg CALL PRNTL CALL GETKY1 ; Get input CALL UCASE ; Make uppercase CPI 'A' ; If less than a JC GETYN2 CPI 'Z'+1 ; Or greater than z JNC GETYN2 ; Then no echo CALL PCHAR ; Else echo it GETYN2: CPI 'Y' ; Is it y for yes RET ; ;---------------------------------------------------------------------- ; ; GETKY1 - Get char from console without echo and return with it in A ; GETKY1: PUSH B ; Save registers PUSH D PUSH H GETKY2: MVI C,DIRCIO ; Direct console i/o to get char MVI E,0FFH CALL BDOS ORA A ; If no char typed JZ GETKY2 ; Then loop POP H ; Restore registers POP D POP B RET ; ;---------------------------------------------------------------------- ; ; INPTN - Input 2 digit number max from the keyboard. Wait for ; return at end. User may use BS or DEL key to back up. ; If no entry (ie, cr only) reg A is set to 0FFH, else ; the number entered is returned in A. If user enters ; control c, then exit the program. ; INPTN: LXI H,INPBUF MVI M,0 ; Set first INX H MVI M,0 ; Second INX H MVI M,0 ; And third chars to null DCX H ; Point back to first DCX H XRA A STA DIGTYP ; Zero chars typed count ; INPTL: CALL GETKY1 ; Get a key CPI CTRLC ; If ctrl c JZ EXIT ; Then exit to cp/m CPI CR ; If carriage return JZ INPTCR CPI LF ; Or linefeed JZ INPTCR ; Then end of line CPI BS ; If backspace JZ BKS CPI DEL ; Or delete JZ BKS ; Then do backspace CPI '0' ; If less than '0' JC INPTL CPI '9'+1 ; Or greater than '9' JNC INPTL ; Then loop MOV B,A ; Else save in b LDA DIGTYP ; Get # chars typed CPI 2 ; If already at limit JZ INPTL ; Then loop MOV A,B ; Else get char typed back CALL PCHAR ; Display it MOV M,A ; Store in buffer INX H ; Increment pointer LDA DIGTYP ; Get # of chars typed INR A ; Increment counter STA DIGTYP ; Store it JMP INPTL ; And loop ; INPTCR: LDA DIGTYP ; Get # of chars typed ORA A ; If no chars typed JZ INPXT ; Then return with a=0ffh LXI D,INPBUF ; Point to input buffer CALL EVAL10 ; Convert to decimal number in l MOV A,L ; Get evaluated number RET ; And return with it in a ; BKS: LDA DIGTYP ; Get # of chars typed ORA A ; If zero JZ INPTL ; Then loop DCR A ; Else decrement counter STA DIGTYP ; Store it DCX H ; Decrement pointer MVI M,0 ; Null it out MVI A,BS ; Print backspace CALL PCHAR MVI A,' ' ; Then a space CALL PCHAR MVI A,BS ; And another backspace CALL PCHAR JMP INPTL ; And loop ; INPXT: MVI A,0FFH ; A=0ffh to show nothing typed RET ; ;---------------------------------------------------------------------- ; ; Convert char in a to upper case ; UCASE: CPI 'a' ; If less than small a RC CPI 'z'+1 ; Or greater than small z RNC ; Then no conversion ANI 5FH ; Else convert RET ; ;---------------------------------------------------------------------- ; ; Print on console only two chars pointed to by HL. ; PRNT2: MVI B,2 ; Set count for 2 PRN2B: MOV A,M ; Get char to a CALL PCHAR ; Print it INX H ; Point to next DCR B ; Count -1 JNZ PRN2B ; Loop if not 0 RET ; ;---------------------------------------------------------------------- ; ; Print on console null terminated line pointed to by HL. ; PRNTL: MOV A,M ; Get char to a ORA A ; Test for 0 end RZ ; Return if 0 CALL PCHAR ; Else print it INX H ; Point to next JMP PRNTL ; Loop ; ;---------------------------------------------------------------------- ; ; Print char in A reg. All registers preserved. ; PCHAR: PUSH PSW PUSH B PUSH D PUSH H MOV E,A ; Char to e MVI C,CONOUT ; Console output func CALL BDOS POP H POP D POP B POP PSW RET ; ;---------------------------------------------------------------------- ; ; EVAL10 - Convert decimal ASCII number at DE to HL ; Ascii number is terminated with a null. ; EVAL10: PUSH D ; Save registers PUSH B LXI H,0 ; Initialize counters to 0 LXI B,0 ; EVL10: LDAX D ; Get ascii number ORA A ; Is it a null? JZ EVD10 ; Yes, all done SUI '0' ; Convert ascii to binary JC EVER10 ; If < 0 then return CPI 10 ; Is it > 9? JNC EVER10 ; Yes, return MOV B,H ; Put h,l in b,c MOV C,L ; DAD H ; *2 DAD H ; *4 DAD B ; *5 DAD H ; *10 ; MOV C,A ; Put current value in bc MVI B,0 DAD B ; Add it into total ; EVS10: INX D ; Increment pointer JMP EVL10 ; And loop until done ; EVER10: LXI H,0 ; Invalid chars return with hl=0 ; EVD10: POP B ; Restore registers POP D RET ; ;---------------------------------------------------------------------- ; ; Convert A register to 2-digit decimal number at HL ; DECIM: MVI B,0 CPI 9+1 ; If 10 or greater JNC DCM1 ; Then do 2 digits ; MVI M,'0' ; Else preceed digit with ascii 0 INX H ; Location for actual digit ADI '0' ; Convert to ascii MOV M,A ; Store in hl RET ; DCM1: INR B ; Increment number of 10's SUI 10 JNC DCM1 ; Loop until no more 10's ADI 10 ; Adjust back to positive number DCR B ; Adjust MOV C,A ; Save 1's in c MOV A,B ; Get 10's ADI '0' ; Make ascii MOV M,A ; Store in hl INX H MOV A,C ; Get 1's ADI '0' ; Make ascii MOV M,A ; Store in hl RET ; ;---------------------------------------------------------------------- ; ; Print a carriage return and a linefeed. All registers preserved. ; CRLF: PUSH PSW PUSH B PUSH D PUSH H MVI A,CR CALL PCHAR MVI A,LF CALL PCHAR POP H POP D POP B POP PSW RET ; ;---------------------------------------------------------------------- ; ; Prompt for and get password if BYE is active. NOT echoed to console. ; PASGET: MVI D,2 ; Maximum number of tries ; PASGT1: CALL CRLF ; Cr/lf LXI H,PASMSG ; Prompt msg CALL PRNTL LXI H,PASWRD ; Point to password MVI E,0 ; Show no errors ; PASGT2: PUSH D ; Save de CALL GETKY1 ; Get char POP D ; Restore de CALL UCASE ; Make upper case CPI 'U'-40H ; If ctrl u JZ PASGT1 ; Try again CMP M ; Check for match JZ PASGT4 ; Yes MVI E,1 ; No, show miss CPI CR ; Is it cr JNZ PASGT2 ; No, wait for cr ; PASGT3: DCR D ; More tries? JNZ PASGT1 ; Yes MOV A,E ; Else get flag ORA A ; Show if error existed RET ; Return not zero, if error ; PASGT4: INX H ; Point to next char CPI CR ; Is it cr JNZ PASGT2 ; No, loop MOV A,E ; Yes, get flag ORA A ; Was there an error JNZ PASGT3 ; Not right RET ; Return zero set, if ok ; ;---------------------------------------------------------------------- ; ; Find start of our set message/values. Returns HL = start addr. ; FNDMS: LDA FUNCNO ; Get current function MVI H,0 MOV L,A ; Function to l MVI D,0 MOV E,A DAD H ; * 2 DAD H ; * 4 DAD D ; * 5 DAD H ; * 10 DAD H ; * 20 LXI D,STABLM ; Point to table start DAD D ; Hl = start of function string RET ; ;---------------------------------------------------------------------- ; ; Initialize the output buffer ; INTOBF: MVI A,'$' ; Fill char LXI H,OUTBUF ; Output buffer start MVI B,33 ; Bytes to fill INTOB1: MOV M,A ; Fill it INX H DCR B JNZ INTOB1 ; Loop til done RET ; ;---------------------------------------------------------------------- ; ; Message strings and data area ; SIGNON: DB 'MSXRTC v.03 (ICM7170) by G.F.Reding 09/25/86' DB CR,LF,0 HELPM: DB CR,LF DB 'TIME display current time, weekday, date',CR,LF DB 'TIME A display alarm with above',CR,LF DB 'TIME N normal mode',CR,LF DB 'TIME T test mode',CR,LF DB 'TIME S set mode',CR,LF DB 'TIME ? this help menu',CR,LF,0 SETCLM: DB CR,LF,'Do you want to set the clock?',0 SETALM: DB CR,LF,'Do you want to set the alarm?',0 ENTERM: DB ' Enter ',0 RETRYM: DB CR,' uit, etry, or to NOT set ',0 NORMM: DB CR,LF,'NORMAL mode',0 TESTM: DB CR,LF,'TEST mode' RESETM: DB BEL,' - please set clock/alarm when done',CR,LF,0 ; ; Clock and alarm set table. 20 bytes per function. ; Format is nul terminated message, followed by low and high values. ; Do NOT change the structure of this table unless you have read the ; comments at SETTER. Used by FNDMS and SETTER routines. ; STABLM: DB '1/100 sec (0-99) ',0 DB 0,99+1 DB 'hours (0-23) ',0 DB 0,23+1 DB 'minutes (0-59) ',0 DB 0,59+1 DB 'seconds (0-59) ',0 DB 0,59+1 DB 'month (1-12) ',0 DB 1,12+1 DB 'date (1-31) ',0 DB 1,31+1 DB 'year 19 ',0 DB 86,99+1 DB 'weekday (0-6) ',0 DB 0,6+1 ; ; These are for the alarm - see the next comment ; DB '1/100 sec (0-99) ',0 DB 0,99+1 DB 'hours (0-23) ',0 DB 0,23+1 DB 'minutes (0-59) ',0 DB 0,59+1 DB 'seconds (0-59) ',0 DB 0,59+1 ; ; For ALARM ONLY, the month, date, and/or year low value is a zero ; DB 'month (0-12) ',0 DB 0,12+1 DB 'date (0-31) ',0 DB 0,31+1 DB 'year (0 or ##) ',0 DB 0,99+1 DB 'weekday (0-6) ',0 DB 0,6+1 ; CORMSG: DB CR,LF,'Are all entries correct?',0 TOSETM: DB 'Any key to set clock or uit ',0 GETYNM: DB ' (Y/N) ',0 ; SHOTIM: DB 'Time ',0 SHOALM: DB 'Alarm ',0 DSECSM: DB '/100 secs',0 WKTBL: DB 'SunMonTueWedThuFriSat' ; PASMSG: DB 'Password: ',0 PASWRD: DB 'PRIVATE' ; Your password DB CR ; Terminator DB 0,0 ; Room for larger password ; ERAEOL: DB ESC,'T' ; Erase to end of line DB 0,0,0,0 ; Room for 6 bytes ; BINTIM: DS 8 ; Binary time data (input buffer) BINALM: DS 8 ; Binary alarm data (input buffer) FUNCCT: DB 0 ; Function counter FUNCNO: DB 0 ; Function number OUTBUF: DS 33 ; Output buffer DIGTYP: DB 0 ; Digits typed INPBUF: DB 0,0,0,0,0,0 ; Input and ascii buffer DB 0,0,0,0,0,0 ; (room for six * 2 digit numbers) ; OLDSTK: DS 2 DS 64 ; 32 level stack STACK: EQU $ ; END