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,219 @@
title 'MP/M II V2.0 Attach Process'
name 'attch'
dseg
@@attch:
public @@attch
cseg
;attch:
@attch:
public @attch
;do;
;/*
; Copyright (C) 1979, 1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (queue.lit)
;$nolist
;$include (xdos.lit)
;$nolist
;$include (datapg.ext)
;$nolist
;$include (xdos.ext)
;$nolist
;$include (bdos.ext)
;$nolist
; declare rlr address external;
extrn rlr
; nfxdos:
; procedure (func,info) external;
extrn nfxdos
; declare func byte;
; declare info address;
; end nfxdos;
; xdos:
; procedure (func,info) byte external;
extrn xdos
; declare func byte;
; declare info address;
; end xdos;
; printb:
; procedure (bufferadr) external;
extrn printb
; declare bufferadr address;
; end printb;
; declare rlrpd based rlr process$descriptor;
;/*
dseg
; Attach Process Data Segment
;*/
; declare attch$pd process$descriptor public
; initial (0,rtr$status,20,.attch$entrypt,
; 'ATTACH ',' '+80h,0,0ffh,0);
attchpd:
public attchpd
dw 0 ; pl
db 0 ; status
db 20 ; priority
dw attchentrypt ; stkptr
db 'ATTACH ',' '+80h ; 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 ; sratch
; declare attch$stk (14) address
; initial (restarts,.attch);
attchstk:
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h
attchentrypt:
dw attch
; declare attch$lqcb structure (
; lqueue,
; buf (12) byte )
; initial (0,'ATTACH ',10,1);
attchlqcb:
dw $-$ ; ql
db 'ATTACH ' ; name
dw 10 ; msglen
dw 1 ; nmbmsgs
dw $-$ ; dqph
dw $-$ ; nqph
dw $-$ ; mh
dw $-$ ; mt
dw $-$ ; bh
ds 12 ; buf (12) byte
; declare attch$uqcb userqcbhead public
; initial (.attch$lqcb,.field);
attchuqcb:
dw attchlqcb ; pointer
dw field ; msgadr
; declare field (11) byte;
field:
ds 11
; declare console byte at (.field(1));
console equ field+1
cseg
atfail:
db 0dh,0ah
db 'Attach failed.'
db '$'
;/*
; attch:
; The purpose of the attach process is to attach
; the console to the specified process.
; Entry Conditions:
; None
; Exit Conditions:
; None
;*/
; attch:
attch:
; procedure public;
public attch
; declare i byte;
; call nfxdos (make$queue,.attch$lqcb);
LXI D,ATTCHLQCB
MVI C,86H
; do forever;
@4:
CALL NFXDOS
; call nfxdos (read$queue,.attch$uqcb);
LXI D,ATTCHUQCB
MVI C,89H
CALL NFXDOS
; rlrpd.console = console;
LXI B,0EH
LHLD RLR
DAD B
LDA CONSOLE
MOV M,A
; i = 2;
MVI C,8
LXI H,FIELD+2
; do while i <> 10;
@6:
; if field(i) = 0 then
MOV A,M
ORA A
JNZ @1
; do while i <> 10;
@8:
; field(i) = ' ';
MVI M,20H
; i = i + 1;
INX H
DCR C
JNZ @8
JMP @7
; end;
@1:
; else i = i + 1;
INX H
DCR C
JNZ @6
; end;
@7:
; /* specify that console of attached process must
; match that currently of the attach process */
; field(10) = 0ffh;
MVI M,0FFH
; if xdos (assign$console,.field(1)) = 255 then
LXI D,FIELD+1H
MVI C,95H
CALL XDOS
INR L
; do;
; call printb (.('Attach failed.','$'));
LXI B,atfail
CZ PRINTB
; end;
; call nfxdos (detlst,0);
mvi c,9fh
call xdos
; call nfxdos (detach,0);
MVI C,93H
; end; /* forever */
JMP @4
; end attch;
;end attch;
END


View File

@@ -0,0 +1,181 @@
title 'MP/M II V2.0 Banked XDOS '
name 'bnkxdos'
cseg
;do;
;/*
; Copyright (C) 1979, 1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
; declare sysdatadr address;
sysdatadr:
dw $-$
; declare cmnbufferadr address;
cmnbufferadr:
dw $-$
; declare Proc$Address$Table (20) address data (
; 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
ProcAddressTable:
dw parse,patch,0,0,0
dw 0,0,0,0,0
dw 0,0,0,0,0
dw 0,0,0,0,0
;
; /* Banked XDOS Procedures */
;
parse: ; BC->.(.filename,.fcb)
;
; filename = [d:]file[.type][;password]
;
; fcb assignments
;
; 0 => drive, 0 = default, 1 = A, 2 = B, ...
; 1-8 => file, converted to upper case,
; padded with blanks
; 9-11 => type, converted to upper case,
; padded with blanks
; 12-15 => set to zero
; 16-23 => password, converted to upper case,
; padded with blanks
; 24-25 => address of password field in 'filename',
; set to zero if password length = 0
; 26 => length of password (0 - 8)
;
; Upon return, HL is set to FFFFH if BC locates
; an invalid file name;
; otherwise, HL is set to 0000H if the delimiter
; following the file name is a 00H (NULL)
; or a 0DH (CR);
; otherwise, HL is set to the address of the delimiter
; following the file name.
;
lxi h,0! push h! push h! push h
mov h,b! mov l,c
mov e,m! inx h! mov d,m! inx h
mov a,m! inx h! mov h,m! mov l,a
call deblank
call delim! jnz parse1
mov a,c! ora a! jnz parse9
mov m,a! jmp parse3
parse1:
mov b,a! inx d! ldax d! cpi ':'! jnz parse2
mov a,b! sui 'A'! jc parse9
cpi 16! jnc parse9
inr a! mov m,a! inx d! call delim! jnz parse3
cpi '.'! jz parse9
cpi ':'! jz parse9
cpi ';'! jz parse9
jmp parse3
parse2:
dcx d! mvi m,0
parse3:
mvi b,8! call setfld
mvi b,3! cpi '.'! jz parse4
call padfld! jmp parse5
parse4:
inx d! call setfld
parse5:
mvi b,4
parse6:
inx h! mvi m,0! dcr b! jnz parse6
mvi b,8! cpi ';'! jz parse7
call padfld! jmp parse8
parse7:
inx d! call pw$fld
parse8:
push d! call deblank! call delim! jnz parse81
inx sp! inx sp! jmp parse82
parse81:
pop d
parse82:
mov a,c! ora a
pop b! mov a,c! pop b
inx h! mov m,c! inx h! mov m,b! inx h! mov m,a
pop b! xchg! rnz
lxi h,0! ret
parse9:
pop h! pop h! lxi h,0ffffh! pop b
pop b! mov a,b! ora c! rz
push b! ret
setfld:
call delim! jz padfld
inx h! cpi '*'! jnz setfld1
mvi m,'?'! dcr b! jnz setfld! jmp setfld2
setfld1:
mov m,a! dcr b
setfld2:
inx d! jnz setfld
setfld3:
call delim! rz
pop h! jmp parse9
pw$fld:
call delim! jz padfld
inx sp! inx sp! inx sp
inx sp! inx sp! inx sp
push d! push h! mvi l,0! xthl
dcx sp! dcx sp
pw$fld1:
inx sp! inx sp! xthl! inr l! xthl! dcx sp! dcx sp
inx h! mov m,a! inx d! dcr b! jz setfld3
call delim! jnz pw$fld1
;jmp padfld
padfld:
inx h! mvi m,' '! dcr b! jnz padfld
ret
delim:
ldax d! mov c,a! ora a! rz
mvi c,0! cpi 0dh! rz! mov c,a
cpi 09h! rz
cpi ' '! jc delim2! rz
cpi '.'! rz
cpi ':'! rz
cpi ';'! rz
cpi '='! rz
cpi ','! rz
cpi '/'! rz
cpi '['! rz
cpi ']'! rz
cpi '<'! rz
cpi '>'! rz
cpi 'a'! rc
cpi 'z'+1! jnc delim1
ani 05fh
delim1:
ani 07fh! ret
delim2:
pop h! jmp parse9
deblank:
ldax d! cpi ' '! jz deblank1
cpi 09h! jz deblank1
ret
deblank1:
inx d! jmp deblank
Patch:
dw 0,0,0,0,0,0,0,0 ;0000-000fh
dw 0,0,0,0,0,0,0,0 ;0010-001fh
dw 0,0,0,0,0,0,0,0 ;0020-002fh
dw 0,0,0,0,0,0,0,0 ;0030-003fh
dw 0,0,0,0,0,0,0,0 ;0040-004fh
dw 0,0,0,0,0,0,0,0 ;0050-005fh
dw 0,0,0,0,0,0,0,0 ;0060-006fh
;end bnkxdos;
END


View File

@@ -0,0 +1,356 @@
title 'MP/M II V2.0 CLBDOS Procedures'
name 'clbdos'
dseg
@@clbdos:
public @@clbdos
cseg
@clbdos:
public @clbdos
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
; open:
open:
; procedure (fcb$adr) byte reentrant public;
public open
; declare fcb$adr address;
; declare fcb based fcb$adr fcb$descriptor;
;
mov d,b
mov e,c
mvi c,15
jmp mon2
; return mon2 (15,fcb$adr);
; end open;
;
; close:
close:
; procedure (fcb$adr) reentrant public;
public close
; declare fcb$adr address;
; declare ret byte;
;
mov d,b
mov e,c
mvi c,16
jmp mon2
; ret = mon2 (16,fcb$adr);
; end close;
;
; readbf:
readbf:
; procedure (fcb$adr) byte reentrant public;
public readbf
; declare fcb$adr address;
;
mov d,b
mov e,c
mvi c,20
jmp mon2
; return mon2 (20,fcb$adr);
; end readbf;
;
; init:
init:
; procedure reentrant public;
public init
;
mvi c,13
jmp mon1
; call mon1 (13,0);
; end init;
;
; set$dma:
setdma:
; procedure (dma$adr) public;
public setdma
; declare dma$adr address;
;
mov d,b
mov e,c
mvi c,26
jmp mon1
; call mon1 (26,dma$adr);
; end set$dma;
;
; flshbf:
flshbf:
; procedure public;
public flshbf
;
mvi c,48
jmp mon1
; call mon1 (48,0);
; end flshbf;
;
; lo:
lo:
; procedure (char) reentrant public;
public lo
; declare char byte;
;
mov e,c
mvi c,5
jmp mon1
; call mon1 (5,char);
; end lo;
;
; co:
co:
; procedure (char) reentrant public;
public co
; declare char byte;
;
mov e,c
mvi c,2
jmp mon1
; call mon1 (2,char);
; end co;
;
; ci:
ci:
; procedure byte reentrant public;
public ci
;
mvi c,1
jmp mon2
; return mon2 (1,0);
; end ci;
;
; rawci:
rawci:
; procedure byte reentrant public;
public rawci
;
mvi c,6
mvi e,0ffh
jmp mon2
; return mon2 (6,0ffh);
; end rawci;
;
; rawlst:
rawlst:
; procedure (string$address) reentrant public;
; declare string$address address;
; declare char based string$address byte;
public rawlst
;
; do while char <> '$';
ldax b
cpi '$'
rz
push b
mvi c,6
mov e,a
call mon1
; call mon1 (6,char);
pop b
inx b
jmp rawlst
; end;
; end rawlst;
;
; print$buffer:
printb:
; procedure (bufferadr) reentrant public;
public printb
; declare bufferadr address;
;
mov d,b
mov e,c
mvi c,9
jmp mon1
; call mon1 (9,bufferadr);
; end print$buffer;
;
; read$buffer:
readbu:
; procedure (bufferadr) reentrant public;
public readbu
; declare bufferadr address;
;
mov d,b
mov e,c
mvi c,10
jmp mon1
; call mon1 (10,bufferadr);
; end read$buffer;
;
; crlf:
crlf:
; procedure reentrant public;
public crlf
;
; call co (0DH);
mvi c,0dh
call co
; call co (0AH);
mvi c,0ah
jmp co
; end crlf;
;
terminate equ 143
public endp
endp:
push psw
push b
push d
push h
mvi c,terminate ;143
lxi d,0
call xbdos
pop h
pop d
pop b
pop psw
ret
public exitr
extrn indisp
exitr:
lda indisp
ora a
jz exitregion ;exit region only if not in dispatcher
ret
xiosoffset equ 33h
public xiosms
xiosms:
jmp $-$
public xiospl
xiospl:
jmp $-$
public strclk
strclk:
jmp $-$
public stpclk
stpclk:
jmp $-$
; public exitr
exitregion:
jmp $-$
public maxcns
maxcns:
jmp $-$
; public sysinit
;sysinit:
jmp $-$
public xidle
xidle:
jmp $-$
extrn sysdat,datapg
public syinit
syinit:
mvi l,252
lxi d,datapg
mov m,e
inx h
mov m,d ; datapg[252] = system data pg adr
lxi h,mpmtop
mvi l,-6
lxi d,xjmptbl
mvi b,6
moveloop:
ldax d
mov m,a
inx d
inx h
dcr b
jnz moveloop
inx h
mov e,m
inx h
mov d,m
xchg
shld xbdosadr
xchg
inx h
inx h
mov e,m
inx h
mov d,m
inx h
push h
lxi h,xiosoffset
dad d
; copy XIOS jump table
mvi b,24 ; 8 entries * 3 bytes
lxi d,xiosms
mvxiostbl:
mov a,m
stax d
inx h
inx d
dcr b
jnz mvxiostbl
extrn dspsvz80,dsprsz80
lxi h,-3
dad d
mvi a,0c3h
cmp m ;is XIOS idle routine present?
jz idleok
mov m,a
lxi d,pdisp
inx h
mov m,e
inx h
mov m,d
idleok:
lhld sysdat
mvi l,5
mov a,m
ora a
jz notz80 ;test z80 flag in sys dat page
xra a
sta dspsvz80
lxi h,0
shld dspsvz80+1
sta dsprsz80
shld dsprsz80+1
notz80:
lhld sysdat ;passed parameter, HL = sysdat
ret
public nfxdos
nfxdos:
extrn xdos,pdisp
xjmptbl:
jmp xdos
jmp pdisp
public xbdos
xbdos:
public mon1,mon2
mon1:
mon2:
lhld xbdosadr
pchl
dseg
xbdosadr:
ds 2
ds 3 ; make room for BDOS external jump table
ds 3
mpmtop:
db 0 ; force byte at end of mpm nucleus module
end


File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,154 @@
title 'MP/M II V2.0 Clock Process'
name 'clock'
dseg
@@clock:
public @@clock
cseg
;clock:
@clock:
public @clock
;do;
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 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


View File

@@ -0,0 +1,241 @@
title 'MP/M II V2.0 Data Page'
name 'datapg'
bnkxdos equ 0ffffh
dseg
;datapg:
@@datapg:
public @@datapg
;do;
;
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (proces.lit)
;$include (memmgr.lit)
;
; declare tod structure (
tod:
public tod
; day address,
; hr byte,
; min byte,
; sec byte ) public
; initial (1353,00H,00H,00H);
dw 1353 ; day
db 0 ; hr
db 0 ; min
db 0 ; sec
; /* 09/14/81 00:00:00 */
;
; declare datapg (1) byte public at (.tod);
datapg equ tod
public datapg
;
; declare initpd process$descriptor external;
extrn initpd
; declare rlr address public initial(initpd);
rlr: dw initpd
public rlr
;
; declare dlr address public initial(0);
dlr: dw 0
public dlr
;
; declare drl address public initial(0);
drl: dw 0
public drl
;
; declare plr address public initial(0);
plr: dw 0
public plr
;
; declare slr address public initial(0);
slr: dw 0
public slr
;
if bnkxdos
; declare MXProccqcb address external;
extrn MXProccqcb
; declare qlr address public initial(0);
qlr: dw MXProccqcb
else
qlr: dw 0
endif
public qlr
;
; declare thrdrt address public initial(0);
thrdrt: dw initpd
public thrdrt
;
; declare max$cns literally '16';
maxcns equ 16
;
; declare nmb$cns byte public;
nmbcns: ds 1
public nmbcns
;
; declare console$attached (max$cns) address public
; initial (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
; declare cnsatt (1) address public at (.console$attached);
cnsatt:
public cnsatt
dw 0,0,0,0
dw 0,0,0,0
dw 0,0,0,0
dw 0,0,0,0
;
; declare console$queue (max$cns) address public
; initial (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
; declare cnsque (1) address public at (.console$queue);
cnsque:
public cnsque
dw 0,0,0,0
dw 0,0,0,0
dw 0,0,0,0
dw 0,0,0,0
;
; declare max$flgs literally '32';
maxflgs equ 32
nmbflags:
public nmbflags
db maxflgs
;
; declare sys$flag (max$flgs) address public initial (
; 0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,
; 0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,
; 0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,
; 0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH);
; declare sysfla address public at (.sys$flag);
sysfla:
public sysfla
dw 0ffffh,0ffffh,0ffffh,0ffffh
dw 0ffffh,0ffffh,0ffffh,0ffffh
dw 0ffffh,0ffffh,0ffffh,0ffffh
dw 0ffffh,0ffffh,0ffffh,0ffffh
dw 0ffffh,0ffffh,0ffffh,0ffffh
dw 0ffffh,0ffffh,0ffffh,0ffffh
dw 0ffffh,0ffffh,0ffffh,0ffffh
dw 0ffffh,0ffffh,0ffffh,0ffffh
;
; declare max$usr$pr literally '8';
maxusrpr equ 8
;
; declare nmb$segs byte public
; initial (max$usr$pr);
nmbsegs:
public nmbsegs
db maxusrpr
;
; declare mem$seg$tbl (max$usr$pr) memory$descriptor public;
msegtbl:
public msegtbl
db 0,0,0,0
db 0,0,0,0
db 0,0,0,0
db 0,0,0,0
db 0,0,0,0
db 0,0,0,0
db 0,0,0,0
db 0,0,0,0
; declare memseg memory$descriptor public at (.mem$seg$tbl);
memseg equ msegtbl
public memseg
;
; declare pdtbl (max$usr$pr) process$descriptor public;
pdtbl:
public pdtbl
; ds 52
dw 0
db 0
db 0
dw 0
db 'MP/M-80',' '+80h
db 0
db 0ffh
ds 36
ds 52
ds 52
ds 52
ds 52
ds 52
ds 52
ds 52
;
; declare max$lst literally '16';
maxlst equ 16
;
; declare nmb$lst byte public;
nmblst: ds 1
public nmblst
;
; declare list$attached (max$lst) address public
; initial (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
; declare lstatt (1) address public at (.list$attached);
lstatt:
public lstatt
dw 0,0,0,0
dw 0,0,0,0
dw 0,0,0,0
dw 0,0,0,0
;
; declare list$queue (max$lst) address public
; initial (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
; declare lstque (1) address public at (.list$queue);
lstque:
public lstque
dw 0,0,0,0
dw 0,0,0,0
dw 0,0,0,0
dw 0,0,0,0
;
; *** Note:
; The user process stack table has been moved to the MPM
; module where it overlays the initialization code.
;
; declare stktbl (max$usr$pr)
; structure (loc (20) address) public;
;stktbl:
; public stktbl
;
;table of offsets
;
ostod equ tod-datapg
osrlr equ rlr-datapg
osdlr equ dlr-datapg
osdrl equ drl-datapg
osplr equ plr-datapg
osslr equ slr-datapg
osqlr equ qlr-datapg
osthrdrt equ thrdrt-datapg
osnmbcns equ nmbcns-datapg
oscnsatt equ cnsatt-datapg
oscnsque equ cnsque-datapg
osnmbflags equ nmbflags-datapg
ossysfla equ sysfla-datapg
osnmbsegs equ nmbsegs-datapg
osmsegtbl equ msegtbl-datapg
ospdtbl equ pdtbl-datapg
osnmblst equ nmblst-datapg
oslstatt equ lstatt-datapg
oslstque equ lstque-datapg
;osstktbl equ stktbl-datapg
;end datapg;
end


File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,295 @@
title 'MP/M II V2.0 Flag Management'
name 'flag'
dseg
@@flag:
public @@flag
cseg
;flag:
@flag:
public @flag
;do;
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;/*
; Common Literals
;*/
; declare enter$region literally
; 'disable';
; exitr:
; procedure external;
extrn exitr
; end exitr;
; declare exit$region literally
; 'call exitr';
;/*
; Proces Literals
;*/
; declare process$header literally
; 'structure (pl address,
; status byte,
; priority byte,
; stkptr address';
; declare bdos$save literally
; 'disk$set$dma address,
; disk$slct$byte,
; dcnt address,
; searchl byte,
; searcha address,
; scratch (13) byte)';
; declare process$descriptor literally
; 'process$header,
; name (8) byte,
; console byte,
; memseg byte,
; b address,
; threadraddress,
; bdos$save';
; declare rtr$status literally '0',
; FlgWt$status literally '4';
;/*
; Data Page Externals
;*/
; declare rlr address external;
extrn rlr
; declare drl address external;
extrn drl
; declare nmbflags byte external;
extrn nmbflags
; declare sys$flag literally 'sysfla';
; declare sys$flag (1) address external;
extrn sysfla
;/*
; Proces Externals
;*/
; declare rlrpdrbased rlr process$descriptor;
; declare dsptch$param literally 'dparam';
; declare dsptch$paramraddress external;
extrn dparam
; declare dispatch literally 'dispat';
; dispatch:
; procedure external;
extrn dispat
; end dispatch;
; declare insert$process literally 'inspr';
; insert$process:
; procedure (pdladr,pdadr) external;
extrn inspr
; declare (pdladr,pdadr) address;
; end insert$process;
; declare pdadr address;
; declare pd based pdadr process$descriptor;
sharedflagcode:
; shared flag code, wait & set
LDA NMBFLAGS
MOV B,A
MOV A,C
CMP B
JC @1
MVI A,0FFH
POP H ; DISCARD RETURN ADR FROM SHARED
RET
@1:
; enter$region;
DI
; if sys$flag(flagnmb) <> 0FFFEH then
MOV E,C
MVI D,0
LXI H,SYSFLA
DAD D
DAD D ; HL = .sys$flag(flagnmb)
MOV E,M
INX H
MOV D,M ; DE = sys$flag(flagnmb)
MVI A,0FFH
CMP D
RET
;/*
; flagwait:
; The purpose of the flag wait procedure is to wait
; until a specified flag has been set before continuing
; execution. If the flag is already set no waiting
; occurs. If a process is already waiting for the same
; flag, no waiting occurs and the boolean flag under run
; is set true.
; Entry Conditions:
; C = flag
; Exit Conditions:
; A = return code,
; where 0 = success,
; FFH = failure
; *** Note *** if waiting is to occur the process remains
; in a critical region until dispatch
;*/
; flag$wait:
flgwt:
public flgwt
; procedure (flagnmb) byte reentrant public;
; declare flagnmb byte; ; Register C
; declare ret byte; ; Register B
; if flagnmb >= nmbflags then return 0FFH;
CALL SHAREDFLAGCODE
; ret = 0;
; enter$region;
; if sys$flag(flagnmb) <> 0FFFEH then
JNZ @5A
DCR A ; A = 0FEH
CMP E
JZ @2
; do;
; if sys$flag(flagnmb) <> 0FFFFH then
INR A ; A = 0FFH
CMP E
JNZ @5A
; do;
; /* flag$under$run */
; ret = 0FFH;
; end;
; else
; do;
; rlrpd.status = flgwt$status;
LHLD RLR
INX H
INX H
MVI M,4H
; dsptch$param = flagnmb;
MOV L,C
MVI H,0
SHLD DPARAM
; call dispatch;
CALL DISPAT
; end;
; end;
JMP @5
@2:
; else sys$flag(flagnmb) = 0FFFFH;
DCX H
MVI M,0FFH
@5:
XRA A
; exit$region;
@5A:
PUSH PSW
CALL EXITR
; return ret;
POP PSW ; A = ret
RET
; end flag$wait;
;/*
; flagset:
; The purpose of the flag set procedure is to set the
; specified flag. If a process is waiting for the flag
; to be set it is placed on the dispatcher ready list.
; If the flag is already set the booleanrflag over run
; is set true.
; Entry Conditions:
; C = flag
; Exit Conditions:
; A = return code,
; where 0 = success,
; FFH = failure
;*/
; flag$set:
flgset:
public flgset
; procedure (flagnmb) byte reentrant public;
; declare flagnmb byte; ; Register C
; derlare ret byte; ; Register B
; if flagnmb >= nmbflags then return 0FFH;
CALL SHAREDFLAGCODE
; ret = 0;
; enter$region;
; pdadr = sys$flag(flagnmb);
; if pdadr = 0FFFFH then
JNZ @9
CMP E
JNZ @7
; do;
; sys$flag(flagnmb) = 0FFFEH;
DCX H
MVI M,0FEH
; end;
JMP @5
@7:
; else
; do;
; if pdadr = 0FFFEH then
DCR A
CMP E
MVI A,0FFH
JZ @5A
; do;
; /* flag$over$run */
; ret = 0FFH;
; end;
@9:
; else
; do;
; sys$flag(flagnmb) = 0FFFFH;
MOV M,A
DCX H
MOV M,A
; pd.pl = drl;
LHLD DRL
XCHG
MOV M,E
INX H
MOV M,D
; drl = pdadr;
DCX H
SHLD DRL
; pd.status = rtr$status;
INX H
INX H
MVI M,0H
; end;
; end;
JMP @5
; exit$region;
; return ret;
; end flag$set;
;end flag;
END


View File

@@ -0,0 +1,235 @@
title 'MP/M II V2.0 List Handler'
name 'lst'
dseg
@@lst:
public @@lst
cseg
;List$handler:
@lst:
public @lst
;do;
;$include (copyrt.lit)
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (datapg.ext)
;$nolist
;$include (proces.ext)
;$nolist
; declare list$attlsted (1) address external;
extrn lstatt
; declare list$queue (1) address external;
extrn lstque
; declare drl address external;
extrn drl
; declare thread$root address external;
extrn thrdrt
; declare nmb$lst byte external;
; extrn nmblst
; declare insert$process literally 'inspr';
; insert$process:
extrn inspr
; procedure (pdladr,pdadr) external;
; declare (pdladr,pdadr) address;
; end insert$process;
; exitr:
extrn exitr
; procedure external;
; end exitr;
; process descriptor offsets
nameos equ 6
CMNCODE:
; if (list$attlsted(pd.console) = pdadr)
LXI H,0EH
DAD B
MOV a,M
ani 0f0h
rrc
rrc
rrc
rrc
mov e,a
INX H
MVI D,0
LXI H,lstatt
DAD D
DAD D
MOV A,M
CMP C
RNZ
INX H
MOV A,M
CMP B
DCX H
RET
;/*
; attlst:
; The purpose of the attlst procedure is to attlst a
; list to the calling process. The list to attlst
; is obtained from the process descriptor. If the list
; is already attlsted to the process or if no one has the
; list attlsted the process is given the list and
; is then placed on the DRL list. If the list is
; attlsted to some other process the current process is
; placed on the list queue.
; Entry Conditions:
; BC = process descriptor address
; Exit Conditions:
; None
; **** Note: this procedure must be called from within a
; critical region.
;*/
; attlst:
attlst:
public attlst
; procedure (pdadr) reentrant public;
; declare pdadr address;
; declare pd based pdadr process$descriptor;
; if (list$attlsted(pd.console) = pdadr) or
CALL CMNCODE
JZ @1A
MOV A,M
INX H
ORA M
JNZ @1
; (list$attlsted(pd.console) = 0) then
; do;
; list$attlsted(pd.console) = pdadr;
MOV M,B
DCX H
MOV M,C
; pd.pl = drl;
@1A:
LHLD DRL
XCHG
MOV H,B
MOV L,C
MOV M,E
INX H
MOV M,D
; drl = pdadr;
DCX H
SHLD DRL
; end;
RET
@1:
; else
; do;
; call insert$process (.list$queue(pd.console),pdadr);
LXI H,lstQUE
DAD D
DAD D
MOV D,B
MOV E,C
MOV B,H
MOV C,L
JMP INSPR
; end;
; end attlst;
;/*
; detlst:
; The purpose of the detlst procedure is to detlst the
; list from the calling process. After checking to
; determine that the list is attlsted to the process
; invoking the detlst, the list is detlsted, attlsting
; the next waiting process to the list and then placing
; it on the DRL.
; Entry Conditions:
; BC = process descriptor address
; Exit Conditions:
; None
; **** Note: this procedure must be called from within a
; critical region.
;*/
; detlst:
detlst:
public detlst
; procedure (pdadr) reentrant public;
; declare pdadr address;
; declare pd based pdadr process$descriptor;
; if pdadr = list$attlsted(pd.console) then
CALL CMNCODE
RNZ
; do;
; list$attlsted(pd.console) = list$queue(pd.console);
PUSH H
LXI H,lstQUE
DAD D
DAD D
POP D
MOV A,M
STAX D
MOV C,A
INX H
INX D
MOV A,M
STAX D
MOV B,A
; pdadr = list$attlsted(pd.console);
; if pdadr <> 0 then
ORA C
RZ
; do;
; list$queue(pd.console) = pd.pl;
LDAX B
DCX H
MOV M,A
INX B
LDAX B
INX H
MOV M,A
; pd.pl = drl;
LHLD DRL
MOV A,H
STAX B
DCX B
MOV A,L
STAX B
; drl = pdadr;
MOV H,B
MOV L,C
SHLD DRL
; pd.status = rtr$status;
INX H
INX H
MVI M,0H
; end;
; end;
; end detlst;
RET
;end List$handler;
END


View File

@@ -0,0 +1,326 @@
title 'MP/M II V2.0 Memory Management'
name 'memmgr'
dseg
@@memmgr:
public @@memmgr
cseg
;memory$manager:
@memmgr:
public @memmgr
;do;
;$include (copyrt.lit)
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (memmgr.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (datapg.ext)
;$nolist
;$include (proces.ext)
;$nolist
; declare rlr address external;
extrn rlr
; declare nmbsegs byte external;
extrn nmbsegs
; declare msegtbl (1) structure (memory$descriptor);
extrn msegtbl
; declare maxseg literally 'nmbsegs - 1';
; exitr:
extrn exitr
; procedure external;
; end exitr;
; memory descriptor offsets
size equ 1
attrib equ 2
; declare user$process literally 'userpr';
; user$process:
userpr:
<EFBFBD> public userpr
; procedure (pdadr) byte public;
; declare pdadr address;
; declare pd based pdadr process$descriptor;
; return not (pd.memseg = 0ffh);
LXI H,0FH
DAD B
MOV A,M
INR A
RZ
MVI A,0FFH
RET
; end user$process;
; declare i byte;
; abs$rq:
absrq:
public absrq
; procedure (mdadr) byte public reentrant;
; declare mdadr address;
; declare md based mdadr memory$descriptor;
; enter$region;
DI
; do i = 0 to maxseg;
LDA NMBSEGS
MOV E,A
LXI H,MSEGTBL-2
@8:
INX H
INX H
INX H
INX H
; if (memsegtbl(i).attrib and allocated) = 0 then
MVI A,80H
ANA M
JNZ @1
; do;
; if memsegtbl(i).base = md.base then
DCX H
DCX H
LDAX B
CMP M
INX H
INX H
JNZ @2
; do;
; memsegtbl(i).attrib = memsegtbl(i).attrib
; or allocated;
MVI A,80H
ORA M
MOV M,A
; md.size = memsegtbl(i).size;
<EFBFBD> INX B
DCX H
MOV A,M
STAX B
; md.attrib = memsegtbl(i).attrib;
INX B
INX H
MOV A,M
STAX B
; md.bank = memsegtbl(i).bank;
inx b
inx h
mov a,m
stax b
; rlrpd.memseg = i;
LXI B,0FH
LHLD RLR
DAD B
LDA NMBSEGS
SUB E
MOV M,A
; exit$region;
CALL EXITR
; return 0;
XRA A
RET
; end;
@2:
; end;
@1:
; end;
DCR E
JNZ @8
; exit$region;
CALL EXITR
; return 0FFH;
MVI A,0FFH
RET
; end abs$rq;
dseg
; declare j byte;
; declare fit$size byte;
; declare fit$index byte;
fitindex:
ds 1
cseg
; /*
; rel$rq:
; The purpose of the relocatable memory request procedure
; is to find the unallocated memory segment which best fits
; the size request.
; */
; rel$rq:
<EFBFBD>relrq:
public relrq
; procedure (mdadr) byte public reentrant;
; declare mdadr address;
; declare md based mdadr memory$descriptor;
; enter$region;
DI
; fit$size = 0ffh;
MVI D,0FFH ; D = fitsize
; do j = 0 to maxseg;
LDA NMBSEGS
MOV E,A
LXI H,MSEGTBL-2
INX B ; BC = .MD.SIZE
@10:
INX H
INX H
INX H
INX H
; if (memsegtbl(j).attrib and allocated) = 0 then
MVI A,80H
ANA M
JNZ @3
; do;
; if memsegtbl(j).size >= md.size then
DCX H
LDAX B
DCR A
CMP M
JNC @4
; do;
; if memsegtbl(j).size <= fit$size then
MOV A,D
CMP M
JC @5
; do;
; fit$index = j;
LDA NMBSEGS
SUB E
STA FITINDEX
; fit$size = memsegtbl(j).size;
MOV A,M
MOV D,A
; end;
@5:
; end;
@4:
; end;
INX H
@3:
; end;
DCR E
JNZ @10
@11:
<EFBFBD>; if fit$size <> 0ffh then
INR D
JZ @6
DCR D
LHLD FITINDEX
MVI H,0
DAD H
DAD H
LXI D,msegtbl ; MEMSEGTBL
DAD D
; do;
; md.base = memsegtbl(fit$index).base;
DCX B
MOV A,M
STAX B
; md.size = memsegtbl(fit$index).size;
INX H
INX B
MOV A,M
STAX B
; memsegtbl(fit$index).attrib =
; memsegtbl(fit$index).attrib or allocated;
INX H
MVI A,80H
ORA M
MOV M,A
; md.attrib = memsegtbl(fit$index).attrib;
INX B
STAX B
; md.bank = memsegtbl(fit$index).bank;
inx h
inx b
mov a,m
stax b
; rlrpd.memseg = fit$index;
LXI B,0FH
LHLD RLR
DAD B
LDA FITINDEX
MOV M,A
; exit$region;
CALL EXITR
; return 0;
XRA A
RET
; end;
@6:
; exit$region;
CALL EXITR
; return 0FFH;
MVI A,0FFH
RET
; end rel$rq;
; mem$fr:
<EFBFBD>memfr:
public memfr
; procedure (mdadr) public reentrant;
; declare mdadr address;
; declare md based mdadr memory$descriptor;
; declare i byte;
; do i = 0 to maxseg;
LDA NMBSEGS
MOV E,A
LXI H,MSEGTBL-4
@12:
INX H
INX H
INX H
INX H
; if memsegtbl(i).base = md.base then
LDAX B
CMP M
JNZ @7
; do;
; if memsegtbl(i).bank = md.bank then
PUSH H
PUSH B
INX H
INX H
INX H
INX B
INX B
INX B
LDAX B
CMP M
POP B
POP H
JNZ @7
; do;
; memsegtbl(i).attrib = memsegtbl(i).attrib
; and (not allocated);
INX H
INX H
MVI A,7FH
ANA M
MOV M,A
; return;
RET
; end;
; end;
@7:
; end;
DCR E
JNZ @12

View File

@@ -0,0 +1,534 @@
title 'MP/M II V2.0 Main Program'
name 'mpm'
dseg
@@mpm:
public @@mpm
cseg
;mpm:
@mpm:
public @mpm
;do;
;$include (copyrt.lit)
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (queue.lit)
;$nolist
;$include (xdos.lit)
;$nolist
;$include (xdos.ext)
;$nolist
;$include (bdosi.ext)
;$nolist
;$include (datapg.ext)
;$nolist
; xdos:
extrn xdos
; procedure (func,info) address external;
; declare func byte;
; declare info address;
; end xdos;
; syinit:
extrn syinit
; procedure external;
; end syinit;
; xidle:
extrn xidle
; procedure external;
; end xidle;
; xbdos:
extrn xbdos
; procedure (func,info) address external;
; declare func byte;
; declare info address;
; end xbdos;
; maxcns:
extrn maxcns
; procedure byte external;
; end maxcons;
; declare datapg (1) byte external;
extrn datapg
; declare sysdat address external;
extrn sysdat
; declare rlr address external;
extrn rlr
; declare qlr address external;
extrn qlr
; declare nmb$segs byte external;
extrn nmbsegs
; declare nmb$cns byte external;
extrn nmbcns
; declare nmb$lst byte external;
extrn nmblst
; declare m$seg$tbl (1) structure (
extrn msegtbl
; base byte,
; size byte,
; attrib byte,
; bank byte );
;/*
; Init Process Data Segment
;
; *** Note:
; Portions of the following 'data' have been moved into csegs
; for the purposes of combining all the initialization code and data
; together in one place so that it can be overlayed by the user
; process stack table.
;
;
; declare stktbl (max$usr$pr)
; structure (loc (10) address) public;
stktbl:
public stktbl
;
;
;*/
; declare init$pd process$descriptor
; initial (idlepd,rtr$status,254,0,'Init ',0,0ffh,0,0,0080h,0);
public initpd
initpd:
dw idlepd ; pl
db 0 ; status
db 254 ; priority
dw 0 ; stkptr
db 'Init ' ; name
db $-$ ; console
db 0ffh ; memseg (system)
dw $-$ ; b
dw $-$ ; thread
dw 0080h ; disk set DMA
db $-$ ; disk select / user code
dw $-$ ; dcnt
db $-$ ; searchl
dw $-$ ; searcha
ds 2 ; drvact
ds 20 ; registers
ds 2 ; scratch
; declare init$stk (24) address
; initial (restarts,0C7C7H);
; /* this stack area is in the system data page */
dseg
;/*
; Idle Process Data Segment
;*/
; declare idle$pd process$descriptor
; initial (0,rtr$status,255,.idlentrypt,'Idle ',0,0ffh,0,0,0080h,0);
public idlepd
idlepd:
dw $-$ ; pl
db 0 ; status
db 255 ; priority
dw idlentrypt ; stkptr
db 'Idle ' ; name
db $-$ ; console
db 0ffh ; memseg (system)
dw $-$ ; b
dw $-$ ; thread
dw 0080h ; disk set DMA
db $-$ ; disk select / user code
dw $-$ ; dcnt
db $-$ ; searchl
dw $-$ ; searcha
ds 2 ; drvact
ds 20 ; registers
ds 2 ; scratch
; declare idle$stk (10) address
; initial (restarts,0C7C7H);
public idlestk
idlestk:
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
idlentrypt:
dw idle
cseg
; declare tmp$pd$adr address;
tmppdadr:
ds 2
; declare tmp$pd based tmp$pd$adr process$descriptor;
; declare tmp$stk$adr address;
tmpstkadr:
ds 2
; declare tmp$stk based tmp$stk$adr (114) address;
; declare sys$dat based tmp$pd$adr (1) byte;
; declare console$dat$adr address;
consoledatadr:
ds 2
dseg
; declare disk$mx userqcb public
; initial (0,0,'MXDisk ');
diskmx:
public diskmx
dw $-$ ; pointer
dw $-$ ; msgadr
db 'MXDisk ' ; name
; declare list$mx userqcb public
; initial (0,0,'MXList ');
listmx:
public listmx
dw $-$ ; pointer
dw $-$ ; msgadr
db 'MXList ' ; name
cseg
; memory descriptor offsets:
size equ 0001h
attrib equ 0002h
bank equ 0003h
;/*
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Idle Program
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;*/
; declare ret byte;
; declare (i,j) byte;
i: ds 1
j: ds 1
; declare tick$pd process$descriptor external;
extrn tickpd
; declare rspladr address;
rspladr:
ds 2
; declare rspl based rspladr address;
; declare temp address;
temp: ds 2
; declare mem$segs$adr address;
memsegsadr:
ds 2
; declare mem$segs based mem$segs$adr (1) byte;
; declare mem$banks$adr address;
membanksadr:
ds 2
; declare mem$banks based mem$banks$adr (1) byte;
; declare template (16) byte initial (
; 0,0,0,198,0,0,'Tmpx ',' '+80h,0,0ffh);
template:
dw $-$ ; pl
db 0 ; status
db 198 ; priority
dw $-$ ; stkptr
db 'Tmpx ',' '+80h ; name
db $-$ ; console
db 0 ; banked OS
; mpm:
mpm:
public mpm
; procedure public;
; stackptr = .init$stk+48;
; rlr = .init$pd;
lhld sysdat
mvi l,245
lxi d,xbdos
mov m,e
inx h
mov m,d
mvi l,0f0h
sphl ; stackptr = sysdat + f0h
; call syinit;
CALL SYINIT
; ret = xdos (open$queue,.disk$mx);
LXI D,DISKMX
MVI C,87H
CALL XDOS
; ret = xdos (open$queue,.list$mx);
LXI D,LISTMX
MVI C,87H
CALL XDOS
; ret = xdos (create,.tick$pd);
LXI D,TICKPD
MVI C,90H
CALL XDOS
; ret = xdos (create,.clock$pd);
; ret = xdos (create,.cli$pd);
; ret = xdos (create,.attch$pd);
; rspladr = (tmp$pd$adr:=xdos (system$data$adr,0)) + 252;
; /* system$data(252-253) = address of data page */
lhld sysdat
mov a,h
mvi l,243
mov h,m
mvi l,0
SHLD TMPPDADR
mov h,a
mvi l,244
mov h,m
mvi l,0
shld consoledatadr
mov h,a
; rspl = .datapg;
; /* system$data(15) = max memory segment followed by table */
mvi l,0fch
LXI B,DATAPG
MOV M,C
INX H
MOV M,B
; mem$segs$adr = tmp$pd$adr + 15;
; /* system$data(32) = memory bank table */
mvi l,0fh
SHLD MEMSEGSADR
; mem$banks$adr = tmp$pd$adr + 32;
; /* system$data(254-255) = resident system process list head */
mvi l,20h
SHLD MEMBANKSADR
; rspladr = rspladr + 2;
mvi l,0feh
SHLD RSPLADR
; /* setup the memory segment table */
; nmb$segs = mem$segs(0);
LHLD MEMSEGSADR
MOV A,M
STA NMBSEGS
INX H
XCHG ; DE = .MEM$SEGS(1)
LXI H,MSEGTBL ; HL = .MEM$SEG$TBL(0).BASE
; do i = 1 to nmb$segs;
RLC
RLC
MOV C,A
@4:
; mem$seg$tbl(i-1).base = mem$segs(i);
; mem$seg$tbl(i-1).size = mem$size(i-1);
; mem$seg$tbl(i-1).attrib = mem$attribs(i-1);;
; mem$seg$tbl(i-1).bank = mem$banks(i-1);
LDAX D
MOV M,A
INX H
INX D
; end;
DCR C
JNZ @4
; call bdos (disk$reset);
mvi c,0dh
call xbdos
lhld rspladr
; temp = rspl;
; /* create the processes on the resident system process
; list and set the first two bytes of the PRL to xbdos adr */
MOV E,M
INX H
MOV D,M
XCHG
SHLD TEMP
; do while temp <> 0;
@2:
LHLD TEMP
MOV A,H
ORA L
JZ @3
; rspladr = temp;
SHLD RSPLADR
; temp = rspl;
MOV E,M
INX H
MOV D,M
XCHG
SHLD TEMP
; rspl = .xbdos;
LXI B,XBDOS
XCHG
MOV M,B
DCX H
MOV M,C
; ret = xdos (create,rspladr + 2);
INX H
INX H
XCHG
MVI C,90H
CALL XDOS
; end;
JMP @2
@3:
; nmb$lst = sysdat(197);
LHLD sysdat
mvi l,197
mov a,m
sta nmb$lst
; /* see if consoles configured > max physical consoles */
; if (nmb$cns:=sys$dat(1)) > maxcns then
CALL MAXCNS
LHLD sysdat
inx h
CMP M
JC @1
MOV A,M
; do;
; nmb$cns = maxcns;
@1:
STA NMBCNS
; end;
; /* create TMP process descriptors, one per console */
; i = nmb$cns;
STA I
; do while i <> 0;
@6:
LDA I
ORA A
JZ @7
; tmp$stk$adr = .tmp$pd.scratch(0);
lhld consoledatadr
mvi l,34h
shld tmpstkadr
; call move (16,.template,.tmp$pd);
lhld tmppdadr
xchg
LXI B,TEMPLATE
MVI L,10H
LDAX B
STAX D
INX B
INX D
DCR L
JNZ $-5H
; tmp$pd.stkptr = .tmp$stk(101);
LXI B,0CAH
LHLD TMPSTKADR
DAD B
MOV B,H
MOV C,L
LHLD TMPPDADR
XCHG
LXI H,4H
DAD D
MOV M,C
INX H
MOV M,B
; i = i - 1;
LXI H,I
DCR M
; tmp$pd.name(3) = i + '0';
MOV A,M
MOV B,A
ADI 30H
LXI H,9H
DAD D
MOV M,A
; tmp$pd.console = i;
LXI H,0EH
DAD D
MOV M,B
; tmp$pd.disk$slct = i;
LXI H,16H
DAD D
MOV M,B
; do j = 0 to 100;
MVI C,202
LHLD TMPSTKADR
@8:
; tmp$stk(j) = 0C7C7H;
MVI M,0C7H
INX H
; end;
DCR C
JNZ @8
; tmp$stk(101) = .tmp;
lxi b,sysdat+1
ldax b
mov b,a
mvi c,247
ldax b
mov b,a
mvi c,2
MOV M,C
INX H
MOV M,B
lhld consoledatadr
inr h
shld consoledatadr
; ret = xdos (create,.tmp$pd);
LHLD TMPPDADR
XCHG
lxi h,64
dad d
shld tmppdadr
MVI C,90H
CALL XDOS
; end;
JMP @6
@7:
; /* Terminate the initialization process */
; ret = xdos (terminate,0ffh);
MVI C,8FH
MVI E,0FFH
JMP XDOS
; /* Idle Process */
idle:
; do forever;
; call xidle;
CALL XIDLE
; end;
JMP idle
; end mpm;
;end mpm;
END


View File

@@ -0,0 +1,45 @@
title 'MP/M II V2.0 Patch Area'
name 'patch'
cseg
@patch:
public @patch
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
patch:
;0000h-000fh
dw 0,0,0,0
dw 0,0,0,0
;0010h-001fh
dw 0,0,0,0
dw 0,0,0,0
;0020h-002fh
dw 0,0,0,0
dw 0,0,0,0
;0030h-003fh
dw 0,0,0,0
dw 0,0,0,0
;0040h-004fh
dw 0,0,0,0
dw 0,0,0,0
;0050h-005fh
dw 0,0,0,0
dw 0,0,0,0
;0060h-006fh
dw 0,0,0,0
dw 0,0,0,0
;0070h-007fh
dw 0,0,0,0
dw 0,0,0,0
end


File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,160 @@
title 'MP/M II V2.0 Release Console & List Devices'
name 'rlsdev'
dseg
@@rlsdev:
public @@rlsdev
cseg
;release$devices:
@rlsdev:
public @rlsdev
;do;
;$include (copyrt.lit)
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (datapg.ext)
;$nolist
;$include (proces.ext)
;$nolist
; declare console$attached (1) address external;
extrn cnsatt
; declare console$queue (1) address external;
extrn cnsque
; declare list$attached (1) address external;
extrn lstatt
; declare list$queue (1) address external;
extrn lstque
; declare drl address external;
extrn drl
; declare sysdat address external;
extrn sysdat
; declare nmbdev literally '16';
nmbdev equ 16
; exitr:
extrn exitr
; procedure external;
; end exitr;
; detach:
extrn detach
; procedure (pdadr) external;
; declare pdadr address;
; end detach;
; detlst:
extrn detlst
; procedure (pdadr) external;
; declare pdadr address;
; end detlst;
dseg
; declare device byte;
device: ds 1
; declare rlsdevsub address;
rlsdevsub:
ds 2
cseg
; rlscon:
rlscon:
; procedure (pdadr) public;
public rlscon
; *** NOTE *** this procedure assumes that a
; critical region has been entered
lxi d,cnsatt
lxi h,rlsconsub
jmp rlsdev
; rlslst:
rlslst:
; procedure (pdadr) public;
public rlslst
; *** NOTE *** this procedure assumes that a
; critical region has been entered
lxi d,lstatt
lxi h,rlslstsub
; jmp rlsdev
rlsdev:
;BC = pdadr
;DE = attach table address
;HL = rls subroutine address
shld rlsdevsub
xra a
rlsdevloop:
sta device
cpi nmbdev
rz
ldax d
inx d
cmp c
jnz rlsdevcont
ldax d
cmp b
jnz rlsdevcont
lxi h,rlsdevcont
push h
lhld rlsdevsub
push h
lxi h,000eh
dad b ;HL = .pd.console
lda device
ret
rlsdevcont:
inx d
lda device
inr a
jmp rlsdevloop
rlsconsub:
push d
push b
mov m,a
call detach
pop b
pop d
ret
rlslstsub:
push d
push b
rrc
rrc
rrc
rrc
mov m,a
call detlst
pop b
pop d
ret
;end release$devices;
END


View File

@@ -0,0 +1,117 @@
title 'MP/M II V2.0 Release MX queues Procedure'
name 'rlsmx'
dseg
@@rlsmx:
public @@rlsmx
cseg
;release$MX:
@rlsmx:
public @rlsmx
;do;
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
; cwriteq:
extrn cwriteq
; procedure (uqcbadr) byte external;
; declare uqcbadr address;
; end cwriteq;
; declare qlr address external;
extrn qlr
;/*
; rlsMX:
; Note- this procedure must be called from within a
; critical region.
;*/
; rlsMX:
rlsmx:
public rlsmx
; procedure (rlr$pdadr) public;
dseg
; declare rls$pdadr address;
; declare ret byte;
; decrare xqlradr address;
xqlradr:
ds 2
; declare xqlr based xqlradr address;
; declare que based xqlradr structure (
; cqueue,pdadr address);
cseg
; xqlradr = qlr;
LHLD QLR
XCHG ; DE = xqlradr
; do while xqlradr <> 0;
@5:
MOV A,D
ORA E
RZ
; if que.name(0) = 'M' then
LXI H,2
DAD D
MOV A,M
CPI 4DH
JNZ @1
; do;
; if que.name(1) = 'X' then
INX H
MOV A,M
CPI 58H
JNZ @1
; do;
; if que.msgcnt = 0 then
LXI H,16H
DAD D
MOV A,M
INX H
ORA M
JNZ @1
; do;
; if que.pdadr = rls$pdadr then
INX H
MOV A,M
CMP C
JNZ @1
INX H
MOV A,M
CMP B
JNZ @1
; do;
; ret = cwriteq (.xqlradr);
PUSH B
PUSH D
xchg
shld xqlradr
LXI B,XQLRADR
CALL CWRITEQ
POP D
POP B
; end;
; end;
; end;
; end;
@1:
; xqlradr = xqlr;
XCHG
MOV E,M
INX H
MOV D,M
; end;
JMP @5
; end rlsMX;
;end release$MX;
END


View File

@@ -0,0 +1,450 @@
title 'MP/M II V2.0 Terminal Handler'
name 'th'
dseg
@@th:
public @@th
cseg
;terminal$handler:
@th:
public @th
;do;
;$include (copyrt.lit)
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (datapg.ext)
;$nolist
;$include (proces.ext)
;$nolist
; declare list$attached (1) address external;
extrn lstatt
; declare console$attached (1) address external;
extrn cnsatt
; declare console$queue (1) address external;
extrn cnsque
; declare rlr address external;
extrn rlr
; declare drl address external;
extrn drl
; declare thread$root address external;
extrn thrdrt
; declare nmb$cns byte external;
; extrn nmbcns
; declare insert$process literally 'inspr';
; insert$process:
extrn inspr
; procedure (pdladr,pdadr) external;
; declare (pdladr,pdadr) address;
; end insert$process;
; exitr:
extrn exitr
; procedure external;
; end exitr;
; process descriptor offsets
nameos equ 6
CMNCODE:
; if (console$attached(pd.console) = pdadr)
LXI H,0EH
DAD B
MOV a,M
ani 0fh
mov e,a
INX H
MVI D,0
LXI H,CNSATT
DAD D
DAD D
MOV A,M
CMP C
RNZ
INX H
MOV A,M
CMP B
DCX H
RET
;/*
; attach:
; The purpose of the attach procedure is to attach a
; console to the calling process. The console to attach
; is obtained from the process descriptor. If the console
; is already attached to the process or if no one has the
; console attached the process is given the console and
; is then placed on the DRL list. If the console is
; attached to some other process the current process is
; placed on the console queue.
; Entry Conditions:
; BC = process descriptor address
; Exit Conditions:
; None
; **** Note: this procedure must be called from within a
; critical region.
;*/
; attach:
attach:
public attach
; procedure (pdadr) reentrant public;
; declare pdadr address;
; declare pd based pdadr process$descriptor;
; if (console$attached(pd.console) = pdadr) or
CALL CMNCODE
JZ @1A
MOV A,M
INX H
ORA M
JNZ @1
; (console$attached(pd.console) = 0) then
; do;
; console$attached(pd.console) = pdadr;
MOV M,B
DCX H
MOV M,C
; pd.pl = drl;
@1A:
LHLD DRL
XCHG
MOV H,B
MOV L,C
MOV M,E
INX H
MOV M,D
; drl = pdadr;
DCX H
SHLD DRL
; end;
RET
@1:
; else
; do;
; call insert$process (.console$queue(pd.console),pdadr);
LXI H,CNSQUE
DAD D
DAD D
MOV D,B
MOV E,C
MOV B,H
MOV C,L
JMP INSPR
; end;
; end attach;
;/*
; detach:
; The purpose of the detach procedure is to detach the
; console from the calling process. After checking to
; determine that the console is attached to the process
; invoking the detach, the console is detached, attaching
; the next waiting process to the console and then placing
; it on the DRL.
; Entry Conditions:
; BC = process descriptor address
; Exit Conditions:
; None
; **** Note: this procedure must be called from within a
; critical region.
;*/
; detach:
detach:
public detach
; procedure (pdadr) reentrant public;
; declare pdadr address;
; declare pd based pdadr process$descriptor;
; if pdadr = console$attached(pd.console) then
CALL CMNCODE
RNZ
; do;
push h
; console$attached(pd.console) = console$queue(pd.console);
LXI H,CNSQUE
DAD D
DAD D
POP D
MOV A,M
STAX D
MOV C,A
INX H
INX D
MOV A,M
STAX D
MOV B,A
; pdadr = console$attached(pd.console);
; if pdadr <> 0 then
ORA C
RZ
; do;
; console$queue(pd.console) = pd.pl;
LDAX B
DCX H
MOV M,A
INX B
LDAX B
INX H
MOV M,A
; pd.pl = drl;
LHLD DRL
MOV A,H
STAX B
DCX B
MOV A,L
STAX B
; drl = pdadr;
MOV H,B
MOV L,C
SHLD DRL
; pd.status = rtr$status;
INX H
INX H
MVI M,0H
; end;
; end;
; end detach;
RET
;/*
; assign:
; The purpose of the assign procedure is to attach a
; specified console to a specified process. The process
; threads are traversed from the thread root to find a
; match between the name passed as a parameter and the
; process name.
; Entry Conditions:
; BC = name address, points to console # followed by
; 8 byte ASCII name
; Exit Conditions:
; A = return code,
; where 0 = success,
; FFH = failure
;*/
; assign:
assign:
public assign
; procedure (name$adr) byte reentrant public;
; declare name$adr address;
; declare pname based name$adr (1) byte;
; declare assign$cns literally 'pname(0)';
; declare match$reqd literally 'pname(9)';
; declare i byte;
; declare pdadr address;
; declare pd based pdadr process$descriptor;
; declare next$console$ptr address;
; declare next$console based next$console$ptr address;
; declare pdladr address;
; declare pdl based pdladr process$descriptor;
; disable;
di
; pdadr = thread$root;
LHLD THRDRT
XCHG
; if assign$cns < nmb$cns then
; LXI H,NMBCNS
; LDAX B
; CMP M
; MVI A,0FFH
; RNC
INX B
; do while pdadr <> 0;
@9:
; i = 1;
PUSH B
LXI H,6
DAD D
PUSH H
MVI L,8
; do while (i <> 9) and (pd.name(i-1) = pname(i));
@11:
XTHL
LDAX B
sub M
INX B
INX H
JZ @11A
ani 7fh
jz @11a ;don't care on high order bit
POP H
POP B
JMP @6
@11A:
XTHL
DCR L
JNZ @11
; i = i + 1;
; end;
; if (i = 9) and
; (not match$reqd or
LDAX B
RAR
POP H
POP B
DCX B
LDAX B
MOV C,A
MVI B,0
JNC @12
mov a,m
ani 0fh
cmp c
JNZ @6
@12: ;if calling proc owns list, past it as well
push b
lhld rlr
mov b,h
mov c,l
lxi h,000eh
dad b
mov a,m
ani 0f0h
rrc
rrc
rrc
rrc
add a
lxi h,lstatt
add l
mov l,a
mov a,h
aci 0
mov h,a
mov a,m
cmp c
jnz @12a
inx h
mov a,m
cmp b
jnz @12a
mov m,d
dcx h
mov m,e
@12a:
pop b
; (match$reqd and (assign$cns = pd.console))) then
; do;
; enter$region;
; DE = pdadr, BC = assign$cns
; DI ;now done at entry
; console$attached(assign$cns) = pdadr;
; /* if process is currently queued for the console
; then put the process on the dispatcher ready list */
LXI H,CNSATT
DAD B
DAD B
MOV M,E
INX H
MOV M,D
; next$console$ptr = .console$queue(assign$cns);
LXI H,CNSQUE
DAD B
DAD B
; do forever;
@13: ; HL = next$console$ptr, DE = pdadr
; if (pdladr := next$console) = 0 then
MOV C,M
INX H
MOV B,M
DCX H
MOV A,B
ORA C
JZ @7
; do;
; exit$region;
; return 0;
; end;
; if pdladr = pdadr then
; HL = NEXT$CONSOLE$PTR, DE = PDADR, BC = PDLADR
MOV A,E
CMP C
JNZ @8
MOV A,D
CMP B
JNZ @8
; do;
; next$console = pdl.pl;
LDAX B
MOV M,A
INX B
INX H
LDAX B
MOV M,A
; pd.pl = drl;
LHLD DRL
XCHG
MOV M,E
INX H
MOV M,D
; drl = pdadr;
DCX H
SHLD DRL
; exit$region;
@7:
ei
; return 0;
XRA A
RET
; end;
@8:
; next$console$ptr = next$console;
MOV A,M
INX H
MOV H,M
MOV L,A
; end; /* of forever */
JMP @13
; end;
@6:
; pdadr = pd.thread;
LXI H,12H
DAD D
MOV E,M
INX H
MOV D,M
MOV A,D
ORA E
JNZ @9
; end;
; enable;
ei
; return 0FFH;
CMA
RET
; end assign;
;end terminal$handler;
END


View File

@@ -0,0 +1,180 @@
title 'MP/M II V2.0 Tick Process'
name 'tick'
dseg
@@tick:
public @@tick
cseg
;tick:
@tick:
public @tick
;do;
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (xdos.lit)
;$nolist
;$include (xdos.ext)
;$nolist
;$include (bdosi.ext)
;$nolist
;$include (datapg.ext)
;$nolist
; xdos:
extrn xdos
; procedure (func,info) address external;
; declare func byte;
; declare info address;
; end xdos;
; stpclk:
extrn stpclk
; procedure external;
; end stpclk;
; declare dlr address external;
extrn dlr
; declare drl address exteranl;
extrn drl
dseg
;/*
; Tick Process Data Segment
;*/
; declare tick$pd process$descriptor public
; initial (0,rtr$status,10,tick$entrypt,
; 'Tick ',0,0ffh,0,0,0);
tickpd:
public tickpd
extrn clockpd
dw clockpd ; pl
db 0 ; status
db 10 ; priority
dw tickentrypt ; stkptr
db 'Tick ' ; 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 tick$stk (10) address
; initial (restarts,.tick);
tickstk:
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h
tickentrypt:
dw tick
; declare ret byte;
; declare pdadr address;
; declare pd based pdadr process$descriptor;
cseg
;/*
; tick:
;*/
; tick:
tick:
; procedure;
; do forever;
@4:
ei
; ret = xdos (flag$wait,1);
MVI E,1
MVI C,84H
CALL XDOS
di
; if dlr <> 0 then
LHLD DLR
MOV A,H
ORA L
JZ @4
; do;
; pdadr = dlr;
XCHG
; if (pd.b := pd.b - 1) = 0 then
LXI H,10H
DAD D
mov c,m
inx h
mov b,m
dcx b
mov m,b
dcx h
mov m,c
mov a,b
ora c
jnz @2
; do while (pdadr <> 0) and (pd.b = 0);
@6: ; DE = pdadr, HL = pd.b
MOV A,D
ORA E
JZ @2
LXI H,10H
DAD D
MOV A,M
INX H
ORA M
JNZ @2
; dlr = pd.pl;
XCHG
MOV E,M
INX H
MOV D,M
XCHG
SHLD DLR
; pd.pl = drl;
LHLD DRL
XCHG
MOV M,D
DCX H
MOV M,E
; drl = pdadr;
SHLD DRL
; pdadr = dlr;
LHLD DLR
XCHG
; end;
JMP @6
@7:
@2:
; if dlr = 0 then call stp$clk;
LHLD DLR
MOV A,H
ORA L
CZ STPCLK
; end;
; end;
JMP @4
; end tick;
;end tick;
END


View File

@@ -0,0 +1,735 @@
title 'MP/M II V2.0 Terminal Message Processor & Submit'
name 'tmpsub'
dseg
@@tmpsub:
public @@tmpsub
cseg
;tmp:
@tmpsub:
public @tmpsub
;do;
;$include (copyrt.lit)
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;$include (common.lit)
;$nolist
;$include (proces.lit)
;$nolist
;$include (queue.lit)
;$nolist
;$include (xdos.lit)
;$nolist
;$include (fcb.lit)
;$nolist
;$include (xdos.ext)
;$nolist
;$include (bdos.ext)
;$nolist
;$include (datapg.ext)
;$nolist
; xbdos:
; extrn xbdos
; procedure (func,info) address external;
; declare func byte;
; declare info address;
; end xbdos;
sysdatadr:
dw $-$
tmp$entry$point:
jmp tmp
bdos:
xdos:
lhld bdosadr
pchl
co:
mvi c,2
jmp bdos
dseg
;/*
; TMP Data Segment
;*/
bdosadr:
ds 2
; declare rlradr address;
rlradr:
ds 2
; declare rlrpd based rlr process$descriptor;
; declare subflgadr address;
subflgtbladr:
ds 2
; declare subflg based subflgadr (1) byte;
cseg
; declare cli$name (8) byte data ('c'+80h,'li ');
cliname:
db 'c'+80h,'li '
; declare submit$fcb (16) byte data (1,'$$$ SUB',
; 0,0,0,0);
submitfcb:
db $-$
db '$$$ SUB'
db 0,0,0,0
dskerr:
db 'Disk error during submit file read.'
db 0dh,0ah
db '$'
startup:
db 0dh,0ah
db 'Start up command: '
db '$'
;/*
; tmp:
;*/
; tmp:
tmp:
lhld sysdatadr
mvi l,245
mov e,m
inx h
mov d,m
xchg
shld bdosadr
LXI H,0FF49H
DAD SP
SPHL
; procedure reentrant public;
; declare buf(129) byte;
; declare fcb fcb$descriptor;
; declare submit$user byte;
; declare console byte;
; declare tmp$user byte;
; declare ret byte;
; declare CLIQ (2) address;
; declare pname (10) byte;
lhld sysdatadr
push h
lxi d,252
dad d
mov e,m
inx h
mov d,m
lxi h,5
dad d
shld rlradr
mov e,m
inx h
mov d,m
; console = rlrpd.console;
LXI h,0EH
DAD d
MOV A,M
pop d
LXI H,0A6H ; CONSOLE
DAD SP
MOV M,A
; subflgadr = xdos (system$data$adr,0) + 128;
lxi h,123 ;offset to system file drive
dad d
mov a,m
sta submitfcb
LXI h,80H
DAD D
SHLD SUBFLGTBLADR
; subflg(console) = false;
call subflgadr
MVI M,0H
; submit$flag = false;
call lclsubflgadr
xra a
mov m,a
dcx h
mov m,a
; pname(0) = console;
LXI H,0A6H ; CONSOLE
DAD SP
MOV A,M
LXI H,0ADH ; PNAME
DAD SP
MOV M,A
; call move (8,.cli$name,.pname(1));
INX H
XCHG
LXI B,CLINAME
MVI L,8H
LDAX B
STAX D
INX B
INX D
DCR L
JNZ $-5H
; pname(9) = 0;
XCHG
MOV M,E
; call set$dma (.buf(1));
LXI H,1H ; BUF+1H
DAD SP
xchg
;
; Temporarily swap stack pointers to avoid TMP process
; descriptor destruction.
;
; lxi h,00a2h
; dad sp
; sphl
mvi c,26
call bdos
; ret = xdos (attach,0);
MVI C,92H
CALL XDOS
; call print$b (.ver);
lhld sysdatadr
mvi l,11 ;offset to xdos base
mov d,m
mvi e,063h ;offset from base of ver module
mvi c,9
call bdos
; call move (16,.submit$fcb,.fcb.et);
LXI H,81H ; FCB
DAD SP
XCHG
LXI B,SUBMITFCB
MVI L,10H
LDAX B
STAX D
INX B
INX D
DCR L
JNZ $-5H
; fcb.fn(1) = console + '0';
MVI A,30H
LXI H,0A6H ; CONSOLE
DAD SP
ADD M
LXI H,83H ; FCB+2H
DAD SP
MOV M,A
lxi d,11-2
dad d
mvi m,'P'
; if open (.fcb) <> 0ffh then
LXI H,81H ; FCB
DAD SP
xchg
mvi c,15
call bdos
INR A
jz @2
lxi h,81h
dad sp
xchg
lxi h,32
dad d
mvi m,0 ;fcb.cr = 0;
mvi c,20
call bdos
inr a
push psw
lxi h,81h+2
dad sp
xchg
mvi c,16
call bdos
pop psw
jz @2
lxi h,1h
dad sp
mvi b,-1
@2a:
inr b
mov a,m
cpi 0dh
inx h
jnz @2a
mvi m,0
mov c,b
inr c
@2b:
dcr c
jz @2c
dcx h
dcx h
mov a,m
inx h
mov m,a
jmp @2b
@2c:
dcx h
mov m,b
mvi c,9
lxi d,startup
call bdos
jmp @7c
@2:
; ret = xdos (detach,0);
MVI C,93H
CALL XDOS
; lxi h,-00a2h
; dad sp
; sphl
; do forever;
@17:
; ret = xdos (attach,0);
MVI C,92H
CALL XDOS
; call crlf;
mvi e,0dh
call co
mvi e,0ah
call co
; i = rlrpd.disk$slct and 0fh;
LHLD rlradr
mov c,m
inx h
mov b,m
lxi h,16h
DAD B
MOV A,M
PUSH PSW
ANI 0FH
; if (i:=i-10) < 15 then
SUI 10
JC @TMP0
; call co ('1');
PUSH PSW
MVI e,'1'
call co
POP PSW
SUI 10
; call co (i + 10 + '0');
@TMP0:
ADI 10+'0'
mov e,a
call co
; call co (shr(rlrpd.disk$slct,4) + 'A');
POP PSW
ANI 0f8h
RAR
RAR
RAR
RAR
ADI 41H
mov e,a
call co
; call co ('>');
MVI e,3EH
call co
; buf(0) = 100;
LXI H,0H ; BUF
DAD SP
MVI M,100
; if not submit$flag then
call lclsubflgadr
jnz @1
; do;
; if subflg(console) then
call subflgadr
jz @6
; do;
; call move (16,.submit$fcb,.fcb.et);
lhld sysdatadr
lxi d,196 ;offset to temp file drive
dad d
mov a,m
LXI H,81H ; FCB
DAD SP
XCHG
LXI B,SUBMITFCB
stax b ;set drive to current temp file drive
MVI L,10H
LDAX B
STAX D
INX B
INX D
DCR L
JNZ $-5H
; fcb.fn(1) = console + '0';
MVI A,30H
LXI H,0A6H ; CONSOLE
DAD SP
ADD M
LXI H,83H ; FCB+2H
DAD SP
MOV M,A
; if open (.fcb) <> 0ffh then
LXI H,81H ; FCB
DAD SP
xchg
mvi c,15
call bdos
INR A
jnz @3
; subflg(console) = false;
call subflgadr
mvi m,0
jmp @6
; do;
; submit$flag = true;
@3:
lxi h,0081h
dad sp
xchg
mvi c,35
call bdos ;compute file size
mvi c,32
mvi e,0ffh
call bdos ;get user number
lxi h,00a5h
dad sp
mov m,a
; end;
; end;
; end;
@1:
; if submit$flag and subflg(console) then
call subflgadr
jz @10a
; do;
; use buffer area as temporary stack
; lxi h,0081h
; dad sp
; sphl
; if bdos (11,0) then
MVI C,0BH
call bdos
RAR
JNC @5
; do;
; ret = ci;
mvi c,1
call bdos
; call bdos (19,.fcb);
; submit$flag = false;
; end;
; lxi h,-0081h
; dad sp
; sphl
JMP @10A
@5:
; lxi h,-0081h
; dad sp
; sphl
; else
; do;
; fcb.nr = fcb.rc - 1;
call lclsubflgadr
mov d,m
dcx h
mov e,m
dcx d
mov m,e
inx h
mov m,d
; if readbf (.fcb) = 0ffh then
call submituser
LXI H,81H ; FCB
DAD SP
xchg
mvi c,33
call bdos
INR A
JNZ @7
call tmpuser
; do;
; call bdos (19,.fcb); /* delete file */
; submit$flag = false;
; call print$b (.(
LXI d,dskerr
mvi c,9
call bdos
; 'Disk error during submit file read.','$'));
; call crlf;
; end;
JMP @10a
@7:
call tmpuser
call lclsubflgadr
mov d,m
dcx h
mov e,m
inx d
mov m,e
inx h
mov m,d
; else
; do;
; i = 2;
@7c:
LXI H,2H ; BUF+2H
DAD SP
; do while buf(i) <> 0;
@7A:
mov a,m
ora a
jz @7B
mov e,a
; call co (.buf(i));
push h
call co
pop h
; i = i + 1;
inx h
; end;
jmp @7A
; call co (0dh);
@7B:
mvi e,0dh
call co
JMP @9
; end;
; end;
; end;
; if not submit$flag then
; do;
@6:
; call read$bu (.buf);
LXI H,0H ; BUF
DAD SP
mvi m,80h
xchg
;
; The following stack swap is done to prevent destruction
; of the TMP process descriptor by the stack. The stack used
; during read$bu overlays the TMP fcb and the end of the
; line buffer. Note that the line buffer length is reduced
; from 128 to 100 bytes.
;
; lxi h,00a2h
; dad sp
; sphl
mvi c,10
call bdos
; lxi h,-00a2h
; dad sp
; sphl
; end;
@9:
; if (buf(1) <> 0) and
LXI H,1H ; BUF+1H
DAD SP
MOV A,M
ORA A
JZ @10
MOV B,A
INX H
MOV A,M
CPI ';'
JZ @10
MOV C,A
; (buf(2) <> ';') then
; do;
; if (buf(1) = 2) and (buf(3) = ':') then
MOV A,B
CPI 2
JNZ @11
INX H
MOV A,M
CPI ':'
JNZ @11
; do;
; i = (buf(2) and 101$1111b) - 'A';
MVI A,5FH
ANA C
SUI 'A'
; if i < 16
CPI 10H
JNC @13
; then call bdos (14,i);
MOV E,A
MVI C,0EH
call bdos
; end;
JMP @13
@11:
; else
; do;
; buf(buf(1)+2) = 0;
LXI H,1H ; BUF+1H
DAD SP
MOV C,M
MVI B,0
LXI H,2H ; BUF+2H
DAD SP
DAD B
MVI M,0H
; call co (0ah);
MVI e,0AH
call co
; buf(0) = rlrpd.disk$slct;
LHLD rlradr
mov c,m
inx h
mov b,m
lxi h,16h
DAD B
MOV A,M
LXI H,0H ; BUF
DAD SP
MOV M,A
; buf(1) = rlrpd.console;
XCHG
lhld rlradr
mov c,m
inx h
mov b,m
lxi h,0eh
dad b
mov a,m
INX D
STAX D
; ret = assign (.pname);
LXI H,0ADH ; PNAME
DAD SP
MOV d,H
MOV e,L
mvi c,149
call xdos
; ret = xdos (send$cli$command,.CLIQ);
LXI H,0 ; buf
DAD SP
XCHG
MVI C,150
CALL XDOS
; end;
@13:
; end;
@10:
; if submit$flag then
call lclsubflgadr
jz @17
; do;
; if fcb.nr = 1 then
mov d,m
dcx h
mov e,m
dcx d
mov m,e
inx h
mov m,d
mov a,d
ora e
jnz @17
@10A:
; do;
; call mon1 (19,.fcb); /* delete file */
; submit$flag = false;
; call close (.fcb);
call submituser
LXI H,81H ; FCB
DAD SP
xchg
mvi c,16
call bdos
; call mon1 (19,.fcb); /* delete file */
LXI H,81H ; FCB
DAD SP
XCHG
MVI C,13H
call bdos
call tmpuser
; submit$flag = false;
call lclsubflgadr
xra a
mov m,a
dcx h
mov m,a
call subflgadr
mvi m,0
; /* free drive */
; call bdos (39,0ffffh);
mvi c,39
lxi d,0ffffh
call bdos
; end;
JMP @17
; else
; do;
; fcb.rc = fcb.rc - 1;
; call close (.fcb);
; end;
; end;
; end;
; end tmp;
;end tmp;
subflgadr:
; ret = .subflg(console);
lxi h,0a6h+2 ; console
dad sp
mov c,m
mvi b,0
lhld subflgtbladr
dad b
mov a,m
ora a
ret ;HL = .subflg(console), B = 0
lclsubflgadr:
; ret = submit$flag;
lxi h,081h+33+2 ; submitflag
dad sp
mov a,m
inx h
ora m
ret ;HL = submitflag
submituser:
;
mvi c,32
mvi e,0ffh
call bdos
lxi h,00a5h+2
dad sp
mov e,m
inx h
inx h
mov m,a
mvi c,32
jmp bdos
tmpuser:
;
lxi h,00a7h+2
dad sp
mov e,m
mvi c,32
jmp bdos
patch:
dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
END


View File

@@ -0,0 +1,69 @@
title 'MP/M II V2.0 Version & Revision Date'
name 'ver'
cseg
@ver:
public @ver
;
; MP/M II V2.0 Version
;
;/*
; Copyright (C) 1979,1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
;
extrn mpm
startmpm:
jmp mpm
extrn pdisp
jmp pdisp
extrn xbdos
jmp xbdos
remfl:
public remfl
jmp $-$
public sysdat
sysdat:
dw $-$
; declare Proc$Address$Table (20) address initial (
; 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
public ProcAddressTable
ProcAddressTable:
dw 0,0,0,0,0,0,0,0,0,0
dw 0,0,0,0,0,0,0,0,0,0
copyright:
db 'COPYRIGHT (C) 1981,'
db ' DIGITAL RESEARCH '
serial:
db '654321'
public mpmver
mpmver:
dw 0120h
public ver
ver:
db 0dh,0ah,0ah
db 'MP/M II '
db 'V2.0'
db 0dh,0ah
db 'Copyright (C) 1981, Digital Research'
db 0dh,0ah
db '$'
db '09/14/81'
end startmpm


File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,120 @@
era *.rel
era *.lib
era *.spr
rmac queue
xref queue
vax queue.xrf $$stan
era *.prn
era *.xrf
rmac dsptch
xref dsptch
vax dsptch.xrf $$stan
era *.prn
era *.xrf
rmac th
xref th
vax th.xrf $$stan
era *.prn
era *.xrf
rmac lst
xref lst
vax lst.xrf $$stan
era *.prn
era *.xrf
rmac xdos
xref xdos
vax xdos.xrf $$stan
era *.prn
era *.xrf
rmac memmgr
xref memmgr
vax memmgr.xrf $$stan
era *.prn
era *.xrf
rmac flag
xref flag
vax flag.xrf $$stan
era *.prn
era *.xrf
lib xdos1.lib=xdos.rel,dsptch.rel,queue.rel,flag.rel,memmgr.rel,th.rel,lst.rel
era *.sym
rmac cli
xref cli
vax cli.xrf $$stan
era *.prn
era *.xrf
rmac tick
xref tick
vax tick.xrf $$stan
era *.prn
era *.xrf
rmac clock
xref clock
vax clock.xrf $$stan
era *.prn
era *.xrf
rmac attach
xref attach
vax attach.xrf $$stan
era *.prn
era *.xrf
lib xdos2.lib=cli.rel,tick.rel,clock.rel,attach.rel
era *.sym
rmac datapg
xref datapg
vax datapg.xrf $$stan
era *.prn
era *.xrf
rmac mpm
xref mpm
vax mpm.xrf $$stan
era *.prn
era *.xrf
rmac rlsmx
xref rlsmx
vax rlsmx.xrf $$stan
era *.prn
era *.xrf
rmac rlsdev
xref rlsdev
vax rlsdev.xrf $$stan
era *.prn
era *.xrf
lib xdos3.lib=datapg.rel,mpm.rel,rlsmx.rel,rlsdev.rel
era *.sym
rmac ver
xref ver
vax ver.xrf $$stan
era *.prn
era *.xrf
rmac clbdos
xref clbdos
vax clbdos.xrf $$stan
era *.prn
era *.xrf
rmac xdosif
xref xdosif
vax xdosif.xrf $$stan
era *.prn
era *.xrf
rmac patch
xref patch
vax patch.xrf $$stan
era *.prn
era *.xrf
link xdos.spr=ver.rel,xdos3.lib,xdos2.lib,xdos1.lib,patch.rel,clbdos.rel,xdosif.rel[os]
era *.sym
rmac tmpsub
xref tmpsub
vax tmpsub.xrf $$stan
era *.prn
era *.xrf
link tmpsub[os]
ren tmp.spr=tmpsub.spr
rmac bnkxdos
xref bnkxdos
vax bnkxdos.xrf $$stan
era *.prn
era *.xrf
link bnkxdos[os]


View File

@@ -0,0 +1,229 @@
title 'MP/M II V2.0 Common/Banked XDOS I/F'
name 'xdosif'
dseg
@@xdsif:
public @@xdsif
cseg
;xdosif:
@xdsif:
public @xdsif
;do;
;/*
; Copyright (C) 1979, 1980,1981
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950
;
; Revised:
; 14 Sept 81 by Thomas Rolander
;*/
extrn rlr
extrn xdos
extrn sysdat
extrn ProcAddressTable
extrn msegtbl
extrn xiosms
parsefilename:
public parsefilename
;BC = .(.filename,.fcb)
push b
call getMX
pop h
mov e,m
inx h
mov d,m
xchg
di
shld temp1
xchg
inx h
mov c,m
inx h
mov h,m
mov l,c
shld temp2
lxi h,commonbuffer+4+80
shld commonbuffer+2
lxi h,commonbuffer+4
shld commonbuffer
lxi b,80
call move
call enterbnkxdos
lxi b,commonbuffer
lxi h,0000
call bnkxdos
mov a,h
ora l
jz savretcode
inx h
mov a,h
ora l
dcx h
jz savretcode
lxi d,commonbuffer+4
mov a,l
sub e
mov e,a
mov a,h
sbb d
mov d,a
lhld temp1
dad d
savretcode:
shld retcode
call exitbnkxdos
lhld temp2
lxi d,commonbuffer+4+80
lxi b,27
call move
lhld retcode
push h
call rlsMX ;also ei's
pop h
; ei
ret
;
; Common/Banked XDOS Utilities
;
move: ;BC = Count, DE = Source, HL = Destination
ldax d
mov m,a
inx h
inx d
dcx b
mov a,b
ora c
jnz move
ret
getmemseg:
lhld rlr
lxi d,0fh ;offset to memseg index
dad d
mov a,m
ret
extbnkswt:
di
mov m,a
inr a
jz extbnkswt1
dcr a
add a
add a
extbnkswt1:
lxi h,msegtbl
add l
mov c,a
mvi a,0
adc h
mov b,a
jmp xiosms
; ret
getMX:
lxi d,MXProcuqcb
mvi c,137
jmp xdos
rlsMX:
lxi d,MXProcuqcb
mvi c,139
jmp xdos
enterbnkxdos:
pop d
lxi h,0
dad sp
lxi sp,topofstack
push h
push d ;enterbnkxdos return address
call getmemseg
sta usermemseg
xra a
call extbnkswt
ei
ret
bnkxdos: ;HL = Proc # * 2
lxi d,ProcAddressTable
dad d
mov e,m
inx h
mov d,m
xchg
pchl
; ret
exitbnkxdos:
call getmemseg
lda usermemseg
call extbnkswt
pop d
pop h
sphl
push d
ret
;
; Common/Banked XDOS Data Segment
;
; declare MXProc$cqcb structure (
; cqueue,
; buf (2) byte ) public
; initial (0,'MXProc ',0,1);
public MXProccqcb
MXProccqcb:
dw $-$ ; ql
db 'MXProc ' ; name
dw 0 ; msglen
dw 1 ; nmbmsgs
dw $-$ ; dqph
dw $-$ ; nqph
dw 0 ; msgin
dw 0 ; msgout
dw 1 ; msgcnt
ds 2 ; buf (2) byte
; declare MXProc$uqcb userqcbhead public
; initial (.MXProc$cqcb);
MXProcuqcb:
dw MXProccqcb ; pointer
; declare common$buffer (128) byte initial (0);
commonbuffer:
ds 128
; declare common$stack (20) address initial (0c7c7h);
commonstack:
dw 0c7c7h,0c7c7h,0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h,0c7c7h,0c7c7h
dw 0c7c7h,0c7c7h,0c7c7h,0c7c7h,0c7c7h
userstkptr:
ds 2
; declare top$of$stack address at (.common$stack(21));
topofstack:
usermemseg:
ds 1
retcode:
ds 2
temp1:
ds 2
temp2:
ds 2
;end xdosif;
END