Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,149 @@
$title ('MP/M 1.1 Clock Process')
name clock
cseg
;clock:
;do;
;/*
; Copyright (C) 1979, 1980
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 18 Jan 80 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (xdos.lit)
;$nolist
;$include (xdos.ext)
;$nolist
;$include (datapg.ext)
;$nolist
; xdos:
extrn xdos
; procedure (func,info) address external;
; declare func byte;
; declare info address;
; end xdos;
; declare tod structure (
extrn tod
; day address,
; hr byte,
; min byte,
; sec byte ) external;
dseg
;/*
; Clock Process Data Segment
;*/
; declare clock$pd process$descriptor public
; initial (0,rtr$status,20,.tick$entrypt,
; 'Clock ',0,0ffh,0);
clockpd:
public clockpd
extrn clipd
dw clipd ; pl
db 0 ; status
db 20 ; priority
dw clockentrypt ; stkptr
db 'Clock ' ; name
db $-$ ; console
db 0ffh ; memseg (system)
dw $-$ ; b
dw $-$ ; thread
dw $-$ ; disk set DMA
db $-$ ; disk select / user code
dw $-$ ; dcnt
db $-$ ; searchl
dw $-$ ; searcha
ds 2 ; drvact
ds 20 ; registers
ds 2 ; scratch
; declare clock$stk (10) address
; initial (restarts,.clock);
clockstk:
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
clockentrypt:
dw clock
cseg
;/*
; clock:
; The purpose of the clock process is to maintain a time
; of day clock. It utilizes the XDOS delay function to
; increment the PUBLIC clock every one second.
;*/
; clock:
clock:
; procedure;
; declare ret byte;
; do forever;
@4:
; ret = xdos (flag$wait,2);
MVI E,2H
MVI C,84H
CALL XDOS
; if (tod.sec := dec (tod.sec + 1)) = 60h then
LXI H,TOD+4H
MOV A,M
INR A
DAA
MOV M,A
SUI 60H
JNZ @4
; do;
; tod.sec = 0;
MOV M,A
; ret = xdos (flag$set,3);
MVI E,3H
MVI C,85H
CALL XDOS
; if (tod.min := dec (tod.min + 1)) = 60h then
LXI H,TOD+3H
MOV A,M
INR A
DAA
MOV M,A
SUI 60H
JNZ @4
; do;
; tod.min = 0;
MOV M,A
; if (tod.hr := dec (tod.hr + 1)) = 24h then
DCX H
MOV A,M
INR A
DAA
MOV M,A
SUI 24H
JNZ @4
; do;
; tod.hr = 0;
MOV M,A
; tod.day = tod.day + 1;
LHLD TOD
INX H
SHLD TOD
; end;
; end;
; end;
; end;
JMP @4
; end clock;
;end clock;
END