home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
SIMTEL
/
CPMUG
/
CPMUG015.ARK
/
INIT2.ASM
< prev
next >
Wrap
Assembly Source File
|
1984-04-29
|
3KB
|
134 lines
TITLE 'INIT2'
DUMP EQU 7200H
WBLK EQU 7442H
PRP EQU 8006H
NMBP EQU 8028H
EXC EQU 80AAH
NP EQU 80F0H
LBLK EQU 8398H
CR00 EQU 82A6H
START EQU 83A8H
SCH00 EQU 8165H
OPEN EQU 0
CLOSE EQU 1
LOAD EQU 6
ISIS EQU 64
NMPCB EQU 5
MBPP EQU 5
SETUP MACRO NUM,VALUE,ADDR,COND
MVI A,NUM
MVI B,VALUE
LXI H,ADDR
LOOP: INX H
IF COND
INR B
ENDIF
MOV M,B
DCR A
JNZ LOOP
IF COND
INX H
MOV M,A
ENDIF
ENDM
FILE MACRO ACT,ADDR
MVI C,ACT
LXI D,ADDR
CALL ISIS
LDA STAT
ORA A
JNZ ERROR
ENDM
FILL MACRO NUM,ADDR ; To fill locations with FF
MVI A,NUM
LXI H,ADDR
MVI B,0FFH
X: MOV M,B
DCR A
INX H
JNZ X
ENDM
ORG 7000H
NM1: DB 'PROC5 '
PBA: DW FNAM
BIAS: DW 0
RETSW: DW 0
DW ENTRY
DW STAT
ENTRY: DS 2
FNAM: DB 'KERNL.BIN '
DMP: DB 'DUMP.BIN '
MESS: DB 'MESS.BIN '
OBLK: DW WBLK ; Parameter block for OPEN
DW OFILE ; Pointer to filename
ACC: DW 2
ECHO: DW 0
DW STAT
OFILE: DB 'DATA '
STAT: DS 2
ERROR: HLT
INIT2: LXI SP,6FF0H ; Set the stack pointer
EI
FILL 0FFH,8000H
FILL 4FH,80FFH
FILL 5FH,6FA0H
FILL 5FH,3FA0H
FILL 5FH,44A0H
FILL 5FH,49A0H
FILL 5FH,4CA0H
FILL 5FH,41A0H
FILL 5FH,42A0H
FILL 5FH,43A0H
FILL 5FH,46A0H
FILE LOAD,PBA ; Load the kernel subroutines
LXI H,DMP
SHLD PBA
FILE LOAD,PBA ; Load the dump routine
LXI H,MESS
SHLD PBA
FILE LOAD,PBA ; Load the message and REMOV
; routines
FILE OPEN,OBLK ; Open the output file DATA
LHLD WBLK
SETUP NMPCB*MBPP-1,1,NMBP,1 ; Message buffer links are set
SETUP NMPCB-1,1,NP,1 ; The NP fields in the PCBs
; are set
LXI H,NM1
SHLD LBLK
CALL CR00 ; Create PROC1
SETUP 1,41H,EXC,0 ; Permanent resident bit is set
SETUP 10,0,PRP-1,0 ; The PRP and NMR fields are set to 0
LXI B,NM1
MVI E,1
CALL START ; Start PROC1 with priority 1
MVI C,1
MVI B,0
MVI A,1
DI
JMP SCH00 ; Call scheduler to start PROC1
END INIT2