mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-26 09:54:20 +00:00
Upload
Digital Research
This commit is contained in:
219
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/ATTACH.ASM
Normal file
219
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/ATTACH.ASM
Normal 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
|
||||
|
||||
31
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BDOS.SUB
Normal file
31
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BDOS.SUB
Normal file
@@ -0,0 +1,31 @@
|
||||
ren resbdos.rps=resbdos.spr
|
||||
ren bnkbdos.rps=bnkbdos.spr
|
||||
era resbdos.asm
|
||||
pip a:=e:*.asm
|
||||
pip resbdos.asm=resbdos1.asm,conbdos.asm
|
||||
rmac resbdos
|
||||
era resbdos.asm
|
||||
xref resbdos
|
||||
vax resbdos.xrf $$stan
|
||||
link resbdos[os]
|
||||
era bnkbdos.asm
|
||||
pip bnkbdos.asm=bnkbdos1.asm,bdos30.asm
|
||||
rmac bnkbdos
|
||||
era bnkbdos.asm
|
||||
xref bnkbdos
|
||||
vax bnkbdos.xrf $$stan
|
||||
link bnkbdos[os]
|
||||
pip e:=a:resbdos.spr
|
||||
pip e:=a:bnkbdos.spr
|
||||
pip b:=a:resbdos.spr
|
||||
pip b:=a:bnkbdos.spr
|
||||
era resbdos.spr
|
||||
era bnkbdos.spr
|
||||
ren resbdos.spr=resbdos.rps
|
||||
ren bnkbdos.spr=bnkbdos.rps
|
||||
era bdos30.asm
|
||||
era bnkbdos1.asm
|
||||
era conbdos.asm
|
||||
era resbdos1.asm
|
||||
;end bdos submit
|
||||
|
||||
3945
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BDOS30.ASM
Normal file
3945
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BDOS30.ASM
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
era resbdos.asm
|
||||
pip resbdos.asm=resbdos1.asm,conbdos.asm
|
||||
rmac resbdos
|
||||
era resbdos.asm
|
||||
xref resbdos
|
||||
vax resbdos.xrf $$stan
|
||||
link resbdos[os]
|
||||
era bnkbdos.asm
|
||||
pip bnkbdos.asm=bnkbdos1.asm,bdos30.asm
|
||||
rmac bnkbdos
|
||||
era bnkbdos.asm
|
||||
xref bnkbdos
|
||||
vax bnkbdos.xrf $$stan
|
||||
link bnkbdos[os]
|
||||
|
||||
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BNKBDOS.SPR
Normal file
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BNKBDOS.SPR
Normal file
Binary file not shown.
288
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BNKBDOS1.ASM
Normal file
288
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BNKBDOS1.ASM
Normal file
@@ -0,0 +1,288 @@
|
||||
title 'Non-Resident Portion of Banked BDOS'
|
||||
cseg
|
||||
|
||||
;***************************************************************
|
||||
;***************************************************************
|
||||
;** **
|
||||
;** B a s i c D i s k O p e r a t i n g S y s t e m **
|
||||
;** **
|
||||
;** N o n - R e s i d e n t P o r t i o n **
|
||||
;** B a n k e d B D O S **
|
||||
;** **
|
||||
;***************************************************************
|
||||
;***************************************************************
|
||||
|
||||
;/*
|
||||
; Copyright (C) 1978,1979,1980,1981
|
||||
; Digital Research
|
||||
; P.O. Box 579
|
||||
; Pacific Grove, CA 93950
|
||||
;
|
||||
; Revised:
|
||||
; 14 Sept 81 by David K. Brown
|
||||
;*/
|
||||
|
||||
on equ 0ffffh
|
||||
off equ 00000h
|
||||
|
||||
MPM EQU ON
|
||||
MPMENV EQU ON
|
||||
BNKBDOS EQU ON
|
||||
|
||||
ctlc equ 03h ;control-c
|
||||
cr equ 0dh ;carriage return
|
||||
lf equ 0ah ;line feed
|
||||
;
|
||||
; BDOS call equates
|
||||
dskinit equ 13
|
||||
dskslct equ 14
|
||||
dsksetDMA equ 26
|
||||
setusercode equ 32
|
||||
;
|
||||
; Process Descriptor Offsets
|
||||
pname equ 6
|
||||
console equ 14
|
||||
memseg equ 15
|
||||
thread equ 18
|
||||
disksetDMA equ 20
|
||||
diskselect equ 22
|
||||
diskparams equ 23
|
||||
MULT$CNT$OFF EQU 50
|
||||
PD$CNT$OFF EQU 51
|
||||
;
|
||||
; System Data Page Offsets
|
||||
userstackflag equ 3
|
||||
brkvctr equ 48
|
||||
usrstkregion equ 80
|
||||
;
|
||||
;
|
||||
; MP/M Data Page Offsets
|
||||
rlros equ 5
|
||||
thrdrt equ 17
|
||||
msegtbl equ 150
|
||||
;
|
||||
;**************************************************
|
||||
;* *
|
||||
;**************************************************
|
||||
;
|
||||
org 0000h
|
||||
base equ $
|
||||
|
||||
jmp bnkbdose
|
||||
JMP BNKBDOSINIT
|
||||
JMP REMOVE$FILES
|
||||
XDMAAD: DW $-$
|
||||
SYSDAT: DW $-$
|
||||
BUFFA: DW $-$
|
||||
|
||||
bnkbdosinit:
|
||||
pop h! push h! inx h! inx h! inx h
|
||||
lxi d,extjmptbl! mvi c,24! xchg
|
||||
CALL MOVE
|
||||
|
||||
;INITIALIZE OPEN FILE AND LOCKED RECORD LIST
|
||||
|
||||
LHLD SYSDAT! MVI L,187
|
||||
MOV A,M! STA LOCK$MAX! INX H
|
||||
MOV A,M! STA OPEN$MAX
|
||||
INX H! MOV E,M! INX H! MOV D,M! INX H
|
||||
PUSH D
|
||||
MOV E,M! INX H! MOV D,M! XCHG! SHLD FREE$ROOT
|
||||
POP D! DCX D! LXI B,10
|
||||
ILIST:
|
||||
PUSH D
|
||||
MOV D,H! MOV E,L! DAD B! XCHG
|
||||
MOV M,E! INX H! MOV M,D! XCHG
|
||||
POP D! DCX D! MOV A,D! ORA E! JNZ ILIST
|
||||
MOV M,A! DCX H! MOV M,A! RET
|
||||
|
||||
extjmptbl:
|
||||
|
||||
reboot: jmp $-$
|
||||
rlr: jmp $-$
|
||||
rlradr: jmp $-$
|
||||
dsplynm: jmp $-$
|
||||
xprint: jmp $-$
|
||||
xcrlf: jmp $-$
|
||||
conoutx: jmp $-$
|
||||
getmemseg: jmp $-$
|
||||
;
|
||||
;************************************************
|
||||
;* *
|
||||
;************************************************
|
||||
;
|
||||
|
||||
bnkbdose:
|
||||
|
||||
push d! push b
|
||||
|
||||
LXI H,DELETED$FILES
|
||||
DI
|
||||
MOV A,M! ORA A! MVI M,0
|
||||
EI
|
||||
CNZ DELETE$FILES
|
||||
|
||||
;perform the necessary BDOS parameter initialization
|
||||
;disk set DMA
|
||||
call rlr! SHLD PDADDR
|
||||
lxi b,disksetDMA! dad b
|
||||
mov e,m! inx h! mov d,m! push h! xchg! shld dmaad
|
||||
mov b,h! mov c,l! call setdmaf
|
||||
|
||||
;disk select
|
||||
pop h! inx h
|
||||
mov a,m! rrc! rrc! rrc! rrc! ani 0fh! STA SELDSK
|
||||
|
||||
;set user code
|
||||
mov a,m! ani 0fh! STA USRCODE
|
||||
|
||||
;copy local disk params
|
||||
inx h! push h! lxi d,dcnt
|
||||
XCHG! MVI C,2! CALL MOVE
|
||||
LXI H,SEARCHL! LDAX D! MOV M,A
|
||||
LXI H,MULT$CNT$OFF-DISKPARAMS-2! DAD D
|
||||
MOV A,M! STA MULT$CNT
|
||||
INX H! MOV A,M! ANI 0F0H! CMP M! JZ BNKBDOS1
|
||||
ADI 10H! MOV M,A
|
||||
BNKBDOS1:
|
||||
STA PDCNT
|
||||
|
||||
;perform requested BDOS function
|
||||
pop h! pop b! pop d! push h
|
||||
call bdose
|
||||
|
||||
;save results
|
||||
pop d! push h ; save results in HL
|
||||
|
||||
;copy disk params
|
||||
lxi h,dcnt
|
||||
XCHG! MVI C,2! CALL MOVE
|
||||
LXI D,SEARCHL! LDAX D! MOV M,A
|
||||
|
||||
;return to non-banked bdos, will restore calling bank
|
||||
; and release disk mutual exclusion message
|
||||
pop h! ret
|
||||
|
||||
|
||||
bdose:
|
||||
xchg! shld info! xchg ;save parameter
|
||||
mov a,e! sta linfo ;linfo = low(info) - don't equ
|
||||
lxi h,0! shld aret ;return value defaults to 0000
|
||||
SHLD RESEL ; RESEL,FCBDSK = 0
|
||||
SHLD COMP$FCB$CKS ; COMP$FCB$CKS,SEARCH$USER0 = 0
|
||||
SHLD MAKE$XFCB ; MAKE$XFCB,FIND$XFCB = 0
|
||||
DAD SP! SHLD ENTSP ; SAVE STACK POSITION
|
||||
lxi h,goback! push h ;fake return address
|
||||
|
||||
;compute disk function code address
|
||||
mov a,c! STA FX! mov c,e! mov b,d
|
||||
CPI NFUNCS+12! JNC HIGH$FXS
|
||||
LXI H,DISKF-24! JMP BDOS$JMP
|
||||
HIGH$FXS:
|
||||
LXI H,XDISKF-200
|
||||
BDOS$JMP:
|
||||
mov e,a! mvi d,0 ;DE=func, HL=.diskf-24
|
||||
dad d! dad d! mov e,m! inx h! mov d,m ;DE=functab(func)
|
||||
LHLD INFO ;INFO IN DE FOR LATER EXCHANGE
|
||||
xchg! pchl ;dispatched
|
||||
;
|
||||
; dispatch table for disk functions
|
||||
diskf:
|
||||
dw func12,func13,func14,func15
|
||||
dw func16,func17,func18,func19
|
||||
dw func20,func21,func22,func23
|
||||
dw func24,func25,func26,func27
|
||||
dw func28,func29,func30,func31
|
||||
dw func32,func33,func34,func35
|
||||
dw func36,func37,func38,func39
|
||||
DW FUNC40,FUNC41,FUNC42,FUNC43
|
||||
DW FUNC44,FUNC45,FUNC46,FUNC47
|
||||
DW FUNC48,FUNC49,FUNC50
|
||||
nfuncs equ ($-diskf)/2
|
||||
XDISKF:
|
||||
DW FUNC100,FUNC101,FUNC102,FUNC103
|
||||
DW FUNC104,FUNC105,FUNC106,FUNC107
|
||||
|
||||
PERERR: DW PERSUB ;PERMANENT ERROR SUBROUTINE
|
||||
RODERR: DW RODSUB ;RO DISK ERROR SUBROUTINE
|
||||
ROFERR: DW ROFSUB ;RO FILE ERROR SUBROUTINE
|
||||
SELERR: DW SELSUB ;SELECT ERROR SUBROUTINE
|
||||
|
||||
;
|
||||
; error subroutines
|
||||
PERSUB:
|
||||
;report permanent error
|
||||
lxi h,permsg! jmp report$err ;to report the error
|
||||
;
|
||||
SELSUB:
|
||||
;report select error
|
||||
lxi h,selmsg! jmp report$err ;wait console before boot
|
||||
;
|
||||
RODSUB:
|
||||
;report write to read/only disk
|
||||
lxi h,rodmsg! jmp report$err ;wait console
|
||||
;
|
||||
ROFSUB:
|
||||
;report read/only file
|
||||
lxi h,rofmsg ;drop through to wait for console
|
||||
;
|
||||
report$err:
|
||||
;report error to console, message address in HL
|
||||
push h ;stack msg address
|
||||
;set D=console #
|
||||
call rlr! lxi d,console! dad d! mov d,m
|
||||
call xcrlf ;new line
|
||||
LDA SELDSK! adi 'A'! sta dskerr ;current disk name
|
||||
lxi b,dskmsg! call xprint ;the error message
|
||||
pop b! call xprint ;error mssage tail
|
||||
|
||||
lda fx! mvi b,30h
|
||||
lxi h,pr$fx1
|
||||
cpi 100! jc rpt$err1
|
||||
mvi m,31h! inx h! sui 100
|
||||
rpt$err1:
|
||||
sui 10! jc rpt$err2
|
||||
inr b! jmp rpt$err1
|
||||
rpt$err2:
|
||||
mov m,b! inx h! adi 3ah! mov m,a
|
||||
inx h! mvi m,20h
|
||||
lxi h,pr$fcb! mvi m,0
|
||||
lda resel! ora a! jz rpt$err3
|
||||
mvi m,20h! push d
|
||||
lhld info! inx h! xchg! lxi h,pr$fcb1
|
||||
mvi c,8! call move! mvi m,'.'! inx h
|
||||
mvi c,3! call move! pop d
|
||||
rpt$err3:
|
||||
call xcrlf
|
||||
lxi b,pr$fx! call xprint
|
||||
|
||||
CALL GET$MEM$SEG
|
||||
ORA A! JZ RTN$PHY$ERRS
|
||||
INR A! JZ RTN$PHY$ERRS
|
||||
LXI D,PNAME+5! CALL TEST$ERROR$MODE1! JNZ RTN$PHY$ERRS
|
||||
jmp reboot ;terminate process
|
||||
;ret
|
||||
|
||||
xerr$list:
|
||||
dw xe3,xe4,xe5,xe6,xe7,xe8,xe9,xe10,xe11
|
||||
|
||||
xe3: db 'File Opened in Read/Only Mode',0
|
||||
xe4: db 0
|
||||
xe5: db 'File Currently Open',0
|
||||
xe6: db 'Close Checksum Error',0
|
||||
xe7: db 'Password Error',0
|
||||
xe8: db 'File Already Exists',0
|
||||
xe9: db 'Illegal ? in FCB',0
|
||||
xe10: db 'Open File Limit Exceeded',0
|
||||
xe11: db 'No Room in System Lock List',0
|
||||
|
||||
pr$fx: db 'Bdos Function: '
|
||||
pr$fx1: db ' '
|
||||
pr$fcb: db ' File: '
|
||||
pr$fcb1:ds 12
|
||||
db 0
|
||||
|
||||
fx: ds 1
|
||||
|
||||
|
||||
|
||||
181
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BNKXDOS.ASM
Normal file
181
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BNKXDOS.ASM
Normal 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
|
||||
|
||||
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BNKXDOS.SPR
Normal file
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/BNKXDOS.SPR
Normal file
Binary file not shown.
356
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/CLBDOS.ASM
Normal file
356
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/CLBDOS.ASM
Normal 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
|
||||
|
||||
1859
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/CLI.ASM
Normal file
1859
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/CLI.ASM
Normal file
File diff suppressed because it is too large
Load Diff
154
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/CLOCK.ASM
Normal file
154
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/CLOCK.ASM
Normal 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
|
||||
|
||||
674
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/CONBDOS.ASM
Normal file
674
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/CONBDOS.ASM
Normal file
@@ -0,0 +1,674 @@
|
||||
|
||||
;***************************************************************
|
||||
;***************************************************************
|
||||
;** **
|
||||
;** B a s i c D i s k O p e r a t i n g S y s t e m **
|
||||
;** **
|
||||
;** C o n s o l e P o r t i o n **
|
||||
;** **
|
||||
;***************************************************************
|
||||
;***************************************************************
|
||||
|
||||
cnsfunc:
|
||||
mov a,c! mov c,e! mov b,d
|
||||
lxi h,functab! mov e,a! mvi d,0 ;DE=func, HL=.functab
|
||||
dad d! dad d! mov e,m! inx h! mov d,m ;DE=functab(func)
|
||||
xchg! pchl ;dispatched
|
||||
;
|
||||
; dispatch table for functions
|
||||
functab:
|
||||
dw bootf,func1,func2,func3
|
||||
dw func4,func5,func6,func7
|
||||
dw cmnret,func9,func10,func11
|
||||
diskf equ ($-functab)/2
|
||||
|
||||
nfuncs equ 41 ;must match with banked bdos # fns
|
||||
|
||||
;
|
||||
func1:
|
||||
;return console character with echo
|
||||
call conech
|
||||
mov l,a! ret
|
||||
;
|
||||
func2:
|
||||
;write console character with tab expansion
|
||||
call attcns! jmp tabout
|
||||
;
|
||||
func3:
|
||||
;return raw unattached console character
|
||||
call rawattcns
|
||||
jmp dirinp
|
||||
;
|
||||
func4:
|
||||
;write raw unattached console character
|
||||
call rawattcns
|
||||
jmp conoutf
|
||||
;
|
||||
func5:
|
||||
;write list character
|
||||
call testlstatt
|
||||
;write to list device if already attached
|
||||
jz listf
|
||||
;else must attach list device first
|
||||
push b! push d
|
||||
mvi c,attlst! call xdos
|
||||
pop d! pop b
|
||||
jmp listf
|
||||
;
|
||||
func6:
|
||||
;direct console i/o - 0ffh = read/status
|
||||
; 0feh = status
|
||||
; 0fdh = read
|
||||
call rawattcns
|
||||
mov a,c! inr a! jz stsdirinp
|
||||
inr a! jz stsinp
|
||||
inr a! jz dirinp
|
||||
;direct output function
|
||||
jmp conoutf
|
||||
stsdirinp:
|
||||
push d! call constf! pop d
|
||||
ora a! jnz dirinp
|
||||
mvi c,dispatch! call xdos
|
||||
xra a! mov l,a! ret
|
||||
stsinp:
|
||||
;direct console status input
|
||||
call constf ;to A
|
||||
mov l,a! ret
|
||||
dirinp:
|
||||
lxi h,kbchar! call ofsthl
|
||||
mov a,m! mvi m,0! ora a
|
||||
cz coninf ;to A
|
||||
mov l,a! ret
|
||||
;
|
||||
func7:
|
||||
;return io byte
|
||||
;*** Not implemented in MP/M ***
|
||||
xra a
|
||||
mov l,a! ret
|
||||
;
|
||||
;func8:
|
||||
;set i/o byte
|
||||
;*** Not implemented in MP/M ***
|
||||
;ret
|
||||
;
|
||||
func9:
|
||||
;write line until $ encountered
|
||||
;BC = string address
|
||||
call attcns! jmp print ;out to console
|
||||
;
|
||||
func10:
|
||||
;read a buffered console line
|
||||
call attcns! jmp read
|
||||
;
|
||||
func11:
|
||||
;check console status
|
||||
call testcnsatt
|
||||
jz doconbrk
|
||||
mvi c,dispatch! call xdos
|
||||
xra a! mov l,a! ret
|
||||
doconbrk:
|
||||
call conbrk
|
||||
mov l,a
|
||||
;
|
||||
cmnret:
|
||||
ret
|
||||
;
|
||||
tstlivekbd:
|
||||
;test for simulated 'live keyboard'
|
||||
;pd.name(3)' = off
|
||||
call rlr! lxi b,pname+3! dad b! mov a,m! ani 80h
|
||||
ret
|
||||
|
||||
;
|
||||
testlstatt:
|
||||
;test to determine if list is attached
|
||||
;Zero = attached, D = List #
|
||||
di
|
||||
call rlr! xchg ;DE = Ready List Root
|
||||
lxi h,console! dad d! mov a,m! ani 0f0h
|
||||
rrc! rrc! rrc! rrc! push psw! push b
|
||||
lxi b,lstatt-rlros! jmp attcmn
|
||||
;ret
|
||||
|
||||
;
|
||||
testcnsatt:
|
||||
;test to determine if console is attached
|
||||
;Zero = attached, D = Console #
|
||||
di
|
||||
call rlr! xchg ;DE = Ready List Root
|
||||
lxi h,console! dad d! mov a,m! ani 0fh
|
||||
push psw! push b
|
||||
lxi b,cnsatt-rlros
|
||||
attcmn:
|
||||
lhld rlradr! dad b
|
||||
add a! mov c,a! mvi b,0! dad b
|
||||
mov a,m! cmp e! inx h! jnz notatt
|
||||
mov a,m! cmp d! jz testext
|
||||
notatt:
|
||||
mov a,m! dcx h! ora m! jnz testext
|
||||
mov m,e! inx h! mov m,d! xra a ;attach ok
|
||||
testext:
|
||||
ei! pop b! pop d
|
||||
mvi e,0 ;cns req'd flag false
|
||||
ret
|
||||
;
|
||||
rawattcns:
|
||||
push b! mvi b,80h! jmp attcns0
|
||||
attcns:
|
||||
push b! mvi b,0
|
||||
attcns0:
|
||||
call rlr
|
||||
inx h! inx h! inx h! inx h! inx h! inx h
|
||||
mov a,m! ani 7fh! ora b! mov m,a ;set/reset direct i/o
|
||||
inx h! inx h! inx h
|
||||
mov a,m! ani 7fh! ora b! mov m,a ;set/reset simul. live kbd
|
||||
pop b
|
||||
;attach console if req'd
|
||||
call testcnsatt
|
||||
mvi e,0ffh! rz ;cns req'd flag true
|
||||
push b! push d!
|
||||
mvi c,attach! call xdos
|
||||
pop d! push d ;restore DE
|
||||
call dsplyatchmsg
|
||||
pop d! pop b
|
||||
ret
|
||||
;
|
||||
ofsthl:
|
||||
;offset HL by console # (in D)
|
||||
push psw
|
||||
mov a,d! add l! mov l,a
|
||||
mvi a,0! adc h! mov h,a
|
||||
pop psw
|
||||
ret
|
||||
|
||||
;
|
||||
; console handlers
|
||||
|
||||
constx:
|
||||
push d! call constf! pop d! ret
|
||||
|
||||
coninx:
|
||||
;returns char & cond code = NZ if raw input
|
||||
push d! call rlr! lxi d,pname! dad d
|
||||
pop d! push d! ;restore console #
|
||||
mov a,m! ani 80h! push psw
|
||||
call coninf
|
||||
mov b,a! pop psw! mov a,b
|
||||
pop d! ret
|
||||
|
||||
conoutx:
|
||||
mov a,c! ani 7fh! mov c,a
|
||||
push d! call conoutf! pop d! ret
|
||||
|
||||
conin:
|
||||
;read console character to A
|
||||
;attach console first
|
||||
call attcns
|
||||
lxi h,kbchar! call ofsthl
|
||||
mov a,m! mvi m,0! ora a! rnz
|
||||
;no previous keyboard character ready
|
||||
call getchr ;get character externally and test it
|
||||
jmp conin ;only exit is with kbchar <> 0
|
||||
;ret
|
||||
;
|
||||
conech:
|
||||
;read character with echo
|
||||
call conin! call echoc! rc ;echo character?
|
||||
;character must be echoed before return
|
||||
push psw! mov c,a! call tabout! pop psw
|
||||
ret ;with character in A
|
||||
;
|
||||
echoc:
|
||||
;echo character if graphic
|
||||
;cr, lf, tab, or backspace
|
||||
cpi cr! rz ;carriage return?
|
||||
cpi lf! rz ;line feed?
|
||||
cpi tab! rz ;tab?
|
||||
cpi ctlh! rz ;backspace?
|
||||
cpi ' '! ret ;carry set if not graphic
|
||||
;
|
||||
conbrk: ;check for character ready
|
||||
call constx! ani 1
|
||||
lxi h,kbchar! call ofsthl
|
||||
jnz pgetchr ;jump if char to be read in
|
||||
mov a,m! ora a! rz ;return if no char in kbchar either
|
||||
jmp conb1 ;active kbchar
|
||||
pgetchr:
|
||||
mvi m,0 ;clear kbchar to prepare for new char
|
||||
;character ready, read it
|
||||
getchr: ;entry point used by conin
|
||||
call coninx ;to A
|
||||
jnz conb0; skip char testing if pd.pname.f0 is "on"
|
||||
cpi ctls! jnz notcts ;check stop screen function
|
||||
;found ctls, read next character
|
||||
getctlq:
|
||||
call coninx ;to A
|
||||
cpi ctlc! jz controlc ;ctlc implies re-boot
|
||||
cpi ctlq! jz gotctlq
|
||||
mvi c,7! call conoutx ;send bell character
|
||||
jmp getctlq
|
||||
gotctlq:
|
||||
;resume after ^Q
|
||||
xra a! ret ;with zero in accumulator
|
||||
notcts:
|
||||
;not a control s, control q?
|
||||
cpi ctlq! jz gotctlq
|
||||
;ignore control Q's
|
||||
notctq:
|
||||
;not a control s, control d?
|
||||
cpi ctld! jnz notctd
|
||||
;found ctld, detach console
|
||||
;^D is ignored if submit in progress
|
||||
lhld sysdat! mvi l,128! call ofsthl
|
||||
mov a,m! ora a! mvi a,0! rnz
|
||||
push d! lxi h,listcp! call ofsthl
|
||||
;if ^D and ^P then detach list
|
||||
mov a,m! ora a! jz notctlp
|
||||
mvi c,detlst! call XDOS
|
||||
notctlp:
|
||||
mvi c,detach! call XDOS
|
||||
;then attach console back
|
||||
; unless cns not req'd
|
||||
pop d! mov a,e! ora a
|
||||
rz! push d ;return if cns not req'd
|
||||
mvi c,attach! call XDOS! pop d
|
||||
dsplyatchmsg:
|
||||
;print console attach message
|
||||
lxi b,atchmsg! call xprint
|
||||
call rlr
|
||||
dsplynm:
|
||||
call pdsplynm
|
||||
xcrlf:
|
||||
;output crlf without CONBRK calls
|
||||
mvi c,cr! call conoutx
|
||||
mvi c,lf! call conoutx
|
||||
xra a! ret ;with zero in A
|
||||
|
||||
pdsplynm:
|
||||
lxi b,pname! dad b! mvi e,8
|
||||
dsploop:
|
||||
mov c,m! push h! push d! call conoutx
|
||||
pop d! pop h! inx h! dcr e
|
||||
jnz dsploop
|
||||
inr e ;cns req'd set true
|
||||
ret
|
||||
|
||||
notctd:
|
||||
;not a control d, control c?
|
||||
cpi ctlc! jnz conb0
|
||||
controlc: ;entry point
|
||||
lhld sysdat! mvi l,128! call ofsthl
|
||||
mov a,m! ora a! jz ctlcnt
|
||||
push h! lxi b,submsg! call query
|
||||
pop h! jnz ctlcnt
|
||||
mvi m,0
|
||||
ctlcnt:
|
||||
;test for suppress abort flag
|
||||
call rlr! lxi b,(pname+7)! dad b
|
||||
mov a,m! ani 80h! jz notctlcsupr
|
||||
dcx h! mov a,m! ori 80h! mov m,a
|
||||
xra a! ret
|
||||
notctlcsupr:
|
||||
;test to see if this is a user process
|
||||
inx h! inx h
|
||||
mov a,m! ora a! rz
|
||||
inr a! rz ;ignore ^C if system process running
|
||||
;print Abort (Y/N) ?
|
||||
lxi b,abtmsg1! call xprint
|
||||
call rlr! call pdsplynm
|
||||
lxi b,abtmsg2! call query! jz xreboot
|
||||
xra a! ret ;with zero in A
|
||||
conb0:
|
||||
;character in accum, save it
|
||||
lxi h,kbchar! call ofsthl! mov m,a
|
||||
conb1:
|
||||
;return with true set in accumulator
|
||||
mvi a,1! ret
|
||||
;
|
||||
query:
|
||||
call xprint
|
||||
eatctlc:
|
||||
call coninx! ani 7fh
|
||||
cpi ctlc! jz eatctlc! push psw
|
||||
mov c,a! call conoutx
|
||||
mvi c,cr! call conoutx
|
||||
mvi c,lf! call conoutx
|
||||
pop psw
|
||||
ani 5fh! cpi 'Y'
|
||||
ret
|
||||
;
|
||||
conout:
|
||||
;compute character position/write console char from C
|
||||
;compcol = true if computing column position
|
||||
lxi h,compcol! call ofsthl
|
||||
mov a,m! ora a! jnz compout
|
||||
;write the character, then compute the column
|
||||
;write console character from C
|
||||
push b! call conoutx ;externally, to console
|
||||
call tstlivekbd ;conbrk only if simulated 'live kbd'
|
||||
cz conbrk ;check for screen stop function
|
||||
pop b! push b! push d ;recall/save character & con #
|
||||
;may be copying to the list device
|
||||
lxi h,listcp! call ofsthl
|
||||
mov a,m! ani 01h! cnz func5 ;to printer, if so
|
||||
pop d! pop b ;recall the character & con #
|
||||
compout:
|
||||
mov a,c ;recall the character
|
||||
;and compute column position
|
||||
lxi h,column! call ofsthl ;A = char, HL = .column
|
||||
cpi rubout! rz ;no column change if nulls
|
||||
inr m ;column = column + 1
|
||||
cpi ' '! rnc ;return if graphic
|
||||
;not graphic, reset column position
|
||||
dcr m ;column = column - 1
|
||||
mov a,m! ora a! rz ;return if at zero
|
||||
;not at zero, may be backspace or end line
|
||||
mov a,c ;character back to A
|
||||
cpi ctlh! jnz notbacksp
|
||||
;backspace character
|
||||
dcr m ;column = column - 1
|
||||
ret
|
||||
notbacksp:
|
||||
;not a backspace character, eol?
|
||||
cpi lf! rnz ;return if not
|
||||
;end of line, column = 0
|
||||
mvi m,0 ;column = 0
|
||||
ret
|
||||
;
|
||||
ctlout:
|
||||
;send C character with possible preceding up-arrow
|
||||
mov a,c! call echoc ;cy if not graphic (or special case)
|
||||
jnc tabout ;skip if graphic, tab, cr, lf, or ctlh
|
||||
;send preceding up arrow
|
||||
push psw! mvi c,ctl! call conout ;up arrow
|
||||
pop psw! ori 40h ;becomes graphic letter
|
||||
mov c,a ;ready to print
|
||||
;(drop through to tabout)
|
||||
;
|
||||
tabout:
|
||||
;expand tabs to console
|
||||
mov a,c! cpi tab! jnz conout ;direct to conout if not
|
||||
;tab encountered, move to next tab position
|
||||
tab0:
|
||||
mvi c,' '! call conout ;another blank
|
||||
call ldacolumn! ani 111b ;column mod 8 = 0 ?
|
||||
jnz tab0 ;back for another if not
|
||||
ret
|
||||
;
|
||||
backup:
|
||||
;back-up one screen position
|
||||
call pctlh! mvi c,' '! call conoutx ;jmp pctlh
|
||||
;
|
||||
pctlh:
|
||||
;send ctlh to console without affecting column count
|
||||
mvi c,ctlh! jmp conoutx
|
||||
;ret
|
||||
;
|
||||
crlfp:
|
||||
;print #, cr, lf for ctlx, ctlu, ctlr functions
|
||||
;then move to strtcol (starting column)
|
||||
mvi c,'#'! call conout
|
||||
call crlf
|
||||
;column = 0, move to position strtcol
|
||||
crlfp0:
|
||||
call ldacolumn! lxi h,strtcol! call ofsthl
|
||||
cmp m! rnc ;stop when column reaches strtcol
|
||||
mvi c,' '! call conout ;print blank
|
||||
jmp crlfp0
|
||||
;;
|
||||
;
|
||||
crlf:
|
||||
;carriage return line feed sequence
|
||||
mvi c,cr! call conout! mvi c,lf! jmp conout
|
||||
;ret
|
||||
;
|
||||
xprint:
|
||||
;print routine which does not CONBRK
|
||||
;BC = string address, string terminated with a '$'
|
||||
ldax b! ORA A! rz
|
||||
push b! mov c,a! call conoutx! pop b
|
||||
inx b! jmp xprint
|
||||
;
|
||||
print:
|
||||
;print message until M(BC) = '$'
|
||||
ldax b! cpi '$'! rz ;stop on $
|
||||
;more to print
|
||||
inx b! push b! mov c,a ;char to C
|
||||
call tabout ;another character printed
|
||||
pop b! jmp print
|
||||
;
|
||||
pread: ;entry to read, restores buffer address
|
||||
pop b
|
||||
read: ;BC = address (max length, current length, buffer)
|
||||
push b ;save buffer address for possible ^X or ^U
|
||||
call ldacolumn
|
||||
lxi h,strtcol! call ofsthl
|
||||
mov m,a ;save start for ctl-x, ctl-h
|
||||
mov h,b! mov l,c! mov c,m! inx h! push h! mvi b,0
|
||||
;B = current buffer length,
|
||||
;C = maximum buffer length,
|
||||
;HL= next to fill - 1
|
||||
readnx:
|
||||
;read next character, BC, HL active
|
||||
push b! push h ;blen, cmax, HL saved
|
||||
readn0:
|
||||
call conin ;next char in A
|
||||
ani 7fh ;mask parity bit
|
||||
pop h! pop b ;reactivate counters
|
||||
cpi cr! jz readen ;end of line?
|
||||
cpi lf! jz readen ;also end of line
|
||||
cpi ctlh! jnz noth ;backspace?
|
||||
;do we have any characters to back over?
|
||||
mov a,b! ora a! jz readnx
|
||||
;characters remain in buffer, backup one
|
||||
dcr b ;remove one character
|
||||
call ldacolumn
|
||||
lxi h,compcol! call ofsthl
|
||||
mov m,a ;col > 0
|
||||
;compcol > 0 marks repeat as length compute
|
||||
jmp linelen ;uses same code as repeat
|
||||
noth:
|
||||
;not a backspace
|
||||
cpi rubout! jnz notrub ;rubout char?
|
||||
;rubout encountered, rubout if possible
|
||||
mov a,b! ora a! jz readnx ;skip if len=0
|
||||
;buffer has characters, resend last char
|
||||
mov a,m! dcr b! dcx h ;A = last char
|
||||
;blen=blen-1, next to fill - 1 decremented
|
||||
jmp rdech1 ;act like this is an echo
|
||||
;
|
||||
notrub:
|
||||
;not a rubout character, check end line
|
||||
cpi ctle! jnz note ;physical end line?
|
||||
;yes, save active counters and force eol
|
||||
push b! push h! call crlf
|
||||
lxi h,strtcol! call ofsthl
|
||||
xra a! mov m,a ;start position = 00
|
||||
jmp readn0 ;for another character
|
||||
note:
|
||||
;not end of line, list toggle?
|
||||
cpi ctlp! jnz notp ;skip if not ctlp
|
||||
lda kbproc! ora a! jnz notp
|
||||
;list toggle - change parity
|
||||
push h ;save next to fill - 1
|
||||
push b! push d
|
||||
lxi h,listcp! call ofsthl ;HL=.listcp flag
|
||||
mvi a,01h! xra m! mov m,a ;listcp=-listcp
|
||||
push h ;save address of listcp
|
||||
jnz prntron ; jump if printer to be turned on
|
||||
prntroff:
|
||||
;return list mutex queue message
|
||||
mvi m,0! ;zero listcp(console)
|
||||
mvi c,detlst! call XDOS
|
||||
pop h! jmp ctlpxit
|
||||
prntron:
|
||||
call testlstatt
|
||||
pop h! jz ctlpxit
|
||||
;printer busy, could not ^p
|
||||
mvi m,0! lxi b,pbsymsg
|
||||
;D = console #
|
||||
pop d! push d
|
||||
call xprint
|
||||
ctlpxit:
|
||||
pop d! pop b
|
||||
pop h! jmp readnx ;for another char
|
||||
notp:
|
||||
;not a ctlp, line delete?
|
||||
cpi ctlx! jnz notx
|
||||
pop h ;discard start position
|
||||
;loop while column > strtcol
|
||||
backx:
|
||||
lxi h,strtcol! call ofsthl
|
||||
mov a,m! lxi h,column! call ofsthl
|
||||
cmp m! jnc pread ;start again
|
||||
dcr m ;column = column - 1
|
||||
call backup ;one position
|
||||
jmp backx
|
||||
notx:
|
||||
;not a control x, control u?
|
||||
cpi ctlu! jnz notu ;skip if not
|
||||
;delete line (ctlu)
|
||||
call crlfp ;physical eol
|
||||
pop h ;discard starting position
|
||||
jmp pread ;to start all over
|
||||
notu:
|
||||
;not line delete, repeat line?
|
||||
cpi ctlr! jnz notr
|
||||
linelen:
|
||||
;repeat line, or compute line len (ctlh)
|
||||
;if compcol > 0
|
||||
push b! call crlfp ;save line length
|
||||
pop b! pop h! push h! push b
|
||||
;bcur, cmax active, beginning buff at HL
|
||||
rep0:
|
||||
mov a,b! ora a! jz rep1 ;count len to 00
|
||||
inx h! mov c,m ;next to print
|
||||
dcr b! push b! push h ;count length down
|
||||
call ctlout ;character echoed
|
||||
pop h! pop b ;recall remaining count
|
||||
jmp rep0 ;for the next character
|
||||
rep1:
|
||||
;end of repeat, recall lengths
|
||||
;original BC still remains pushed
|
||||
push h ;save next to fill
|
||||
lxi h,compcol! call ofsthl
|
||||
mov a,m! ora a ;>0 if computing length
|
||||
jz readn0 ;for another char if so
|
||||
;column position computed for ctlh
|
||||
lxi h,column! call ofsthl! sub m ;diff > 0
|
||||
lxi h,compcol! call ofsthl
|
||||
mov m,a ;count down below
|
||||
;move back compcol-column spaces
|
||||
backsp:
|
||||
;move back one more space
|
||||
call backup ;one space
|
||||
lxi h,compcol! call ofsthl! dcr m
|
||||
jnz backsp
|
||||
jmp readn0 ;for next character
|
||||
notr:
|
||||
;not a ctlr, place into buffer
|
||||
rdecho:
|
||||
inx h! mov m,a ;character filled to mem
|
||||
inr b ;blen = blen + 1
|
||||
rdech1:
|
||||
;look for a random control character
|
||||
push b! push h ;active values saved
|
||||
mov c,a ;ready to print
|
||||
call ctlout ;may be up-arrow C
|
||||
pop h! pop b! mov a,b ;len to A
|
||||
;are we at end of buffer?
|
||||
cmp c! jc readnx ;go for another if not
|
||||
readen:
|
||||
;end of read operation, store blen
|
||||
pop h! mov m,b ;M(current len) = B
|
||||
pop h ;discard buffer address
|
||||
mvi c,cr! jmp conout ;return carriage
|
||||
;ret
|
||||
;
|
||||
ldacolumn:
|
||||
lxi h,column! call ofsthl! mov a,m! ret
|
||||
|
||||
pbsymsg:
|
||||
db cr,lf,'Printer Busy.',cr,lf,0
|
||||
|
||||
abtmsg1:
|
||||
db cr,lf,'Abort ',0
|
||||
abtmsg2:
|
||||
db ' (Y/N) ?',0
|
||||
|
||||
atchmsg:
|
||||
db cr,lf,'Attach:',0
|
||||
|
||||
submsg:
|
||||
db cr,lf,'Terminate Submit ?',0
|
||||
|
||||
;
|
||||
; data areas
|
||||
;
|
||||
nmbcns equ 16
|
||||
|
||||
compcol:db 0 ;true if computing column position
|
||||
rept nmbcns-1
|
||||
db 0
|
||||
endm
|
||||
strtcol:db 0 ;starting column position after read
|
||||
rept nmbcns-1
|
||||
db 0
|
||||
endm
|
||||
column: db 0 ;column position
|
||||
rept nmbcns-1
|
||||
db 0
|
||||
endm
|
||||
kbchar: db 0 ;initial key char = 00
|
||||
rept nmbcns-1
|
||||
db 0
|
||||
endm
|
||||
listcp: db 0 ;listing toggle
|
||||
rept nmbcns-1
|
||||
db 0
|
||||
endm
|
||||
|
||||
kbproc: db 0 ;kb proc resident flag
|
||||
|
||||
;
|
||||
patch$size equ 80
|
||||
ds patch$size
|
||||
patch:
|
||||
org (((patch-base)+255) AND 0ff00h)-patch$size
|
||||
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
|
||||
|
||||
;
|
||||
; bios external jump table
|
||||
;
|
||||
bios equ $ ;base of the bios jump table
|
||||
bootf equ bios ;cold boot function
|
||||
wbootf equ bootf+3 ;warm boot function
|
||||
constf equ wbootf+3 ;console status function
|
||||
coninf equ constf+3 ;console input function
|
||||
conoutf equ coninf+3 ;console output function
|
||||
listf equ conoutf+3 ;list output function
|
||||
punchf equ listf+3 ;punch output function
|
||||
readerf equ punchf+3 ;reader input function
|
||||
homef equ readerf+3 ;disk home function
|
||||
seldskf equ homef+3 ;select disk function
|
||||
settrkf equ seldskf+3 ;set track function
|
||||
setsecf equ settrkf+3 ;set sector function
|
||||
setdmaf equ setsecf+3 ;set dma function
|
||||
readf equ setdmaf+3 ;read disk function
|
||||
writef equ readf+3 ;write disk function
|
||||
liststf equ writef+3 ;list status function
|
||||
sectran equ liststf+3 ;sector translate
|
||||
;
|
||||
; xios access table
|
||||
xiosms equ sectran+3 ;memory select / protect
|
||||
xiospl equ xiosms+3 ;device poll
|
||||
strclk equ xiospl+3 ;start clock
|
||||
stpclk equ strclk+3 ;stop clock
|
||||
exitr equ stpclk+3 ;exit critical region
|
||||
maxcns equ exitr+3 ;max console #
|
||||
syinitf equ maxcns+3 ;MP/M system initialization
|
||||
;
|
||||
end
|
||||
|
||||
241
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/DATAPG.ASM
Normal file
241
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/DATAPG.ASM
Normal 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
|
||||
|
||||
1142
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/DSPTCH.ASM
Normal file
1142
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/DSPTCH.ASM
Normal file
File diff suppressed because it is too large
Load Diff
295
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/FLAG.ASM
Normal file
295
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/FLAG.ASM
Normal 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
|
||||
|
||||
235
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/LST.ASM
Normal file
235
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/LST.ASM
Normal 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
|
||||
|
||||
326
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/MEMMGR.ASM
Normal file
326
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/MEMMGR.ASM
Normal 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
|
||||
534
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/MPM.ASM
Normal file
534
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/MPM.ASM
Normal 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
|
||||
|
||||
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/MPM.SYS
Normal file
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/MPM.SYS
Normal file
Binary file not shown.
45
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/PATCH.ASM
Normal file
45
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/PATCH.ASM
Normal 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
|
||||
|
||||
1210
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/QUEUE.ASM
Normal file
1210
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/QUEUE.ASM
Normal file
File diff suppressed because it is too large
Load Diff
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/RESBDOS.SPR
Normal file
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/RESBDOS.SPR
Normal file
Binary file not shown.
772
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/RESBDOS1.ASM
Normal file
772
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/RESBDOS1.ASM
Normal file
@@ -0,0 +1,772 @@
|
||||
title 'MP/M II V2.0 Resident Portion of Banked BDOS'
|
||||
cseg
|
||||
;***************************************************************
|
||||
;***************************************************************
|
||||
;** **
|
||||
;** B a s i c D i s k O p e r a t i n g S y s t e m **
|
||||
;** **
|
||||
;** R e s i d e n t P o r t i o n - B a n k e d B D O S **
|
||||
;** **
|
||||
;***************************************************************
|
||||
;***************************************************************
|
||||
|
||||
;/*
|
||||
; Copyright (C) 1978,1979,1980,1981
|
||||
; Digital Research
|
||||
; P.O. Box 579
|
||||
; Pacific Grove, CA 93950
|
||||
;
|
||||
; Revised:
|
||||
; 14 Sept 81 by David K. Brown
|
||||
;*/
|
||||
;
|
||||
org 0000h
|
||||
base equ $
|
||||
;
|
||||
; XDOS jump table below BDOS origin
|
||||
pdisp equ $-3
|
||||
xdos equ pdisp-3
|
||||
|
||||
; equates for non graphic characters
|
||||
ctlc equ 03h ;control c, abort
|
||||
ctld equ 04h ;control d, detach
|
||||
ctle equ 05h ;physical eol
|
||||
ctlh equ 08h ;backspace
|
||||
ctlp equ 10h ;prnt toggle
|
||||
ctlq equ 11h ;prnt owner toggle
|
||||
ctlr equ 12h ;repeat line
|
||||
ctls equ 13h ;stop/start screen
|
||||
ctlu equ 15h ;line delete
|
||||
ctlx equ 18h ;=ctl-u
|
||||
ctlz equ 1ah ;end of file
|
||||
rubout equ 7fh ;char delete
|
||||
tab equ 09h ;tab char
|
||||
cr equ 0dh ;carriage return
|
||||
lf equ 0ah ;line feed
|
||||
ctl equ 5eh ;up arrow
|
||||
;
|
||||
; XDOS call equates
|
||||
makeque equ 134
|
||||
readque equ 137
|
||||
writeque equ 139
|
||||
dispatch equ 142
|
||||
terminate equ 143
|
||||
setprior equ 145
|
||||
attach equ 146
|
||||
detach equ 147
|
||||
asgncns equ 149
|
||||
sendcli equ 150
|
||||
ATTLST EQU 158
|
||||
DETLST EQU 159
|
||||
;
|
||||
; Process Descriptor Offsets
|
||||
pname equ 6
|
||||
console equ 14
|
||||
memseg equ 15
|
||||
disksetDMA equ 20
|
||||
diskselect equ 22
|
||||
searcha equ 26
|
||||
MULT$CNT EQU 50
|
||||
;
|
||||
; System Data Page Offsets
|
||||
userstackflag equ 3
|
||||
brkvctr equ 48
|
||||
usrstkregion equ 80
|
||||
LISTCPADR EQU 126
|
||||
;
|
||||
; MP/M Data Page Offsets
|
||||
rlros equ 5
|
||||
cnsatt equ 20
|
||||
msegtbl equ 150
|
||||
LSTATT EQU 599
|
||||
;
|
||||
;*****
|
||||
;
|
||||
; enter here from the user's program with function number
|
||||
; in c, and information address in d,e
|
||||
jmp xbdos ;to xbdos handler
|
||||
jmp bios ;to bios jump table base address
|
||||
JMP SYINIT
|
||||
JMP REMOVE$FILES
|
||||
JMP SWITCH$USER
|
||||
JMP SWITCH$ZERO
|
||||
XREMOVE$FILES:
|
||||
JMP $-$
|
||||
;
|
||||
; bdos/xdos initialization code
|
||||
syinit:
|
||||
;HL = sysdat page address
|
||||
shld sysdat
|
||||
mvi l,14! lxi b,bnkbdos+1
|
||||
mov a,m! mov d,a! stax b
|
||||
xchg! mvi l,3
|
||||
shld bnkbdosinit
|
||||
MVI L,6! SHLD XREMOVE$FILES+1
|
||||
MVI L,9! LXI D,COMMON$DMA
|
||||
MOV M,E! INX H! MOV M,D! INX H
|
||||
XCHG! LHLD SYSDAT! XCHG
|
||||
MOV M,E! INX H! MOV M,D
|
||||
INX H! PUSH H
|
||||
bnkbdosinit equ $+1
|
||||
call $-$ ;initialize the banked bdos
|
||||
jmp syinitcontd
|
||||
|
||||
extjmptbl:
|
||||
jmp extreboot
|
||||
jmp rlr
|
||||
jmp getrlradr
|
||||
jmp dsplynm
|
||||
jmp xprint
|
||||
jmp xcrlf
|
||||
jmp conoutx
|
||||
jmp xgetmemseg
|
||||
;
|
||||
syinitcontd:
|
||||
lhld sysdat! mov c,h
|
||||
MVI L,LISTCPADR! LXI D,LISTCP ;PUT .LISTCP IN SYS DTA PG
|
||||
MOV M,E! INX H! MOV M,D
|
||||
mvi l,252! mov a,m! inx h! mov h,m
|
||||
mov l,a! lxi d,0005! dad d! shld rlradr
|
||||
lxi d,0091h! dad d! shld msegtadr
|
||||
mov h,c! mvi l,userstackflag
|
||||
mov a,m! sta usrstkflg
|
||||
dcr l! mov l,m! mvi h,0 ;HL = RST #
|
||||
mov c,l ;put RST # into C for use by SYSINITF
|
||||
dad h! dad h! dad h ;HL = breakpoint address
|
||||
mvi m,0C3h! inx h ;store jump to brkpt hndlr
|
||||
lxi d,brkpt ;DE = brkpt entry address
|
||||
mov m,e! inx h! mov m,d
|
||||
;initialize jmp at 0000H to fake BIOS jump table
|
||||
mvi a,0C3H! sta 0000H
|
||||
lxi h,drctjmptbl! shld 0001H
|
||||
;execute the XIOS SYSINIT function
|
||||
call syinitf
|
||||
ei ;in case it was not done in sysinit
|
||||
;create disk mutual exclusion queue
|
||||
mvi c,makeque! lxi d,diskcqcb! call xdos
|
||||
mvi c,writeque! lxi d,MXDisk! call xdos
|
||||
;create printer mutual exclusion queue
|
||||
mvi c,makeque! lxi d,listcqcb! call xdos
|
||||
;INHIBIT MXList EXCLUSION
|
||||
LXI H,0FFFFH! SHLD LISTNMSGS! SHLD LISTMSGCNT
|
||||
;get the directory buffer address
|
||||
mvi c,0! call seldskf
|
||||
lxi d,8! dad d! mov e,m! inx h! mov d,m
|
||||
JMP SYINITEXTRA
|
||||
;
|
||||
CoNm:
|
||||
db ' COPYRIGHT (C) 1981,'
|
||||
db ' DIGITAL RESEARCH '
|
||||
Serial:
|
||||
db '654321'
|
||||
|
||||
lstack equ Serial+4
|
||||
|
||||
entsp equ lstack ;BDOS entry stack pointer
|
||||
|
||||
dtbl equ $
|
||||
org ((dtbl-base)+0ffh) and 0ff00h
|
||||
; *** this table is page aligned
|
||||
; BIOS jump table for *.COM file support
|
||||
jmp bootf
|
||||
drctjmptbl:
|
||||
jmp wbootf
|
||||
jmp bconst
|
||||
jmp bconin
|
||||
jmp bconout
|
||||
jmp blist
|
||||
;
|
||||
; Support for direct BIOS console & list device I/O
|
||||
;
|
||||
SYINITEXTRA:
|
||||
xchg! shld dirbufa
|
||||
XCHG! POP H! MOV M,E! INX H! MOV M,D
|
||||
ret
|
||||
|
||||
bconst: mvi e,0feh! mvi c,6! jmp xbdos
|
||||
|
||||
bconin: mvi c,3! jmp xbdos
|
||||
|
||||
bconout:mov e,c! mvi c,4! jmp xbdos
|
||||
|
||||
blist: mov e,c! mvi c,5! jmp xbdos
|
||||
|
||||
; Disk and List data structures
|
||||
diskcqcb:
|
||||
;disk mutual exclusion circular que ctl blk
|
||||
dw $-$ ;link
|
||||
db 'MXDisk ' ;name
|
||||
dw 0 ;message length
|
||||
dw 1 ;number of messages
|
||||
dw $-$ ;dq process head
|
||||
dw $-$ ;nq process head
|
||||
dw $-$ ;msgin
|
||||
dw $-$ ;msgout
|
||||
dw $-$ ;msgcnt
|
||||
dw $-$ ;owner Process descriptor adr
|
||||
MXDisk:
|
||||
;disk user queue control block
|
||||
dw diskcqcb
|
||||
|
||||
listcqcb:
|
||||
;list mutual exclusion circular queue control block
|
||||
dw $-$ ;link
|
||||
db 'MXList ' ;name
|
||||
dw 0 ;message length
|
||||
LISTNMSGS:
|
||||
dw 0FFFFH ;number of messages
|
||||
dw $-$ ;dq process head
|
||||
dw $-$ ;nq process head
|
||||
dw $-$ ;msgin
|
||||
dw $-$ ;msgout
|
||||
LISTMSGCNT:
|
||||
dw 0FFFFH ;msgcnt
|
||||
dw listcqcb-4 ;owner Process Descriptor adr
|
||||
|
||||
xbdos: ;arrive here from user programs
|
||||
mov a,c! ora c ; test function code
|
||||
jz reboot ;zero terminates calling process
|
||||
jp notXDOS ;jump if a BDOS call
|
||||
|
||||
call XDOS ;func >= 128 is a XDOS call
|
||||
mov a,l ;XDOS returns address put low byte into A
|
||||
ret
|
||||
|
||||
badfunc:
|
||||
;invalid function code
|
||||
lxi h,0ffffh! mov a,l! ret
|
||||
|
||||
brkpt: ;debugger breakpoint entry
|
||||
di! shld svdhl! pop h! shld svdrt! push psw
|
||||
;set HL = RLR
|
||||
lhld rlradr! mov a,m! inx h! mov h,m! mov l,a
|
||||
mvi a,memseg! add l! mov l,a
|
||||
mvi a,0! adc h! mov h,a ;HL = .pd.memseg
|
||||
mov a,m! add a! adi brkvctr
|
||||
lhld sysdat! mov l,a ;HL = brkpt hndlr address
|
||||
mov a,m! inx h! mov h,m! mov l,a
|
||||
shld jmptobrk+1
|
||||
pop psw! lhld svdrt! push h! lhld svdhl
|
||||
jmptobrk:
|
||||
jmp $-$
|
||||
|
||||
restore:
|
||||
;restore user stack
|
||||
xchg! pop h! sphl! xchg ;get user stack pointer
|
||||
ret
|
||||
|
||||
tst$stk$swap:
|
||||
lda usrstkflg! ora a
|
||||
rz ; if flag set then change stack
|
||||
; get memory segment index
|
||||
lhld rlradr! mov a,m! inx h
|
||||
mov h,m! mov l,a
|
||||
mvi a,pname+2! add l! mov l,a
|
||||
mvi a,0! adc h! mov h,a
|
||||
mov a,m ; A = pd.name(2)
|
||||
ani 80h! jz tst$stk$swap1 ;no stk chg if name(2) "on"
|
||||
xra a! ret
|
||||
tst$stk$swap1:
|
||||
mvi a,memseg-(pname+2)! add l! mov l,a
|
||||
mvi a,0! adc h! mov h,a
|
||||
mov a,m ; A = memory segment index
|
||||
ora a! rz
|
||||
inr a! ret ;no stack change if system process call
|
||||
|
||||
notXDOS:
|
||||
call tst$stk$swap! jz BDOS
|
||||
dcr a! dcr a! add a! adi usrstkregion
|
||||
lhld sysdat! mov l,a
|
||||
mov a,d! mov b,e ;save DE in AB
|
||||
mov e,m! inx h! mov d,m
|
||||
lxi h,0! dad sp
|
||||
xchg! sphl! push d ;set & save user SP
|
||||
lxi h,restore! push h ; setup return address to restore stack
|
||||
mov d,a! mov e,b ;restore DE
|
||||
|
||||
BDOS:
|
||||
mov a,c! cpi diskf! jc cnsfunc ;jump if not disk i/o
|
||||
cpi 26! jnz BDOS2
|
||||
call rlr! mvi a,disksetDMA! add l! mov l,a
|
||||
mvi a,0! adc h! mov h,a
|
||||
inx d! mov a,e! ora d
|
||||
jz BDOS1
|
||||
dcx d
|
||||
BDOS1:
|
||||
mov m,e! inx h! mov m,d
|
||||
ret
|
||||
BDOS2:
|
||||
cpi ndf+1! jc OKdf ;func <= ndf
|
||||
cpi 100! jc badfunc ;ndf < func < 100
|
||||
cpi nxdf+1! jnc badfunc ;func > nxdf
|
||||
OKdf:
|
||||
cpi chainf! jz chain
|
||||
|
||||
push d! push b ;save info & func
|
||||
|
||||
CALL TSTLIVEKBD ;TST FOR PD.NAME(3)' OFF
|
||||
cz func11 ;simulate 'live console' with kbd status chk
|
||||
|
||||
;if not suppressing abort then set ctlc flg off, in BDOS on
|
||||
call rlr! lxi d,(pname+7)! dad d
|
||||
mov a,m! ani 80h! jnz noinbdosflg
|
||||
dcx h! mov a,m! ani 7fh! mov m,a
|
||||
dcx h! dcx h! dcx h! dcx h! dcx h
|
||||
;DO NOT ALLOW ABORT WHEN IN BDOS
|
||||
MOV A,M! ORI 80H! MOV M,A
|
||||
noinbdosflg:
|
||||
;obtain entry by getting disk mutual exclusion message
|
||||
mvi c,readque! lxi d,MXDisk! call XDOS
|
||||
|
||||
;setup & jump to banked bdos
|
||||
pop b! pop d ;restore info & func
|
||||
lxi h,0! dad sp! shld entsp
|
||||
lxi sp,lstack
|
||||
;perform the required buffer transfers from
|
||||
; the user in common memory
|
||||
mov a,c! cpi 17 ;search ?
|
||||
jnz skipsrch
|
||||
call rlr! push d! lxi d,searcha! dad d! pop d
|
||||
mov m,e! inx h! mov m,d
|
||||
jmp skipsrchnxt
|
||||
skipsrch:
|
||||
cpi 18 ;search next ?
|
||||
jnz skipsrchnxt
|
||||
call rlr! lxi d,searcha! dad d
|
||||
mov e,m! inx h! mov d,m
|
||||
skipsrchnxt:
|
||||
lxi h,dfctbl-12
|
||||
mov a,c! cpi 100! jc normalCPM
|
||||
lxi h,xdfctbl-100
|
||||
normalCPM:
|
||||
mvi b,0! dad b! mov a,m
|
||||
|
||||
;***** SAVE DFTBL ITEM, INFO, & FUNCTION *****
|
||||
|
||||
MOV B,A! PUSH B! PUSH D
|
||||
|
||||
rar! jc cpydmain
|
||||
RAR! JC CPYCDMAIN
|
||||
rar! jc cpyfcbin
|
||||
jmp nocpyin
|
||||
CPYCDMAIN:
|
||||
LXI H,COMMON$DMA! PUSH H! MVI B,16! PUSH B
|
||||
JMP CPYDMAIN1
|
||||
cpydmain:
|
||||
LHLD DIRBUFA! PUSH H! MVI B,128! PUSH B
|
||||
CPYDMAIN1:
|
||||
CALL SET$DMABUFA
|
||||
XCHG! POP B! POP H
|
||||
call move
|
||||
pop d! push d
|
||||
cpyfcbin:
|
||||
lxi h,commonfcb! mvi b,36
|
||||
call move
|
||||
lxi d,commonfcb
|
||||
|
||||
nocpyin:
|
||||
MOV A,C! MVI B,0! CPI 41! JZ SHELL
|
||||
PUSH D! CALL GET$MULT$CNT$ADD! POP D
|
||||
MOV A,M! DCR A! JZ BDOSE2
|
||||
LXI H,MULT$FXS! INR B
|
||||
BDOSE1:
|
||||
MOV A,M! ORA A! JZ BDOSE2
|
||||
CMP C! JZ SHELL
|
||||
INX H! JMP BDOSE1
|
||||
BDOSE2:
|
||||
|
||||
CALL BANK$BDOS
|
||||
|
||||
BDOSE3:
|
||||
POP D ;RESTORE FCB ADDRESS
|
||||
POP B! MOV A,B ;RESTORE DFCTBL BYTE & FUNCTION #
|
||||
ral! jc dmacpyout
|
||||
RAL! JC CDMACPYOUT
|
||||
COPYOUT:
|
||||
lxi h,commonfcb! xchg! mvi b,33
|
||||
ral! jc cpyoutcmn
|
||||
ral! jnc nocpyout
|
||||
MOV A,C! CPI 105! MVI B,4! JZ CPYOUTCMN
|
||||
CPI 107! MVI B,6! JZ CPYOUTCMN
|
||||
mvi b,36! CPI 15! JZ CPYOUT1
|
||||
CPI 22! JNZ CPYOUTCMN
|
||||
CPYOUT1:
|
||||
DCR B! PUSH H! LXI H,12! DAD D! MOV A,M! POP H
|
||||
ANI 80H! JNZ CPYOUTCMN
|
||||
MVI B,33! jmp cpyoutcmn
|
||||
|
||||
CDMACPYOUT:
|
||||
PUSH D ;SAVE FCB ADDRESS FOR COPYOUT
|
||||
CALL SET$DMA$BUFA
|
||||
MVI B,3! CALL COPY$CDMA$OUT
|
||||
POP D! JMP NOCPYOUT
|
||||
dmacpyout:
|
||||
lhld dirbufa! xchg! lhld dmabufa! mvi b,128
|
||||
cpyoutcmn:
|
||||
call move
|
||||
|
||||
nocpyout:
|
||||
lhld entsp! sphl ;user stack restored
|
||||
RELEASE:
|
||||
lhld aret
|
||||
push h
|
||||
;release disk mutual exclusion message
|
||||
mvi c,writeque! lxi d,MXDisk! call XDOS
|
||||
|
||||
;if in BDOS flag on, check for abt spc proc flg
|
||||
call rlr! lxi d,(pname+1)! dad d
|
||||
mov a,m! ani 7fh! cmp m! mov m,a
|
||||
jz funcdone
|
||||
inx h! inx h! inx h! inx h! inx h
|
||||
mov a,m! ani 7fh! cmp m! mov m,a
|
||||
CNZ REBOOT
|
||||
|
||||
funcdone:
|
||||
;function done
|
||||
pop h! mov a,l! mov b,h ;BA = HL = aret
|
||||
ret
|
||||
|
||||
BANK$BDOS:
|
||||
push d! push b ;save info & func
|
||||
call getmemseg! sta usermemseg
|
||||
xra a ;set memseg to 0 (memseg #0 must be bank zero)
|
||||
call extbnkswt
|
||||
pop b! pop d
|
||||
|
||||
bnkbdos equ $+1
|
||||
call $-$
|
||||
|
||||
shld aret
|
||||
call getmemseg! lda usermemseg
|
||||
jmp extbnkswt ;ret
|
||||
|
||||
COPY$CDMA$OUT: ;B = 2 | 3
|
||||
LHLD DMABUFA! LXI D,COMMON$DMA
|
||||
;FALLS THROUGH TO MOVE
|
||||
|
||||
move:
|
||||
;move data length of B from source DE to
|
||||
;destination HL
|
||||
inr b ;in case of length=0
|
||||
move0:
|
||||
dcr b! rz
|
||||
ldax d! mov m,a
|
||||
inx d! inx h
|
||||
jmp move0
|
||||
|
||||
MULT$FXS: DB 20,21,33,34,40,0
|
||||
|
||||
;
|
||||
getrlradr:
|
||||
lhld rlradr! ret
|
||||
|
||||
rlr:
|
||||
;set HL = contents of Ready List Root
|
||||
lhld rlradr! mov a,m! inx h! mov h,m! mov l,a
|
||||
ret
|
||||
;
|
||||
GET$MULT$CNT$ADD:
|
||||
CALL RLR! LXI D,MULT$CNT! DAD D! RET
|
||||
;
|
||||
xgetmemseg:
|
||||
lda usermemseg
|
||||
ret
|
||||
;
|
||||
getmemseg:
|
||||
;set A = memory segment #
|
||||
call rlr ;HL = Ready List Root
|
||||
mvi a,memseg! add l! mov l,a
|
||||
mvi a,0! adc h! mov h,a ;HL = .pd.memseg
|
||||
mov a,m! ret
|
||||
;
|
||||
REMOVE$FILES:
|
||||
CALL GETMEMSEG! PUSH A! XRA A
|
||||
PUSH B! CALL EXTBNKSWT! POP B
|
||||
CALL XREMOVE$FILES
|
||||
CALL GETMEMSEG! POP A! JMP EXTBNKSWT
|
||||
|
||||
;
|
||||
;
|
||||
; intercept bios boot to switch banks
|
||||
|
||||
extreboot:
|
||||
call getmemseg! lda usermemseg
|
||||
call extbnkswt
|
||||
lxi h,0ffffh! shld aret
|
||||
LHLD ENTSP! SPHL ;RESTORE USER'S STACK
|
||||
CALL RELEASE ;RELEASE MXDisk
|
||||
LDA USERMEMSEG
|
||||
ORA A! RZ! INR A! RZ ;DON'T TERMINATE IF SYS PROCESS
|
||||
xreboot:
|
||||
call tst$stk$swap! jz reboot
|
||||
lxi h,0! dad sp! lxi d,3fh! dad d
|
||||
mov a,l! ani 0c0h! mov l,a! dcx h
|
||||
mov d,m! dcx h! mov e,m! xchg! sphl
|
||||
reboot:
|
||||
call rlr! lxi d,memseg! dad d
|
||||
mov a,m! ora a! rz
|
||||
inr a! rz
|
||||
dcx h! dcx h
|
||||
mov a,m! ani 80h! rnz
|
||||
;terminate the calling process
|
||||
mvi c,terminate! lxi d,0
|
||||
jmp xdos
|
||||
|
||||
SWITCH$USER:
|
||||
call getmemseg! lda usermemseg
|
||||
jmp extbnkswt
|
||||
|
||||
SWITCH$ZERO:
|
||||
call getmemseg! xra a
|
||||
;call extbnkswt
|
||||
;ret
|
||||
|
||||
extbnkswt:
|
||||
di
|
||||
mov m,a! inr a! jz extbnkswt1 ;return if system process
|
||||
dcr a! add a! add a! lhld msegtadr
|
||||
add l! mov c,a
|
||||
mvi a,0! adc h! mov b,a
|
||||
call xiosms
|
||||
extbnkswt1:
|
||||
ei
|
||||
ret
|
||||
|
||||
;
|
||||
; Local Data Segment
|
||||
msegtadr: ds 2 ;address of memory segment table
|
||||
rlradr: ds 2 ;address of Ready List Root
|
||||
sysdat: ds 2 ;address of system data page
|
||||
usrstkflg: ds 1 ;user stack flag, 0ffh=users stack
|
||||
svdhl: ds 2 ;saved HL at breakpoint entry
|
||||
svdrt: ds 2 ;saved return address at breakpoint entry
|
||||
;
|
||||
dirbufa: ds 2 ;directory buffer address
|
||||
dmabufa: ds 2 ;dma buffer address
|
||||
usermemseg: ds 1 ;saved user mem seg index
|
||||
aret: ds 2 ;address value to return
|
||||
|
||||
commonfcb:
|
||||
ds 36 ;fcb copy in common memory
|
||||
;
|
||||
COMMON$DMA:
|
||||
DS 16 ;LOCAL DMA FOR PASSWORDS, ETC.
|
||||
;
|
||||
; Disk Function Copy Table
|
||||
;
|
||||
dmain equ 00000001b ;dma copy on entry
|
||||
CDMAIN EQU 00000010B ;COPY 1ST 16 BYTES OF DMA TO
|
||||
fcbin equ 00000100b ;fcb copy on entry
|
||||
;COMMON$DMA ON ENTRY
|
||||
dmaout equ 10000000b ;dma copy on exit
|
||||
CDMAOUT EQU 01000000B ;COPY 1ST 2 | 3 BYTES OF COMMON$DMA
|
||||
;TO DMA ON EXIT
|
||||
;2 IF UNLOCKED OPEN
|
||||
;3 IF GET DISK FREE SPACE
|
||||
fcbout equ 00100000b ;fcb copy on exit
|
||||
pfcbout equ 00010000b ;random fcb copy on exit
|
||||
dfctbl:
|
||||
db 0 ; 12=return version #
|
||||
db 0 ; 13=reset disk system
|
||||
db 0 ; 14=select disk
|
||||
db fcbin+PFCBOUT+CDMAIN ; 15=open file
|
||||
db fcbin+fcbout ; 16=close file
|
||||
db fcbin+dmain+dmaout ; 17=search first
|
||||
db fcbin+dmain+dmaout ; 18=search next
|
||||
db fcbin+CDMAIN ; 19=delete file
|
||||
db fcbin+fcbout ; 20=read sequential
|
||||
db fcbin+fcbout ; 21=write sequential
|
||||
db fcbin+PFCBOUT+CDMAIN ; 22=make file
|
||||
db fcbin+CDMAIN ; 23=rename file
|
||||
db 0 ; 24=return login vector
|
||||
db 0 ; 25=return current disk
|
||||
db 0 ; 26=set DMA address
|
||||
db 0 ; 27=get alloc address
|
||||
db 0 ; 28=write protect disk
|
||||
db 0 ; 29=get R/O vector
|
||||
db fcbin+CDMAIN ; 30=set file attributes
|
||||
db 0 ; 31=get disk param addr
|
||||
db 0 ; 32=get/set user code
|
||||
db fcbin+fcbout ; 33=read random
|
||||
db fcbin+fcbout ; 34=write random
|
||||
db fcbin+pfcbout ; 35=compute file size
|
||||
db fcbin+pfcbout ; 36=set random record
|
||||
db 0 ; 37=drive reset
|
||||
db 0 ; 38=access drive
|
||||
db 0 ; 39=free drive
|
||||
db fcbin+fcbout ; 40=write random w/ zero fill
|
||||
|
||||
db fcbin+fcbout ; 41=test & write record
|
||||
db fcbin+fcbout+CDMAIN ; 42=record lock
|
||||
db fcbin+fcbout+CDMAIN ; 43=record unlock
|
||||
db 0 ; 44=set multi-sector count
|
||||
db 0 ; 45=set BDOS error mode
|
||||
db CDMAOUT ; 46=get disk free space
|
||||
db fcbin ; 47=chain to program
|
||||
db 0 ; 48=flush buffers
|
||||
db 0 ; 49=CCP chain query (CP/M)
|
||||
db 0 ; 50=direct BIOS call (CP/M)
|
||||
ndf equ ($-dfctbl)+12
|
||||
|
||||
xdfctbl:
|
||||
db fcbin+CDMAIN ; 100=set directory label
|
||||
db 0 ; 101=return directory label data
|
||||
db fcbin+fcbout+CDMAIN ; 102=read file xfcb
|
||||
db fcbin+CDMAIN ; 103=write or update file xfcb
|
||||
db fcbin ; 104=set current date and time
|
||||
db fcbin+pfcbout ; 105=get current date and time
|
||||
db fcbin ; 106=set default password
|
||||
db fcbin+pfcbout ; 107=return serial number
|
||||
nxdf equ ($-xdfctbl)+100
|
||||
|
||||
get$dma$add:
|
||||
call rlr! lxi d,disksetdma! dad d! ret
|
||||
|
||||
set$dmabufa:
|
||||
call get$dma$add
|
||||
mov e,m! inx h! mov d,m
|
||||
xchg! shld dmabufa! ret
|
||||
|
||||
shell:
|
||||
sta fx! call set$dmabufa
|
||||
shld shell$dma
|
||||
call get$mult$cnt$add
|
||||
mov a,m! sta shell$cnt
|
||||
lxi h,shell$rtn! push h! push b
|
||||
call save$rr! call save$dma
|
||||
pop psw! ora a! jz tst$wrt
|
||||
jmp mult$io ; HL = .DMA
|
||||
;
|
||||
shell$cnt: db 0
|
||||
fx: db 0
|
||||
shell$rr: db 0,0,0
|
||||
;
|
||||
hold$dma: dw 0
|
||||
shell$dma: dw 0
|
||||
;
|
||||
cbdos:
|
||||
lda fx! mov c,a
|
||||
cbdos1:
|
||||
lxi d,common$fcb! call bank$bdos! lda aret! ret
|
||||
;
|
||||
adv$dma:
|
||||
lhld shell$dma
|
||||
lxi d,80h! dad d! shld shell$dma
|
||||
;
|
||||
set$process$dma:
|
||||
push h
|
||||
call get$dma$add! pop d! mov m,e! inx h! mov m,d
|
||||
ret
|
||||
;
|
||||
save$dma:
|
||||
lhld shell$dma! shld hold$dma! ret
|
||||
;
|
||||
reset$dma:
|
||||
lhld hold$dma! jmp set$process$dma
|
||||
;
|
||||
shell$err:
|
||||
lhld aret
|
||||
lda shell$cnt! pop b! sub b
|
||||
add a! add a! add a! add a
|
||||
ora h! mov h,a! ret
|
||||
;
|
||||
shell$rtn:
|
||||
shld aret! lda fx! cpi 33! cnc reset$rr
|
||||
call reset$dma! jmp bdose3
|
||||
;
|
||||
incr$rr:
|
||||
call get$rra
|
||||
inr m! rnz
|
||||
inx h! inr m! rnz
|
||||
inx h! inr m! ret
|
||||
;
|
||||
save$rr:
|
||||
call save$rr2! xchg
|
||||
save$rr1:
|
||||
mvi b,3! jmp move ;ret
|
||||
save$rr2:
|
||||
call get$rra! lxi d,shell$rr! ret
|
||||
;
|
||||
reset$rr:
|
||||
call save$rr2! jmp save$rr1
|
||||
;
|
||||
tst$wrt:
|
||||
lhld dirbufa! xchg
|
||||
mvi c,26! call bank$bdos
|
||||
lda shell$cnt
|
||||
tst$wrt1:
|
||||
push a! mvi c,33! call cbdos1
|
||||
ora a! jnz shell$err
|
||||
call compare$recs
|
||||
call incr$rr
|
||||
lxi d,80h! lhld shell$dma! dad d! shld shell$dma
|
||||
pop a! dcr a! jnz tst$wrt1
|
||||
call set$process$dma
|
||||
call reset$rr
|
||||
mvi a,34! sta fx ; jmp mult$io
|
||||
;
|
||||
mult$io:
|
||||
lda shell$cnt
|
||||
mult$io1:
|
||||
push a! call cbdos
|
||||
ora a! jnz shell$err
|
||||
lda fx! cpi 33! cnc incr$rr
|
||||
call adv$dma
|
||||
pop a! dcr a! jnz mult$io1
|
||||
lxi h,0
|
||||
ret
|
||||
;
|
||||
compare$recs:
|
||||
lhld shell$dma! xchg! lhld dirbufa
|
||||
mvi c,128
|
||||
call compare! rz
|
||||
pop h! lxi h,0007! jmp shell$err
|
||||
;
|
||||
compare:
|
||||
ldax d! cmp m! rnz
|
||||
inx h! inx d! dcr c! rz
|
||||
jmp compare
|
||||
;
|
||||
get$rra:
|
||||
lxi h,common$fcb! lxi d,33! dad d! ret
|
||||
|
||||
;******************************************************
|
||||
;** **
|
||||
;** C h a i n **
|
||||
;** **
|
||||
;******************************************************
|
||||
;
|
||||
chainf equ 47
|
||||
|
||||
chain:
|
||||
call getmemseg! lhld rlradr
|
||||
lxi b,msegtbl-rlros! dad b
|
||||
add a! add a! mov e,a! mvi d,0! dad d
|
||||
mov h,m! mvi l,5ch
|
||||
push h! inx h! mvi c,8! lxi d,clipdname
|
||||
moveclipdname:
|
||||
ldax d! mov m,a! inx d! inx h
|
||||
dcr c! jnz moveclipdname
|
||||
mvi m,0
|
||||
;set no user sys stacks
|
||||
call rlr! lxi b,pname+2! dad b
|
||||
mov a,m! ori 80h! mov m,a
|
||||
lxi b,console-(pname+2)! dad b! mov a,m
|
||||
pop d! push d! stax d! mvi e,7dh! stax d
|
||||
lxi b,diskselect-console! dad b
|
||||
dcx d! mov a,m! stax d
|
||||
inx d! inx d! xra a! stax d! inx d
|
||||
call getmemseg! stax d;
|
||||
;assign the console to the cli
|
||||
mvi c,asgncns! pop d! push d! call xdos
|
||||
;raise process priority
|
||||
mvi c,setprior! mvi e,0! call xdos
|
||||
;send special form of send cli command
|
||||
mvi c,sendcli! pop d! mvi e,7ch! call xdos
|
||||
;terminate the calling process
|
||||
mvi c,terminate! lxi d,0ff00h! jmp xdos
|
||||
|
||||
clipdname:
|
||||
db 'cli '
|
||||
|
||||
|
||||
160
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/RLSDEV.ASM
Normal file
160
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/RLSDEV.ASM
Normal 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
|
||||
|
||||
117
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/RLSMX.ASM
Normal file
117
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/RLSMX.ASM
Normal 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
|
||||
|
||||
450
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/TH.ASM
Normal file
450
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/TH.ASM
Normal 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
|
||||
|
||||
180
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/TICK.ASM
Normal file
180
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/TICK.ASM
Normal 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
|
||||
|
||||
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/TMP.SPR
Normal file
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/TMP.SPR
Normal file
Binary file not shown.
735
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/TMPSUB.ASM
Normal file
735
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/TMPSUB.ASM
Normal 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
|
||||
|
||||
69
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/VER.ASM
Normal file
69
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/VER.ASM
Normal 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
|
||||
|
||||
1284
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS.ASM
Normal file
1284
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS.ASM
Normal file
File diff suppressed because it is too large
Load Diff
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS.SPR
Normal file
BIN
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS.SPR
Normal file
Binary file not shown.
82
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS1.BAK
Normal file
82
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS1.BAK
Normal file
@@ -0,0 +1,82 @@
|
||||
ren tmp.rps=tmp.spr
|
||||
ren xdos.rps=xdos.spr
|
||||
ren bnkxdos.rps=bnkxdos.spr
|
||||
pip a:=e:*.asm
|
||||
era xdos*.lib
|
||||
rmac queue
|
||||
xref queue
|
||||
vax queue.xrf $$stan
|
||||
rmac dsptch
|
||||
xref dsptch
|
||||
vax dsptch.xrf $$stan
|
||||
rmac th
|
||||
xref th
|
||||
vax th.xrf $$stan
|
||||
rmac lst
|
||||
xref lst
|
||||
vax lst.xrf $$stan
|
||||
rmac xdos
|
||||
xref xdos
|
||||
vax xdos.xrf $$stan
|
||||
rmac memmgr
|
||||
xref memmgr
|
||||
vax memmgr.xrf $$stan
|
||||
rmac flag
|
||||
xref flag
|
||||
vax flag.xrf $$stan
|
||||
lib xdos1.lib=xdos.rel,dsptch.rel,queue.rel,flag.rel,memmgr.rel,th.rel,lst.rel
|
||||
rmac cli
|
||||
xref cli
|
||||
vax cli.xrf $$stan
|
||||
rmac tick
|
||||
xref tick
|
||||
vax tick.xrf $$stan
|
||||
rmac clock
|
||||
xref clock
|
||||
vax clock.xrf $$stan
|
||||
rmac attach
|
||||
xref attach
|
||||
vax attach.xrf $$stan
|
||||
lib xdos2.lib=cli.rel,tick.rel,clock.rel,attach.rel
|
||||
era *.sym
|
||||
rmac datapg
|
||||
xref datapg
|
||||
vax datapg.xrf $$stan
|
||||
rmac mpm
|
||||
xref mpm
|
||||
vax mpm.xrf $$stan
|
||||
rmac rlsmx
|
||||
xref rlsmx
|
||||
vax rlsmx.xrf $$stan
|
||||
rmac rlsdev
|
||||
xref rlsdev
|
||||
vax rlsdev.xrf $$stan
|
||||
lib xdos3.lib=datapg.rel,mpm.rel,rlsmx.rel,rlsdev.rel
|
||||
era *.sym
|
||||
rmac ver
|
||||
xref ver
|
||||
vax ver.xrf $$stan
|
||||
rmac clbdos
|
||||
xref clbdos
|
||||
vax clbdos.xrf $$stan
|
||||
rmac xdosif
|
||||
xref xdosif
|
||||
vax xdosif.xrf $$stan
|
||||
rmac patch
|
||||
xref patch
|
||||
vax patch.xrf $$stan
|
||||
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
|
||||
link tmpsub[os]
|
||||
era *.sym
|
||||
ren tmp.spr=tmpsub.spr
|
||||
rmac bnkxdos
|
||||
xref bnkxdos
|
||||
vax bnkxdos.xrf $$stan
|
||||
link bnkxdos[os]
|
||||
era *.sym
|
||||
submit xdos2
|
||||
|
||||
83
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS1.SUB
Normal file
83
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS1.SUB
Normal file
@@ -0,0 +1,83 @@
|
||||
ren tmp.rps=tmp.spr
|
||||
ren xdos.rps=xdos.spr
|
||||
ren bnkxdos.rps=bnkxdos.spr
|
||||
pip a:=e:*.asm
|
||||
era xdos*.lib
|
||||
rmac queue
|
||||
xref queue
|
||||
vax queue.xrf $$stan
|
||||
rmac dsptch
|
||||
xref dsptch
|
||||
vax dsptch.xrf $$stan
|
||||
rmac th
|
||||
xref th
|
||||
vax th.xrf $$stan
|
||||
rmac lst
|
||||
xref lst
|
||||
vax lst.xrf $$stan
|
||||
rmac xdos
|
||||
xref xdos
|
||||
vax xdos.xrf $$stan
|
||||
rmac memmgr
|
||||
xref memmgr
|
||||
vax memmgr.xrf $$stan
|
||||
rmac flag
|
||||
xref flag
|
||||
vax flag.xrf $$stan
|
||||
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
|
||||
rmac tick
|
||||
xref tick
|
||||
vax tick.xrf $$stan
|
||||
rmac clock
|
||||
xref clock
|
||||
vax clock.xrf $$stan
|
||||
rmac attach
|
||||
xref attach
|
||||
vax attach.xrf $$stan
|
||||
lib xdos2.lib=cli.rel,tick.rel,clock.rel,attach.rel
|
||||
era *.sym
|
||||
rmac datapg
|
||||
xref datapg
|
||||
vax datapg.xrf $$stan
|
||||
rmac mpm
|
||||
xref mpm
|
||||
vax mpm.xrf $$stan
|
||||
rmac rlsmx
|
||||
xref rlsmx
|
||||
vax rlsmx.xrf $$stan
|
||||
rmac rlsdev
|
||||
xref rlsdev
|
||||
vax rlsdev.xrf $$stan
|
||||
lib xdos3.lib=datapg.rel,mpm.rel,rlsmx.rel,rlsdev.rel
|
||||
era *.sym
|
||||
rmac ver
|
||||
xref ver
|
||||
vax ver.xrf $$stan
|
||||
rmac clbdos
|
||||
xref clbdos
|
||||
vax clbdos.xrf $$stan
|
||||
rmac xdosif
|
||||
xref xdosif
|
||||
vax xdosif.xrf $$stan
|
||||
rmac patch
|
||||
xref patch
|
||||
vax patch.xrf $$stan
|
||||
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
|
||||
link tmpsub[os]
|
||||
era *.sym
|
||||
ren tmp.spr=tmpsub.spr
|
||||
rmac bnkxdos
|
||||
xref bnkxdos
|
||||
vax bnkxdos.xrf $$stan
|
||||
link bnkxdos[os]
|
||||
era *.sym
|
||||
submit e:xdos2
|
||||
|
||||
35
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS2.SUB
Normal file
35
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOS2.SUB
Normal file
@@ -0,0 +1,35 @@
|
||||
pip b:=a:xdos.spr
|
||||
pip b:=a:bnkxdos.spr
|
||||
pip b:=a:tmp.spr
|
||||
pip e:=a:bnkxdos.spr
|
||||
pip e:=a:xdos.spr
|
||||
pip e:=a:tmp.spr
|
||||
era bnkxdos.spr
|
||||
era xdos.spr
|
||||
era tmp.spr
|
||||
ren xdos.spr=xdos.rps
|
||||
ren tmp.spr=tmp.rps
|
||||
ren bnkxdos.spr=bnkxdos.rps
|
||||
era attach.*
|
||||
era bnkxdos.*
|
||||
era clbdos.*
|
||||
era cli.*
|
||||
era clock.*
|
||||
era datapg.*
|
||||
era dsptch.*
|
||||
era flag.*
|
||||
era lst.*
|
||||
era memmgr.*
|
||||
era mpm.*
|
||||
era patch.*
|
||||
era queue.*
|
||||
era rlsdev.*
|
||||
era rlsmx.*
|
||||
era th.*
|
||||
era tick.*
|
||||
era tmpsub.*
|
||||
era ver.*
|
||||
era xdos.*
|
||||
era xdosif.*
|
||||
;end nucleus submit
|
||||
|
||||
229
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOSIF.ASM
Normal file
229
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOSIF.ASM
Normal 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
|
||||
|
||||
120
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOSOLD.OLD
Normal file
120
MPM OPERATING SYSTEMS/MPM II/MPM II SOURCE/NUCLEUS/XDOSOLD.OLD
Normal 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]
|
||||
|
||||
Reference in New Issue
Block a user