-
Notifications
You must be signed in to change notification settings - Fork 1
/
BDOS2.MAC
910 lines (897 loc) · 18 KB
/
BDOS2.MAC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
;
; îï÷ùå äéóëï÷ùå æõîëãéé
;
;F29 - ÷ íáóóé÷ ó áäòåóïí ÷ DE ÷ ôåëõýåí âáîëå ÷ïú÷òáý.16 óéí÷.íåôëá äéóëá
;F2A - éú íáóóé÷á (ðï DE) îá äéóë úáðéó. 16-é óéí÷ïìøîáñ íåôëá äéóëá
;F2B - ÷ íáóóé÷ (ðï DE) ÷ïú÷òáý. 16 óéí÷. éíñ ôåëõýåçï àúåòá
;F2C - ôåëõýåíõ àúåòõ õóôáîá÷ì. îï÷ïå éíñ éú íáóóé÷á (ðï DE) - 16 óéí÷.
;F2D - õóôáîï÷ëá àúåòá ðï éíåîé éú íáóé÷á (ðï DE)
;F2E - ðïìõþéôø éú âõæåòá ôéíðìåôá óôòïëõ ÷ íáóóé÷ (ðï DE).
;F2F - äïâá÷éôø óôòïëõ ÷ âõæåò ôéíðìåôá éú íáóóé÷á (ÐÏ DE).
;F30 - ðïìõþéôø éú âõæåòá ðïäíåî óôòïëõ ÷ íáóóé÷ (ðï DE).
;F31 - äïâá÷éôø óôòïëõ ÷ âõæåò ðïäíåî éú íáóóé÷á (ÐÏ DE).
;F32 - ðïìõþéôø óôòïëõ éú BAT-âõæåòá ÷ íáóóé÷ (ðï DE).íáóCé÷ óïëòáýáåôóñ
;F33 - äïâá÷éôø óôòïëõ ÷ BAT-âõæåò éú íáóóé÷á (ðï DE).
;F34 - ðïìõþéôø äáôõ é ÷òåíñ óïúäáîéñ æáêìá. ÷èïä: DE=ADDR(FCB).
;F35 - õóôáîï÷éôø äáôõ óïúäáîéñ æáêìá. ÷èïä: DE=ADDR(FCB).
;F36 - ðïìõþéôø óôòïëõ õóôáîï÷ëé äéóëï÷
;F37 - õóôîï÷éôø/ðïìõþéôø PATH-USER . ÷èïä: E=(0..0FH)/0FFH
;F38 - ðïìõþéôø äáôõ óïúäáîéñ ðïóìåäîåçï éóðïìøúï÷á÷ûåçïóñ æáêìá.
;
XORSUM EQU DRVCODE
NBUFF EQU NEWBUFF+80H
;
FN29: PUSH DE
CALL LOADATE
POP HL
LD A,(RG_B)
EXX
EX AF,AF'
CALL LABPRES
JP NZ,BADRET
LD HL,LABEL
LD BC,16
call BLDIRF1 ; set A to WORKPAGE
LABPRES:LD HL,LABEL
LD DE,KSS
LD B,16
ANYPRES:XOR A
LABXOR: XOR (HL)
INC HL
DJNZ LABXOR
LD (XORSUM),A
EX DE,HL
XOR (HL)
RET
;
USRPRES:LD HL,USERS
LD DE,KSS+1
LD B,0
JR ANYPRES
;
FN2A: CALL LOADATE
CALL LABPRES
JP NZ,BADRET
CALL TRACK0FLUSH ; set track 0, force flush
LD BC,1
CALL @SELSEC
CALL RDSEC
LD A,WORKPAGE
LD HL,NBUFF+20H
EXX
EX AF,AF'
LD A,(RG_B)
LD HL,(RG_DE)
LD BC,16
CALL BLDIR
LD HL,NBUFF+20H
LD DE,LABEL
LD C, 16 ; BC,16 ;(BLDIR)->BC=0
LDIR
CALL WRSEC
LD BC,2
CALL @SELSEC
CALL RDSEC
CALL LABPRES
LD A,(XORSUM)
LD (NBUFF+07DH),A
LD (KSS),A
CALL WRSEC
JP TRACK1
;
TSTINS: XOR A
LD HL,USERS
OR (HL) ;ëïòîå÷ïê ÷ìïöåî óáí ÷ óåâñ
RET NZ
LD B,15
TSTINS0:INC HL
LD A,(HL) ; îå âïìåå 15 àúåòï÷
AND 0F0H
RET NZ
PUSH BC ; ðòï÷åòëá ëï÷áòîïê ÷ìïöåî.
PUSH HL
LD B,15 ; MAX çìõâéîá ÷ìïöåîîïóôé
TSTINS1:LD A,(HL)
OR A
JR Z,TSTINS2 ; åóìé äïûìé äï ëïòîå÷ïçï
LD E,A
LD D,0
LD HL,USERS
ADD HL,DE
DJNZ TSTINS1
POP HL
POP BC
OR A ; NZ - BAD INSERTING
RET ; ÷ìïöåîîïóôø "óáí ÷ óåâñ"
TSTINS2:POP HL
POP BC
DJNZ TSTINS0
XOR A ; Z - GOOD INSERTING
RET
;
FN2B: PUSH DE
CALL LOADATE
POP HL
LD A,(RG_B)
EXX
EX AF,AF'
LD A,(ACTUSER)
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD C,A
LD B,0
LD HL,USERS
ADD HL,BC
LD C,16
call BLDIRF1 ; set A to WORKPAGE
CALL USRPRES
JR NZ,XBADRET
CALL TSTINS
RET Z
XBADRET:JP BADRET
;
FN2C: CALL LOADATE
CALL USRPRES
JR NZ,XBADRET
LD HL,USERS
LD DE,NBUFF
LD BC,16
LDIR
LD A,(ACTUSER)
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD C,A
; LD B,0 ; (LDIR)->BC=0
LD HL,USERS
ADD HL,BC ; ËÕÄÁ
LD A,WORKPAGE
EXX
EX AF,AF'
LD HL,(RG_DE)
LD A,(RG_B)
LD BC,16
CALL BLDIR
LD HL,USERS
PUSH HL
LD (HL),B ;(HL),0 ;(BLDIR)->BC=0
LD B,15
FN2C0: INC HL
LD A,0FH
AND (HL)
LD (HL),A
DJNZ FN2C0
CALL TSTINS
POP DE
JR Z,IFROOT
LD HL,NBUFF
LD BC,16
LDIR
JR XBADRET ; ÷ìïöåîîïóôø "óáí ÷ óåâñ"
IFROOT: CALL USRPRES
CALL TRACK0FLUSH ; set track 0, force flush
LD BC,2
CALL @SELSEC
CALL RDSEC
LD A,(XORSUM)
LD (NBUFF+7EH),A
LD (KSS+1),A
CALL WRSEC
LD BC,USERS
LD E,3
CALL WRDMA
LD BC,USERS+80H
LD E,4
CALL WRDMA
;
TRACK1: LD BC,1
CALL @SELTRK
LD BC,NBUFF
LD E,1
;
RDDMA: PUSH DE
CALL @SETDMA
POP BC
LD B,0
CALL @SELSEC
JP RDSEC
;
WRDMA: PUSH DE
CALL @SETDMA
POP BC
LD B,0
CALL @SELSEC
JP WRSEC
;
FN2D: CALL LOADATE
CALL USRPRES
JP NZ,BADRET
LD A,WORKPAGE
LD HL,NBUFF
EXX
EX AF,AF'
LD A,(RG_B)
LD HL,(RG_DE)
LD BC,16
CALL BLDIR
LD DE,USERS+10H
LD C,0FH
COMP0: LD B,10H
LD HL,NBUFF
COMP: LD A,(DE)
CP (HL)
JR NZ,NOFOUND
INC HL
INC DE
DJNZ COMP
LD A,10H
SUB C
LD (RG_E),A
CALL F20
XOR A
RET
NOFOUND:INC DE
DJNZ NOFOUND
DEC C
JR NZ,COMP0
LD A,0FFH
RET
;
GETSTRING:
PUSH DE
LD A,WORKPAGE ; ëõäá
LD HL,NEWBUFF
EX AF,AF'
EXX
POP HL
LD A,(RG_B) ; éú ëáëïê óôòáîéãù ÷ùúï÷
CALL BLDB
LD C,B
LD B,0
INC C
INC C
RET Z
LD (FALEN),BC
LD A,(RG_B)
CALL BLDIR
LD HL,NEWBUFF+1
RET
;
; ðïìõþéôø óôòïëõ éú âõæåòá ôéíðìåôá
; ðáòáíåôòù: HL- õëáúáôåìø îá áäòåó âõæåòá+1 (STRING SIZE)
; ÷ùèïä: A - îïíåò óôòïëé ôéíðìåôá (1..9) éìé 0
;
FN2E: LD HL,TIMBUF
LD (BEGBUF),HL
CALL GETSTRING
CALL GETTIM0
CALL EXITFA
LD A,(IX)
RET
@GETTIM:LD BC,TIMBUF
LD (BEGBUF),BC
GETTIM0:LD IX,FL0
LD IY,FL1
;
GETTIM: PUSH AF
LD BC,(BEGBUF)
LD A,(BC)
OR A
JR Z,FA_NL2 ; ÷ùèïä, âõæåò ôéíðìåôá ðõóôïê
PUSH HL
DEC HL
LD B,(HL) ; ÷ REG.B íáëó. òáúíåò âõæåòá
LD A,(IX)
CP (IY)
JR C,FA_DL12 ; IF FL0<FL1
XOR A
FA_DL12:INC A ; õóô. ÷ òåç. á îïíåò óôòïëé
LD (IX),A ; é úáîåóôé åçï ÷ FL0
LD HL,(BEGBUF)
DEC A
JR Z,ADDROK
LD D,0
GSTR1: LD E,(HL)
INC E
ADD HL,DE ; ÷ HL áäòåó îõöîïê óôòïëé ÷
DEC A ; âõæåòå ôéíðìåôá
JR NZ,GSTR1
ADDROK:
POP DE ; DE - áäòåó STRING SIZE
PUSH DE
LD C,(HL) ; äìéîá ôéíðìåôîïê óôòïëé
PUSH BC
FA_L17: INC HL
INC DE
LD A,(HL) ; ðåòåóùìëá éú âõæåòá ôéíðìåôá ÷
LD (DE),A ; âõæåò óôòïëé îõöîïçï óôòéîçá
DEC C
JR Z,FA_NL1
DJNZ FA_L17
FA_NL1: POP DE ; D=MAX SIZE E=REAL SIZE
POP HL ; HL- áäòåó STRING SIZE
LD (HL), e
LD A,B
OR A
JR NZ,FA_NL2
LD (HL),D
FA_NL2: POP AF
LD B,A
RET
;
; úáîåóôé óôòïëõ ÷ âõæåò ðïäíåî
; ðáòáíåôòù: HL - áäòåó âõæåòá ÷÷ïäá+1 (BUFFER SIZE)
;
FN31: LD HL,REPLBUF
LD (BEGBUF),HL
LD HL,REPLBUF+TIMSIZE
LD (ENDBUF),HL
CALL GETSTRING
LD IY,FL3
JR SAVETM2
@SAVETIM:
PUSH HL
LD HL,TIMBUF
LD (BEGBUF),HL
LD HL,TIMBUF+TIMSIZE
LD (ENDBUF),HL
POP HL
JR SAVETIM
;
; úáîåóôé óôòïëõ ÷ âõæåò ôéíðìåôá
; ðáòáíåôòù: HL - áäòåó âõæåòá ÷÷ïäá+1 (BUFFER SIZE)
;
FN2F: LD HL,TIMBUF
LD (BEGBUF),HL
LD HL,TIMBUF+TIMSIZE
LD (ENDBUF),HL
CALL GETSTRING
SAVETIM:LD IY,FL1
SAVETM2:
PUSH HL ; TO STACK - STRING SIZE
LD DE,(BEGBUF)
LD A,(DE) ; FL1 - ëïì-÷ï óôòéîçï÷ ÷ âõæåòå
OR A
JR Z,FA_L5 ; ðåòåèïä, åóìé âõæåò ôéíðìåôá
; ðõóôïê
; ðòï÷åòëá îá ðï÷ôïòîùê óôòéîç
;
INC A
LD B,A
RPSTR1: LD A,(DE)
CP (HL)
JR NZ,FA_L5
INC HL
INC DE
DJNZ RPSTR1
POP HL
RET
FA_L5: POP HL ; APPEND
PUSH HL
LD C,(HL) ; C - REAL LENGTH
LD B,0
INC BC ; BC=LENGTH(LENGTH+STR)
PUSH BC
LD HL,(ENDBUF)
LD D,H
LD E,L
OR A
SBC HL,BC
LD A,TIMSIZE
SUB C
LD C,A
INC BC
LDDR ; òáúä÷éîõôø
POP BC
POP HL
LD DE,(BEGBUF)
PUSH DE
LDIR ; ÷óôá÷éôø
POP HL ; HL=TIMBUF
LD (IY),B ; BC=0
FLL_1: LD A,(HL)
OR A ; ðïäóþåô óôòïë ÷ TIMBUF
RET Z
ADD A,C
JR C,FLL_3 ; ëïîôòïìø ÷ùèïäá úá âõæåò
CP TIMSIZE
JR NC,FLL_3 ; --"--"--"--"--"--"--"--
LD C,A
INC BC
LD HL,(BEGBUF)
ADD HL,BC
INC (IY) ; õ÷åìéþéôø óþåôþéë óôòéîçï÷
JR FLL_1
FLL_3: LD (HL),B
RET
;
; ðïìõþéôø óôòïëõ éú âõæåòá ðïäíåî
; ðáòáíåôòù: HL- õëáúáôåìø îá áäòåó âõæåòá+1 (STRING SIZE)
; ÷ùèïä: A - îïíåò óôòïëé ôéíðìåôá (1..9) éìé 0
;
FN30: LD HL,REPLBUF
LD (BEGBUF),HL
CALL GETSTRING
LD IX,FL2
LD IY,FL3
CALL GETTIM
CALL EXITFA
LD A,(IX)
RET
;
; äïâá÷éôø óôòïëõ ÷ âáô-âõæåò
;
FN33: CALL GETSTRING ; óþéôáôø óôòïëõ ÷ âõæåò
LD A,(HL)
OR A
JR Z,TOBDRET
RLA
JR C,TOBDRET
PUSH HL ; HL=âõæåò+1
CALL GETBATSEGM ; ÷ïú÷ò. òåç.á=îïíåò óåçí.
CALL GETLASTSTR ; DE=BEGSTR-1, HL=ADDR(0)
LD A,(DRVCODE) ; BANK
PUSH AF
LD B,1
CALL BSTB
POP AF
LD C,A ; C=BANK
POP IX
LD B,(IX) ; IX=INP_STRING_BUFFER+1
LD E,B
LD D,0 ; DE=APPEND STRING LENGTH
PUSH HL
LD A,H
AND 0FH
LD H,A
ADD HL,DE
INC HL
INC HL
INC HL
LD A,H
AND 0F0H
POP HL
JR NZ,TOBDRET ; ÷ âõæåòå îåô íåóôá
ld d,h
ld e,l
APPEND: PUSH BC
INC IX
INC HL
LD B,(IX)
ld a,b
call CPSPTB ; cp ' ', cp 9
jr z, spx1
ld d,h
ld e,l ; (a,de)=last nonspace symbol
spx1: LD A,C
push de
CALL BSTB
pop de
POP BC
DJNZ APPEND ; b=0 at exit from djnz
ex de,hl
INC HL
; LD B,0
LD A,C
CALL BSTB
XOR A
RET
;
BDRETFA:CALL EXITFA
TOBDRET:JP BADRET
TFBDRET:CALL FREESEG
JR TOBDRET
;
GETBATSEGM:
LD A,(BATSEGM)
CP 0FFH
RET NZ
ld a, (VMEM1)
or a
jr nz, GBS0
LD E,3EH
LD A,(ETRACK0)
CP E
JR Z,GBS0
CALL GETSEGM
CP 0EH
LD A,3EH
JR Z,LDBAT
GBS0: LD DE,1FFH ; òåúåò÷. 1 ìàâïê óåçíåîô
CALL F103
LDBAT: LD (BATSEGM),A
CP 0FFH
JR Z,TOBDRET
SETNULL:PUSH AF
LD E,A
CALL F112 ; B=0 ; SEGMENT -> ADDRESS
LD A,L ; BANK
LD L,B ; B=0
CALL BSTB
POP AF
RET
;
CLRBAT: LD A,(BATSEGM)
CP 0FFH
RET Z
JR SETNULL
FREESEG:LD HL,BATSEGM
LD A,(HL)
CP 3EH
RET Z
LD C,A
LD (HL),0FFH
XOR A
JP SETSEG1 ; üôï ÷ BDOS0
;
; ðïìõþéôø óôòïëõ. âõæåò óïëòáýáåôóñ.
;
FN32: CALL GETSTRING ; C=0
LD (HL),C ; 0
LD A,(BATSEGM)
CP 0FFH
JR Z,BDRETFA
PUSH HL
CALL GETLASTSTR
JR Z,TFBDRET
LD A,0FH
AND D
OR E
PUSH DE
CALL Z,FREESEG ; åóìé îáþáìï óåçíåîôá
POP HL
LD A,(DRVCODE) ; õóôáîá÷ìé÷áåôóñ GETLASTSTR
LD B,0
CALL BSTB ; õäáìñåí óôòïëõ
LD HL,MOVEBUF-1
POP DE ; DE=NEWBUFF+1
DEC DE
LD A,(DE)
LD B,A ; B=MAX STRING SIZE
INC DE
PUSH DE
LD C,A
FN321: INC HL
INC DE
LD A,(HL)
LD (DE),A
OR A
JR Z,IFEOST
DJNZ FN321
IFEOST: LD A,C
SUB B
POP DE
LD (DE),A
CALL EXITFA
XOR A
RET
;
; ðïìõþéôø ðïóìåäîàà óôòïëõ éú ÷áô-óåçíåîôá ó îïíåòïí ÷ ò.á
; ÷ùèïä: á=0+æìáçé - âõæåò ðõóô, á=0FFH+æìáçé- îå ðõóô
; DE=ADDR(óôòïëé ÷ ÷áô-âõæ)-1, HL=áäò. 0 (EOSTR)
; îá MOVEBUF ëìáäåôóñ óôòïëá, ëïîåã óôòïëé - 0
;
GETLASTSTR:
LD E,A
CALL F112 ; B=0
LD A,L ; A=BANK OF BAT-SEGMENT
LD L,B ; L,0 ; HL=ADDRESS OF BAT-SEGMENT
LD (DRVCODE),A
CALL BLDB
LD A,B
OR A
LD D,H
LD E,L
RET Z ; âõæåò ðõóô
GETLS1: LD D,H
LD E,L
LD IX,MOVEBUF
GETLS2: INC HL
PUSH DE
LD A,(DRVCODE)
CALL BLDB
POP DE
LD (IX),B
INC IX
LD A,B
OR A
JR Z,RETGLS
DEC A
JR NZ,GETLS2
JR GETLS1
RETGLS: DEC A
RET
;
DATAPRES:
LD HL,DATES ; DATAPRES
LD BC,3H
XOR A
DATAPR1:XOR (HL)
INC HL
DJNZ DATAPR1
DEC C
JR NZ,DATAPR1
LD (XORSUM),A
LD HL,KSS+2
XOR (HL)
RET
;
OOPEN: LD A,(COPYEXRGA)
CP 4
JR C,OOOPEN
CALL GETFCB ; ðÌÁÇÉÁÔ æ-ÉÉ 0Fh - ÏÔËÒÙÔØ ÆÁÊÌ
PUSH DE
LD HL,NEWBUFF+16
LD DE,NEWBUFF+35
LD BC,5
LDIR ; 5 âáêô: yy+mm+dd+hh+min
POP DE
CALL AD172
CALL SETDSKUSR
CALL AD451 ; SET CNTREC=0..XX, EXITRG_A=0..3
LD A,(EXITRG_A)
CP 4
JR NC,EXDATE1
OOOPEN: PUSH AF
CALL LOADATE
CALL DATAPRES
POP BC
JR NZ,NODATES
LD A,(CNTREC)
ADD A,A
ADD A,A ; A=A*4
ADD A,B ; A=ïôîïóéô. îïíåò ÷ íáóóé÷å äáô
LD HL,DATES
LD C,A
LD B,0
ADD HL,BC
ADD HL,BC ; B=0, C=îïíåò üìåíåîôá
ADD HL,BC ; HL=áäòåó üì-ôá ÷ íáóóé÷å äáô
RET
;
NODATES:LD A,(ISCREAT)
OR A
JR NZ,EXDATE1
DEC A ; A=0FFh
EXDATES:LD (EXITRG_A),A
EXDATE1:XOR A
LD (RETOK),A
JP EXIT_ST
;
FN34: LD A,0FFH
LD (COPYEXRGA),A
FN38: LD (FCBADDR),DE
CALL OOPEN
XOR A
LD (NEWBUFF),A
LD DE,NEWBUFF+16
LD A,(HL) ; òáóðáëï÷ëá 3-è âáêôï÷ïê äáôù
RRA ; ÷ íáóóé÷ NEWBUFF+16..+20
RRA
RRA
RRA
AND 0FH
LD B,96
CP 4
JR C,LESS4
LD B,0FCH
LESS4: ADD A,B
LD (DE),A ; çïä
INC DE
LD A,(HL)
AND 0FH
LD (DE),A ; íåóñã
INC HL
LD B,(HL)
INC HL
LD L,(HL)
LD H,B ; HL= 5ÄÄ + 5ÞÞ + 6ÍÍ
CALL SDVI ; äåîø
CALL SDVI ; þáóù
LD B,6
CALL SDVIG ; íéîõôù
LD BC,22
CALL RETFCB
XOR A
JR EXDATES
;
SDVI: LD B,5
SDVIG: XOR A
SDVIGG: ADD HL,HL
RLA
DJNZ SDVIGG
INC DE
LD (DE),A
RET
;
FN36: EX DE,HL
LD A,(RG_B)
EX AF,AF'
EXX
LD HL,DRVTAB
LD BC,16
BLDIRF2:LD A, TPAPAGE
JP BLDIR
;
FN37: LD A,E
LD HL,PATHUSR
INC A
LD A,(HL)
RET Z
LD (HL),E
RET
;
;ESC,'Z' - ÒÁÂÏÔÁ Ó ÞÁÓÁÍÉ:
; esc,'Z',0 - ÐÏÌÕÞÅÎÉÅ ÚÎÁÞÅÎÉÑ ÞÁÓÏ× Ó ËÌÁ×ÉÁÔÕÒÙ × h,m,s
; esc,'Z',6 - ÐÏÌ. ÄÁÔÕ × ÆÏÒÍÁÔÅ d,m,y
;
GTIMSTR:DB 27,'Z',0,'$'
GDATSTR:DB 27,'Z',6,'$'
;
SETDATE:LD A,(EXITRG_A)
CP 4
RET NC
PUSH AF
LD A,1
LD (ISCREAT),A
ld hl, IO_BYTE
call BLDB2
ld a, b
and 3
jr z, skipdate ; if TTY - do not ask for datetime
LD DE,GTIMSTR
CALL PRINTT
CALL @CONIN
LD (NEWBUFF+38),A ; þáóù
CALL @CONIN
LD (NEWBUFF+39),A ; íéîõôù
CALL @CONIN
LD DE,GDATSTR
CALL PRINTT
CALL @CONIN
LD (NEWBUFF+37),A ; äåîø
CALL @CONIN
LD (NEWBUFF+36),A ; Måóñã
CALL @CONIN
LD (NEWBUFF+35),A ; çïä
skipdate:
POP AF
CALL OOOPEN
JR FN351
;
FN39: CALL GETFCB
LD HL,NEWBUFF+16
LD DE,NEWBUFF+35
LD BC,5
LDIR ; 5 âáêô: yy+mm+dd+hh+min
CALL OOPEN
JR FN351
;
FN35: LD A,0FFH
LD (COPYEXRGA),A
CALL OOPEN ; B=0, HL=áäòåó üìåíåîôá.
FN351: LD DE,NEWBUFF+35 ; õðáëï÷ëá äáô
LD A,(DE) ; A = çïä
CP 96
JR NC,MORE96
ADD A,4
MORE96: RLCA
RLCA
RLCA
RLCA
AND 0F0H
LD B,A
INC DE
LD A,(DE) ; á = íåóñã
OR B
LD (HL),A ; 4ÇÇ + 4 ÍÍ
INC HL
INC DE
PUSH HL
LD HL,0
CALL SDVIG3 ; äåîø
CALL SDVIG3 ; þáó
LD A,(DE) ; A = íéîõôù
LD B,6
CALL SDVIG2
EX DE,HL ; DE = 5ÄÄ + 5ÞÞ + 6ÍÉÎ
POP HL
LD (HL),D
INC HL
LD (HL),E
LD HL,(DMAPOINT)
PUSH HL
CALL TRACK0FLUSH ; set track 0, force flush, BC=NBUFF
LD E,2
CALL RDDMA
CALL DATAPRES
LD A,(XORSUM)
LD (HL),A ; HL=KSS+2
LD (NBUFF+07FH),A ; +0FFh
CALL WRSEC
LD BC,DATES
LD DE,605H
SAVDATE:PUSH DE
PUSH BC
CALL WRDMA
POP BC
LD HL,128
ADD HL,BC
LD B,H
LD C,L
POP DE
INC E
DEC D
JR NZ,SAVDATE
CALL TRACK1
POP HL
LD (DMAPOINT),HL
LD A,(COPYEXRGA)
CP 0FFH
RET NZ
XOR A
JP EXDATES
;
SDVIG3: LD A,(DE)
INC DE
LD B,5
RLA
SDVIG2: RLA
RLA
SDVIG1: RLA
ADC HL,HL
DJNZ SDVIG1
RET
;
LOADATE:LD A,(ACTDISK)
LD HL,DATADSK
CP (HL)
RET Z
LD (HL),A
LOADAT1:LD HL,(DMAPOINT)
PUSH HL
CALL TRACK0FLUSH ; set track 0, force flush, BC=NBUFF
LD DE,201H
CALL LDDATE ; load bootsector
LD HL,NBUFF+0FDH
LD DE,KSS
LD BC,3
LDIR
LD HL,NBUFF+20H
LD DE,LABEL
LD C,16
LDIR
LD BC,USERS
LD DE,803H
CALL LDDATE ; load usernames & filedates
POP HL
LD (DMAPOINT),HL
RET
;
LDDATE: PUSH DE
PUSH BC
CALL RDDMA
POP BC
LD HL,128
ADD HL,BC
LD B,H
LD C,L
POP DE
INC E
DEC D
JR NZ,LDDATE
RET
;
TRACK0FLUSH:
CALL TRACK1 ; read track 1 sector 1
CALL @SETTR00 ; set track 0 - force flush ???
LD BC,NBUFF
RET
;
FN3A: LD HL,(DMAPOINT)
RET
;
SET DMA=NEWBU