diff --git a/Makefile b/Makefile index a8db1c51..71d211ed 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ SRC = syseng sysen1 sysen2 sysen3 sysnet kshack dragon channa \ tensor transl wgd zz graphs lmlib pratt quux scheme gsb ejs mudsys \ draw wl taa tj6 budd sharem ucode rvb kldcp math as imsrc gls demo \ macsym lmcons dmcg hack hibou agb gt40 rug maeda ms kle aap common \ - fonts zork 11logo kmp info aplogo bkph bbn pdp11 chsncp sca + fonts zork 11logo kmp info aplogo bkph bbn pdp11 chsncp sca guest2 DOC = info _info_ sysdoc sysnet syshst kshack _teco_ emacs emacs1 c kcc \ chprog sail draw wl pc tj6 share _glpr_ _xgpr_ inquir mudman system \ xfont maxout ucode moon acount alan channa fonts games graphs humor \ diff --git a/src/guest2/vtclk.6 b/src/guest2/vtclk.6 new file mode 100644 index 00000000..30f3593c --- /dev/null +++ b/src/guest2/vtclk.6 @@ -0,0 +1,203 @@ +; Pacific Time zone clock program +; Taken from VTCLK program (by EH) +; +; + + TITLE Pacific Time Zone clock progrm for me (KJB) +;Define accumlators +A=1 +B=2 +C=3 +D=4 +E=5 +F=6 +G=7 +H=10 +I=11 +J=12 +K=13 +L=14 +M=15 +N=16 +P=17 + + +;TTY channels +TTYO==1 +TTYI==2 +DEFINE SYSCAL OP,ARGS + .CALL [SETZ ? SIXBIT /OP/ ? ARGS ((SETZ))] + TERMIN + +START: SYSCAL OPEN,[%CLBIT,,%TJDIS+.UIO + + %CLIMM,,TTYO ; Open output channel + [SIXBIT /TTY/]] + .LOSE %LSFIL + .CALL [SETZ ? SIXBIT/OPEN/ + [.UAI,,TTYI] ? [SIXBIT/TTY/] ((SETZ)) ] + .LOSE %LSFIL + + move p,[-lpdl,,pdl] + MOVEI A,[ASCIZ/Multi-Time Zone clock program. +/] + + PUSHJ P,ASCOUT + + MOVEI A,[ASCIZ/0=Eastern 1=Central 2=Mountain 3=Pacific +/] + + PUSHJ P,ASCOUT + MOVEI A,[ASCIZ/Which time zone are you in (0-3)?/] + PUSHJ P,ASCOUT + +INPUT: .IOT TTYI,A + CAIGE A,"0 + JUMPA INPUT + CAILE A,"3 + JUMPA INPUT + +IN1: SUBI A,48. ; convert to decimal from ASCII + MOVEM A,ZONE ; Time zone factor + + .VALUE [ASCIZ /  :FORGET +:VK /] ;Proceed job, but allow it to print out. -Klotz + +RE: .IOT TTYO,[^P] ; Save cursor pos + .IOT TTYO,["S] + + MOVEI A,1 ; Set flag so later ESC j is skipped + MOVEM A,FLAG ; otherwise things get screwed up + move p,[-lpdl,,pdl] + SETZ B, + SETZ A, + SETZ C, + .IOT TTYO,[^P] ; Position + .IOT TTYO,["V] ; Cursor to + .IOT TTYO,[7+31.] ; Line 31 + .IOT TTYO,[^P] ; Column 1 + .IOT TTYO,["H] ; + .IOT TTYO,[7+1.] ; + MOVE B,ZONE + CAIN B,3 + MOVEI A,[ASCIZ/Time (Pacific) =/] + CAIN B,2 + MOVEI A,[ASCIZ/Time (Mount.) =/] + CAIN B,1 + MOVEI A,[ASCIZ/Time (Central) =/] + CAIN B,0 + MOVEI A,[ASCIZ/Time (Eastern) =/] + PUSHJ P,ASCOUT + + MOVSI A,-1 ; Load A with -1,,0 + MOVEM A,ONE ; Load it into ONE +CLOCK: SETZ A, ; Clear A + .RTIME A, ; Get the Time + MOVEM A,TIME ; Transfer it to TIME + SETZ C, ; Clear C + MOVSI D,-3 ; D=counter + MOVE B,[440600,,TIME] ; B=SIXBIT byte pointer + MOVEM B,TIMEP ; Set it up +; get the HH and do nesscary time zone computations + ILDB A,TIMEP + ADDI A,32. + SUBI A,48. + IMULI A,10. ;Tens of Hours + ILDB B,TIMEP + ADDI B,32. + SUBI B,48. ;Ones of Hours + MOVEM B,TRASH ;temp storage + ADD A,TRASH ; Now we have the HOURS in A + SUB A,ZONE ;Subtract to match your time zone + CAIGE A,0 ; Midnight or after ? + ADDI A,24. ;Negative,add 24 to restore;-1=23 O'clock + SETZ B, + CAILE A,12. ; time 0<=x<12 means AM + MOVEI B,1 + MOVEM B,AMPM + + SUBI A,12. ; Convert to 12 hour time + CAIGE A,0 ; x<=0 if time was 0-12 + ADDI A,12. ; fix it + CAIN A,0 + MOVEI A,12. ; Should be 12 instead of 0 o'clock + SETZ C, + CAMN C,FLAG ; During INIT,FLAG is set + .IOT TTYO,[^P] + .IOT TTYO,["S] ; save cursor pos + .IOT TTYO,[^P] ; Position + .IOT TTYO,["V] ; cursor to + .IOT TTYO,[7+31.] ; 31st line + .IOT TTYO,[^P] ; column 28 + .IOT TTYO,["H] + .IOT TTYO,[7+18.] +;Hours is in A + PUSHJ P,DECOUT ; Print the hours + .IOT TTYO,[":] + +LOOP: MOVSI C,-2 ; Print M M +LOOP1: ILDB A,TIMEP ; Get a byte (0-6bits) + ADDI A,32. ; Add 32 dec to make into 0-9 + .IOT TTYO,A ; Print it (SIXBIT=bit 0-5) + AOBJN C,LOOP1 ; Bump counter + MOVE A,AMPM ; AMPM=1 if PM + .IOT TTYO,[" ] + JUMPE A,AM + .IOT TTYO,["p] + .IOT TTYO,["m] + JUMPA SLEEP +AM: .IOT TTYO,["a] + .IOT TTYO,["m] +SLEEP: .IOT TTYO,[^P] + .IOT TTYO,["R] ;Restore cursor pos. + MOVE A,FLAG + JUMPN A,LOADP ; If init skip sleep + MOVEI A,1200 + .SLEEP A, ; Sleep for 40 secs +LOADP: SETZ A, ; Clear A + MOVEM A,FLAG ; Zero FLAG + + +ascout: hrli a,440700 ;If C=1, "#" => "", else => "s" +ascou1: ildb b,a + jumpe b,cpopj + cain b,"# + jrst [movei b,"s + caie c,1 + .iot ttyo,b + jrst ascou1] + .iot ttyo,b + jrst ascou1 + +decout: move c,a ;leaves number in C. +decou1: idivi a,10. + hrlm b,(p) + +cpopj: popj p, +blank: popj p, + +WARN: + POPJ P, + +nfstys: 0 +nfjobs: 0 +nidle1: 0 +nidle5: 0 +nidl10: 0 + +trash: 0 ;Place for the unused values from syscals. +pat: patch: + block 40 +epatch: -1 + +lpdl=10 +pdl: block lpdl + +TIME: BLOCK 1 ; One word storage +TIMEP: 0 ; Pointer +ONE: 0 ; Store a -1,,0 +FLAG: 0 ; Flag +ZONE: 0 +AMPM: 0 ; AM/PM +CURSOR: 0 + END START