home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol112 / rbsclock.bas < prev    next >
Encoding:
BASIC Source File  |  1985-02-10  |  2.4 KB  |  70 lines

  1. 1 ' Clock routines for RBBENT, RBBMIN, and EXITBBS1, using the
  2. 2 ' CompuTime clock board (late model, using the OKI-5832 clock
  3. 3 ' chip.)
  4. 4 '
  5. 5 ' The base port address (frequently 80h) should be specified
  6. 6 ' with CLKBASE = &H80 (or whatever) somewhere in the initialization
  7. 7 ' section of EACH of the programs in which it is used.
  8. 8 '
  9. 9 '                                    Dave Goodman - 02/15/82
  10. 10 '
  11.  
  12.  
  13.  
  14.  
  15. 20 'The module with line numbers 14000-14999 replaces all code
  16. 21 'within those line numbers in RBBENT.
  17. 22 '
  18. 23 'The module with line numbers 44000-xxxxx replaces all code
  19. 24 'within those line numbers in RBBMIN and EXITBBS1.
  20. 25 '
  21. 26 'Don't forget to put the CLKBASE equate somewhere!
  22.  
  23.  
  24.  
  25.  
  26. 14000 ' Date getting subroutine
  27. 14010 ' For CompuTime with OKI-5832 chip.  DG - 2/15/82
  28. 14030 '
  29. 14035 INDX = 12 : GOSUB 14092 : DY$ = TEMP$
  30. 14040 INDX = 10 : GOSUB 14092 : DM$ = TEMP$
  31. 14045 INDX = 8  : GOSUB 14092 : DD$ = TEMP$
  32. 14055 DT$=DM$+"/"+DD$
  33. 14060 DZ$=DM$+"/"+DD$+"/"+DY$
  34. 14090 RETURN
  35. 14091  '
  36. 14092 OUT CLKBASE + 1, &H10 : TEMP$ = ""
  37. 14093   FOR REGISTER = INDX TO INDX - 1 STEP -1
  38. 14094      OUT CLKBASE + 2, REGISTER + &H20
  39. 14095     IF REGISTER=8 THEN TEMP$=TEMP$+CHR$((INP(CLKBASE + 2) AND 3) + &H30)
  40.  
  41.           ELSE TEMP$ = TEMP$ + CHR$(INP(CLKBASE + 2) + &H30)
  42. 14096   NEXT
  43. 14097 OUT CLKBASE + 1, 0
  44. 14098 RETURN
  45. 14100 ' 
  46. 14200 ' Time-finding subroutine
  47. 14205 '
  48. 14210 OUT CLKBASE + 1, &H10
  49. 14215   FOR REGISTER = 5 TO 0 STEP -1
  50. 14220      OUT CLKBASE + 2, REGISTER + &H20
  51. 14225      IF REGISTER = 5 THEN H(1) = INP(CLKBASE + 2) AND 3
  52.  
  53.       ELSE H(6 - REGISTER) = INP(CLKBASE + 2)
  54. 14230   NEXT
  55. 14235 OUT CLKBASE + 1, 0
  56. 14240 '
  57. 14245 TD$ = ""
  58. 14250   FOR INDX = 1 TO 6
  59. 14255      TD$ = TD$ + CHR$(H(INDX) + &H30)
  60. 14260   NEXT
  61. 14265 TD$ = LEFT$(TD$, 2) + ":" + MID$(TD$, 3, 2) + ":" + RIGHT$(TD$, 2)
  62. 14270 TI$ = DD$ + "-" + LEFT$(TD$, 5)
  63. 14290 RETURN
  64. 14999 '
  65.  
  66.  
  67.  
  68.  
  69. 44000 ' Clock routine for Computime with OKI-5832 chip.  DG - 2/15/81
  70. 44010 ' Print present time first
  71. 44210 OUT CLKBASE + 1, &H10
  72. 44215   FOR REGISTER = 5 TO 0 STEP -1
  73. 44220      OUT CLKBASE + 2, REGISTER + &H20
  74. 44225      IF REGISTER = 5 THEN H(1) = INP(CLKBASE + 2) AND 3
  75.  
  76.       ELSE H(6 - REGISTER) = INP(CLKBASE + 2)
  77. 44230   NEXT
  78. 44235 OUT CLKBASE + 1, 0
  79.