annotate level1/cmds/setime.asm @ 1020:c1a5613ffe7b

changes
author boisy
date Thu, 06 Mar 2003 01:41:03 +0000
parents c155aac72190
children 84ea83668304
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * Setime - Set Date/Time
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * This is a Setime for use when a Y2K compliant system is required.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * This is somewhat of a cheat in that any attempts to do a full
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9 * 4 digit conversion on the entered date string would have
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 * seriously broken the nice, generally compact codeing of the
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 * original setime module. I didn't want to do that, so I cheated
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 * and simply added one more byte to the date packet image it builds
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 * on the stack. Its conversion algorithm does 2 digits per pass/byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 * so if you enter 1998 (You MUST now enter the year as a 4 digit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 * value!), this image will have a $13 as itas first and unused
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 * digit, if you enter a 20xx date, it will be a $14.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 * I check this value after the rest of the conversion is all
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 * done, and if its $14 (or more), an extra 100 ($64) is added to the
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 * os9 year byte before the system F$STime call is made, pointing
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 * the F$STime call at only the normal 6 byte packet of time data.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 * I've played with this maybe 20 minutes. Hopefully you can use
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 * this into the next century without any further concerns about
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 * the "Y2K" problem.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 * ------------------------------------------------------------------
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 11
diff changeset
29 * 10 Made Y2K compliant GH
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 11
diff changeset
30 * 11 Made totally compliant for 1900-2155 BGP 99/05/07
265
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
31 * 12 Typing a CR at the prompt no longer sets the BGP 02/07/20
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
32 * time to a bogus value.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 nam Setime
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 ttl Set Date/Time
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 * Disassembled 96/09/26 00:34:54 by Dsm v1.7 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 rev set $01
265
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
46 edition set 12
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49
924
c155aac72190 Made cosmetic changes
boisy
parents: 265
diff changeset
50 org 0
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 u0000 rmb 450
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 name fcs /Setime/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 fcb 10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 L0014 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 fcb C$BELL
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 fcc " >> No Clock module found <<"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 L0036 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 fcb C$BELL
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 fcc " >> Clock Initialization Errors <<"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 L005E fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 fcc " yyyy/mm/dd hh:mm:ss"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 fcb C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 fcc "Time ? "
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 L005EL equ *-L005E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 start cmpd #2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 bcc L00A3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 leas <-20,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 leax >L005E,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 ldy #L005EL
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 lda #1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 leax ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 lda #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 sta ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 ldy #21
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 os9 I$ReadLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88
265
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
89 L00A3
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
90 * BGP: following lines added in case CR is pressed at prompt. No need to set time
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
91 * if there is nothing to process
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
92 GetNext lda ,x+ +BGP+
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
93 cmpa #C$CR +BGP+
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
94 beq L00DF +BGP+
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
95 cmpa #C$SPAC +BGP+
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
96 beq GetNext +BGP+
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
97 cmpa #C$COMA +BGP+
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
98 beq GetNext +BGP+
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
99 leax -1,x +BGP+
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
100
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 * Make room for time packet on stack
265
4b547814b192 Added code to prevent setting of time if carriage return was pressed
boisy
parents: 200
diff changeset
102 leas -7,s
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 bsr L00E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 stb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 bsr L00E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 stb $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 bsr L00E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 stb $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 bsr L00E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 stb $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 bsr L00E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 stb $04,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 bsr L00E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 stb $05,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 bsr L00E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 stb $06,s now we have a 7 byte pkt
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 ldb ,s get 1st 2 digits (century)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 subb #19 subtract 19 from century +BGP+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 lda #100 now we will +BGP+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 mul multiply difference * 100, now B holds 0, 100 or 200 +BGP+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 addb 1,s add os9's year to century byte +BGP+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 stb 1,s save back in year
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 leax 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 os9 F$STime
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 bcc L00DF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 cmpb #$EA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 bne L00D2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 leax >L0014,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 ldy #$0022
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 bra L00DA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 L00D2 leax >L0036,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 ldy #40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 L00DA lda #1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 L00DF clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 os9 F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 L00E3 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 bsr L0101
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 bsr L0101
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 cmpa #C$SPAC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 beq L0100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 cmpa #'/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 beq L0100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 cmpa #':
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 beq L0100
11
50bca5580dfb Enhanced source
boisy
parents: 0
diff changeset
148 cmpa #C$COMA
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 beq L0100
11
50bca5580dfb Enhanced source
boisy
parents: 0
diff changeset
150 cmpa #C$PERD
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 beq L0100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 leax -1,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 L0100 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 L0101 lda ,x get a digit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 suba #$30 make it binary
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 bcs L0114 not a number, go
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 cmpa #$09
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 bhi L0114 not a number, go
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 leax $01,x inc to next num
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 pshs a save a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 lda #$0A do a 10x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 mul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 addb ,s+ save result
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 L0114 rts all done
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 end