Advertisement
compu_85

Quadram Quadboard clock set

Feb 3rd, 2020
1,318
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 10 DEFINT A-Z
  2. 20 DIM Q(12)
  3. 25 OUT &H313,&H90:OUT &H311,97:IF INP(&H311)<>97 THEN A=&H210 ELSE A=&H310
  4. 30 B=A+1:C=A+2:Z=A+3    'define ports A,B,C and Control word address
  5. 40 OM=&H80:IM=&H90
  6. 50 H=&H90:R=&HB0:W=&HD0
  7. 60 REM
  8. 70 OUT Z,IM
  9. 75 OUT B,97:TST=INP(B):IF TST <> 97 THEN GOSUB 2000
  10. 80 REM ENSURE 24 HOUT FORMAT
  11. 90 OUT B,5:OUT C,R:X=INP(A):OUT Z,OM
  12. 100 OUT B,5:OUT C,H:OUT A,X AND 3 OR 8
  13. 110 OUT C,W:OUT Z,IM
  14. 120 REM ENSURE LEAP BIT SET CORRECTLY
  15. 130 OUT C,R
  16. 140 FOR I=9 TO 12:OUT B,I:Q(I)=INP(A)
  17. 150 NEXT:OUT Z,IM
  18. 160 L=10*Q(10)+Q(9)>2 AND 1
  19. 170 L=4 AND (L+10*Q(12)+Q(11) AND 3)=0
  20. 180 OUT B,8:OUT C,R:X=INP(A):OUT Z,OM
  21. 190 OUT B,8:OUT C,H:OUT A,X AND 3 OR L
  22. 200 OUT C,W:OUT Z,IM
  23. 210 REM
  24. 220 GOSUB 1000 'READ HCLK & SET STRINGS
  25. 230 TIME$="0":DATE$=D$:TIME$=T$
  26. 240 PRINT CHR$(12)+"DATE "+DATE$+", TIME "+TIME$
  27. 250 SYSTEM
  28. 1000 OUT C,R:FOR I=0 TO 12:OUT B,I
  29. 1010 Q(I)=INP(A) AND 15:NEXT:OUT Z,IM
  30. 1020 Q(5)=Q(5) AND 3:Q(8)=Q(8) AND 3
  31. 1030 T$="HH:MM:SS"
  32. 1040 FOR I=0 TO 2:FOR J=0 TO 1
  33. 1050 MID$(T$,1+J+3*I)=CHR$(Q(5-J-2*I)+48)
  34. 1060 NEXT J,I
  35. 1070 X$="MM-DD-YY"
  36. 1080 Q(6)=Q(12):Q(5)=Q(11)
  37. 1090 FOR I=0 TO 2:FOR J=0 TO 1
  38. 1100 MID$(X$,1+J+3*I)=CHR$(Q(10-J-2*I)+48)
  39. 1110 NEXT J,I
  40. 1120 Y$="19"
  41. 1130 IF VAL(MID$(X$,7,2))<80 THEN Y$="20"
  42. 1140 D$=LEFT$(X$,6)+Y$+RIGHT$(X$,2)
  43. 1150 RETURN
  44. 2000 A=&H310:B=A+1:C=A+2:Z=A+3
  45. 2010 OM=&H80:IM=&H90
  46. 2030 H=&H90:R=&HB0:W=&HD0
  47. 2040 OUT Z,IM
  48. 2050 OUT B,97:TST=INP(B):IF TST <> 97 THEN PRINT"QUADCLOCK NOT INSTALLED":SYSTE
  49. 2060 RETURN
  50. 
Advertisement
RAW Paste Data Copied
Advertisement