mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-23 00:14:25 +00:00
Upload
Digital Research
This commit is contained in:
7139
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.1/bdos.a86
Normal file
7139
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.1/bdos.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,132 @@
|
||||
bdos31.exe=entry,
|
||||
sup,
|
||||
rtm,
|
||||
mem,
|
||||
cio,
|
||||
misc,
|
||||
bdos,
|
||||
proctbl,
|
||||
ccpldr[nop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
@@ -0,0 +1,253 @@
|
||||
;
|
||||
; This little segment appears in PCP/M-86 3.x between the BDOS proper
|
||||
; and the XIOS. I'm assembling it as part of the BDOS, but it may need to
|
||||
; become a separate file with separate support in DPGEN.
|
||||
;
|
||||
; It appears to be a miniature CCP that can be used to run commands and
|
||||
; set the drive/user containing the CCP. It has only one builtin command
|
||||
; - USER.
|
||||
;
|
||||
include equates.a86
|
||||
|
||||
dseg
|
||||
extrn boot_drive:byte
|
||||
extrn ccp_user:byte
|
||||
|
||||
cseg
|
||||
public ccpldr
|
||||
|
||||
ccpldr: jmp ccpl_main
|
||||
|
||||
ccpl_space: mov al, ' '
|
||||
ccpl_putch: mov dl, al
|
||||
push cx
|
||||
mov cl, 2
|
||||
int 0E0h
|
||||
pop cx
|
||||
ret
|
||||
;
|
||||
ccpl_crlf: mov al, 0Dh
|
||||
call ccpl_putch
|
||||
mov al, 0Ah
|
||||
jmps ccpl_putch
|
||||
|
||||
ccpl_drv_set: mov dl, al
|
||||
mov cl, 0Eh
|
||||
int 0E0h
|
||||
ret
|
||||
|
||||
ccpl_getuid: mov dl, 0FFh
|
||||
ccpl_setuid: mov cl, 20h
|
||||
int 0E0h
|
||||
ret
|
||||
;
|
||||
ccpl_input: mov dx, offset ccpl_inpbuf
|
||||
mov cl, 0Ah
|
||||
int 0E0h
|
||||
xor bh, bh
|
||||
mov bl, ccpl_inpbuf+1
|
||||
mov ccpl_inpbuf+2[bx], bh
|
||||
mov ccpl_pfcb, offset ccpl_inpbuf+2
|
||||
ret
|
||||
;
|
||||
ccpl_drv_get: mov cl, 19h
|
||||
int 0E0h
|
||||
ret
|
||||
;
|
||||
ccpl_parse_name:
|
||||
mov ax, ccpl_pfcb
|
||||
mov ccpl_filename_0,ax
|
||||
mov dx, offset ccpl_pfcb
|
||||
mov cl, 98h
|
||||
int 0E0h
|
||||
mov ccpl_pfcb, ax
|
||||
or ax, ax
|
||||
jnz ccpl_pn1
|
||||
mov ccpl_pfcb, offset ccpl_blank
|
||||
ccpl_pn1: dec ax
|
||||
ret
|
||||
;
|
||||
ccpl_main: mov ds,word ptr .0 ;-> CP/M DSEG
|
||||
mov ccpl_sp, sp
|
||||
push ds
|
||||
pop es
|
||||
mov dl, 0FEh
|
||||
mov cl, 2Dh
|
||||
int 0E0h
|
||||
ccpl_mainloop: mov sp, ccpl_sp
|
||||
mov dl, ccp_user
|
||||
call ccpl_setuid
|
||||
mov al, boot_drive
|
||||
call ccpl_drv_set
|
||||
cld
|
||||
mov dx, addr_no_ccp
|
||||
mov cl, 9
|
||||
int 0E0h
|
||||
mov al, ccp_user
|
||||
cmp al, 0Ah
|
||||
jc bootuserlt9
|
||||
mov al, '1'
|
||||
call ccpl_putch
|
||||
mov al, ccp_user
|
||||
sub al, 0Ah
|
||||
bootuserlt9: add al, '0'
|
||||
call ccpl_putch
|
||||
mov al, boot_drive
|
||||
add al, 'A'
|
||||
call ccpl_putch
|
||||
mov al, '>'
|
||||
call ccpl_putch
|
||||
call ccpl_input
|
||||
call ccpl_parse_name
|
||||
jz ccpl_showerr ;Name does not parse
|
||||
test ccpl_fcb, 0FFh
|
||||
jz ccpl_1
|
||||
jmp ccpl_trychain
|
||||
;
|
||||
ccpl_1: cmp ccpl_fcb+1, 20h
|
||||
jz ccpl_mainloop
|
||||
mov di, addr_user ;Check if the command entered is USER
|
||||
mov si, offset ccpl_fcb+1
|
||||
mov cl, [di]
|
||||
xor ch, ch
|
||||
inc di
|
||||
rep cmpsb
|
||||
jnz ccpl_2
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jnz ccpl_2
|
||||
jmp ccpl_setuser
|
||||
;
|
||||
ccpl_2: jmp ccpl_trychain
|
||||
;
|
||||
ccpl_showerr: call ccpl_crlf ;Echo the first filename then "?"
|
||||
mov si, ccpl_filename_0
|
||||
ccpl_skipsp: lodsb
|
||||
cmp al, 20h
|
||||
jz ccpl_skipsp
|
||||
ccpl_showerr2: cmp al, 20h
|
||||
jz ccpl_showerr3
|
||||
or al, al
|
||||
jz ccpl_showerr3
|
||||
call ccpl_putch
|
||||
lodsb
|
||||
jmps ccpl_showerr2
|
||||
;
|
||||
ccpl_showerr3: mov al, '?'
|
||||
call ccpl_putch
|
||||
call ccpl_crlf
|
||||
jmp ccpl_mainloop
|
||||
;
|
||||
ccpl_parse_num: call ccpl_parse_name
|
||||
jz ccpl_showerr
|
||||
mov si, offset ccpl_fcb+1
|
||||
mov cx, 0Bh
|
||||
cmp byte ptr [si], ' '
|
||||
jnz ccpl_pnum_1
|
||||
mov al, 33
|
||||
ret
|
||||
;
|
||||
ccpl_pnum_1: lodsb
|
||||
cmp al, ' '
|
||||
jz ccpl_pnum_next
|
||||
sub al, '0'
|
||||
cmp al, 0Ah
|
||||
jnc ccpl_showerr
|
||||
xchg al, ch
|
||||
mov ah, 0Ah
|
||||
mul ah
|
||||
add al, ch
|
||||
cmp al, 16
|
||||
jnc ccpl_showerr
|
||||
mov ch, al
|
||||
dec cl
|
||||
jnz ccpl_pnum_1
|
||||
ret
|
||||
;
|
||||
ccpl_pnum_next:
|
||||
cmp al, ' '
|
||||
jnz ccpl_showerr
|
||||
lodsb
|
||||
dec cl
|
||||
jnz ccpl_pnum_next
|
||||
mov al, ch
|
||||
ret
|
||||
;
|
||||
ccpl_setuser: call ccpl_parse_num
|
||||
cmp al, 33
|
||||
jnz ccpl_setuser2
|
||||
call ccpl_crlf
|
||||
call ccpl_getuid
|
||||
cmp al, 9
|
||||
jbe ccpl_setuser1
|
||||
push ax
|
||||
mov al, '1'
|
||||
call ccpl_putch
|
||||
pop ax
|
||||
sub al, 0Ah
|
||||
ccpl_setuser1: add al, '0'
|
||||
call ccpl_putch
|
||||
jmps ccpl_setuser3
|
||||
;
|
||||
ccpl_setuser2: mov dl, al
|
||||
mov ccp_user, al
|
||||
call ccpl_setuid
|
||||
ccpl_setuser3: jmp ccpl_mainloop
|
||||
;
|
||||
ccpl_trychain: cmp ccpl_fcb+1, ' '
|
||||
jnz ccpl_trychain1
|
||||
mov al, ccpl_fcb
|
||||
or al, al
|
||||
jz ccpl_setuser3
|
||||
dec al
|
||||
push ax
|
||||
call ccpl_drv_set
|
||||
inc al
|
||||
pop ax
|
||||
jz ccpl_trychain2
|
||||
mov boot_drive, al
|
||||
jmps ccpl_setuser3
|
||||
;
|
||||
ccpl_trychain1: cmp ccpl_fcb+9, ' '
|
||||
jz ccpl_chain
|
||||
ccpl_trychain2: jmp ccpl_showerr
|
||||
;
|
||||
ccpl_chain: call ccpl_crlf
|
||||
mov dx, offset ccpl_inpbuf+2
|
||||
mov cl, 1Ah ;F_DMAOFF
|
||||
int 0E0h
|
||||
mov dx, ds
|
||||
mov cl, 33h ;F_DMASEG
|
||||
int 0E0h
|
||||
mov cl, 2Fh ;P_CHAIN
|
||||
int 0E0h
|
||||
jmp ccpl_showerr
|
||||
|
||||
dseg
|
||||
public ccpldr_ds
|
||||
public ccpldr_cs
|
||||
|
||||
ccpldr_ds dw 0
|
||||
db 0
|
||||
ccpldr_cs dw 0
|
||||
db 0
|
||||
ccpl_inpbuf db 3Fh
|
||||
rb 40h
|
||||
ccpl_blank db 0
|
||||
ccpl_sp dw 0
|
||||
ccpl_filename_0 dw 0
|
||||
ccpl_pfcb dw offset ccpl_inpbuf+2
|
||||
dw offset ccpl_fcb
|
||||
|
||||
rb 12
|
||||
|
||||
ccpl_fcb rb 24h
|
||||
|
||||
rb 0E6h
|
||||
;
|
||||
; I hope this is junk picked up by (eg) something being a couple of paragraphs
|
||||
; short of a whole sector rather than anything important.
|
||||
;
|
||||
db 8Ah, 0FFh, 0
|
||||
db 83h, 0FFh, 0
|
||||
db 84h, 0FFh, 0
|
1616
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.1/cio.a86
Normal file
1616
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.1/cio.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,144 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "cmdio.h"
|
||||
|
||||
static byte zeroes[16];
|
||||
|
||||
void zero_cmd(cmd_desc *cmdfile)
|
||||
{
|
||||
cmdfile->cs = cmdfile->ds = NULL;
|
||||
cmdfile->cs_base = cmdfile->ds_base = 0;
|
||||
cmdfile->cs_len = cmdfile->ds_len = 0;
|
||||
cmdfile->cs_max = cmdfile->ds_max = 0;
|
||||
}
|
||||
|
||||
void free_cmd (cmd_desc *cmdfile)
|
||||
{
|
||||
if (cmdfile->ds) free(cmdfile->ds);
|
||||
if (cmdfile->cs) free(cmdfile->cs);
|
||||
zero_cmd(cmdfile);
|
||||
}
|
||||
|
||||
char *alloc_cmd(cmd_desc *cmdfile, long cs_len, long ds_len)
|
||||
{
|
||||
if (!cs_len || !ds_len) return "cs_len or ds_len is 0.";
|
||||
cmdfile->cs = malloc(cs_len);
|
||||
cmdfile->ds = malloc(ds_len);
|
||||
if (!cmdfile->ds || !cmdfile->cs)
|
||||
{
|
||||
free_cmd(cmdfile);
|
||||
return "Out of memory.";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *load_cmd(char *filename, cmd_desc *cmdfile)
|
||||
{
|
||||
FILE *fp;
|
||||
char *boo;
|
||||
byte cmd_header[128];
|
||||
|
||||
fp = fopen(filename, "rb");
|
||||
if (!fp) return "Failed to open file.";
|
||||
|
||||
if (fread(cmd_header, 1, sizeof(cmd_header), fp) < sizeof(cmd_header))
|
||||
{
|
||||
fclose(fp);
|
||||
return "Too short to be a CMD file.";
|
||||
}
|
||||
cmdfile->cs_len = peekw(cmd_header, 1);
|
||||
cmdfile->cs_base = peekw(cmd_header, 3);
|
||||
cmdfile->cs_max = peekw(cmd_header, 5);
|
||||
cmdfile->ds_len = peekw(cmd_header, 10);
|
||||
cmdfile->ds_base = peekw(cmd_header, 12);
|
||||
cmdfile->ds_max = peekw(cmd_header, 14);
|
||||
|
||||
if (!cmdfile->cs_len || !cmdfile->ds_len)
|
||||
{
|
||||
fclose(fp);
|
||||
return "Not a 2-segment CMD file";
|
||||
}
|
||||
boo = alloc_cmd(cmdfile, 16 * cmdfile->cs_max, 16 * cmdfile->ds_max);
|
||||
if (boo)
|
||||
{
|
||||
fclose(fp);
|
||||
return boo;
|
||||
}
|
||||
if (fread(cmdfile->cs, 16, cmdfile->cs_len, fp) < cmdfile->cs_len)
|
||||
{
|
||||
fclose(fp);
|
||||
free_cmd(cmdfile);
|
||||
return "Failed to load code segment.";
|
||||
}
|
||||
if (fread(cmdfile->ds, 16, cmdfile->ds_len, fp) < cmdfile->ds_len)
|
||||
{
|
||||
fclose(fp);
|
||||
free_cmd(cmdfile);
|
||||
return "Failed to load data segment.";
|
||||
}
|
||||
fclose(fp);
|
||||
cmdfile->cs_len *= 16L;
|
||||
cmdfile->ds_len *= 16L;
|
||||
cmdfile->cs_max *= 16L;
|
||||
cmdfile->ds_max *= 16L;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void pokew(byte *base, word a, word v)
|
||||
{
|
||||
base[a ] = (v) & 0xFF;
|
||||
base[a+1] = (v >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
word peekw(byte *base, word a)
|
||||
{
|
||||
return base[a] | (((word)base[a+1]) << 8);
|
||||
}
|
||||
|
||||
|
||||
char *save_cmd(char *cmdname, cmd_desc *cmdfile, int absolute)
|
||||
{
|
||||
FILE *fp;
|
||||
word csparas, cmparas;
|
||||
word dsparas, dmparas;
|
||||
byte header[128];
|
||||
|
||||
csparas = cmdfile->cs_len >> 4;
|
||||
dsparas = cmdfile->ds_len >> 4;
|
||||
cmparas = cmdfile->cs_max >> 4;
|
||||
dmparas = cmdfile->ds_max >> 4;
|
||||
|
||||
memset(header, 0, sizeof(header));
|
||||
header[0] = 1; /* Code segment */
|
||||
pokew(header, 1, csparas);
|
||||
if (absolute) pokew(header, 3, cmdfile->cs_base);
|
||||
pokew(header, 5, cmparas);
|
||||
header[9] = 2; /* Data segment */
|
||||
pokew(header, 10, dsparas);
|
||||
if (absolute) pokew(header, 12, cmdfile->ds_base);
|
||||
pokew(header, 14, dmparas);
|
||||
|
||||
fp = fopen(cmdname, "wb");
|
||||
if (!fp)
|
||||
{
|
||||
return "Cannot open file to write.";
|
||||
}
|
||||
if (fwrite(header, 1, 128, fp) < 128 ||
|
||||
fwrite(cmdfile->cs, 16, csparas, fp) < csparas ||
|
||||
fwrite(cmdfile->ds, 16, dsparas, fp) < dsparas)
|
||||
{
|
||||
fclose(fp);
|
||||
return "Error writing to CMD file";
|
||||
}
|
||||
/* Pack out to a multiple of 128 bytes */
|
||||
while ((csparas + dsparas) & 7)
|
||||
{
|
||||
fwrite(zeroes, 1, 16, fp);
|
||||
++dsparas;
|
||||
}
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
typedef unsigned long dword;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte *cs;
|
||||
byte *ds;
|
||||
word cs_base;
|
||||
word ds_base;
|
||||
dword cs_len;
|
||||
dword ds_len;
|
||||
dword cs_max;
|
||||
dword ds_max;
|
||||
} cmd_desc;
|
||||
|
||||
void zero_cmd (cmd_desc *cmdfile);
|
||||
void free_cmd (cmd_desc *cmdfile);
|
||||
char *alloc_cmd(cmd_desc *cmdfile, long cs_len, long ds_len);
|
||||
|
||||
char *load_cmd(char *filename, cmd_desc *cmdfile);
|
||||
char *save_cmd(char *filename, cmd_desc *cmdfile, int absolute);
|
||||
|
||||
word peekw(byte *base, word a);
|
||||
void pokew(byte *base, word a, word v);
|
||||
|
@@ -0,0 +1,135 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "cmdio.h"
|
||||
|
||||
cmd_desc dosplus_sys, bdos_cmd, xios_cmd, ccp_cmd, dos_cmd;
|
||||
|
||||
int gl_base = 0x60;
|
||||
|
||||
void dump_cmd(char *caption, cmd_desc *cmd)
|
||||
{
|
||||
printf("%s CS: base=%04x length=%05lx\n",
|
||||
caption, cmd->cs_base, cmd->cs_len);
|
||||
printf("%s DS: base=%04x length=%05lx\n",
|
||||
caption, cmd->ds_base, cmd->ds_len);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *boo;
|
||||
long o = 0;
|
||||
long xios_cs, dos_cs, dos_ds, ccp_cs, ccp_ds;
|
||||
int n;
|
||||
/* Load the component parts */
|
||||
|
||||
for (n = 1; n < argc; n++)
|
||||
{
|
||||
if (!strncmp(argv[n], "base=", 5))
|
||||
{
|
||||
if (!sscanf(&argv[n][5], "%x", &gl_base))
|
||||
{
|
||||
fprintf(stderr, "base= option incorrect.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boo = load_cmd("bdos.cmd", &bdos_cmd);
|
||||
if (boo) { fprintf(stderr, "bdos.cmd: %s\n", boo); return 1; }
|
||||
boo = load_cmd("xios.cmd", &xios_cmd);
|
||||
if (boo) { fprintf(stderr, "xios.cmd: %s\n", boo); return 1; }
|
||||
boo = load_cmd("ccp.cmd", &ccp_cmd);
|
||||
if (boo) { fprintf(stderr, "ccp.cmd: %s\n", boo); return 1; }
|
||||
load_cmd("dos.cmd", &dos_cmd);
|
||||
|
||||
/* Work out segment sizes */
|
||||
dosplus_sys.cs_max =
|
||||
dosplus_sys.cs_len = bdos_cmd.cs_len + xios_cmd.cs_len +
|
||||
ccp_cmd.cs_len + ccp_cmd.ds_len +
|
||||
dos_cmd.cs_len + dos_cmd.ds_len;
|
||||
dosplus_sys.cs_base = gl_base;
|
||||
dosplus_sys.ds_len = xios_cmd.ds_len;
|
||||
dosplus_sys.ds_max = xios_cmd.ds_max;
|
||||
dosplus_sys.ds_base = gl_base + (dosplus_sys.cs_len >> 4);
|
||||
|
||||
boo = alloc_cmd(&dosplus_sys, dosplus_sys.cs_len, dosplus_sys.ds_len);
|
||||
if (boo) { fprintf(stderr, "%s", boo); return 1; }
|
||||
|
||||
printf("Code segment at %04x:0000 length 0x%05lx\n",
|
||||
dosplus_sys.cs_base,
|
||||
dosplus_sys.cs_len);
|
||||
printf("Data segment at %04x:0000 length 0x%05lx\n",
|
||||
dosplus_sys.ds_base,
|
||||
dosplus_sys.ds_len);
|
||||
|
||||
/* OK. Now copy the modules into the SYS file */
|
||||
|
||||
memcpy(dosplus_sys.cs + o, bdos_cmd.cs, bdos_cmd.cs_len);
|
||||
o += bdos_cmd.cs_len;
|
||||
xios_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, xios_cmd.cs, xios_cmd.cs_len);
|
||||
o += xios_cmd.cs_len;
|
||||
if (dos_cmd.cs_len)
|
||||
{
|
||||
dos_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, dos_cmd.cs, dos_cmd.cs_len);
|
||||
o += dos_cmd.cs_len;
|
||||
}
|
||||
ccp_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, ccp_cmd.cs, ccp_cmd.cs_len);
|
||||
o += ccp_cmd.cs_len;
|
||||
ccp_ds = o;
|
||||
memcpy(dosplus_sys.cs + o, ccp_cmd.ds, ccp_cmd.ds_len);
|
||||
o += ccp_cmd.ds_len;
|
||||
if (dos_cmd.ds_len)
|
||||
{
|
||||
dos_ds = o;
|
||||
memcpy(dosplus_sys.cs + o, dos_cmd.ds, dos_cmd.ds_len);
|
||||
o += dos_cmd.ds_len;
|
||||
}
|
||||
memcpy(dosplus_sys.ds, xios_cmd.ds, xios_cmd.ds_len);
|
||||
memcpy(dosplus_sys.ds, bdos_cmd.ds, bdos_cmd.ds_len);
|
||||
|
||||
/* Set up the pointers to modules correctly */
|
||||
pokew(dosplus_sys.cs, 6, dosplus_sys.ds_base);
|
||||
pokew(dosplus_sys.cs, xios_cs + 6, dosplus_sys.ds_base);
|
||||
if (dos_cmd.ds_len)
|
||||
{
|
||||
pokew(dosplus_sys.cs, dos_cs + 6, dosplus_sys.ds_base);
|
||||
pokew(dosplus_sys.cs, dos_cs + 8, (dos_ds >> 4) + gl_base);
|
||||
}
|
||||
pokew(dosplus_sys.cs, ccp_ds , ccp_cmd.cs_len);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 3, (ccp_cs >> 4) + gl_base);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 6, ccp_cmd.ds_len);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 9, (ccp_ds >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x2A, (xios_cs >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x2E, (xios_cs >> 4) + gl_base);
|
||||
if (dos_cmd.ds_len)
|
||||
pokew(dosplus_sys.ds, 0x42, (dos_cs >> 4) + gl_base);
|
||||
else pokew(dosplus_sys.ds, 0x42, 0);
|
||||
pokew(dosplus_sys.ds, 0x44, (ccp_ds >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x48, ((dosplus_sys.cs_max +
|
||||
dosplus_sys.ds_max + 0x10 * gl_base) >> 4)
|
||||
/*+ 0x1000*/);
|
||||
/* SYS file has been generated. Write it. */
|
||||
|
||||
dump_cmd("BDOS ", &bdos_cmd);
|
||||
dump_cmd("XIOS ", &xios_cmd);
|
||||
if (dos_cmd.cs_len) dump_cmd("DOS ", &dos_cmd);
|
||||
dump_cmd("CCP ", &ccp_cmd);
|
||||
dump_cmd("SYS ", &dosplus_sys);
|
||||
|
||||
/* Now start writing the stuff out */
|
||||
boo = save_cmd("new.sys", &dosplus_sys, 1);
|
||||
if (boo) fprintf(stderr, "new.sys: %s\n", boo);
|
||||
free_cmd(&dosplus_sys);
|
||||
free_cmd(&bdos_cmd);
|
||||
free_cmd(&xios_cmd);
|
||||
free_cmd(&ccp_cmd);
|
||||
free_cmd(&dos_cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,525 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
dseg
|
||||
|
||||
cseg
|
||||
|
||||
extrn rtm_sysflag:near
|
||||
extrn cio_keyboard:near
|
||||
extrn rtm_timeslice:near
|
||||
|
||||
public bdos_start
|
||||
public bdos_rsx
|
||||
public bdos_callback
|
||||
public far_ret_1
|
||||
public bdos_dseg
|
||||
|
||||
jmp bdos_start
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmp bdos_int_E0
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bdos_dseg dw seg time_slice
|
||||
; ...
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_start: ; CODE XREF: bdos:0000j
|
||||
cli
|
||||
xor ax, ax
|
||||
mov ds, ax
|
||||
mov word ptr INT_E0, offset bdos_int_E0
|
||||
mov word ptr INT_E0+2, cs
|
||||
mov bx, cs:bdos_dseg
|
||||
mov ds, bx
|
||||
mov ax, rlr
|
||||
mov cl, 4
|
||||
shr ax, cl
|
||||
add ax, bx
|
||||
mov rlr, ax
|
||||
mov process_table, ax
|
||||
mov bdos_conowner, ax
|
||||
mov ss, ax
|
||||
mov sp, 160h
|
||||
|
||||
init_proctab: ; CODE XREF: bdos:0054j
|
||||
mov es, ax
|
||||
mov es:word ptr proc_onblock, offset far_ret_1
|
||||
|
||||
g003f: ; DATA XREF: P_TERMCPM+16r
|
||||
mov es:word ptr proc_onblock+2, cs
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
jz procs_inited
|
||||
shr ax, cl
|
||||
add ax, bx
|
||||
mov es:proc_nextseg, ax
|
||||
jmps init_proctab
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
procs_inited: ; CODE XREF: bdos:004Aj
|
||||
mov es, rlr
|
||||
mov es:proc_bdos_seg, cs
|
||||
cld
|
||||
mov cx, 7
|
||||
mov bx, offset function_tables + 2 ;Call all init funcs
|
||||
call_inits: push bx
|
||||
push cx
|
||||
call word ptr [bx]
|
||||
pop cx
|
||||
pop bx
|
||||
add bx, 4
|
||||
loop call_inits
|
||||
|
||||
callf dword ptr lp_xios_init
|
||||
sti
|
||||
mov al, boot_drive
|
||||
mov es:proc_drive, al
|
||||
push es
|
||||
xor si, si
|
||||
push ds
|
||||
mov ds, si
|
||||
|
||||
mov word ptr INT_E0, offset bdos_int_E0
|
||||
mov word ptr INT_E0+2, cs
|
||||
mov di, offset proc_int0
|
||||
mov cx, 4
|
||||
rep movsw
|
||||
mov cl, 4
|
||||
add si, cx
|
||||
rep movsw
|
||||
mov si, offset INT_E0
|
||||
mov cl, 4
|
||||
rep movsw
|
||||
pop es
|
||||
pop ds
|
||||
|
||||
mov di, offset cpu_vectors
|
||||
mov si, offset proc_int0
|
||||
mov cl, 0Ch
|
||||
rep movsw
|
||||
xor cx, cx
|
||||
mov dx, cx
|
||||
int 0E0h ; used by BASIC while in interpreter
|
||||
;
|
||||
entry_init: ret
|
||||
;
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bdos_functions db 20h ; DATA XREF: bdos:01F2o
|
||||
; P_TERMCPM
|
||||
db 60h ; C_READ
|
||||
db 61h ; C_WRITE
|
||||
db 62h ; A_READ
|
||||
db 63h ; A_WRITE
|
||||
db 64h ; L_WRITE
|
||||
db 65h ; C_RAWIO
|
||||
db 66h ; A_STATIN
|
||||
db 67h ; A_STATOUT
|
||||
db 68h ; C_WRITESTR
|
||||
db 69h ; C_READSTR
|
||||
db 6Ah ; C_STAT
|
||||
db 0A1h ; S_BDOSVER
|
||||
db 0C0h ; DRV_ALLRESET
|
||||
db 0C1h ; DRV_SET
|
||||
db 0C2h ; F_OPEN
|
||||
db 0C3h ; F_CLOSE
|
||||
db 0C4h ; F_SFIRST
|
||||
db 0C5h ; F_SNEXT
|
||||
db 0C6h ; F_DELETE
|
||||
db 0C7h ; F_READ
|
||||
db 0C8h ; F_WRITE
|
||||
db 0C9h ; F_MAKE
|
||||
db 0CAh ; F_RENAME
|
||||
db 0A2h ; DRV_LOGINVEC
|
||||
db 0A3h ; DRV_GET
|
||||
db 0A4h ; F_DMAOFF
|
||||
db 0CBh ; DRV_ALLOCVEC
|
||||
db 0CCh ; DRV_SETRO
|
||||
db 0A5h ; DRV_ROVEC
|
||||
db 0CDh ; F_ATTRIB
|
||||
db 0CEh ; DRV_DPB
|
||||
db 0A6h ; F_USERNUM
|
||||
db 0CFh ; F_READRAND
|
||||
db 0D0h ; F_WRITERAND
|
||||
db 0D1h ; F_SIZE
|
||||
db 0D2h ; F_RANDREC
|
||||
db 0D3h ; DRV_RESET
|
||||
db 0A0h ; (access drives)
|
||||
db 0D5h ; DRV_FREE
|
||||
db 0D6h ; F_WRITEZF
|
||||
db 0A0h, 0A0h, 0A0h ; MP/M file lock functions
|
||||
db 0A7h ; F_MULTISEC
|
||||
db 0A8h ; F_ERRMODE
|
||||
db 0D9h ; DRV_SPACE
|
||||
db 0 ; P_CHAIN
|
||||
db 0DAh ; DRV_FLUSH
|
||||
db 0A9h ; S_SYSVAR
|
||||
db 6Bh ; S_BIOS
|
||||
db 0AAh ; F_DMASEG
|
||||
db 0ABh ; F_DMAGET
|
||||
db 40h ; MC_MAX
|
||||
db 41h ; MC_ABSMAX
|
||||
db 42h ; MC_ALLOC
|
||||
db 43h ; MC_ABSALLOC
|
||||
db 44h ; MC_FREE
|
||||
db 45h ; MC_ALLFREE
|
||||
db 1 ; P_LOAD
|
||||
db 0A0h ; P_RSX
|
||||
db 0DBh ; Clean up disc
|
||||
db 0DCh ; F_TRUNCATE
|
||||
db 0DDh ; DRV_SETLABEL
|
||||
db 0DEh ; DRV_GETLABEL
|
||||
db 0DFh ; F_TIMEDATE
|
||||
db 0E0h ; F_WRITEXFCB
|
||||
db 0ACh ; T_SET
|
||||
db 0ADh ; T_GET
|
||||
db 0E1h ; F_PASSWD
|
||||
db 0AEh ; S_SERIAL
|
||||
db 0AFh ; P_CODE
|
||||
db 6Ch ; C_MODE
|
||||
db 6Dh ; C_DELIMIT
|
||||
db 6Eh ; C_WRITEBLK
|
||||
db 6Fh ; L_WRITEBLK
|
||||
db 0A0h ; PCP/M direct screen access
|
||||
db 0A0h ; Unused in all versions
|
||||
db 0A0h ; GSX
|
||||
db 0E2h ; Set file timestamp
|
||||
db 21h ; Wait on system flag
|
||||
db 0A0h ; Set system flag
|
||||
db 0A0h ; Create message queue
|
||||
db 0A0h ; Open message queue
|
||||
db 0A0h ; Delete message queue
|
||||
db 0A0h ; Read message queue
|
||||
db 0A0h ; Conditional read queue
|
||||
db 0A0h ; Write to message queue
|
||||
db 0A0h ; Conditional write message queue
|
||||
db 22h ; P_DELAY
|
||||
db 23h ; P_DISPATCH
|
||||
db 20h ; P_TERM
|
||||
db 0A0h, 0A0h, 0A0h
|
||||
db 70h ; C_DETACH
|
||||
db 0A0h, 0A0h, 0A0h, 0A0h
|
||||
db 2 ; F_PARSE
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_int_E0: ; CODE XREF: bdos:0003j
|
||||
; DATA XREF: bdos:000Eo ...
|
||||
push ds
|
||||
mov ds, cs:bdos_dseg
|
||||
mov ax, es
|
||||
mov es, rlr
|
||||
pop ds
|
||||
cmp es:proc_incpm, 0
|
||||
jnz already_in_cpm
|
||||
mov es:word ptr userStack+2, ss
|
||||
mov es:word ptr userStack, sp
|
||||
push es
|
||||
pop ss
|
||||
mov sp, offset proc_cpm_stack
|
||||
|
||||
already_in_cpm: ; CODE XREF: bdos:0155j
|
||||
inc es:proc_incpm
|
||||
sti
|
||||
cld
|
||||
mov es:userES, ax
|
||||
mov es:proc_fx, cl
|
||||
push si
|
||||
push di
|
||||
push bp
|
||||
callf es:dword ptr proc_bdos_offs
|
||||
pop bp
|
||||
pop di
|
||||
pop si
|
||||
mov ax, bx
|
||||
dec es:proc_incpm
|
||||
jnz still_in_cpm
|
||||
cli
|
||||
mov ss, es:word ptr userStack+2
|
||||
mov sp, es:word ptr userStack
|
||||
|
||||
still_in_cpm: ; CODE XREF: bdos:0188j
|
||||
mov es, es:userES
|
||||
cmp ax, 0FFFFh
|
||||
jz check_result
|
||||
xor cx, cx
|
||||
|
||||
check_result: ; CODE XREF: bdos:019Dj
|
||||
iret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_rsx: ; DATA XREF: proc1:0052o
|
||||
jmp bdos_rsx_main
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rs 5
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_rsx_main: ; CODE XREF: bdos:01A2j
|
||||
push es:userDS
|
||||
mov es:userDS, ds
|
||||
mov ds, cs:bdos_dseg
|
||||
callf dword ptr lp_bdos_entry
|
||||
mov ds, es:userDS
|
||||
pop es:userDS
|
||||
|
||||
far_ret_1: ; DATA XREF: bdos:0038o P_CHAIN+71o
|
||||
; ...
|
||||
retf
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_entry: ; CODE XREF: x_dev_waitflag+2u
|
||||
; x_p_delay+2u
|
||||
; DATA XREF: ...
|
||||
jmp bdos_func
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rs 5
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_func: ; CODE XREF: bdos:01C8j
|
||||
cld
|
||||
mov al, cl
|
||||
cmp al, 3Ch
|
||||
jbe bdos_gotfunc
|
||||
sub al, 25h
|
||||
cmp al, 3Dh
|
||||
jb bdos_badfunc
|
||||
cmp al, 4Fh
|
||||
jbe bdos_gotfunc
|
||||
sub al, 0Fh
|
||||
cmp al, 50h
|
||||
jb bdos_badfunc
|
||||
cmp al, 64h
|
||||
jbe bdos_gotfunc
|
||||
|
||||
bdos_badfunc: ; CODE XREF: bdos:01DBj bdos:01E5j
|
||||
mov bx, 0FFFFh
|
||||
mov cx, 2
|
||||
retf
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_gotfunc: ; CODE XREF: bdos:01D5j bdos:01DFj
|
||||
; ...
|
||||
mov bx, offset bdos_functions
|
||||
xlat cs:byte ptr [bx]
|
||||
mov cl, al
|
||||
rol al, 1
|
||||
rol al, 1
|
||||
rol al, 1
|
||||
and al, 7
|
||||
mov ah, 1Fh
|
||||
cmp al, 6
|
||||
jb mask_fxn
|
||||
mov ah, 3Fh
|
||||
and al, 6
|
||||
|
||||
mask_fxn: ; CODE XREF: bdos:0205j
|
||||
and cl, ah
|
||||
|
||||
entry_bdos: ; DATA XREF: dseg:0010o
|
||||
call inner_callback
|
||||
retf
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
inner_callback: ; CODE XREF: bdos:020Dp bdos_callback+8p
|
||||
mov es:proc_intfunc, cl
|
||||
mov es:proc_intmod, al
|
||||
xor ah, ah
|
||||
mov ch, ah
|
||||
mov di, ax ; AL = function class
|
||||
shl di, 1 ; CL = function number within class
|
||||
shl di, 1
|
||||
mov si, cx
|
||||
shl si, 1
|
||||
jmp function_tables[di]
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
bdos_callback: ; CODE XREF: get_proc_dskdat+Bp
|
||||
; release+3p ...
|
||||
test ch, ch
|
||||
jz callback_00
|
||||
dec ch
|
||||
mov al, ch
|
||||
call inner_callback
|
||||
jmps bdos_cbk_end
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
callback_00: ; CODE XREF: bdos_callback+2j
|
||||
callf es:dword ptr proc_bdos_offs
|
||||
|
||||
bdos_cbk_end: ; CODE XREF: bdos_callback+Bj
|
||||
mov ax, bx
|
||||
retn
|
||||
|
||||
extrn sup_main:near
|
||||
extrn sup_init:near
|
||||
extrn rtm_main:near
|
||||
extrn rtm_init:near
|
||||
extrn mem_main:near
|
||||
extrn mem_init:near
|
||||
extrn cio_main:near
|
||||
extrn cio_init:near
|
||||
extrn misc_main:near
|
||||
extrn misc_init:near
|
||||
extrn bdos_main:near
|
||||
extrn bdos_init:near
|
||||
|
||||
dseg
|
||||
|
||||
extrn freemem:byte
|
||||
extrn proc1:word
|
||||
extrn dirname_1:word
|
||||
extrn dirdata_0:word
|
||||
|
||||
public function_tables
|
||||
public bdos_8087_inuse
|
||||
public rlr
|
||||
public drl
|
||||
public pq_disk
|
||||
public pq_loader
|
||||
public pq_memmgr
|
||||
public pq_error
|
||||
public pq_filesystem
|
||||
public search_path
|
||||
public temp_drive
|
||||
public cpu_vectors
|
||||
public lp_xios_entry
|
||||
public lp_dos_module
|
||||
public lp_sysflag_chg
|
||||
public lp_kbd_callback
|
||||
public time_slice
|
||||
public proc_count
|
||||
public bdos_conowner
|
||||
public bdos_sysflags
|
||||
public ccp_dseg
|
||||
public cur_x
|
||||
public max_x
|
||||
public max_y
|
||||
public sysvar_131
|
||||
public sysvar_132
|
||||
public echo_backspaced
|
||||
public echo_deleted
|
||||
public boot_drive
|
||||
public ccp_user
|
||||
public bdos_ver
|
||||
public date_days
|
||||
public date_secs
|
||||
public page_mode
|
||||
|
||||
function_tables dw offset sup_main ; DATA XREF: inner_callback+Eo
|
||||
dw offset sup_init
|
||||
dw offset rtm_main
|
||||
dw offset rtm_init
|
||||
dw offset mem_main
|
||||
dw offset mem_init
|
||||
dw offset cio_main
|
||||
dw offset cio_init
|
||||
dw offset entry_init
|
||||
dw offset entry_init
|
||||
off_A15_14 dw offset misc_main
|
||||
dw offset misc_init
|
||||
off_A15_18 dw offset bdos_main
|
||||
off_A15_1A dw offset bdos_init
|
||||
a080586 db '* 11/16/83 *'
|
||||
lp_xios_entry dw 3 ; Offset of XIOS entry
|
||||
seg_A15_2A dw seg lp_xios_entry ; -> XIOS segment
|
||||
lp_xios_init dw 0 ; Offset of XIOS init function
|
||||
dw seg lp_xios_entry ; -> XIOS segment
|
||||
lp_bdos_entry dw offset bdos_entry ; DATA XREF: bdos:01B9r x_dev_waitflag+2r
|
||||
; ...
|
||||
dw seg bdos_start
|
||||
|
||||
lp_timeslice dw offset rtm_timeslice
|
||||
dw seg rtm_timeslice
|
||||
|
||||
lp_sysflag_chg dw offset rtm_sysflag
|
||||
dw seg rtm_sysflag
|
||||
|
||||
lp_kbd_callback dw offset cio_keyboard
|
||||
dw seg cio_keyboard
|
||||
|
||||
lp_dos_module dw 0,0 ; DATA XREF: bdos:007Dr P_CHAIN+A9r
|
||||
; ...
|
||||
ccp_dseg dw 0 ; DATA XREF: mc_temp_untempr
|
||||
; get_mcb_pars+38r ...
|
||||
; 0 if no temporary memory blocks allocated
|
||||
dw seg bdos_start
|
||||
dw seg freemem
|
||||
bdos_conowner dw offset proc1 ; DATA XREF: bdos:002Ew bdos_sysflag+Ar
|
||||
; ...
|
||||
bdos_sysflags dw SYSFLAGS ; This should get set by GENCPM
|
||||
|
||||
rlr dw offset proc1 ; DATA XREF: bdos:001Fr bdos:0028w
|
||||
; ...
|
||||
; Current process
|
||||
process_table dw 0 ; DATA XREF: bdos:002Bw
|
||||
drl dw 0 ; DATA XREF: P_0207+5r P_0209+7o
|
||||
; ...
|
||||
; Processes that have just become
|
||||
; ready to run
|
||||
dw 0
|
||||
proc_count db 1 ; DATA XREF: get_new_process+1Dw
|
||||
; P_TERMCPM+5Ew ...
|
||||
bdos_ver dw 1031h ; DATA XREF: S_BDOSVERr
|
||||
bdos_8087_inuse db 0 ; DATA XREF: call_p_load+10w
|
||||
; retake_8087+Br ...
|
||||
search_path db 0, 0FFh, 0FFh, 0FFh
|
||||
; ...
|
||||
temp_drive db 0 ; DATA XREF: rsx_find+53o bdos:23AEo
|
||||
date_days dw 0862h ; DATA XREF: bdos:23B2o bdos:2540o
|
||||
; ...
|
||||
date_hours db 12h ; DATA XREF: xios_hook_timer+85w
|
||||
; xios_int08+5Dr ...
|
||||
date_mins db 0 ; DATA XREF: xios_hook_timer+7Dw
|
||||
; xios_int08+4Br ...
|
||||
date_secs db 0 ; DATA XREF: bdos:2551w bdos:2566r
|
||||
; ...
|
||||
cur_x db 0 ; DATA XREF: bdos_char_out+44r
|
||||
; bdos_char_out+70w ...
|
||||
max_x db SCR_MAXX ; DATA XREF: input_putchar+12r
|
||||
; expand_tabs+14r ...
|
||||
max_y db SCR_MAXY ; DATA XREF: bdos:23A2o
|
||||
page_mode db 0 ; DATA XREF: bdos:23A6o
|
||||
echo_backspaced db 0 ; DATA XREF: input_ctlH+9r
|
||||
echo_deleted db SCR_ECHODEL ; DATA XREF: input_delete+9r
|
||||
;
|
||||
; Process queues for single-threaded parts of the system.
|
||||
;
|
||||
; Format of process queue:
|
||||
; DW offset of next queue, 0 for none
|
||||
; DW segment of process currently in that section, 0 for none
|
||||
; DW linked list of processes waiting for that section, 0 for none
|
||||
; DW 0
|
||||
;
|
||||
pq_disk dw offset pq_loader ; DATA XREF: get_proc_dskdat+5o
|
||||
; release_DMAo ...
|
||||
rw 3
|
||||
pq_loader dw offset pq_filesystem
|
||||
rw 3
|
||||
pq_filesystem dw offset pq_error ; DATA XREF: funcs_F_main+8o
|
||||
; funcs_F_main+124o ...
|
||||
rw 3
|
||||
pq_error dw 8Ah ; DATA XREF: funcs_F_main+136o
|
||||
; funcs_F_main+1C7o ...
|
||||
rw 3
|
||||
pq_memmgr rw 4 ; DATA XREF: funcs_MC+2o funcs_MC+24o
|
||||
; ...
|
||||
boot_drive db 0 ; DATA XREF: bdos:006Cr bdos:23CEo
|
||||
; ...
|
||||
ccp_user db 0
|
||||
rb 0FEh
|
||||
sysvar_131 db 0 ; DATA XREF: copy_to_history+14w
|
||||
; bdos:1CFFr ...
|
||||
sysvar_132 rb 100h ; DATA XREF: copy_to_history+Do
|
||||
; bdos:1CFAo ...
|
||||
time_slice db 10h ; DATA XREF: delay_dispatch+A2r
|
||||
; bdos:23DEo
|
||||
cpu_vectors rw 12
|
||||
|
||||
end
|
||||
|
||||
|
@@ -0,0 +1,99 @@
|
||||
|
||||
NO equ 0
|
||||
YES equ NOT NO
|
||||
|
||||
dseg
|
||||
;
|
||||
; Addresses in the Zero Page
|
||||
;
|
||||
INT_E0 equ dword ptr .0380h
|
||||
;
|
||||
; Addresses in the XIOS
|
||||
;
|
||||
xios_bh_delay equ byte ptr .0F00h ;XIOS header
|
||||
xios_bh_ticks equ byte ptr .0F01h
|
||||
xios_bh_gdopen equ byte ptr .0F02h
|
||||
xios_bh_inint equ byte ptr .0F03h
|
||||
xios_bh_nextflg equ byte ptr .0F04h
|
||||
xios_bh_lastflg equ byte ptr .0F05h
|
||||
xios_bh_intconi equ byte ptr .0F06h
|
||||
xios_bh_8087 equ byte ptr .0F07h
|
||||
mem_table equ word ptr .0F56h
|
||||
msg_cannot_load equ word ptr .1016h
|
||||
addr_no_ccp equ word ptr .1018h
|
||||
addr_user equ word ptr .101Ah
|
||||
addr_cpm_error equ word ptr .101Ch ;Localised messages
|
||||
addr_bdos_fn equ word ptr .101Eh
|
||||
addr_file equ word ptr .1020h
|
||||
addr_writeerr equ word ptr .1022h
|
||||
addr_rodisk equ word ptr .1024h
|
||||
addr_rofile equ word ptr .1026h
|
||||
addr_invaliddrv equ word ptr .1028h
|
||||
addr_pwderr equ word ptr .102Ah
|
||||
addr_filexists equ word ptr .102Ch
|
||||
addr_ambiguous equ word ptr .102Eh
|
||||
country_info equ word ptr .1030h ;DOS country info
|
||||
switch_char equ byte ptr .1050h ;DOS switch character
|
||||
;
|
||||
; Addresses in the process table
|
||||
;
|
||||
proc_nextready equ word ptr .00h ;Link to next ready process
|
||||
proc_nextseg equ word ptr .02h ;Link to next process in
|
||||
;numerical order
|
||||
proc_status equ byte ptr .04h ; 0 => Runnable
|
||||
; 1 => Waiting on timer
|
||||
; 2 => Terminated
|
||||
; 3 => Waiting on flag
|
||||
proc_pid equ byte ptr .05h
|
||||
proc_flags equ word ptr .06h ; Bit 0 => killed
|
||||
; Bit 1 => Using 8087
|
||||
proc_name equ byte ptr .08h
|
||||
proc_incpm equ byte ptr .10h
|
||||
proc_intfunc equ byte ptr .11h
|
||||
proc_intmod equ byte ptr .12h
|
||||
proc_indisk equ byte ptr .13h
|
||||
proc_errcode equ word ptr .14h
|
||||
proc_conmode equ word ptr .16h
|
||||
proc_background equ byte ptr .18h
|
||||
proc_delimiter equ byte ptr .19h
|
||||
proc_sp equ word ptr .1Ah
|
||||
proc_ss equ word ptr .1Ch
|
||||
proc_ax equ word ptr .1Eh
|
||||
proc_bx equ word ptr .20h
|
||||
proc_cx equ word ptr .22h
|
||||
proc_dx equ word ptr .24h
|
||||
proc_di equ word ptr .26h
|
||||
proc_si equ word ptr .28h
|
||||
proc_bp equ word ptr .2Ah
|
||||
proc_es equ word ptr .2Ch
|
||||
userDS equ word ptr .2Eh
|
||||
userES equ word ptr .30h
|
||||
userStack equ word ptr .32h
|
||||
proc_drive equ byte ptr .36h
|
||||
proc_uid equ byte ptr. 37h
|
||||
proc_dma equ dword ptr .38h
|
||||
proc_fx equ byte ptr .3Ch
|
||||
proc_find1st equ dword ptr .3Eh
|
||||
proc_errmode equ byte ptr .46h
|
||||
proc_multisec equ byte ptr .47h
|
||||
proc_passwd equ byte ptr .48h
|
||||
proc_countdown equ word ptr .50h
|
||||
proc_bdos_offs equ word ptr .52h
|
||||
proc_bdos_seg equ word ptr .54h
|
||||
proc_int0 equ dword ptr .56h
|
||||
proc_using_drvs equ word ptr .6Eh
|
||||
proc_onblock equ dword ptr .70h
|
||||
proc_dirname equ word ptr .74h
|
||||
|
||||
proc_cpm_stack equ byte ptr .100h
|
||||
;
|
||||
; Addresses in the file redirection structure
|
||||
;
|
||||
redir_mode equ byte ptr .0 ; Bit 0: 0=write 1=read
|
||||
; Bits 1-2: 0=file 1=aux 2=lst
|
||||
redir_fcb equ byte ptr .1 ; FCB for redirected file
|
||||
redir_buf_count equ byte ptr .25h ; Count of bytes in current buffer
|
||||
redir_cwd equ word ptr .26h ; Current directory for redirected file
|
||||
redir_buf equ byte ptr .28h ; Current record
|
||||
|
||||
|
@@ -0,0 +1,193 @@
|
||||
/* Convert the Personal CP/M-86 BDOS (compiled as a small-model EXE)
|
||||
* to CMD.
|
||||
* Copyright (C) 2003, 2007 John Elliott <jce@seasip.demon.co.uk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DS_LEN 0xF0 /* Length of data segment (paras) */
|
||||
|
||||
int gl_base = 0x60;
|
||||
|
||||
/* EXE header (plus first 8 bytes of EXE file) */
|
||||
unsigned char exe_header[0x208];
|
||||
|
||||
/* CMD header */
|
||||
unsigned char cmd_header[0x80];
|
||||
|
||||
|
||||
/* Read a word from the EXE header */
|
||||
unsigned short peek(int offset)
|
||||
{
|
||||
unsigned short l = exe_header[offset];
|
||||
unsigned short h = exe_header[offset + 1];
|
||||
return (h << 8) | l;
|
||||
}
|
||||
|
||||
/* Add a group to the CMD header */
|
||||
void addgroup(int type, unsigned short paras, unsigned short base,
|
||||
unsigned short minparas, unsigned short maxparas)
|
||||
{
|
||||
static unsigned char *group = cmd_header;
|
||||
*group++ = type;
|
||||
*group++ = (paras & 0xFF);
|
||||
*group++ = (paras >> 8);
|
||||
*group++ = (base & 0xFF);
|
||||
*group++ = (base >> 8);
|
||||
*group++ = (minparas & 0xFF);
|
||||
*group++ = (minparas >> 8);
|
||||
*group++ = (maxparas & 0xFF);
|
||||
*group++ = (maxparas >> 8);
|
||||
printf("Group %d: len=%04x base=%04x min=%04x max=%04x\n",
|
||||
type, paras, base, minparas, maxparas);
|
||||
}
|
||||
|
||||
/* Copy bytes from one file to another.
|
||||
* TODO: Warn if error. */
|
||||
void mvbytes(FILE *fpexe, FILE *fpcmd, long count)
|
||||
{
|
||||
int c;
|
||||
|
||||
while (count)
|
||||
{
|
||||
c = fgetc(fpexe);
|
||||
fputc(c, fpcmd);
|
||||
--count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
FILE *fpexe, *fpcmd;
|
||||
unsigned short cseg,dseg,sseg,dstop;
|
||||
unsigned short dsmin, dsmax, exeparas;
|
||||
unsigned long exelen, dsbytes;
|
||||
long pos;
|
||||
int n;
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
fprintf(stderr, "Syntax: exe2cmd <exefile> <cmdfile>\n");
|
||||
return 1;
|
||||
}
|
||||
for (n = 3; n < argc; n++)
|
||||
{
|
||||
if (!strncmp(argv[n], "base=", 5))
|
||||
{
|
||||
if (!sscanf(&argv[n][5], "%x", &gl_base))
|
||||
{
|
||||
fprintf(stderr, "base= option incorrect.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Load EXE header, and extract the segment info. This code depends
|
||||
* on the word at CS:6 being the length of the code segment in
|
||||
* paragraphs. */
|
||||
fpexe = fopen(argv[1], "rb");
|
||||
if (!fpexe)
|
||||
{
|
||||
perror(argv[1]);
|
||||
return 1;
|
||||
}
|
||||
if (fread(exe_header, 1, sizeof(exe_header), fpexe) < (int)sizeof(exe_header)
|
||||
/* Check for CP/M-86 BDOS:
|
||||
* 32 header paragraphs
|
||||
* First relocation is at address 6 or less */
|
||||
|| peek(8) != 32 || peek(32) > 6)
|
||||
{
|
||||
fclose(fpexe);
|
||||
fprintf(stderr, "%s is not a BDOS image\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
cseg = 0;
|
||||
dseg = peek(0x206);
|
||||
sseg = peek(14);
|
||||
exelen = 512L * peek(4);
|
||||
if (peek(2)) exelen -= (512 - peek(2));
|
||||
exeparas = (exelen + 15) >> 4;
|
||||
/*
|
||||
dstop = exeparas - peek(8);
|
||||
ssparas = dstop - sseg;
|
||||
dsmin = dstop - dseg + peek(10);
|
||||
dsmax = dstop - dseg + peek(12);
|
||||
*/
|
||||
/* This is CP/M-86, the DSEG is a fixed size */
|
||||
dsmin = dsmax = DS_LEN;
|
||||
dstop = dseg + DS_LEN;
|
||||
printf("EXE length = %04lx\n", exelen);
|
||||
printf("EXE header len = %04x\n", peek(8));
|
||||
printf("EXE paras = %04x\n", exeparas);
|
||||
printf("DS top = %04x\n", dstop);
|
||||
printf("CS: %04x length %04x\n", cseg, dseg - cseg);
|
||||
printf("DS: %04x length %04x\n", dseg, dstop - dseg);
|
||||
|
||||
/* Now generate CP/M-86 header. */
|
||||
addgroup(1, dseg - cseg, 0, dseg - cseg, 0);
|
||||
addgroup(2, dstop - dseg, 0, dsmin, 0);
|
||||
|
||||
fpcmd = fopen(argv[2], "wb");
|
||||
if (fpcmd == NULL)
|
||||
{
|
||||
perror(argv[2]);
|
||||
fclose(fpexe);
|
||||
return 2;
|
||||
}
|
||||
if (fwrite(cmd_header, 1, sizeof(cmd_header), fpcmd) < (int)sizeof(cmd_header)
|
||||
|| fwrite(exe_header+0x200, 1, 8, fpcmd) < 8)
|
||||
{
|
||||
fclose(fpcmd);
|
||||
fclose(fpexe);
|
||||
perror(argv[2]);
|
||||
return 2;
|
||||
}
|
||||
/* Write the code segment. The first 8 bytes have been done. */
|
||||
mvbytes(fpexe, fpcmd, 16L * (dseg - cseg) - 8);
|
||||
/* Write the data segment. */
|
||||
dsbytes = 16L * (dstop - dseg);
|
||||
mvbytes(fpexe, fpcmd, 40);
|
||||
/* Apply fixups to offsets within the data segment */
|
||||
for (n = 0; n < 8; n++)
|
||||
{
|
||||
unsigned seg;
|
||||
if (n == 6)
|
||||
{
|
||||
mvbytes(fpexe, fpcmd, 4);/* Address of DOS module */
|
||||
continue;
|
||||
}
|
||||
mvbytes(fpexe, fpcmd, 2); /* Offset */
|
||||
fread(exe_header, 1, 2, fpexe);
|
||||
seg = peek(0) + gl_base;
|
||||
fputc(seg & 0xFF, fpcmd);
|
||||
fputc(seg >> 8, fpcmd);
|
||||
}
|
||||
mvbytes(fpexe, fpcmd, dsbytes - 72);
|
||||
/* Pad the CMD file out to a whole number of records */
|
||||
pos = ftell(fpcmd);
|
||||
while (pos & 0x7F)
|
||||
{
|
||||
fputc(0, fpcmd);
|
||||
++pos;
|
||||
}
|
||||
fclose(fpcmd);
|
||||
fclose(fpexe);
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
|
||||
ZIPFILES= bdos.a86 cmdio.c equates.a86 mem.a86 system.a86 \
|
||||
serial.a86 cmdio.h exe2cmd.c misc.a86 proctbl.a86 \
|
||||
xios.cmd ccp.cmd dpgen.c makefile rtm.a86 \
|
||||
cio.a86 entry.a86 sup.a86 bdos31ex.inp \
|
||||
ccpldr.a86
|
||||
|
||||
OBJECTS=entry.obj sup.obj rtm.obj mem.obj cio.obj misc.obj bdos.obj \
|
||||
ccpldr.obj proctbl.obj
|
||||
|
||||
all: bdos.cmd new.sys
|
||||
|
||||
new.sys: bdos.cmd ccp.cmd xios.cmd dpgen.exe
|
||||
dpgen base=70
|
||||
|
||||
bdos31.exe: $(OBJECTS)
|
||||
linkexe bdos31ex[i
|
||||
|
||||
bdos.cmd: bdos31.exe exe2cmd.exe
|
||||
exe2cmd bdos31.exe bdos.cmd base=70
|
||||
|
||||
%.obj: %.a86 equates.a86 system.a86
|
||||
rasm86 $<
|
||||
|
||||
misc.obj: misc.a86 equates.a86 system.a86 serial.a86
|
||||
|
||||
dpgen.exe: dpgen.c cmdio.c cmdio.h
|
||||
pacc -Bl dpgen.c cmdio.c
|
||||
|
||||
exe2cmd.exe: exe2cmd.c
|
||||
pacc -Bs $<
|
||||
|
||||
clean:
|
||||
xdel $(OBJECTS)
|
||||
xdel bdos.cmd new.sys
|
||||
|
||||
zip:
|
||||
zip bdos31.zip $(ZIPFILES)
|
@@ -0,0 +1,737 @@
|
||||
|
||||
include equates.a86
|
||||
|
||||
dseg
|
||||
extrn pq_memmgr:word
|
||||
extrn ccp_dseg:word
|
||||
|
||||
cseg
|
||||
extrn bdos_callback:near
|
||||
|
||||
public mem_init
|
||||
public mem_main
|
||||
;
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mem_init: retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mem_main: push dx
|
||||
push si
|
||||
mov bx, offset pq_memmgr
|
||||
mov cx, 204h
|
||||
call bdos_callback
|
||||
inc es:proc_indisk
|
||||
pop si
|
||||
pop dx
|
||||
call cs:mem_functions[si]
|
||||
jb mc_success
|
||||
mov bx, 0FFFFh
|
||||
|
||||
mc_success: ; CODE XREF: funcs_MC+17j
|
||||
push bx
|
||||
push cx
|
||||
mov cx, 206h
|
||||
call bdos_callback
|
||||
mov bx, offset pq_memmgr
|
||||
mov cx, 205h
|
||||
call bdos_callback
|
||||
pop cx
|
||||
pop bx
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mem_functions dw offset MC_MAX ; DATA XREF: funcs_MC+12o
|
||||
dw offset MC_ABSMAX
|
||||
dw offset MC_ALLOC
|
||||
dw offset MC_ABSALLOC
|
||||
dw offset MC_FREE
|
||||
dw offset MC_ALLFREE
|
||||
dw offset mc_temp_untemp
|
||||
dw offset mc_cleanprg
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ABSALLOC: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+36o
|
||||
call get_mcb_pars
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ABSMAX: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+32o
|
||||
call get_mcb_pars
|
||||
mov mcb_len_min, 1
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ALLFREE: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Ao
|
||||
call get_mcb_pars
|
||||
cmp mcb_ext, 2
|
||||
jnb mcaf_just_anyle
|
||||
mov dx, 8
|
||||
call free_allmem
|
||||
|
||||
mcaf_just_anyle: ; CODE XREF: MC_ALLFREE+8j
|
||||
jmp mc_anyleft
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ALLOC: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+34o
|
||||
call get_mcb_pars
|
||||
mov mcb_segment, 0
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_FREE: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+38o
|
||||
call get_mcb_pars
|
||||
mov al, mcb_ext
|
||||
cmp al, 0FFh
|
||||
jnz free_onemem
|
||||
mov dx, 8
|
||||
call free_allmem
|
||||
jmps free_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
free_onemem: ; CODE XREF: MC_FREE+8j
|
||||
cmp al, 2
|
||||
jnb free_done
|
||||
call ml_free
|
||||
jmps free_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmps free_done
|
||||
|
||||
free_done: ; CODE XREF: MC_FREE+10j MC_FREE+14j
|
||||
; ...
|
||||
jmp mc_anyleft
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_MAX: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+30o
|
||||
call get_mcb_pars
|
||||
mov mcb_segment, 0
|
||||
mov mcb_len_min, 1
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
;
|
||||
; Resets the 'temporary' flag on all temporary allocations,
|
||||
; making them permanent.
|
||||
;
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mc_temp_untemp: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Co
|
||||
mov bx, ccp_dseg ; Temp blocks exist?
|
||||
test bx, bx
|
||||
jnz mctu_temp_found
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mctu_temp_found: ; CODE XREF: mc_temp_untemp+6j
|
||||
push bx
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mctu_loop: ; CODE XREF: mc_temp_untemp+16j
|
||||
call ml_next
|
||||
jnb mctu_done
|
||||
and byte ptr 5[di], 0FEh
|
||||
jmps mctu_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mctu_done: ; CODE XREF: mc_temp_untemp+10j
|
||||
pop bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mc_cleanprg: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Eo
|
||||
push dx
|
||||
;
|
||||
; If bit 2 set in process flags, look for all memory blocks
|
||||
; with bit 2 set in their flags and set bit 0
|
||||
;
|
||||
test es:proc_flags, 4
|
||||
jz mccp_endlabel
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mccp_label: ; CODE XREF: mc_cleanprg+16j
|
||||
; mc_cleanprg+1Cj
|
||||
call ml_next
|
||||
jnb mccp_endlabel
|
||||
test byte ptr 5[di], 4
|
||||
jz mccp_label
|
||||
or byte ptr 5[di], 1
|
||||
jmps mccp_label
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_endlabel: ; CODE XREF: mc_cleanprg+8j
|
||||
; mc_cleanprg+10j
|
||||
pop dx
|
||||
cmp dx, 1
|
||||
jz mccp_type1
|
||||
xor dx, dx
|
||||
call free_allmem
|
||||
jmps mccp_end
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_type1: ; CODE XREF: mc_cleanprg+22j
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mccp_type1_loop: ; CODE XREF: mc_cleanprg+3Aj
|
||||
; mc_cleanprg+40j
|
||||
call ml_next
|
||||
jnb mccp_end
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al
|
||||
jnz mccp_type1_loop
|
||||
mov byte ptr 4[di], 0FDh
|
||||
jmps mccp_type1_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_end: ; CODE XREF: mc_cleanprg+29j
|
||||
; mc_cleanprg+31j
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
get_mcb_pars: ; CODE XREF: MC_ABSALLOCp MC_ABSMAXp
|
||||
; ...
|
||||
mov caller_mcb, dx
|
||||
mov bx, dx
|
||||
push es
|
||||
mov es, es:userDS
|
||||
mov ax, es:[bx]
|
||||
mov mcb_segment, ax
|
||||
mov ax, es:2[bx]
|
||||
mov mcb_len_min, ax
|
||||
mov mcb_len_max, ax
|
||||
xor ax, ax
|
||||
mov cl, es:4[bx]
|
||||
mov mcb_ext, cl
|
||||
cmp cl, 2
|
||||
jnz mcb_ext_range
|
||||
mov ax, 2 ; Keep memory flag
|
||||
|
||||
mcb_ext_range: ; CODE XREF: get_mcb_pars+29j
|
||||
pop es
|
||||
mov dx, es:proc_flags
|
||||
and dx, 0Ch
|
||||
cmp ccp_dseg, 0 ; Do temporary blocks exist?
|
||||
jz mcb_noccpdseg
|
||||
and dx, 0FFFBh
|
||||
|
||||
mcb_noccpdseg: ; CODE XREF: get_mcb_pars+3Dj
|
||||
or ax, dx
|
||||
mov mcb_keep_flag, al
|
||||
mov cx, 2Bh ; Bad Parameter
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
common_alloc: ; CODE XREF: MC_ABSALLOC+3j
|
||||
; MC_ABSMAX+9j ...
|
||||
cmp mcb_ext, 2 ; Remain after termination?
|
||||
ja mc_anyleft
|
||||
call allocate_block
|
||||
|
||||
mc_anyleft: ; CODE XREF: MC_ALLFREE+10j
|
||||
; MC_FREE+1Dj ...
|
||||
push es
|
||||
pushf
|
||||
mov es, es:userDS
|
||||
mov di, offset mem_table-6
|
||||
xor dl, dl ; Not available
|
||||
call ml_find_free
|
||||
jnb mc_noneleft
|
||||
inc dl ; Available
|
||||
|
||||
mc_noneleft: ; CODE XREF: common_alloc+19j
|
||||
mov bx, caller_mcb
|
||||
mov es:4[bx], dl
|
||||
mov ax, mcb_segment
|
||||
mov es:[bx], ax
|
||||
mov ax, mcb_len_max
|
||||
mov es:2[bx], ax
|
||||
xor bx, bx
|
||||
popf
|
||||
pop es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
allocate_block: ; CODE XREF: common_alloc+7p
|
||||
mov cx, 43 ; Bad parameter
|
||||
mov ax, mcb_len_min
|
||||
mov bx, mcb_len_max
|
||||
push ax
|
||||
or ax, bx
|
||||
pop ax
|
||||
jz mcb_param_err
|
||||
cmp ax, bx
|
||||
ja mcb_param_err
|
||||
cmp mcb_segment, 0
|
||||
jz mcb_not_abs
|
||||
|
||||
mcb_abs_retry: ; CODE XREF: allocate_block+36j
|
||||
mov dx, mcb_segment ; Find the memory list entry
|
||||
; controlling this segment.
|
||||
call ml_find_byseg
|
||||
jnb mcb_param_err ; If failed, segment not in the memory arena.
|
||||
mov al, 4[di] ; Get the PID of the memory owner
|
||||
cmp al, 0FEh ; Does the entry contain free memory?
|
||||
jz mcb_wasfree ; Yes. Allocate in it.
|
||||
test byte ptr 5[di], 1; Is it owned by a temporary block?
|
||||
jz mcb_nofree
|
||||
push ax ; Free all temporary blocks
|
||||
call free_temp_block
|
||||
pop ax ; And if that worked, try again
|
||||
jb mcb_abs_retry
|
||||
|
||||
mcb_nofree: ; CODE XREF: allocate_block+2Fj
|
||||
cmp al, es:proc_pid ; Block is in use. By the current
|
||||
; process?
|
||||
jnz mcb_param_err
|
||||
mov ax, [di] ; Suppose so.
|
||||
cmp ax, mcb_segment ; Does the passed start address match the
|
||||
; start of the block?
|
||||
jnz mcb_param_err
|
||||
;
|
||||
; In this case, we're trying to allocate a block
|
||||
; which was allocated already. Update its
|
||||
; flags and then leave it.
|
||||
;
|
||||
mov al, mcb_keep_flag
|
||||
or 5[di], al
|
||||
jmps mcb_allocated
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_wasfree: ; CODE XREF: allocate_block+29j
|
||||
mov ax, [di] ; Start of block
|
||||
add ax, 2[di] ; End of block
|
||||
sub ax, mcb_segment ; Max size to allocate
|
||||
cmp ax, mcb_len_min ; Is it > min size requested?
|
||||
jb mcb_param_err
|
||||
call ml_checksplit
|
||||
jnb mcb_didntsplit
|
||||
mov byte ptr 4[si], 0FEh; Mark the new block as free
|
||||
mov di, si
|
||||
|
||||
mcb_didntsplit: ; CODE XREF: allocate_block+61j
|
||||
jmps mcb_doalloc
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_not_avail: ; CODE XREF: allocate_block+96j
|
||||
mov cx, 3
|
||||
|
||||
mcb_param_err: ; CODE XREF: allocate_block+Ej
|
||||
; allocate_block+12j
|
||||
; ...
|
||||
clc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_not_abs: ; CODE XREF: allocate_block+19j
|
||||
; allocate_block+90j
|
||||
xor dx, dx
|
||||
mov di, offset mem_table-6
|
||||
|
||||
not_abs_next: ; CODE XREF: allocate_block+89j
|
||||
call ml_find_free
|
||||
jnb not_abs_endscan
|
||||
mov ax, 2[di] ; Length of free block
|
||||
cmp dx, ax ; Suitable candidate?
|
||||
jnb not_abs_small
|
||||
mov dx, ax
|
||||
mov si, di ; Keep it in mind
|
||||
|
||||
not_abs_small: ; CODE XREF: allocate_block+7Fj
|
||||
cmp ax, mcb_len_max
|
||||
jb not_abs_next ; Block isn't ideal
|
||||
jmps mcb_doalloc; Got an ideal block. Use it.
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
not_abs_endscan: ; CODE XREF: allocate_block+78j
|
||||
call free_temp_block ; Free temp blocks and try again
|
||||
jb mcb_not_abs
|
||||
cmp dx, mcb_len_min ; Can we at least get the minimum?
|
||||
jb mcb_not_avail
|
||||
mov ax, 2[si] ; OK, make do with the best one we found
|
||||
mov mcb_len_max, ax
|
||||
mov di, si
|
||||
|
||||
mcb_doalloc: ; CODE XREF: allocate_block+69j
|
||||
; allocate_block+8Bj
|
||||
mov ax, [di]
|
||||
mov mcb_segment, ax
|
||||
call ml_splittail ; If not all the block was taken,
|
||||
; mark the remainder as free.
|
||||
jnb mcb_tookall
|
||||
mov byte ptr 4[si], 0FEh
|
||||
|
||||
mcb_tookall: ; CODE XREF: allocate_block+A8j
|
||||
mov al, mcb_keep_flag
|
||||
mov 5[di], al
|
||||
mov al, es:proc_pid
|
||||
test mcb_keep_flag, 4
|
||||
jz mcb_gotowner
|
||||
mov al, 0FCh ; Owner -4 for blocks that persist
|
||||
|
||||
mcb_gotowner: ; CODE XREF: allocate_block+BDj
|
||||
mov 4[di], al
|
||||
|
||||
mcb_allocated: ; CODE XREF: allocate_block+4Dj
|
||||
mov ax, 2[di]
|
||||
mov mcb_len_max, ax
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
free_temp_block: ; CODE XREF: allocate_block+32p
|
||||
; allocate_block+8Dp
|
||||
mov di, offset mem_table-6
|
||||
clc
|
||||
pushf
|
||||
|
||||
freetmp_loop: ; CODE XREF: free_temp_block+Ej
|
||||
; free_temp_block+1Ej
|
||||
call ml_next
|
||||
jnb freetmp_done
|
||||
test byte ptr 5[di], 1; Temporary?
|
||||
jz freetmp_loop
|
||||
popf
|
||||
stc
|
||||
pushf
|
||||
push di ; If so, free it
|
||||
call ml_freeblk
|
||||
pop di
|
||||
mov ccp_dseg, 0
|
||||
jmps freetmp_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
freetmp_done: ; CODE XREF: free_temp_block+8j
|
||||
popf
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
free_allmem: ; CODE XREF: MC_ALLFREE+Dp
|
||||
; MC_FREE+Dp ...
|
||||
mov di, offset mem_table-6
|
||||
push dx
|
||||
|
||||
freeall_loop: ; CODE XREF: free_allmem+10j
|
||||
; free_allmem+19j ...
|
||||
call ml_next
|
||||
jnb allmem_freed
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al ; Owned by this process?
|
||||
jnz freeall_loop
|
||||
pop dx
|
||||
mov al, 5[di] ; Flags
|
||||
test al, dl
|
||||
push dx
|
||||
jnz freeall_loop
|
||||
test al, 2
|
||||
mov byte ptr 4[di], 0FDh
|
||||
jnz freeall_loop
|
||||
call ml_freeblk
|
||||
jmps freeall_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
allmem_freed: ; CODE XREF: free_allmem+7j
|
||||
pop dx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_free: ; CODE XREF: MC_FREE+16p
|
||||
mov dx, mcb_segment
|
||||
call ml_find_byseg ; Find memory list entry for this segment
|
||||
jnb ml_freefail
|
||||
cmp byte ptr 4[di], 0FDh
|
||||
jz ml_canfree ; Owned by ??? shared ???
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al ; Owned by this process?
|
||||
jz ml_canfree
|
||||
mov cx, 20h ; Don't own resource
|
||||
jmps ml_freefail
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_canfree: ; CODE XREF: ml_free+Dj ml_free+16j
|
||||
cmp dx, [di] ; Block start matches?
|
||||
jz ml_freeblk
|
||||
call ml_splitblk ; No. Split block
|
||||
mov di, si
|
||||
jb ml_freeblk
|
||||
|
||||
ml_freefail: ; CODE XREF: ml_free+7j ml_free+1Bj
|
||||
clc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_freeblk: ; CODE XREF: free_temp_block+14p
|
||||
; free_allmem+23p ...
|
||||
mov ax, 0FEh
|
||||
mov 4[di], al ; Owner = free
|
||||
mov byte ptr 5[di], 0; Persist = 0
|
||||
mov si, di
|
||||
mov dx, [si]
|
||||
dec dx ; Who owns the para before the memory
|
||||
; we're freeing?
|
||||
push ax
|
||||
call ml_find_byseg
|
||||
pop ax
|
||||
jnb no_coalesce ; Not found
|
||||
cmp 4[di], al
|
||||
jnz no_coalesce ; Not free
|
||||
mov cx, 2[si]
|
||||
add 2[di], cx ; Merge blocks
|
||||
mov byte ptr 4[si], 0FFh
|
||||
mov si, di ; Destroy this block
|
||||
|
||||
no_coalesce: ; CODE XREF: ml_freeblk+14j
|
||||
; ml_freeblk+19j
|
||||
mov di, si
|
||||
mov dx, [di]
|
||||
add dx, 2[di] ; Now try the same with the following
|
||||
; block.
|
||||
push ax
|
||||
call ml_find_byseg
|
||||
pop ax
|
||||
jnb no_coalesce2
|
||||
cmp 4[di], al
|
||||
jnz no_coalesce2
|
||||
mov cx, 2[di]
|
||||
add 2[si], cx
|
||||
mov byte ptr 4[di], 0FFh
|
||||
|
||||
no_coalesce2: ; CODE XREF: ml_freeblk+33j
|
||||
; ml_freeblk+38j
|
||||
mov di, si
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_checksplit: ; CODE XREF: allocate_block+5Ep
|
||||
mov ax, mcb_segment
|
||||
mov dx, ax ; DX = first requested para
|
||||
sub ax, [di] ; AX = paras before allocated area
|
||||
cmp ax, 1 ; If there are some...
|
||||
jnb ml_splitblk ; Then split the block
|
||||
clc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_splittail: ; CODE XREF: allocate_block+A5p
|
||||
mov dx, mcb_len_max
|
||||
mov ax, 2[di]
|
||||
sub ax, dx
|
||||
cmp ax, 1
|
||||
jnb ml_dospltail
|
||||
clc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_dospltail: ; CODE XREF: ml_splittail+Cj
|
||||
add dx, mcb_segment
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_splitblk: ; CODE XREF: ml_free+21p ml_checksplit+Aj
|
||||
mov cx, 12h
|
||||
push di
|
||||
mov di, offset mem_table-6
|
||||
|
||||
ml_split1: ; CODE XREF: ml_splitblk+10j
|
||||
call ml_next
|
||||
jnb ml_split2
|
||||
cmp byte ptr 4[di], 0FFh
|
||||
jnz ml_split1
|
||||
pop si
|
||||
xchg si, di
|
||||
mov [si], dx
|
||||
mov ax, [di]
|
||||
add ax, 2[di]
|
||||
sub ax, dx
|
||||
mov 2[si], ax
|
||||
sub dx, [di]
|
||||
mov 2[di], dx
|
||||
stc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_split2: ; CODE XREF: ml_splitblk+Aj
|
||||
pop di
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_find_byseg: ; CODE XREF: allocate_block+1Fp
|
||||
; ml_free+4p ...
|
||||
mov di, offset mem_table-6
|
||||
mov cx, 3
|
||||
|
||||
mlfbs_loop: ; CODE XREF: ml_find_byseg+Fj
|
||||
; ml_find_byseg+15j ...
|
||||
call ml_next
|
||||
jnb mlfbs_end
|
||||
cmp byte ptr 4[di], 0FFh
|
||||
jz mlfbs_loop
|
||||
mov ax, [di]
|
||||
cmp ax, dx
|
||||
ja mlfbs_loop
|
||||
add ax, 2[di]
|
||||
cmp dx, ax
|
||||
jnb mlfbs_loop
|
||||
|
||||
mlfbs_end: ; CODE XREF: ml_find_byseg+9j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_find_free: ; CODE XREF: common_alloc+16p
|
||||
; allocate_block+75p
|
||||
; ...
|
||||
call ml_next
|
||||
jnb no_free_ml
|
||||
cmp byte ptr 4[di], 0FEh
|
||||
jnz ml_find_free
|
||||
stc
|
||||
|
||||
no_free_ml: ; CODE XREF: ml_find_free+3j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_next: ; CODE XREF: mc_temp_untemp+Dp
|
||||
; mc_cleanprg+Dp ...
|
||||
add di, 6
|
||||
mov ax, offset msg_cannot_load
|
||||
cmp di, ax
|
||||
retn
|
||||
|
||||
|
||||
dseg
|
||||
|
||||
mcb_len_min dw 0 ; DATA XREF: MC_ABSMAX+3w MC_MAX+9w
|
||||
; ...
|
||||
mcb_len_max dw 0 ; DATA XREF: get_mcb_pars+19w
|
||||
; common_alloc+2Br ...
|
||||
mcb_segment dw 0 ; DATA XREF: MC_ALLOC+3w MC_MAX+3w
|
||||
; ...
|
||||
mcb_keep_flag db 0 ; DATA XREF: get_mcb_pars+45w
|
||||
; allocate_block+47r
|
||||
; ...
|
||||
caller_mcb dw 0 ; DATA XREF: get_mcb_parsw
|
||||
; common_alloc+1Dr
|
||||
mcb_ext db 0 ; DATA XREF: MC_ALLFREE+3r
|
||||
; MC_FREE+3r ...
|
||||
end
|
||||
|
@@ -0,0 +1,397 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
dseg
|
||||
extrn rlr:word
|
||||
extrn login_vector:word
|
||||
extrn readonly_vector:word
|
||||
extrn date_days:word
|
||||
extrn date_secs:byte
|
||||
extrn bdos_8087_inuse:word
|
||||
extrn cio_flags:word
|
||||
extrn ccp_dseg:word
|
||||
extrn sysvar_131:byte
|
||||
extrn sysvar_132:byte
|
||||
extrn search_path:byte
|
||||
extrn proc_count:byte
|
||||
extrn time_slice:byte
|
||||
extrn page_mode:byte
|
||||
extrn temp_drive:byte
|
||||
extrn max_x:byte
|
||||
extrn max_y:byte
|
||||
extrn bdos_ver:word
|
||||
extrn boot_drive:byte
|
||||
cseg
|
||||
|
||||
public misc_init
|
||||
public misc_main
|
||||
|
||||
|
||||
db 'COPYRIGHT(C)1983,DIGITAL RESEARCH'
|
||||
db '(11/16/83)'
|
||||
|
||||
sernumber:
|
||||
include serial.a86
|
||||
|
||||
misc_init: ; DATA XREF: dseg:0016o
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
misc_functions dw offset P_RSX_default ; DATA XREF: bdos:2317o
|
||||
dw offset S_BDOSVER
|
||||
dw offset DRV_LOGINVEC
|
||||
dw offset DRV_GET
|
||||
dw offset F_DMAOFF
|
||||
dw offset DRV_ROVEC
|
||||
dw offset F_USERNUM
|
||||
dw offset F_MULTISEC
|
||||
dw offset F_ERRMODE
|
||||
dw offset S_SYSVAR
|
||||
dw offset F_DMASEG
|
||||
dw offset F_DMAGET
|
||||
dw offset T_SET
|
||||
dw offset T_GET
|
||||
dw offset S_SERIAL
|
||||
dw offset P_CODE
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
misc_main: ; DATA XREF: dseg:0014o
|
||||
jmp cs:misc_functions[si]
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_RSX_default: ; DATA XREF: bdos:22EFo
|
||||
mov bx, 0FFFFh
|
||||
mov cx, 2
|
||||
retn
|
||||
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_BDOSVER: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F1o
|
||||
mov bx, bdos_ver
|
||||
retn
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_SYSVAR: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2301o
|
||||
mov si, dx ; Caller SCBPB
|
||||
mov dx, ds ; Our DS
|
||||
push ds
|
||||
push es
|
||||
mov ds, es:userDS ; Caller DS
|
||||
mov di, offset public_sysvars
|
||||
xor bx, bx
|
||||
mov bl, [si]
|
||||
cmp bl, 6
|
||||
jb sysvar_valid
|
||||
sub bl, 80h
|
||||
jb sysvar_invalid
|
||||
mov di, offset private_sysvars
|
||||
cmp bl, 0Eh
|
||||
jb sysvar_valid
|
||||
|
||||
sysvar_invalid: ; CODE XREF: S_SYSVAR+1Aj S_SYSVAR+4Fj
|
||||
; ...
|
||||
mov bx, 0FFFFh
|
||||
jmps s_sysvar_ret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
sysvar_valid: ; CODE XREF: S_SYSVAR+15j S_SYSVAR+22j
|
||||
shl bx, 1
|
||||
shl bx, 1
|
||||
mov cx, cs:[bx+di]
|
||||
test ch, 80h ; Process variable?
|
||||
jz not_proc_var
|
||||
mov dx, es
|
||||
|
||||
not_proc_var: ; CODE XREF: S_SYSVAR+33j
|
||||
mov di, cs:2[bx+di]
|
||||
test byte ptr 1[si], 0FFh
|
||||
lea si, 2[si]
|
||||
jnz sysvar_set
|
||||
xchg si, di
|
||||
push ds
|
||||
pop es
|
||||
|
||||
mov ds, dx
|
||||
|
||||
jmps sysvar_access
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
sysvar_set: ; CODE XREF: S_SYSVAR+42j
|
||||
test ch, 40h ; Read-only?
|
||||
jnz sysvar_invalid
|
||||
cmp es:proc_background, 0
|
||||
jz sysvar_is_fg
|
||||
test ch, 20h ; Owned by FG process?
|
||||
jnz sysvar_invalid
|
||||
|
||||
sysvar_is_fg: ; CODE XREF: S_SYSVAR+57j
|
||||
mov es, dx
|
||||
|
||||
sysvar_access: ; CODE XREF: S_SYSVAR+4Aj
|
||||
test ch, 10h ; Volatile?
|
||||
jz sysvar_nocli
|
||||
cli
|
||||
|
||||
sysvar_nocli: ; CODE XREF: S_SYSVAR+63j
|
||||
xor ch, ch
|
||||
rep movsb
|
||||
sti
|
||||
xor bx, bx
|
||||
|
||||
s_sysvar_ret: ; CODE XREF: S_SYSVAR+27j
|
||||
pop es
|
||||
pop ds
|
||||
|
||||
retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
public_sysvars dw 2001h ; DATA XREF: S_SYSVAR+Bo
|
||||
dw offset max_x
|
||||
dw 2001h
|
||||
dw offset max_y
|
||||
dw 2001h
|
||||
dw offset page_mode
|
||||
dw 6001h
|
||||
dw offset xios_bh_ticks
|
||||
dw 2001h
|
||||
dw offset temp_drive
|
||||
dw 1005h
|
||||
dw offset date_days
|
||||
private_sysvars dw 2001h ; DATA XREF: S_SYSVAR+1Co
|
||||
dw offset xios_bh_8087
|
||||
dw 0E001h
|
||||
dw offset proc_pid
|
||||
dw 801Ah
|
||||
dw offset proc_drive
|
||||
dw 2001h
|
||||
dw offset sysvar_131
|
||||
dw 20FFh
|
||||
dw offset sysvar_132
|
||||
dw 3002h
|
||||
dw offset ccp_dseg
|
||||
dw 20FFh
|
||||
dw offset boot_drive
|
||||
dw 3004h
|
||||
dw offset search_path
|
||||
dw 0E001h
|
||||
dw offset proc_background
|
||||
dw 6001h
|
||||
dw offset proc_count
|
||||
dw 2001h
|
||||
dw offset time_slice
|
||||
dw 6002h ; BUG? this is 2002h in PCP/M 2.04e
|
||||
dw offset cio_flags
|
||||
dw 6001h
|
||||
dw offset bdos_8087_inuse
|
||||
dw 9004h
|
||||
dw offset proc_onblock
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_SERIAL: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:230Bo
|
||||
push es
|
||||
mov es, es:userDS
|
||||
mov di, dx
|
||||
mov si, offset sernumber+10
|
||||
mov cx, 3
|
||||
db 0F3h, 2Eh ;REP CS:
|
||||
movsw
|
||||
pop es
|
||||
mov bx, cx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_CODE: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:230Do
|
||||
inc dx
|
||||
jz p_code_get
|
||||
dec dx
|
||||
mov es:proc_errcode, dx
|
||||
|
||||
p_code_get: ; CODE XREF: P_CODE+1j
|
||||
mov bx, es:proc_errcode
|
||||
retn
|
||||
;
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_LOGINVEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F3o
|
||||
mov bx, login_vector
|
||||
ret
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_GET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F5o
|
||||
mov bl, es:proc_drive
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMAOFF: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F7o
|
||||
mov es:word ptr proc_dma, dx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_ROVEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F9o
|
||||
mov bx, readonly_vector
|
||||
ret
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_USERNUM: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FBo
|
||||
mov al, dl
|
||||
cmp al, 0FFh
|
||||
jnz f_setuid
|
||||
mov bl, es:proc_uid
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
f_setuid: ; CODE XREF: F_USERNUM+4j
|
||||
and al, 0Fh
|
||||
mov es:proc_uid, al
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_MULTISEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FDo
|
||||
xor bx, bx
|
||||
or dl, dl
|
||||
jz f_bad_multisec
|
||||
cmp dl, 81h
|
||||
jnb f_bad_multisec
|
||||
mov es:proc_multisec, dl
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
f_bad_multisec: ; CODE XREF: F_MULTISEC+4j
|
||||
; F_MULTISEC+9j
|
||||
dec bx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_ERRMODE: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FFo
|
||||
mov es:proc_errmode, dl
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMASEG: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2303o
|
||||
mov es:word ptr proc_dma+2, dx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMAGET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2305o
|
||||
mov ax, es:word ptr proc_dma+2
|
||||
mov es:userES, ax
|
||||
mov bx, es:word ptr proc_dma
|
||||
retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
T_SET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2307o
|
||||
mov si, dx
|
||||
mov di, offset date_days
|
||||
pushf
|
||||
cli
|
||||
push es
|
||||
push ds
|
||||
mov ds, es:userDS
|
||||
pop es
|
||||
|
||||
movsw
|
||||
movsw
|
||||
push es
|
||||
pop ds
|
||||
pop es
|
||||
|
||||
mov date_secs, 0
|
||||
popf
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
T_GET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2309o
|
||||
mov di, dx
|
||||
mov si, offset date_days
|
||||
push es
|
||||
mov es, es:userDS
|
||||
pushf
|
||||
cli
|
||||
movsw
|
||||
movsw
|
||||
mov bl, date_secs
|
||||
popf
|
||||
pop es
|
||||
retn
|
||||
|
||||
end
|
||||
|
@@ -0,0 +1,45 @@
|
||||
|
||||
include equates.a86
|
||||
cseg
|
||||
|
||||
extrn bdos_rsx:near
|
||||
|
||||
dseg
|
||||
|
||||
public proc1
|
||||
;
|
||||
; First process
|
||||
;
|
||||
proc1 dw 0
|
||||
dw offset proc2 ; DATA XREF: bdos:0044r bdos:0050w
|
||||
rw 2
|
||||
db 'INIT '
|
||||
db 0
|
||||
rw 4
|
||||
db '$'
|
||||
|
||||
rb 45
|
||||
db 1
|
||||
rw 5
|
||||
dw offset bdos_rsx
|
||||
rb 10Ch
|
||||
|
||||
proc2 dw 0
|
||||
dw proc3
|
||||
db 2, 1
|
||||
rb 15Ah
|
||||
|
||||
proc3 dw 0
|
||||
dw proc4
|
||||
db 2, 2
|
||||
rb 15Ah
|
||||
|
||||
|
||||
proc4 dw 0
|
||||
dw 0
|
||||
db 2, 3
|
||||
rb 15Ah
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1 @@
|
||||
BDOS 3.1 for PCP/M-86 1.05
|
@@ -0,0 +1,897 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
|
||||
|
||||
dseg
|
||||
extrn rlr:word
|
||||
extrn drl:word
|
||||
extrn bdos_conowner:word
|
||||
extrn lp_sysflag_chg:dword
|
||||
extrn time_slice:byte
|
||||
extrn pq_disk:word
|
||||
extrn lst_owner:byte
|
||||
extrn aux_owner:byte
|
||||
extrn bdos_8087_inuse:byte
|
||||
extrn proc_count:byte
|
||||
extrn bdos_sysflags:word
|
||||
|
||||
cseg
|
||||
extrn bdos_dseg:word
|
||||
extrn bdos_callback:near
|
||||
extrn far_ret_1:near
|
||||
|
||||
public rtm_main
|
||||
public rtm_init
|
||||
public rtm_timeslice
|
||||
public rtm_sysflag
|
||||
|
||||
rtm_init: ; DATA XREF: dseg:0006o
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
rtm_main: ; DATA XREF: dseg:0004o
|
||||
call cs:rtm_functions[si]; 0208, get new process
|
||||
jb proc_ok
|
||||
mov bx, 0FFFFh
|
||||
|
||||
proc_ok: ; CODE XREF: bdos:0EDFj
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rtm_functions dw offset P_TERMCPM ; DATA XREF: bdos:0EDAo
|
||||
dw offset P_WAITFLAG
|
||||
dw offset P_DELAY
|
||||
dw offset P_DISPATCH
|
||||
dw offset P_0204 ; Enter a process-queue controlled area
|
||||
dw offset P_0205 ; Leave a process-queue controlled area
|
||||
dw offset P_0206
|
||||
dw offset P_0207 ; Check runnable processes
|
||||
dw offset get_new_process; 0208, get new process
|
||||
dw offset P_0209 ; Wake a process (DX = process segment)
|
||||
dw offset P_020A ; Terminate foreground process
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_WAITFLAG: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE7o
|
||||
cli
|
||||
call lookup_flag
|
||||
jnb pwf_badflag
|
||||
cmp ax, 0FFFEh
|
||||
jz pwf_minus2
|
||||
ja pwf_block
|
||||
mov cx, 6
|
||||
clc
|
||||
jmps pwf_badflag
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pwf_block: ; CODE XREF: P_WAITFLAG+Bj
|
||||
mov [bx], es ; Process waiting on flag
|
||||
mov es:proc_status, 3; Make process wait
|
||||
mov es:proc_countdown, dx
|
||||
call delay_dispatch
|
||||
jmps pwf_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pwf_minus2: ; CODE XREF: P_WAITFLAG+9j
|
||||
mov word ptr [bx], 0FFFFh
|
||||
|
||||
pwf_done: ; CODE XREF: P_WAITFLAG+23j
|
||||
stc
|
||||
|
||||
pwf_badflag: ; CODE XREF: P_WAITFLAG+4j
|
||||
; P_WAITFLAG+11j
|
||||
sti
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
rtm_sysflag: ; CODE XREF: xios_int09+EDu
|
||||
; DATA XREF: dseg:0038o
|
||||
cmp dl, 1
|
||||
jnz bsf_not1
|
||||
mov xios_bh_delay, 0
|
||||
mov ax, bdos_conowner
|
||||
push es
|
||||
|
||||
bsf_checktimer: ; CODE XREF: rtm_sysflag+34j
|
||||
mov es, ax
|
||||
cmp es:proc_status, 1; Waiting on timer
|
||||
jnz bsf_nexttimer
|
||||
mov xios_bh_delay, 0FFh
|
||||
call is_proc_busy
|
||||
jb bsf_wakeproc
|
||||
dec es:proc_countdown
|
||||
jnz bsf_nexttimer
|
||||
|
||||
bsf_wakeproc: ; CODE XREF: rtm_sysflag+20j
|
||||
mov dx, es
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
|
||||
bsf_nexttimer: ; CODE XREF: rtm_sysflag+16j
|
||||
; rtm_sysflag+27j
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
jnz bsf_checktimer
|
||||
xor ax, ax
|
||||
pop es
|
||||
jmps bsf_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_not1: ; CODE XREF: rtm_sysflag+3j
|
||||
pushf
|
||||
cli
|
||||
call lookup_flag
|
||||
jnb bsf_badflag
|
||||
cmp ax, 0FFFEh
|
||||
jz bsf_overrun
|
||||
ja bsf_nowake
|
||||
mov word ptr [bx], 0FFFFh
|
||||
mov dx, ax
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
jmps bsf_woken
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_nowake: ; CODE XREF: rtm_sysflag+47j
|
||||
mov word ptr [bx], 0FFFEh
|
||||
|
||||
bsf_woken: ; CODE XREF: rtm_sysflag+52j
|
||||
xor ax, ax
|
||||
jmps bsf_popret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_overrun: ; CODE XREF: rtm_sysflag+45j
|
||||
mov cx, 5
|
||||
|
||||
bsf_badflag: ; CODE XREF: rtm_sysflag+40j
|
||||
mov ax, 0FFFFh
|
||||
|
||||
bsf_popret: ; CODE XREF: rtm_sysflag+5Aj
|
||||
popf
|
||||
|
||||
bsf_done: ; CODE XREF: rtm_sysflag+39j
|
||||
mov bx, ax
|
||||
retf
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
lookup_flag: ; CODE XREF: P_WAITFLAG+1p
|
||||
; rtm_sysflag+3Dp
|
||||
mov cx, 4
|
||||
cmp dl, xios_bh_lastflg
|
||||
ja luf_badflag
|
||||
xor dh, dh
|
||||
mov bx, bdos_sysflags
|
||||
add bx, dx
|
||||
add bx, dx
|
||||
mov ax, [bx]
|
||||
stc
|
||||
|
||||
luf_badflag: ; CODE XREF: lookup_flag+7j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; 0208, get new process
|
||||
|
||||
get_new_process: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EF5o
|
||||
push ds
|
||||
mov bx, bdos_conowner
|
||||
mov cx, 4
|
||||
|
||||
gnp_loop: ; CODE XREF: get_new_process+14j
|
||||
mov ds, bx
|
||||
|
||||
cmp proc_status, 2 ; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jz gnp_found
|
||||
add bx, 16h
|
||||
loop gnp_loop
|
||||
pop ds
|
||||
|
||||
clc
|
||||
mov cx, 0Ch
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
gnp_found: ; CODE XREF: get_new_process+Fj
|
||||
pop ds
|
||||
inc proc_count
|
||||
xor cx, cx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_DELAY: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE9o
|
||||
cmp xios_bh_ticks, 0
|
||||
jnz delay_haveclock
|
||||
mov cx, 45 ; No tick
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
delay_haveclock: ; CODE XREF: P_DELAY+5j
|
||||
mov tick_wait_proc, es
|
||||
cli
|
||||
mov xios_bh_delay, 0FFh; Ask for ticks, because
|
||||
mov es:proc_status, 1; there's now a process waiting
|
||||
mov es:proc_countdown, dx
|
||||
jmp delay_dispatch
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Terminate foreground process
|
||||
|
||||
P_020A: ; CODE XREF: bdos:0EDAu P_TERMCPM+4Cp
|
||||
; DATA XREF: ...
|
||||
xor bp, bp
|
||||
jmps proc_doterm
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
proc_term_bg: ; CODE XREF: P_TERMCPM+5Bp
|
||||
mov bp, 1
|
||||
|
||||
proc_doterm: ; CODE XREF: P_020A+2j
|
||||
push ds
|
||||
push es
|
||||
mov di, offset proc_passwd+6; BDOS pointer - 4
|
||||
lds si, es:4[di]
|
||||
|
||||
proc_unhook_rsx: ; CODE XREF: proc_term_bg+29j
|
||||
; proc_term_bg+58j
|
||||
mov ax, 4[si]
|
||||
or ax, 6[si]
|
||||
jz proc_unhooked
|
||||
mov byte ptr 18[si], 0FFh
|
||||
test bp, bp
|
||||
jnz proc_free_rsx
|
||||
cmp byte ptr 3[si], 0
|
||||
jnz proc_free_rsx
|
||||
push si
|
||||
pop di
|
||||
push ds
|
||||
pop es
|
||||
|
||||
lds si, 4[si]
|
||||
jmps proc_unhook_rsx
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_free_rsx: ; CODE XREF: proc_term_bg+1Aj
|
||||
; proc_term_bg+20j
|
||||
mov ax, 20[si]
|
||||
lds si, 4[si]
|
||||
mov es:4[di], si
|
||||
mov es:6[di], ds
|
||||
push si
|
||||
push ds
|
||||
push di
|
||||
push es
|
||||
push bp
|
||||
mov ds, cs:bdos_dseg
|
||||
mov es, rlr
|
||||
|
||||
mov mcb_to_free, ax
|
||||
mov dx, offset mcb_to_free
|
||||
mov cx, 39h ; MC_FREE
|
||||
call bdos_callback
|
||||
pop bp
|
||||
pop es
|
||||
pop di
|
||||
pop ds
|
||||
pop si
|
||||
jmps proc_unhook_rsx
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_unhooked: ; CODE XREF: proc_term_bg+12j
|
||||
pop es
|
||||
pop ds
|
||||
retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
kill_process: ; CODE XREF: delay_dispatch+6Aj
|
||||
; delay_dispatch+128j
|
||||
mov ax, es
|
||||
cli
|
||||
mov ss, ax
|
||||
mov sp, 100h
|
||||
sti
|
||||
mov al, es:proc_pid
|
||||
cmp aux_owner, al
|
||||
jnz dont_free_aux
|
||||
mov aux_owner, 0FFh
|
||||
|
||||
dont_free_aux: ; CODE XREF: kill_process+11j
|
||||
cmp lst_owner, al
|
||||
jnz dont_free_lst
|
||||
mov lst_owner, 0FFh
|
||||
|
||||
dont_free_lst: ; CODE XREF: kill_process+1Cj
|
||||
and es:proc_flags, 0FFFEh
|
||||
mov es:proc_errcode, 0FFFEh
|
||||
cmp es:proc_fx, 0Ah ; If broken into line input
|
||||
mov es:proc_fx, 0
|
||||
jnz dont_reset_disk
|
||||
mov cx, 0Dh ; Then reset disks
|
||||
call bdos_callback ; presumably so ^C at command prompt
|
||||
; does what the user expects.
|
||||
|
||||
dont_reset_disk: ; CODE XREF: kill_process+3Dj
|
||||
call release_queues ; Release all process queues owned by a process
|
||||
|
||||
call_termcpm: ; CODE XREF: P_0206+1Bj
|
||||
xor cx, cx
|
||||
mov dx, cx
|
||||
jmp bdos_callback
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_0206: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EF1o
|
||||
mov tick_wait_proc, es
|
||||
dec es:proc_indisk
|
||||
jnz P_0207 ; Check runnable processes
|
||||
test es:proc_flags, 1
|
||||
jz P_0207 ; Check runnable processes
|
||||
and es:proc_flags, 0FFFEh
|
||||
jmps call_termcpm
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_TERMCPM: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE5o
|
||||
cli
|
||||
mov es:word ptr proc_onblock, offset far_ret_1
|
||||
mov es:word ptr proc_onblock+2, cs
|
||||
sti
|
||||
push dx
|
||||
call release_queues ; Release all process queues owned by a process
|
||||
mov cx, 723h
|
||||
call bdos_callback
|
||||
pop dx
|
||||
mov cx, 307h
|
||||
call bdos_callback
|
||||
cmp es:proc_background, 0
|
||||
jnz ptc_background
|
||||
call P_020A ; Kill foreground process
|
||||
mov cx, 103h ; Bring CCP to foreground
|
||||
jmp bdos_callback
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ptc_background: ; CODE XREF: P_TERMCPM+4Aj
|
||||
call proc_term_bg ; Terminate background process
|
||||
dec proc_count
|
||||
test es:proc_flags, 2; Was using 8087?
|
||||
jz ptc_not8087
|
||||
and es:proc_flags, 0FFFDh
|
||||
mov bdos_8087_inuse, 0
|
||||
|
||||
ptc_not8087: ; CODE XREF: P_TERMCPM+69j
|
||||
mov tick_wait_proc, es
|
||||
mov es:proc_status, 2; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jmp delay_dispatch
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Check runnable processes
|
||||
|
||||
P_0207: ; CODE XREF: bdos:0EDAu P_0206+9j
|
||||
; ...
|
||||
xor ax, ax
|
||||
mov tick_wait_proc, ax
|
||||
cmp drl, ax ; Anything waiting to run?
|
||||
jnz P_DISPATCH ; If so, give it a go
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Release all process queues owned by a process
|
||||
|
||||
release_queues: ; CODE XREF: P_TERMCPM+2Ep
|
||||
; kill_process+45p
|
||||
mov bx, offset pq_disk
|
||||
|
||||
release_loop: ; CODE XREF: release_queues+Cj
|
||||
push bx
|
||||
call P_0205 ; Leave a process-queue controlled area
|
||||
pop bx
|
||||
mov bx, [bx]
|
||||
test bx, bx
|
||||
jnz release_loop
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Enter a process-queue controlled area
|
||||
|
||||
P_0204: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EEDo
|
||||
mov ax, es
|
||||
mov tick_wait_proc, ax
|
||||
xchg ax, 2[bx] ; Is there already a process waiting?
|
||||
test ax, ax
|
||||
jz P_0207 ; Check runnable processes
|
||||
mov 2[bx], ax ; Yes. Add us to the chain.
|
||||
lea bx, 4[bx]
|
||||
call add_to_chain
|
||||
jmps delay_dispatch
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Leave a process-queue controlled area
|
||||
|
||||
P_0205: ; CODE XREF: bdos:0EDAu release_queues+4p
|
||||
; DATA XREF: ...
|
||||
mov ax, es
|
||||
cmp 2[bx], ax
|
||||
jz pq_leave_1
|
||||
clc ; Queue isn't owned by this process
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pq_leave_1: ; CODE XREF: P_0205+5j
|
||||
mov tick_wait_proc, es
|
||||
push es
|
||||
push bx
|
||||
lea bx, 4[bx]
|
||||
call next_runnable
|
||||
pop bx
|
||||
mov 2[bx], es
|
||||
mov dx, es
|
||||
pop es
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
jmp P_0207 ; Check runnable processes
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Wake a process (DX = process segment)
|
||||
|
||||
P_0209: ; CODE XREF: bdos:0EDAu rtm_sysflag+2Bp
|
||||
; ...
|
||||
test dx, dx
|
||||
jz wake_none
|
||||
push es
|
||||
mov es, dx
|
||||
mov bx, offset drl
|
||||
pushf
|
||||
cli
|
||||
mov es:proc_status, 0; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
call add_to_chain
|
||||
popf
|
||||
pop es
|
||||
stc
|
||||
|
||||
wake_none: ; CODE XREF: P_0209+2j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
delay_dispatch: ; CODE XREF: P_WAITFLAG+20p
|
||||
; P_DELAY+20j ...
|
||||
mov bx, offset delay_cbk
|
||||
jmps disp_general
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
P_DISPATCH: ; CODE XREF: bdos:0EDAu P_0207+9j
|
||||
; DATA XREF: ...
|
||||
mov bx, offset dispatch_cbk
|
||||
|
||||
disp_general: ; CODE XREF: delay_dispatch+3j
|
||||
mov tick_wait_proc, es
|
||||
mov cbk_function, bx
|
||||
pushf
|
||||
push cs
|
||||
mov ax, offset dispret
|
||||
push ax
|
||||
push ds
|
||||
jmps dsptch
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dispret: ; DATA XREF: delay_dispatch+12o
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
rtm_timeslice: ; CODE XREF: xios_int09+EDu
|
||||
; DATA XREF: dseg:0034o
|
||||
cli
|
||||
cmp tick_wait_proc, 0
|
||||
jz twp_is_0
|
||||
pop ds
|
||||
iret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
twp_is_0: ; CODE XREF: delay_dispatch+23j
|
||||
mov tick_wait_proc, 0FFFFh
|
||||
sti
|
||||
mov cbk_function, offset dispatch_cbk
|
||||
|
||||
dsptch: ; CODE XREF: delay_dispatch+17j
|
||||
; delay_dispatch+1A1j
|
||||
sti
|
||||
mov dsptch_es, es
|
||||
mov es, rlr
|
||||
mov es:proc_ax, ax
|
||||
mov ax, dsptch_es
|
||||
mov es:proc_es, ax
|
||||
mov es:proc_ss, ss
|
||||
mov es:proc_sp, sp
|
||||
mov ax, ds
|
||||
cli
|
||||
mov ss, ax
|
||||
|
||||
mov sp, offset dsptch_stack
|
||||
sti
|
||||
call check_timeslice
|
||||
cld
|
||||
call is_proc_busy
|
||||
jnb dont_kill
|
||||
mov tick_wait_proc, 0
|
||||
jmp kill_process
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dont_kill: ; CODE XREF: delay_dispatch+62j
|
||||
cmp cbk_function, offset dispatch_cbk
|
||||
jnz disp_switchproc
|
||||
xor ax, ax
|
||||
cmp drl, ax
|
||||
jnz disp_switchproc
|
||||
cmp es:proc_nextready, ax
|
||||
jz j_leave_disp
|
||||
cmp es:proc_background, 0
|
||||
jnz disp_switchproc
|
||||
|
||||
proc_can_run: ; CODE XREF: delay_dispatch+8Aj
|
||||
cmp time_to_switch, 0
|
||||
jz slice_expired
|
||||
dec time_to_switch
|
||||
|
||||
j_leave_disp: ; CODE XREF: delay_dispatch+82j
|
||||
jmp leave_disp
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
slice_expired: ; CODE XREF: delay_dispatch+99j
|
||||
mov al, time_slice
|
||||
mov time_to_switch, al
|
||||
|
||||
disp_switchproc: ; CODE XREF: delay_dispatch+73j
|
||||
; delay_dispatch+7Bj
|
||||
; ...
|
||||
mov es:proc_bx, bx
|
||||
mov es:proc_cx, cx
|
||||
mov es:proc_dx, dx
|
||||
mov es:proc_bp, bp
|
||||
mov es:proc_di, di
|
||||
mov es:proc_si, si
|
||||
xor ax, ax
|
||||
mov ds, ax
|
||||
|
||||
mov si, ax
|
||||
mov di, offset proc_int0
|
||||
mov dx, 4
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
mov cx, dx
|
||||
add si, dx
|
||||
rep movsw
|
||||
mov si, offset INT_E0
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
xor ax, ax
|
||||
callf es:dword ptr proc_onblock
|
||||
mov ds, cs:bdos_dseg
|
||||
|
||||
mov bx, offset rlr
|
||||
call next_runnable
|
||||
jmp cbk_function
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
delay_cbk: ; DATA XREF: delay_dispatcho
|
||||
jmps check_ready
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dispatch_cbk: ; DATA XREF: delay_dispatch+5o
|
||||
; delay_dispatch+2Eo
|
||||
; ...
|
||||
call add_to_chain
|
||||
|
||||
check_ready: ; CODE XREF: delay_dispatch+F9j
|
||||
; delay_dispatch+10Ej
|
||||
; ...
|
||||
mov bx, offset drl
|
||||
cli
|
||||
call next_runnable
|
||||
sti
|
||||
jnb check_ready1
|
||||
mov bx, offset rlr
|
||||
call proc_makeready
|
||||
jmps check_ready
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
check_ready1: ; CODE XREF: delay_dispatch+106j
|
||||
call check_timeslice
|
||||
mov ax, rlr
|
||||
test ax, ax
|
||||
jz check_ready
|
||||
mov es, ax
|
||||
call is_proc_busy
|
||||
jnb proc_switchin
|
||||
cli
|
||||
mov tick_wait_proc, 0
|
||||
jmp kill_process
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_switchin: ; CODE XREF: delay_dispatch+11Fj
|
||||
mov ax, 1
|
||||
callf es:dword ptr proc_onblock
|
||||
mov ds, cs:bdos_dseg
|
||||
mov ds, rlr
|
||||
mov si, offset proc_int0
|
||||
xor ax, ax
|
||||
mov es, ax
|
||||
|
||||
mov di, ax
|
||||
mov dx, 4
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
mov cx, dx
|
||||
add di, dx
|
||||
rep movsw
|
||||
mov di, offset INT_E0
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
push ds
|
||||
pop es
|
||||
|
||||
mov ds, cs:bdos_dseg
|
||||
mov bx, es:proc_bx
|
||||
mov cx, es:proc_cx
|
||||
mov dx, es:proc_dx
|
||||
mov bp, es:proc_bp
|
||||
mov di, es:proc_di
|
||||
mov si, es:proc_si
|
||||
|
||||
leave_disp: ; CODE XREF: delay_dispatch+9Fj
|
||||
cli
|
||||
mov ss, es:proc_ss
|
||||
|
||||
mov sp, es:proc_sp
|
||||
sti
|
||||
mov ax, es:proc_ax
|
||||
mov es, es:proc_es
|
||||
cli
|
||||
cmp drl, 0
|
||||
jz drl_is_empty
|
||||
mov cbk_function, offset dispatch_cbk
|
||||
jmp dsptch
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
drl_is_empty: ; CODE XREF: delay_dispatch+199j
|
||||
mov tick_wait_proc, 0
|
||||
pop ds
|
||||
iret
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
proc_makeready: ; CODE XREF: delay_dispatch+10Bp
|
||||
mov ax, [bx]
|
||||
mov [bx], es
|
||||
test ax, ax
|
||||
jz pmr_1
|
||||
mov es:proc_nextready, ax
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pmr_1: ; CODE XREF: proc_makeready+6j
|
||||
mov 2[bx], es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
add_to_chain: ; CODE XREF: P_0204+12p P_0209+12p
|
||||
; ...
|
||||
mov ax, 2[bx]
|
||||
mov 2[bx], es
|
||||
test ax, ax
|
||||
jz added_to_chain
|
||||
push ds
|
||||
mov ds, ax
|
||||
|
||||
mov proc_nextready, es
|
||||
pop ds
|
||||
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
added_to_chain: ; CODE XREF: add_to_chain+8j
|
||||
mov [bx], es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
next_runnable: ; CODE XREF: P_0205+12p delay_dispatch+F2p
|
||||
; ...
|
||||
mov ax, [bx]
|
||||
test ax, ax
|
||||
mov es, ax
|
||||
jz nxtrun_2
|
||||
mov ax, es:proc_nextready
|
||||
mov es:proc_nextready, 0
|
||||
mov [bx], ax
|
||||
test ax, ax
|
||||
jnz nxtrun_1
|
||||
mov 2[bx], ax
|
||||
|
||||
nxtrun_1: ; CODE XREF: next_runnable+17j
|
||||
stc
|
||||
|
||||
nxtrun_2: ; CODE XREF: next_runnable+6j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
is_proc_busy: ; CODE XREF: rtm_sysflag+1Dp
|
||||
; delay_dispatch+5Fp
|
||||
; ...
|
||||
test es:proc_flags, 1
|
||||
jz proc_notbusy
|
||||
cmp es:proc_indisk, 1
|
||||
|
||||
proc_notbusy: ; CODE XREF: is_proc_busy+7j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
check_timeslice: ; CODE XREF: delay_dispatch+5Bp
|
||||
; delay_dispatch+110p
|
||||
dec timeslice
|
||||
jnz not_expired
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
mov es, bdos_conowner
|
||||
|
||||
cts_process: ; CODE XREF: check_timeslice+39j
|
||||
test es:proc_flags, 1
|
||||
jz cts_nextproc
|
||||
cmp es:proc_indisk, 0
|
||||
jnz cts_nextproc
|
||||
cli
|
||||
cmp es:proc_status, 3; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jnz cts_nextproc
|
||||
mov dx, es:proc_countdown
|
||||
callf dword ptr lp_sysflag_chg
|
||||
sti
|
||||
|
||||
cts_nextproc: ; CODE XREF: check_timeslice+14j
|
||||
; check_timeslice+1Cj
|
||||
; ...
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
mov es, ax
|
||||
jnz cts_process
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
mov es, rlr
|
||||
mov timeslice, 1Eh
|
||||
|
||||
not_expired: ; CODE XREF: check_timeslice+4j
|
||||
retn
|
||||
|
||||
|
||||
dseg
|
||||
mcb_to_free dw 0
|
||||
dw 0
|
||||
db 0
|
||||
|
||||
time_to_switch db 10h ; DATA XREF: delay_dispatch+94r
|
||||
; delay_dispatch+9Bw
|
||||
; ...
|
||||
timeslice db 1Eh ; DATA XREF: check_timeslicew
|
||||
; check_timeslice+42w
|
||||
tick_wait_proc dw 0 ; DATA XREF: P_DELAY+Bw P_TERMCPM+77w
|
||||
; ...
|
||||
cbk_function dw 0 ; DATA XREF: delay_dispatch+Cw
|
||||
; delay_dispatch+2Ew
|
||||
; ...
|
||||
dsptch_es dw 0 ; DATA XREF: delay_dispatch+35w
|
||||
; delay_dispatch+41r
|
||||
dw 0CCCCh, 0CCCCh, 0CCCCh, 0CCCCh
|
||||
dw 0CCCCh, 0CCCCh, 0CCCCh, 0CCCCh
|
||||
dw 0CCCCh, 0CCCCh, 0CCCCh, 0CCCCh
|
||||
dw 0CCCCh, 0CCCCh, 0CCCCh, 0CCCCh
|
||||
|
||||
dsptch_stack db 0 ; DATA XREF: delay_dispatch+57o
|
||||
|
@@ -0,0 +1 @@
|
||||
db '6049-0673-020724'
|
1953
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.1/sup.a86
Normal file
1953
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.1/sup.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 36A0h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 78
|
||||
SCR_MAXY equ 22
|
||||
SCR_ECHODEL equ 0
|
||||
|
Binary file not shown.
11055
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.3/bdos.a86
Normal file
11055
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.3/bdos.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,132 @@
|
||||
bdos33.exe=entry,
|
||||
sup,
|
||||
rtm,
|
||||
mem,
|
||||
cio,
|
||||
misc,
|
||||
bdos,
|
||||
proctbl,
|
||||
ccpldr[nop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
@@ -0,0 +1,254 @@
|
||||
;
|
||||
; This little segment appears in Apricot PCP/M-86 between the BDOS proper
|
||||
; and the XIOS. I'm assembling it as part of the BDOS, but it may need to
|
||||
; become a separate file with separate support in DPGEN.
|
||||
;
|
||||
; It appears to be a miniature CCP that can be used to run commands and
|
||||
; set the drive/user containing the CCP. It has only one builtin command
|
||||
; - USER.
|
||||
;
|
||||
include equates.a86
|
||||
|
||||
dseg
|
||||
extrn boot_drive:byte
|
||||
extrn ccp_user:byte
|
||||
|
||||
cseg
|
||||
public ccpldr
|
||||
|
||||
ccpldr: jmp ccpl_main
|
||||
|
||||
ccpl_space: mov al, ' '
|
||||
ccpl_putch: mov dl, al
|
||||
push cx
|
||||
mov cl, 2
|
||||
int 0E0h
|
||||
pop cx
|
||||
ret
|
||||
;
|
||||
ccpl_crlf: mov al, 0Dh
|
||||
call ccpl_putch
|
||||
mov al, 0Ah
|
||||
jmps ccpl_putch
|
||||
|
||||
ccpl_drv_set: mov dl, al
|
||||
mov cl, 0Eh
|
||||
int 0E0h
|
||||
ret
|
||||
|
||||
ccpl_getuid: mov dl, 0FFh
|
||||
ccpl_setuid: mov cl, 20h
|
||||
int 0E0h
|
||||
ret
|
||||
;
|
||||
ccpl_input: mov dx, offset ccpl_inpbuf
|
||||
mov cl, 0Ah
|
||||
int 0E0h
|
||||
xor bh, bh
|
||||
mov bl, ccpl_inpbuf+1
|
||||
mov ccpl_inpbuf+2[bx], bh
|
||||
mov ccpl_pfcb, offset ccpl_inpbuf+2
|
||||
ret
|
||||
;
|
||||
ccpl_drv_get: mov cl, 19h
|
||||
int 0E0h
|
||||
ret
|
||||
;
|
||||
ccpl_parse_name:
|
||||
mov ax, ccpl_pfcb
|
||||
mov ccpl_filename_0,ax
|
||||
mov dx, offset ccpl_pfcb
|
||||
mov cl, 98h
|
||||
int 0E0h
|
||||
mov ccpl_pfcb, ax
|
||||
or ax, ax
|
||||
jnz ccpl_pn1
|
||||
mov ccpl_pfcb, offset ccpl_blank
|
||||
ccpl_pn1: dec ax
|
||||
ret
|
||||
;
|
||||
ccpl_main: mov ds,word ptr .0 ;-> CP/M DSEG
|
||||
mov ccpl_sp, sp
|
||||
push ds
|
||||
pop es
|
||||
mov dl, 0FEh
|
||||
mov cl, 2Dh
|
||||
int 0E0h
|
||||
ccpl_mainloop: mov sp, ccpl_sp
|
||||
mov dl, ccp_user
|
||||
call ccpl_setuid
|
||||
mov al, boot_drive
|
||||
call ccpl_drv_set
|
||||
cld
|
||||
mov dx, addr_no_ccp
|
||||
mov cl, 9
|
||||
int 0E0h
|
||||
mov al, ccp_user
|
||||
cmp al, 0Ah
|
||||
jc bootuserlt9
|
||||
mov al, '1'
|
||||
call ccpl_putch
|
||||
mov al, ccp_user
|
||||
sub al, 0Ah
|
||||
bootuserlt9: add al, '0'
|
||||
call ccpl_putch
|
||||
mov al, boot_drive
|
||||
add al, 'A'
|
||||
call ccpl_putch
|
||||
mov al, '>'
|
||||
call ccpl_putch
|
||||
call ccpl_input
|
||||
call ccpl_parse_name
|
||||
jz ccpl_showerr ;Name does not parse
|
||||
test ccpl_fcb, 0FFh
|
||||
jz ccpl_1
|
||||
jmp ccpl_trychain
|
||||
;
|
||||
ccpl_1: cmp ccpl_fcb+1, 20h
|
||||
jz ccpl_mainloop
|
||||
mov di, addr_user ;Check if the command entered is USER
|
||||
mov si, offset ccpl_fcb+1
|
||||
mov cl, [di]
|
||||
xor ch, ch
|
||||
inc di
|
||||
rep cmpsb
|
||||
jnz ccpl_2
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jnz ccpl_2
|
||||
jmp ccpl_setuser
|
||||
;
|
||||
ccpl_2: jmp ccpl_trychain
|
||||
;
|
||||
ccpl_showerr: call ccpl_crlf ;Echo the first filename then "?"
|
||||
mov si, ccpl_filename_0
|
||||
ccpl_skipsp: lodsb
|
||||
cmp al, 20h
|
||||
jz ccpl_skipsp
|
||||
ccpl_showerr2: cmp al, 20h
|
||||
jz ccpl_showerr3
|
||||
or al, al
|
||||
jz ccpl_showerr3
|
||||
call ccpl_putch
|
||||
lodsb
|
||||
jmps ccpl_showerr2
|
||||
;
|
||||
ccpl_showerr3: mov al, '?'
|
||||
call ccpl_putch
|
||||
call ccpl_crlf
|
||||
jmp ccpl_mainloop
|
||||
;
|
||||
ccpl_parse_num: call ccpl_parse_name
|
||||
jz ccpl_showerr
|
||||
mov si, offset ccpl_fcb+1
|
||||
mov cx, 0Bh
|
||||
cmp byte ptr [si], ' '
|
||||
jnz ccpl_pnum_1
|
||||
mov al, 33
|
||||
ret
|
||||
;
|
||||
ccpl_pnum_1: lodsb
|
||||
cmp al, ' '
|
||||
jz ccpl_pnum_next
|
||||
sub al, '0'
|
||||
cmp al, 0Ah
|
||||
jnc ccpl_showerr
|
||||
xchg al, ch
|
||||
mov ah, 0Ah
|
||||
mul ah
|
||||
add al, ch
|
||||
cmp al, 16
|
||||
jnc ccpl_showerr
|
||||
mov ch, al
|
||||
dec cl
|
||||
jnz ccpl_pnum_1
|
||||
ret
|
||||
;
|
||||
ccpl_pnum_next:
|
||||
cmp al, ' '
|
||||
jnz ccpl_showerr
|
||||
lodsb
|
||||
dec cl
|
||||
jnz ccpl_pnum_next
|
||||
mov al, ch
|
||||
ret
|
||||
;
|
||||
ccpl_setuser: call ccpl_parse_num
|
||||
cmp al, 33
|
||||
jnz ccpl_setuser2
|
||||
call ccpl_crlf
|
||||
call ccpl_getuid
|
||||
cmp al, 9
|
||||
jbe ccpl_setuser1
|
||||
push ax
|
||||
mov al, '1'
|
||||
call ccpl_putch
|
||||
pop ax
|
||||
sub al, 0Ah
|
||||
ccpl_setuser1: add al, '0'
|
||||
call ccpl_putch
|
||||
jmps ccpl_setuser3
|
||||
;
|
||||
ccpl_setuser2: mov dl, al
|
||||
mov ccp_user, al
|
||||
call ccpl_setuid
|
||||
ccpl_setuser3: jmp ccpl_mainloop
|
||||
;
|
||||
ccpl_trychain: cmp ccpl_fcb+1, ' '
|
||||
jnz ccpl_trychain1
|
||||
mov al, ccpl_fcb
|
||||
or al, al
|
||||
jz ccpl_setuser3
|
||||
dec al
|
||||
push ax
|
||||
call ccpl_drv_set
|
||||
inc al
|
||||
pop ax
|
||||
jz ccpl_trychain2
|
||||
mov boot_drive, al
|
||||
jmps ccpl_setuser3
|
||||
;
|
||||
ccpl_trychain1: cmp ccpl_fcb+9, ' '
|
||||
jz ccpl_chain
|
||||
ccpl_trychain2: jmp ccpl_showerr
|
||||
;
|
||||
ccpl_chain: call ccpl_crlf
|
||||
mov dx, offset ccpl_inpbuf+2
|
||||
mov cl, 1Ah ;F_DMAOFF
|
||||
int 0E0h
|
||||
mov dx, ds
|
||||
mov cl, 33h ;F_DMASEG
|
||||
int 0E0h
|
||||
mov cl, 2Fh ;P_CHAIN
|
||||
int 0E0h
|
||||
jmp ccpl_showerr
|
||||
|
||||
dseg
|
||||
public ccpldr_ds
|
||||
public ccpldr_cs
|
||||
|
||||
ccpldr_ds dw 0
|
||||
db 0
|
||||
ccpldr_cs dw 0
|
||||
db 0
|
||||
ccpl_inpbuf db 3Fh
|
||||
rb 40h
|
||||
ccpl_blank db 0
|
||||
ccpl_sp dw 0
|
||||
ccpl_filename_0 dw 0
|
||||
ccpl_pfcb dw offset ccpl_inpbuf+2
|
||||
dw offset ccpl_fcb
|
||||
|
||||
rb 12
|
||||
|
||||
ccpl_fcb rb 24h
|
||||
|
||||
rb 40h
|
||||
;
|
||||
; I hope this is junk picked up by (eg) something being a couple of paragraphs
|
||||
; short of a whole sector rather than anything important.
|
||||
;
|
||||
db 0Ch, 3Ch, 5Ah, 76h, 0Ah, 3Ch, 61h, 72h
|
||||
db 04h, 3Ch, 7Ah, 76h, 02h, 0F9h, 0C3h, 0F8h
|
||||
db 0C3h, 0B1h, 31h, 0C6h, 06h, 0B5h, 02h, 00h
|
||||
db 0BAh, 0B4h, 02h, 0CDh, 0E0h, 0BBh, 0B6h, 02h
|
1616
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.3/cio.a86
Normal file
1616
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.3/cio.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,144 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "cmdio.h"
|
||||
|
||||
static byte zeroes[16];
|
||||
|
||||
void zero_cmd(cmd_desc *cmdfile)
|
||||
{
|
||||
cmdfile->cs = cmdfile->ds = NULL;
|
||||
cmdfile->cs_base = cmdfile->ds_base = 0;
|
||||
cmdfile->cs_len = cmdfile->ds_len = 0;
|
||||
cmdfile->cs_max = cmdfile->ds_max = 0;
|
||||
}
|
||||
|
||||
void free_cmd (cmd_desc *cmdfile)
|
||||
{
|
||||
if (cmdfile->ds) free(cmdfile->ds);
|
||||
if (cmdfile->cs) free(cmdfile->cs);
|
||||
zero_cmd(cmdfile);
|
||||
}
|
||||
|
||||
char *alloc_cmd(cmd_desc *cmdfile, long cs_len, long ds_len)
|
||||
{
|
||||
if (!cs_len || !ds_len) return "cs_len or ds_len is 0.";
|
||||
cmdfile->cs = malloc(cs_len);
|
||||
cmdfile->ds = malloc(ds_len);
|
||||
if (!cmdfile->ds || !cmdfile->cs)
|
||||
{
|
||||
free_cmd(cmdfile);
|
||||
return "Out of memory.";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *load_cmd(char *filename, cmd_desc *cmdfile)
|
||||
{
|
||||
FILE *fp;
|
||||
char *boo;
|
||||
byte cmd_header[128];
|
||||
|
||||
fp = fopen(filename, "rb");
|
||||
if (!fp) return "Failed to open file.";
|
||||
|
||||
if (fread(cmd_header, 1, sizeof(cmd_header), fp) < sizeof(cmd_header))
|
||||
{
|
||||
fclose(fp);
|
||||
return "Too short to be a CMD file.";
|
||||
}
|
||||
cmdfile->cs_len = peekw(cmd_header, 1);
|
||||
cmdfile->cs_base = peekw(cmd_header, 3);
|
||||
cmdfile->cs_max = peekw(cmd_header, 5);
|
||||
cmdfile->ds_len = peekw(cmd_header, 10);
|
||||
cmdfile->ds_base = peekw(cmd_header, 12);
|
||||
cmdfile->ds_max = peekw(cmd_header, 14);
|
||||
|
||||
if (!cmdfile->cs_len || !cmdfile->ds_len)
|
||||
{
|
||||
fclose(fp);
|
||||
return "Not a 2-segment CMD file";
|
||||
}
|
||||
boo = alloc_cmd(cmdfile, 16 * cmdfile->cs_max, 16 * cmdfile->ds_max);
|
||||
if (boo)
|
||||
{
|
||||
fclose(fp);
|
||||
return boo;
|
||||
}
|
||||
if (fread(cmdfile->cs, 16, cmdfile->cs_len, fp) < cmdfile->cs_len)
|
||||
{
|
||||
fclose(fp);
|
||||
free_cmd(cmdfile);
|
||||
return "Failed to load code segment.";
|
||||
}
|
||||
if (fread(cmdfile->ds, 16, cmdfile->ds_len, fp) < cmdfile->ds_len)
|
||||
{
|
||||
fclose(fp);
|
||||
free_cmd(cmdfile);
|
||||
return "Failed to load data segment.";
|
||||
}
|
||||
fclose(fp);
|
||||
cmdfile->cs_len *= 16L;
|
||||
cmdfile->ds_len *= 16L;
|
||||
cmdfile->cs_max *= 16L;
|
||||
cmdfile->ds_max *= 16L;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void pokew(byte *base, word a, word v)
|
||||
{
|
||||
base[a ] = (v) & 0xFF;
|
||||
base[a+1] = (v >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
word peekw(byte *base, word a)
|
||||
{
|
||||
return base[a] | (((word)base[a+1]) << 8);
|
||||
}
|
||||
|
||||
|
||||
char *save_cmd(char *cmdname, cmd_desc *cmdfile, int absolute)
|
||||
{
|
||||
FILE *fp;
|
||||
word csparas, cmparas;
|
||||
word dsparas, dmparas;
|
||||
byte header[128];
|
||||
|
||||
csparas = cmdfile->cs_len >> 4;
|
||||
dsparas = cmdfile->ds_len >> 4;
|
||||
cmparas = cmdfile->cs_max >> 4;
|
||||
dmparas = cmdfile->ds_max >> 4;
|
||||
|
||||
memset(header, 0, sizeof(header));
|
||||
header[0] = 1; /* Code segment */
|
||||
pokew(header, 1, csparas);
|
||||
if (absolute) pokew(header, 3, cmdfile->cs_base);
|
||||
pokew(header, 5, cmparas);
|
||||
header[9] = 2; /* Data segment */
|
||||
pokew(header, 10, dsparas);
|
||||
if (absolute) pokew(header, 12, cmdfile->ds_base);
|
||||
pokew(header, 14, dmparas);
|
||||
|
||||
fp = fopen(cmdname, "wb");
|
||||
if (!fp)
|
||||
{
|
||||
return "Cannot open file to write.";
|
||||
}
|
||||
if (fwrite(header, 1, 128, fp) < 128 ||
|
||||
fwrite(cmdfile->cs, 16, csparas, fp) < csparas ||
|
||||
fwrite(cmdfile->ds, 16, dsparas, fp) < dsparas)
|
||||
{
|
||||
fclose(fp);
|
||||
return "Error writing to CMD file";
|
||||
}
|
||||
/* Pack out to a multiple of 128 bytes */
|
||||
while ((csparas + dsparas) & 7)
|
||||
{
|
||||
fwrite(zeroes, 1, 16, fp);
|
||||
++dsparas;
|
||||
}
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
typedef unsigned long dword;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte *cs;
|
||||
byte *ds;
|
||||
word cs_base;
|
||||
word ds_base;
|
||||
dword cs_len;
|
||||
dword ds_len;
|
||||
dword cs_max;
|
||||
dword ds_max;
|
||||
} cmd_desc;
|
||||
|
||||
void zero_cmd (cmd_desc *cmdfile);
|
||||
void free_cmd (cmd_desc *cmdfile);
|
||||
char *alloc_cmd(cmd_desc *cmdfile, long cs_len, long ds_len);
|
||||
|
||||
char *load_cmd(char *filename, cmd_desc *cmdfile);
|
||||
char *save_cmd(char *filename, cmd_desc *cmdfile, int absolute);
|
||||
|
||||
word peekw(byte *base, word a);
|
||||
void pokew(byte *base, word a, word v);
|
||||
|
@@ -0,0 +1,135 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "cmdio.h"
|
||||
|
||||
cmd_desc dosplus_sys, bdos_cmd, xios_cmd, ccp_cmd, dos_cmd;
|
||||
|
||||
int gl_base = 0x60;
|
||||
|
||||
void dump_cmd(char *caption, cmd_desc *cmd)
|
||||
{
|
||||
printf("%s CS: base=%04x length=%05lx\n",
|
||||
caption, cmd->cs_base, cmd->cs_len);
|
||||
printf("%s DS: base=%04x length=%05lx\n",
|
||||
caption, cmd->ds_base, cmd->ds_len);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *boo;
|
||||
long o = 0;
|
||||
long xios_cs, dos_cs, dos_ds, ccp_cs, ccp_ds;
|
||||
int n;
|
||||
/* Load the component parts */
|
||||
|
||||
for (n = 1; n < argc; n++)
|
||||
{
|
||||
if (!strncmp(argv[n], "base=", 5))
|
||||
{
|
||||
if (!sscanf(&argv[n][5], "%x", &gl_base))
|
||||
{
|
||||
fprintf(stderr, "base= option incorrect.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boo = load_cmd("bdos.cmd", &bdos_cmd);
|
||||
if (boo) { fprintf(stderr, "bdos.cmd: %s\n", boo); return 1; }
|
||||
boo = load_cmd("xios.cmd", &xios_cmd);
|
||||
if (boo) { fprintf(stderr, "xios.cmd: %s\n", boo); return 1; }
|
||||
boo = load_cmd("ccp.cmd", &ccp_cmd);
|
||||
if (boo) { fprintf(stderr, "ccp.cmd: %s\n", boo); return 1; }
|
||||
load_cmd("dos.cmd", &dos_cmd);
|
||||
|
||||
/* Work out segment sizes */
|
||||
dosplus_sys.cs_max =
|
||||
dosplus_sys.cs_len = bdos_cmd.cs_len + xios_cmd.cs_len +
|
||||
ccp_cmd.cs_len + ccp_cmd.ds_len +
|
||||
dos_cmd.cs_len + dos_cmd.ds_len;
|
||||
dosplus_sys.cs_base = gl_base;
|
||||
dosplus_sys.ds_len = xios_cmd.ds_len;
|
||||
dosplus_sys.ds_max = xios_cmd.ds_max;
|
||||
dosplus_sys.ds_base = gl_base + (dosplus_sys.cs_len >> 4);
|
||||
|
||||
boo = alloc_cmd(&dosplus_sys, dosplus_sys.cs_len, dosplus_sys.ds_len);
|
||||
if (boo) { fprintf(stderr, "%s", boo); return 1; }
|
||||
|
||||
printf("Code segment at %04x:0000 length 0x%05lx\n",
|
||||
dosplus_sys.cs_base,
|
||||
dosplus_sys.cs_len);
|
||||
printf("Data segment at %04x:0000 length 0x%05lx\n",
|
||||
dosplus_sys.ds_base,
|
||||
dosplus_sys.ds_len);
|
||||
|
||||
/* OK. Now copy the modules into the SYS file */
|
||||
|
||||
memcpy(dosplus_sys.cs + o, bdos_cmd.cs, bdos_cmd.cs_len);
|
||||
o += bdos_cmd.cs_len;
|
||||
xios_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, xios_cmd.cs, xios_cmd.cs_len);
|
||||
o += xios_cmd.cs_len;
|
||||
if (dos_cmd.cs_len)
|
||||
{
|
||||
dos_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, dos_cmd.cs, dos_cmd.cs_len);
|
||||
o += dos_cmd.cs_len;
|
||||
}
|
||||
ccp_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, ccp_cmd.cs, ccp_cmd.cs_len);
|
||||
o += ccp_cmd.cs_len;
|
||||
ccp_ds = o;
|
||||
memcpy(dosplus_sys.cs + o, ccp_cmd.ds, ccp_cmd.ds_len);
|
||||
o += ccp_cmd.ds_len;
|
||||
if (dos_cmd.ds_len)
|
||||
{
|
||||
dos_ds = o;
|
||||
memcpy(dosplus_sys.cs + o, dos_cmd.ds, dos_cmd.ds_len);
|
||||
o += dos_cmd.ds_len;
|
||||
}
|
||||
memcpy(dosplus_sys.ds, xios_cmd.ds, xios_cmd.ds_len);
|
||||
memcpy(dosplus_sys.ds, bdos_cmd.ds, bdos_cmd.ds_len);
|
||||
|
||||
/* Set up the pointers to modules correctly */
|
||||
pokew(dosplus_sys.cs, 6, dosplus_sys.ds_base);
|
||||
pokew(dosplus_sys.cs, xios_cs + 6, dosplus_sys.ds_base);
|
||||
if (dos_cmd.ds_len)
|
||||
{
|
||||
pokew(dosplus_sys.cs, dos_cs + 6, dosplus_sys.ds_base);
|
||||
pokew(dosplus_sys.cs, dos_cs + 8, (dos_ds >> 4) + gl_base);
|
||||
}
|
||||
pokew(dosplus_sys.cs, ccp_ds , ccp_cmd.cs_len);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 3, (ccp_cs >> 4) + gl_base);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 6, ccp_cmd.ds_len);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 9, (ccp_ds >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x2A, (xios_cs >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x2E, (xios_cs >> 4) + gl_base);
|
||||
if (dos_cmd.ds_len)
|
||||
pokew(dosplus_sys.ds, 0x42, (dos_cs >> 4) + gl_base);
|
||||
else pokew(dosplus_sys.ds, 0x42, 0);
|
||||
pokew(dosplus_sys.ds, 0x44, (ccp_ds >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x48, ((dosplus_sys.cs_max +
|
||||
dosplus_sys.ds_max + 0x10 * gl_base) >> 4)
|
||||
+ 0x1000);
|
||||
/* SYS file has been generated. Write it. */
|
||||
|
||||
dump_cmd("BDOS ", &bdos_cmd);
|
||||
dump_cmd("XIOS ", &xios_cmd);
|
||||
if (dos_cmd.cs_len) dump_cmd("DOS ", &dos_cmd);
|
||||
dump_cmd("CCP ", &ccp_cmd);
|
||||
dump_cmd("SYS ", &dosplus_sys);
|
||||
|
||||
/* Now start writing the stuff out */
|
||||
boo = save_cmd("new.sys", &dosplus_sys, 1);
|
||||
if (boo) fprintf(stderr, "new.sys: %s\n", boo);
|
||||
free_cmd(&dosplus_sys);
|
||||
free_cmd(&bdos_cmd);
|
||||
free_cmd(&xios_cmd);
|
||||
free_cmd(&ccp_cmd);
|
||||
free_cmd(&dos_cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,540 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
dseg
|
||||
|
||||
cseg
|
||||
|
||||
extrn rtm_sysflag:near
|
||||
extrn cio_keyboard:near
|
||||
extrn rtm_timeslice:near
|
||||
|
||||
public bdos_start
|
||||
public bdos_rsx
|
||||
public bdos_callback
|
||||
public far_ret_1
|
||||
public bdos_dseg
|
||||
|
||||
jmp bdos_start
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmp bdos_int_E0
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bdos_dseg dw seg sysvar_144
|
||||
; ...
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_start: ; CODE XREF: bdos:0000j
|
||||
cli
|
||||
xor ax, ax
|
||||
mov ds, ax
|
||||
mov word ptr INT_E0, offset bdos_int_E0
|
||||
mov word ptr INT_E0+2, cs
|
||||
mov bx, cs:bdos_dseg
|
||||
mov ds, bx
|
||||
mov ax, rlr
|
||||
mov cl, 4
|
||||
shr ax, cl
|
||||
add ax, bx
|
||||
mov rlr, ax
|
||||
mov process_table, ax
|
||||
mov bdos_conowner, ax
|
||||
mov ss, ax
|
||||
mov sp, 160h
|
||||
|
||||
init_proctab: ; CODE XREF: bdos:0054j
|
||||
mov es, ax
|
||||
mov es:word ptr proc_onblock, offset far_ret_1
|
||||
|
||||
g003f: ; DATA XREF: P_TERMCPM+16r
|
||||
mov es:word ptr proc_onblock+2, cs
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
jz procs_inited
|
||||
shr ax, cl
|
||||
add ax, bx
|
||||
mov es:proc_nextseg, ax
|
||||
jmps init_proctab
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
procs_inited: ; CODE XREF: bdos:004Aj
|
||||
mov es, rlr
|
||||
mov es:proc_bdos_seg, cs
|
||||
cld
|
||||
push dx
|
||||
mov cx, 7
|
||||
mov bx, offset function_tables + 2 ;Call all init funcs
|
||||
call_inits: push bx
|
||||
push cx
|
||||
call word ptr [bx]
|
||||
pop cx
|
||||
pop bx
|
||||
add bx, 4
|
||||
loop call_inits
|
||||
|
||||
pop dx
|
||||
callf dword ptr lp_xios_init
|
||||
sti
|
||||
mov al, boot_drive
|
||||
mov es:proc_drive, al
|
||||
mov sysvar_144, al
|
||||
push es
|
||||
xor si, si
|
||||
push ds
|
||||
mov ds, si
|
||||
|
||||
mov word ptr INT_E0, offset bdos_int_E0
|
||||
mov word ptr INT_E0+2, cs
|
||||
mov di, offset proc_int0
|
||||
mov cx, 4
|
||||
rep movsw
|
||||
mov cl, 4
|
||||
add si, cx
|
||||
rep movsw
|
||||
mov si, offset INT_E0
|
||||
mov cl, 4
|
||||
rep movsw
|
||||
pop es
|
||||
pop ds
|
||||
|
||||
mov di, offset cpu_vectors
|
||||
mov si, offset proc_int0
|
||||
mov cl, 0Ch
|
||||
rep movsw
|
||||
xor cx, cx
|
||||
mov dx, cx
|
||||
int 0E0h ; used by BASIC while in interpreter
|
||||
;
|
||||
entry_init: ret
|
||||
;
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bdos_functions db 20h ; DATA XREF: bdos:01F2o
|
||||
; P_TERMCPM
|
||||
db 60h ; C_READ
|
||||
db 61h ; C_WRITE
|
||||
db 62h ; A_READ
|
||||
db 63h ; A_WRITE
|
||||
db 64h ; L_WRITE
|
||||
db 65h ; C_RAWIO
|
||||
db 66h ; A_STATIN
|
||||
db 67h ; A_STATOUT
|
||||
db 68h ; C_WRITESTR
|
||||
db 69h ; C_READSTR
|
||||
db 6Ah ; C_STAT
|
||||
db 0A1h ; S_BDOSVER
|
||||
db 0C0h ; DRV_ALLRESET
|
||||
db 0C1h ; DRV_SET
|
||||
db 0C2h ; F_OPEN
|
||||
db 0C3h ; F_CLOSE
|
||||
db 0C4h ; F_SFIRST
|
||||
db 0C5h ; F_SNEXT
|
||||
db 0C6h ; F_DELETE
|
||||
db 0C7h ; F_READ
|
||||
db 0C8h ; F_WRITE
|
||||
db 0C9h ; F_MAKE
|
||||
db 0CAh ; F_RENAME
|
||||
db 0A2h ; DRV_LOGINVEC
|
||||
db 0A3h ; DRV_GET
|
||||
db 0A4h ; F_DMAOFF
|
||||
db 0CBh ; DRV_ALLOCVEC
|
||||
db 0CCh ; DRV_SETRO
|
||||
db 0A5h ; DRV_ROVEC
|
||||
db 0CDh ; F_ATTRIB
|
||||
db 0CEh ; DRV_DPB
|
||||
db 0A6h ; F_USERNUM
|
||||
db 0CFh ; F_READRAND
|
||||
db 0D0h ; F_WRITERAND
|
||||
db 0D1h ; F_SIZE
|
||||
db 0D2h ; F_RANDREC
|
||||
db 0D3h ; DRV_RESET
|
||||
db 0A0h ; (access drives)
|
||||
db 0D5h ; DRV_FREE
|
||||
db 0D6h ; F_WRITEZF
|
||||
db 0A0h, 0A0h, 0A0h ; MP/M file lock functions
|
||||
db 0A7h ; F_MULTISEC
|
||||
db 0A8h ; F_ERRMODE
|
||||
db 0D9h ; DRV_SPACE
|
||||
db 0 ; P_CHAIN
|
||||
db 0DAh ; DRV_FLUSH
|
||||
db 0A9h ; S_SYSVAR
|
||||
db 6Bh ; S_BIOS
|
||||
db 0AAh ; F_DMASEG
|
||||
db 0ABh ; F_DMAGET
|
||||
db 40h ; MC_MAX
|
||||
db 41h ; MC_ABSMAX
|
||||
db 42h ; MC_ALLOC
|
||||
db 43h ; MC_ABSALLOC
|
||||
db 44h ; MC_FREE
|
||||
db 45h ; MC_ALLFREE
|
||||
db 1 ; P_LOAD
|
||||
db 0A0h ; P_RSX
|
||||
db 0DBh ; Clean up disc
|
||||
db 0DCh ; F_TRUNCATE
|
||||
db 0DDh ; DRV_SETLABEL
|
||||
db 0DEh ; DRV_GETLABEL
|
||||
db 0DFh ; F_TIMEDATE
|
||||
db 0E0h ; F_WRITEXFCB
|
||||
db 0ACh ; T_SET
|
||||
db 0ADh ; T_GET
|
||||
db 0E1h ; F_PASSWD
|
||||
db 0AEh ; S_SERIAL
|
||||
db 0AFh ; P_CODE
|
||||
db 6Ch ; C_MODE
|
||||
db 6Dh ; C_DELIMIT
|
||||
db 6Eh ; C_WRITEBLK
|
||||
db 6Fh ; L_WRITEBLK
|
||||
db 0A0h ; PCP/M direct screen access
|
||||
db 0A0h ; Unused in all versions
|
||||
db 0A0h ; GSX
|
||||
db 0E2h ; Set file timestamp
|
||||
db 0E4h ; INT13h helper
|
||||
db 4 ; 76h
|
||||
db 21h ; Wait on system flag
|
||||
db 0A0h ; Set system flag
|
||||
db 0A0h ; Create message queue
|
||||
db 0A0h ; Open message queue
|
||||
db 0A0h ; Delete message queue
|
||||
db 0A0h ; Read message queue
|
||||
db 0A0h ; Conditional read queue
|
||||
db 0A0h ; Write to message queue
|
||||
db 0A0h ; Conditional write message queue
|
||||
db 22h ; P_DELAY
|
||||
db 23h ; P_DISPATCH
|
||||
db 20h ; P_TERM
|
||||
db 0A0h, 0A0h, 0A0h
|
||||
db 70h ; C_DETACH
|
||||
db 0A0h, 0A0h, 0A0h, 0A0h
|
||||
db 2 ; F_PARSE
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_int_E0: ; CODE XREF: bdos:0003j
|
||||
; DATA XREF: bdos:000Eo ...
|
||||
push ds
|
||||
mov ds, cs:bdos_dseg
|
||||
mov ax, es
|
||||
mov es, rlr
|
||||
pop ds
|
||||
cmp es:proc_incpm, 0
|
||||
jnz already_in_cpm
|
||||
mov es:word ptr userStack+2, ss
|
||||
mov es:word ptr userStack, sp
|
||||
push es
|
||||
pop ss
|
||||
mov sp, offset proc_cpm_stack
|
||||
|
||||
already_in_cpm: ; CODE XREF: bdos:0155j
|
||||
inc es:proc_incpm
|
||||
sti
|
||||
cld
|
||||
mov es:userES, ax
|
||||
mov es:proc_fx, cl
|
||||
push si
|
||||
push di
|
||||
push bp
|
||||
callf es:dword ptr proc_bdos_offs
|
||||
pop bp
|
||||
pop di
|
||||
pop si
|
||||
mov ax, bx
|
||||
dec es:proc_incpm
|
||||
jnz still_in_cpm
|
||||
cli
|
||||
mov ss, es:word ptr userStack+2
|
||||
mov sp, es:word ptr userStack
|
||||
|
||||
still_in_cpm: ; CODE XREF: bdos:0188j
|
||||
mov es, es:userES
|
||||
cmp ax, 0FFFFh
|
||||
jz check_result
|
||||
xor cx, cx
|
||||
|
||||
check_result: ; CODE XREF: bdos:019Dj
|
||||
iret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_rsx: ; DATA XREF: proc1:0052o
|
||||
jmp bdos_rsx_main
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rs 5
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_rsx_main: ; CODE XREF: bdos:01A2j
|
||||
push es:userDS
|
||||
mov es:userDS, ds
|
||||
mov ds, cs:bdos_dseg
|
||||
callf dword ptr lp_bdos_entry
|
||||
mov ds, es:userDS
|
||||
pop es:userDS
|
||||
|
||||
far_ret_1: ; DATA XREF: bdos:0038o P_CHAIN+71o
|
||||
; ...
|
||||
retf
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_entry: ; CODE XREF: x_dev_waitflag+2u
|
||||
; x_p_delay+2u
|
||||
; DATA XREF: ...
|
||||
jmp bdos_func
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rs 5
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_func: ; CODE XREF: bdos:01C8j
|
||||
cld
|
||||
mov al, cl
|
||||
cmp al, 3Ch
|
||||
jbe bdos_gotfunc
|
||||
sub al, 25h
|
||||
cmp al, 3Dh
|
||||
jb bdos_badfunc
|
||||
cmp al, 51h
|
||||
jbe bdos_gotfunc
|
||||
sub al, 0Dh
|
||||
cmp al, 52h
|
||||
jb bdos_badfunc
|
||||
cmp al, 66h
|
||||
jbe bdos_gotfunc
|
||||
|
||||
bdos_badfunc: ; CODE XREF: bdos:01DBj bdos:01E5j
|
||||
mov bx, 0FFFFh
|
||||
mov cx, 2
|
||||
retf
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_gotfunc: ; CODE XREF: bdos:01D5j bdos:01DFj
|
||||
; ...
|
||||
mov bx, offset bdos_functions
|
||||
xlat cs:byte ptr [bx]
|
||||
mov cl, al
|
||||
rol al, 1
|
||||
rol al, 1
|
||||
rol al, 1
|
||||
and al, 7
|
||||
mov ah, 1Fh
|
||||
cmp al, 6
|
||||
jb mask_fxn
|
||||
mov ah, 3Fh
|
||||
and al, 6
|
||||
|
||||
mask_fxn: ; CODE XREF: bdos:0205j
|
||||
and cl, ah
|
||||
|
||||
entry_bdos: ; DATA XREF: dseg:0010o
|
||||
call inner_callback
|
||||
retf
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
inner_callback: ; CODE XREF: bdos:020Dp bdos_callback+8p
|
||||
mov es:proc_intfunc, cl
|
||||
mov es:proc_intmod, al
|
||||
xor ah, ah
|
||||
mov ch, ah
|
||||
mov di, ax ; AL = function class
|
||||
shl di, 1 ; CL = function number within class
|
||||
shl di, 1
|
||||
mov si, cx
|
||||
shl si, 1
|
||||
jmp function_tables[di]
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
bdos_callback: ; CODE XREF: get_proc_dskdat+Bp
|
||||
; release+3p ...
|
||||
test ch, ch
|
||||
jz callback_00
|
||||
dec ch
|
||||
mov al, ch
|
||||
call inner_callback
|
||||
jmps bdos_cbk_end
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
callback_00: ; CODE XREF: bdos_callback+2j
|
||||
callf es:dword ptr proc_bdos_offs
|
||||
|
||||
bdos_cbk_end: ; CODE XREF: bdos_callback+Bj
|
||||
mov ax, bx
|
||||
retn
|
||||
|
||||
extrn sup_main:near
|
||||
extrn sup_init:near
|
||||
extrn rtm_main:near
|
||||
extrn rtm_init:near
|
||||
extrn mem_main:near
|
||||
extrn mem_init:near
|
||||
extrn cio_main:near
|
||||
extrn cio_init:near
|
||||
extrn misc_main:near
|
||||
extrn misc_init:near
|
||||
extrn bdos_main:near
|
||||
extrn bdos_init:near
|
||||
|
||||
dseg
|
||||
|
||||
extrn freemem:byte
|
||||
extrn proc1:word
|
||||
extrn dirname_1:word
|
||||
extrn dirdata_0:word
|
||||
|
||||
public function_tables
|
||||
public bdos_8087_inuse
|
||||
public rlr
|
||||
public drl
|
||||
public pq_disk
|
||||
public pq_loader
|
||||
public pq_memmgr
|
||||
public pq_error
|
||||
public pq_filesystem
|
||||
public search_path
|
||||
public temp_drive
|
||||
public cpu_vectors
|
||||
public lp_xios_entry
|
||||
public lp_dos_module
|
||||
public lp_sysflag_chg
|
||||
public lp_kbd_callback
|
||||
public time_slice
|
||||
public proc_count
|
||||
public bdos_conowner
|
||||
public bdos_sysflags
|
||||
public ccp_dseg
|
||||
public cur_x
|
||||
public max_x
|
||||
public max_y
|
||||
public sysvar_131
|
||||
public sysvar_132
|
||||
public sysvar_142
|
||||
public sysvar_143
|
||||
public sysvar_144
|
||||
public echo_backspaced
|
||||
public echo_deleted
|
||||
public boot_drive
|
||||
public ccp_user
|
||||
public bdos_ver
|
||||
public date_days
|
||||
public date_secs
|
||||
public page_mode
|
||||
|
||||
function_tables dw offset sup_main ; DATA XREF: inner_callback+Eo
|
||||
dw offset sup_init
|
||||
dw offset rtm_main
|
||||
dw offset rtm_init
|
||||
dw offset mem_main
|
||||
dw offset mem_init
|
||||
dw offset cio_main
|
||||
dw offset cio_init
|
||||
dw offset entry_init
|
||||
dw offset entry_init
|
||||
off_A15_14 dw offset misc_main
|
||||
dw offset misc_init
|
||||
off_A15_18 dw offset bdos_main
|
||||
off_A15_1A dw offset bdos_init
|
||||
a080586 db '[06-Feb-85] '
|
||||
lp_xios_entry dw 3 ; Offset of XIOS entry
|
||||
seg_A15_2A dw seg lp_xios_entry ; -> XIOS segment
|
||||
lp_xios_init dw 0 ; Offset of XIOS init function
|
||||
dw seg lp_xios_entry ; -> XIOS segment
|
||||
lp_bdos_entry dw offset bdos_entry ; DATA XREF: bdos:01B9r x_dev_waitflag+2r
|
||||
; ...
|
||||
dw seg bdos_start
|
||||
|
||||
lp_timeslice dw offset rtm_timeslice
|
||||
dw seg rtm_timeslice
|
||||
|
||||
lp_sysflag_chg dw offset rtm_sysflag
|
||||
dw seg rtm_sysflag
|
||||
|
||||
lp_kbd_callback dw offset cio_keyboard
|
||||
dw seg cio_keyboard
|
||||
|
||||
lp_dos_module dw 0,0 ; DATA XREF: bdos:007Dr P_CHAIN+A9r
|
||||
; ...
|
||||
ccp_dseg dw 0 ; DATA XREF: mc_temp_untempr
|
||||
; get_mcb_pars+38r ...
|
||||
; 0 if no temporary memory blocks allocated
|
||||
dw seg bdos_start
|
||||
dw seg freemem
|
||||
bdos_conowner dw offset proc1 ; DATA XREF: bdos:002Ew bdos_sysflag+Ar
|
||||
; ...
|
||||
bdos_sysflags dw SYSFLAGS ; This should get set by GENCPM
|
||||
|
||||
rlr dw offset proc1 ; DATA XREF: bdos:001Fr bdos:0028w
|
||||
; ...
|
||||
; Current process
|
||||
process_table dw 0 ; DATA XREF: bdos:002Bw
|
||||
drl dw 0 ; DATA XREF: P_0207+5r P_0209+7o
|
||||
; ...
|
||||
; Processes that have just become
|
||||
; ready to run
|
||||
dw 0
|
||||
proc_count db 1 ; DATA XREF: get_new_process+1Dw
|
||||
; P_TERMCPM+5Ew ...
|
||||
bdos_ver dw 1033h ; DATA XREF: S_BDOSVERr
|
||||
bdos_8087_inuse db 0 ; DATA XREF: call_p_load+10w
|
||||
; retake_8087+Br ...
|
||||
search_path db 0, 10h, 0FFh, 0FFh
|
||||
; ...
|
||||
temp_drive db 0 ; DATA XREF: rsx_find+53o bdos:23AEo
|
||||
date_days dw 0A22h ; DATA XREF: bdos:23B2o bdos:2540o
|
||||
; ...
|
||||
date_hours db 12h ; DATA XREF: xios_hook_timer+85w
|
||||
; xios_int08+5Dr ...
|
||||
date_mins db 0 ; DATA XREF: xios_hook_timer+7Dw
|
||||
; xios_int08+4Br ...
|
||||
date_secs db 0 ; DATA XREF: bdos:2551w bdos:2566r
|
||||
; ...
|
||||
cur_x db 0 ; DATA XREF: bdos_char_out+44r
|
||||
; bdos_char_out+70w ...
|
||||
max_x db SCR_MAXX ; DATA XREF: input_putchar+12r
|
||||
; expand_tabs+14r ...
|
||||
max_y db SCR_MAXY ; DATA XREF: bdos:23A2o
|
||||
page_mode db 0 ; DATA XREF: bdos:23A6o
|
||||
echo_backspaced db 0 ; DATA XREF: input_ctlH+9r
|
||||
echo_deleted db SCR_ECHODEL ; DATA XREF: input_delete+9r
|
||||
;
|
||||
; Process queues for single-threaded parts of the system.
|
||||
;
|
||||
; Format of process queue:
|
||||
; DW offset of next queue, 0 for none
|
||||
; DW segment of process currently in that section, 0 for none
|
||||
; DW linked list of processes waiting for that section, 0 for none
|
||||
; DW 0
|
||||
;
|
||||
pq_disk dw offset pq_loader ; DATA XREF: get_proc_dskdat+5o
|
||||
; release_DMAo ...
|
||||
rw 3
|
||||
pq_loader dw offset pq_filesystem
|
||||
rw 3
|
||||
pq_filesystem dw offset pq_error ; DATA XREF: funcs_F_main+8o
|
||||
; funcs_F_main+124o ...
|
||||
rw 3
|
||||
pq_error dw 8Ah ; DATA XREF: funcs_F_main+136o
|
||||
; funcs_F_main+1C7o ...
|
||||
rw 3
|
||||
pq_memmgr rw 4 ; DATA XREF: funcs_MC+2o funcs_MC+24o
|
||||
; ...
|
||||
boot_drive db 0 ; DATA XREF: bdos:006Cr bdos:23CEo
|
||||
; ...
|
||||
ccp_user db 0
|
||||
rb 7
|
||||
db 1,2
|
||||
rb 0F5h
|
||||
sysvar_142 rb 20h
|
||||
db 0
|
||||
sysvar_143 db 0, 20h, 0
|
||||
sysvar_144 db 0 ; DATA XREF: bdos:0073w bdos:23F6o
|
||||
; ...
|
||||
sysvar_131 db 0 ; DATA XREF: copy_to_history+14w
|
||||
; bdos:1CFFr ...
|
||||
sysvar_132 rb 100h ; DATA XREF: copy_to_history+Do
|
||||
; bdos:1CFAo ...
|
||||
time_slice db 10h ; DATA XREF: delay_dispatch+A2r
|
||||
; bdos:23DEo
|
||||
cpu_vectors rw 12
|
||||
|
||||
end
|
||||
|
||||
|
@@ -0,0 +1,99 @@
|
||||
|
||||
NO equ 0
|
||||
YES equ NOT NO
|
||||
|
||||
dseg
|
||||
;
|
||||
; Addresses in the Zero Page
|
||||
;
|
||||
INT_E0 equ dword ptr .0380h
|
||||
;
|
||||
; Addresses in the XIOS
|
||||
;
|
||||
xios_bh_delay equ byte ptr .0F00h ;XIOS header
|
||||
xios_bh_ticks equ byte ptr .0F01h
|
||||
xios_bh_gdopen equ byte ptr .0F02h
|
||||
xios_bh_inint equ byte ptr .0F03h
|
||||
xios_bh_nextflg equ byte ptr .0F04h
|
||||
xios_bh_lastflg equ byte ptr .0F05h
|
||||
xios_bh_intconi equ byte ptr .0F06h
|
||||
xios_bh_8087 equ byte ptr .0F07h
|
||||
mem_table equ word ptr .0F56h
|
||||
msg_cannot_load equ word ptr .1016h
|
||||
addr_no_ccp equ word ptr .1018h
|
||||
addr_user equ word ptr .101Ah
|
||||
addr_cpm_error equ word ptr .101Ch ;Localised messages
|
||||
addr_bdos_fn equ word ptr .101Eh
|
||||
addr_file equ word ptr .1020h
|
||||
addr_writeerr equ word ptr .1022h
|
||||
addr_rodisk equ word ptr .1024h
|
||||
addr_rofile equ word ptr .1026h
|
||||
addr_invaliddrv equ word ptr .1028h
|
||||
addr_pwderr equ word ptr .102Ah
|
||||
addr_filexists equ word ptr .102Ch
|
||||
addr_ambiguous equ word ptr .102Eh
|
||||
country_info equ word ptr .1030h ;DOS country info
|
||||
switch_char equ byte ptr .1050h ;DOS switch character
|
||||
;
|
||||
; Addresses in the process table
|
||||
;
|
||||
proc_nextready equ word ptr .00h ;Link to next ready process
|
||||
proc_nextseg equ word ptr .02h ;Link to next process in
|
||||
;numerical order
|
||||
proc_status equ byte ptr .04h ; 0 => Runnable
|
||||
; 1 => Waiting on timer
|
||||
; 2 => Terminated
|
||||
; 3 => Waiting on flag
|
||||
proc_pid equ byte ptr .05h
|
||||
proc_flags equ word ptr .06h ; Bit 0 => killed
|
||||
; Bit 1 => Using 8087
|
||||
proc_name equ byte ptr .08h
|
||||
proc_incpm equ byte ptr .10h
|
||||
proc_intfunc equ byte ptr .11h
|
||||
proc_intmod equ byte ptr .12h
|
||||
proc_indisk equ byte ptr .13h
|
||||
proc_errcode equ word ptr .14h
|
||||
proc_conmode equ word ptr .16h
|
||||
proc_background equ byte ptr .18h
|
||||
proc_delimiter equ byte ptr .19h
|
||||
proc_sp equ word ptr .1Ah
|
||||
proc_ss equ word ptr .1Ch
|
||||
proc_ax equ word ptr .1Eh
|
||||
proc_bx equ word ptr .20h
|
||||
proc_cx equ word ptr .22h
|
||||
proc_dx equ word ptr .24h
|
||||
proc_di equ word ptr .26h
|
||||
proc_si equ word ptr .28h
|
||||
proc_bp equ word ptr .2Ah
|
||||
proc_es equ word ptr .2Ch
|
||||
userDS equ word ptr .2Eh
|
||||
userES equ word ptr .30h
|
||||
userStack equ word ptr .32h
|
||||
proc_drive equ byte ptr .36h
|
||||
proc_uid equ byte ptr. 37h
|
||||
proc_dma equ dword ptr .38h
|
||||
proc_fx equ byte ptr .3Ch
|
||||
proc_find1st equ dword ptr .3Eh
|
||||
proc_errmode equ byte ptr .46h
|
||||
proc_multisec equ byte ptr .47h
|
||||
proc_passwd equ byte ptr .48h
|
||||
proc_countdown equ word ptr .50h
|
||||
proc_bdos_offs equ word ptr .52h
|
||||
proc_bdos_seg equ word ptr .54h
|
||||
proc_int0 equ dword ptr .56h
|
||||
proc_using_drvs equ word ptr .6Eh
|
||||
proc_onblock equ dword ptr .70h
|
||||
proc_dirname equ word ptr .74h
|
||||
|
||||
proc_cpm_stack equ byte ptr .100h
|
||||
;
|
||||
; Addresses in the file redirection structure
|
||||
;
|
||||
redir_mode equ byte ptr .0 ; Bit 0: 0=write 1=read
|
||||
; Bits 1-2: 0=file 1=aux 2=lst
|
||||
redir_fcb equ byte ptr .1 ; FCB for redirected file
|
||||
redir_buf_count equ byte ptr .25h ; Count of bytes in current buffer
|
||||
redir_cwd equ word ptr .26h ; Current directory for redirected file
|
||||
redir_buf equ byte ptr .28h ; Current record
|
||||
|
||||
|
@@ -0,0 +1,193 @@
|
||||
/* Convert the Personal CP/M-86 BDOS (compiled as a small-model EXE)
|
||||
* to CMD.
|
||||
* Copyright (C) 2003, 2007 John Elliott <jce@seasip.demon.co.uk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DS_LEN 0xF0 /* Length of data segment (paras) */
|
||||
|
||||
int gl_base = 0x60;
|
||||
|
||||
/* EXE header (plus first 8 bytes of EXE file) */
|
||||
unsigned char exe_header[0x208];
|
||||
|
||||
/* CMD header */
|
||||
unsigned char cmd_header[0x80];
|
||||
|
||||
|
||||
/* Read a word from the EXE header */
|
||||
unsigned short peek(int offset)
|
||||
{
|
||||
unsigned short l = exe_header[offset];
|
||||
unsigned short h = exe_header[offset + 1];
|
||||
return (h << 8) | l;
|
||||
}
|
||||
|
||||
/* Add a group to the CMD header */
|
||||
void addgroup(int type, unsigned short paras, unsigned short base,
|
||||
unsigned short minparas, unsigned short maxparas)
|
||||
{
|
||||
static unsigned char *group = cmd_header;
|
||||
*group++ = type;
|
||||
*group++ = (paras & 0xFF);
|
||||
*group++ = (paras >> 8);
|
||||
*group++ = (base & 0xFF);
|
||||
*group++ = (base >> 8);
|
||||
*group++ = (minparas & 0xFF);
|
||||
*group++ = (minparas >> 8);
|
||||
*group++ = (maxparas & 0xFF);
|
||||
*group++ = (maxparas >> 8);
|
||||
printf("Group %d: len=%04x base=%04x min=%04x max=%04x\n",
|
||||
type, paras, base, minparas, maxparas);
|
||||
}
|
||||
|
||||
/* Copy bytes from one file to another.
|
||||
* TODO: Warn if error. */
|
||||
void mvbytes(FILE *fpexe, FILE *fpcmd, long count)
|
||||
{
|
||||
int c;
|
||||
|
||||
while (count)
|
||||
{
|
||||
c = fgetc(fpexe);
|
||||
fputc(c, fpcmd);
|
||||
--count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
FILE *fpexe, *fpcmd;
|
||||
unsigned short cseg,dseg,sseg,dstop;
|
||||
unsigned short dsmin, dsmax, exeparas;
|
||||
unsigned long exelen, dsbytes;
|
||||
long pos;
|
||||
int n;
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
fprintf(stderr, "Syntax: exe2cmd <exefile> <cmdfile>\n");
|
||||
return 1;
|
||||
}
|
||||
for (n = 3; n < argc; n++)
|
||||
{
|
||||
if (!strncmp(argv[n], "base=", 5))
|
||||
{
|
||||
if (!sscanf(&argv[n][5], "%x", &gl_base))
|
||||
{
|
||||
fprintf(stderr, "base= option incorrect.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Load EXE header, and extract the segment info. This code depends
|
||||
* on the word at CS:6 being the length of the code segment in
|
||||
* paragraphs. */
|
||||
fpexe = fopen(argv[1], "rb");
|
||||
if (!fpexe)
|
||||
{
|
||||
perror(argv[1]);
|
||||
return 1;
|
||||
}
|
||||
if (fread(exe_header, 1, sizeof(exe_header), fpexe) < (int)sizeof(exe_header)
|
||||
/* Check for CP/M-86 BDOS:
|
||||
* 32 header paragraphs
|
||||
* First relocation is at address 6 or less */
|
||||
|| peek(8) != 32 || peek(32) > 6)
|
||||
{
|
||||
fclose(fpexe);
|
||||
fprintf(stderr, "%s is not a BDOS image\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
cseg = 0;
|
||||
dseg = peek(0x206);
|
||||
sseg = peek(14);
|
||||
exelen = 512L * peek(4);
|
||||
if (peek(2)) exelen -= (512 - peek(2));
|
||||
exeparas = (exelen + 15) >> 4;
|
||||
/*
|
||||
dstop = exeparas - peek(8);
|
||||
ssparas = dstop - sseg;
|
||||
dsmin = dstop - dseg + peek(10);
|
||||
dsmax = dstop - dseg + peek(12);
|
||||
*/
|
||||
/* This is CP/M-86, the DSEG is a fixed size */
|
||||
dsmin = dsmax = DS_LEN;
|
||||
dstop = dseg + DS_LEN;
|
||||
printf("EXE length = %04lx\n", exelen);
|
||||
printf("EXE header len = %04x\n", peek(8));
|
||||
printf("EXE paras = %04x\n", exeparas);
|
||||
printf("DS top = %04x\n", dstop);
|
||||
printf("CS: %04x length %04x\n", cseg, dseg - cseg);
|
||||
printf("DS: %04x length %04x\n", dseg, dstop - dseg);
|
||||
|
||||
/* Now generate CP/M-86 header. */
|
||||
addgroup(1, dseg - cseg, 0, dseg - cseg, 0);
|
||||
addgroup(2, dstop - dseg, 0, dsmin, 0);
|
||||
|
||||
fpcmd = fopen(argv[2], "wb");
|
||||
if (fpcmd == NULL)
|
||||
{
|
||||
perror(argv[2]);
|
||||
fclose(fpexe);
|
||||
return 2;
|
||||
}
|
||||
if (fwrite(cmd_header, 1, sizeof(cmd_header), fpcmd) < (int)sizeof(cmd_header)
|
||||
|| fwrite(exe_header+0x200, 1, 8, fpcmd) < 8)
|
||||
{
|
||||
fclose(fpcmd);
|
||||
fclose(fpexe);
|
||||
perror(argv[2]);
|
||||
return 2;
|
||||
}
|
||||
/* Write the code segment. The first 8 bytes have been done. */
|
||||
mvbytes(fpexe, fpcmd, 16L * (dseg - cseg) - 8);
|
||||
/* Write the data segment. */
|
||||
dsbytes = 16L * (dstop - dseg);
|
||||
mvbytes(fpexe, fpcmd, 40);
|
||||
/* Apply fixups to offsets within the data segment */
|
||||
for (n = 0; n < 8; n++)
|
||||
{
|
||||
unsigned seg;
|
||||
if (n == 6)
|
||||
{
|
||||
mvbytes(fpexe, fpcmd, 4);/* Address of DOS module */
|
||||
continue;
|
||||
}
|
||||
mvbytes(fpexe, fpcmd, 2); /* Offset */
|
||||
fread(exe_header, 1, 2, fpexe);
|
||||
seg = peek(0) + gl_base;
|
||||
fputc(seg & 0xFF, fpcmd);
|
||||
fputc(seg >> 8, fpcmd);
|
||||
}
|
||||
mvbytes(fpexe, fpcmd, dsbytes - 72);
|
||||
/* Pad the CMD file out to a whole number of records */
|
||||
pos = ftell(fpcmd);
|
||||
while (pos & 0x7F)
|
||||
{
|
||||
fputc(0, fpcmd);
|
||||
++pos;
|
||||
}
|
||||
fclose(fpcmd);
|
||||
fclose(fpexe);
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
|
||||
ZIPFILES= bdos.a86 cmdio.c equates.a86 mem.a86 system.a86 \
|
||||
serial.a86 cmdio.h exe2cmd.c misc.a86 proctbl.a86 \
|
||||
xios.cmd ccp.cmd dpgen.c makefile rtm.a86 \
|
||||
cio.a86 entry.a86 sup.a86 bdos33ex.inp \
|
||||
ccpldr.a86
|
||||
|
||||
OBJECTS=entry.obj sup.obj rtm.obj mem.obj cio.obj misc.obj bdos.obj \
|
||||
ccpldr.obj proctbl.obj
|
||||
|
||||
all: bdos.cmd new.sys
|
||||
|
||||
new.sys: bdos.cmd ccp.cmd xios.cmd dpgen.exe
|
||||
dpgen base=F08
|
||||
|
||||
bdos33.exe: $(OBJECTS)
|
||||
linkexe bdos33ex[i
|
||||
|
||||
bdos.cmd: bdos33.exe exe2cmd.exe
|
||||
exe2cmd bdos33.exe bdos.cmd base=F08
|
||||
|
||||
%.obj: %.a86 equates.a86 system.a86
|
||||
rasm86 $<
|
||||
|
||||
misc.obj: misc.a86 equates.a86 system.a86 serial.a86
|
||||
|
||||
dpgen.exe: dpgen.c cmdio.c cmdio.h
|
||||
pacc -Bl dpgen.c cmdio.c
|
||||
|
||||
exe2cmd.exe: exe2cmd.c
|
||||
pacc -Bs $<
|
||||
|
||||
clean:
|
||||
xdel $(OBJECTS)
|
||||
xdel bdos.cmd new.sys
|
||||
|
||||
zip:
|
||||
zip bdos33.zip $(ZIPFILES)
|
@@ -0,0 +1,737 @@
|
||||
|
||||
include equates.a86
|
||||
|
||||
dseg
|
||||
extrn pq_memmgr:word
|
||||
extrn ccp_dseg:word
|
||||
|
||||
cseg
|
||||
extrn bdos_callback:near
|
||||
|
||||
public mem_init
|
||||
public mem_main
|
||||
;
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mem_init: retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mem_main: push dx
|
||||
push si
|
||||
mov bx, offset pq_memmgr
|
||||
mov cx, 204h
|
||||
call bdos_callback
|
||||
inc es:proc_indisk
|
||||
pop si
|
||||
pop dx
|
||||
call cs:mem_functions[si]
|
||||
jb mc_success
|
||||
mov bx, 0FFFFh
|
||||
|
||||
mc_success: ; CODE XREF: funcs_MC+17j
|
||||
push bx
|
||||
push cx
|
||||
mov cx, 206h
|
||||
call bdos_callback
|
||||
mov bx, offset pq_memmgr
|
||||
mov cx, 205h
|
||||
call bdos_callback
|
||||
pop cx
|
||||
pop bx
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mem_functions dw offset MC_MAX ; DATA XREF: funcs_MC+12o
|
||||
dw offset MC_ABSMAX
|
||||
dw offset MC_ALLOC
|
||||
dw offset MC_ABSALLOC
|
||||
dw offset MC_FREE
|
||||
dw offset MC_ALLFREE
|
||||
dw offset mc_temp_untemp
|
||||
dw offset mc_cleanprg
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ABSALLOC: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+36o
|
||||
call get_mcb_pars
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ABSMAX: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+32o
|
||||
call get_mcb_pars
|
||||
mov mcb_len_min, 1
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ALLFREE: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Ao
|
||||
call get_mcb_pars
|
||||
cmp mcb_ext, 2
|
||||
jnb mcaf_just_anyle
|
||||
mov dx, 8
|
||||
call free_allmem
|
||||
|
||||
mcaf_just_anyle: ; CODE XREF: MC_ALLFREE+8j
|
||||
jmp mc_anyleft
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ALLOC: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+34o
|
||||
call get_mcb_pars
|
||||
mov mcb_segment, 0
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_FREE: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+38o
|
||||
call get_mcb_pars
|
||||
mov al, mcb_ext
|
||||
cmp al, 0FFh
|
||||
jnz free_onemem
|
||||
mov dx, 8
|
||||
call free_allmem
|
||||
jmps free_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
free_onemem: ; CODE XREF: MC_FREE+8j
|
||||
cmp al, 2
|
||||
jnb free_done
|
||||
call ml_free
|
||||
jmps free_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmps free_done
|
||||
|
||||
free_done: ; CODE XREF: MC_FREE+10j MC_FREE+14j
|
||||
; ...
|
||||
jmp mc_anyleft
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_MAX: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+30o
|
||||
call get_mcb_pars
|
||||
mov mcb_segment, 0
|
||||
mov mcb_len_min, 1
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
;
|
||||
; Resets the 'temporary' flag on all temporary allocations,
|
||||
; making them permanent.
|
||||
;
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mc_temp_untemp: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Co
|
||||
mov bx, ccp_dseg ; Temp blocks exist?
|
||||
test bx, bx
|
||||
jnz mctu_temp_found
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mctu_temp_found: ; CODE XREF: mc_temp_untemp+6j
|
||||
push bx
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mctu_loop: ; CODE XREF: mc_temp_untemp+16j
|
||||
call ml_next
|
||||
jnb mctu_done
|
||||
and byte ptr 5[di], 0FEh
|
||||
jmps mctu_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mctu_done: ; CODE XREF: mc_temp_untemp+10j
|
||||
pop bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mc_cleanprg: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Eo
|
||||
push dx
|
||||
;
|
||||
; If bit 2 set in process flags, look for all memory blocks
|
||||
; with bit 2 set in their flags and set bit 0
|
||||
;
|
||||
test es:proc_flags, 4
|
||||
jz mccp_endlabel
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mccp_label: ; CODE XREF: mc_cleanprg+16j
|
||||
; mc_cleanprg+1Cj
|
||||
call ml_next
|
||||
jnb mccp_endlabel
|
||||
test byte ptr 5[di], 4
|
||||
jz mccp_label
|
||||
or byte ptr 5[di], 1
|
||||
jmps mccp_label
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_endlabel: ; CODE XREF: mc_cleanprg+8j
|
||||
; mc_cleanprg+10j
|
||||
pop dx
|
||||
cmp dx, 1
|
||||
jz mccp_type1
|
||||
xor dx, dx
|
||||
call free_allmem
|
||||
jmps mccp_end
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_type1: ; CODE XREF: mc_cleanprg+22j
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mccp_type1_loop: ; CODE XREF: mc_cleanprg+3Aj
|
||||
; mc_cleanprg+40j
|
||||
call ml_next
|
||||
jnb mccp_end
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al
|
||||
jnz mccp_type1_loop
|
||||
mov byte ptr 4[di], 0FDh
|
||||
jmps mccp_type1_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_end: ; CODE XREF: mc_cleanprg+29j
|
||||
; mc_cleanprg+31j
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
get_mcb_pars: ; CODE XREF: MC_ABSALLOCp MC_ABSMAXp
|
||||
; ...
|
||||
mov caller_mcb, dx
|
||||
mov bx, dx
|
||||
push es
|
||||
mov es, es:userDS
|
||||
mov ax, es:[bx]
|
||||
mov mcb_segment, ax
|
||||
mov ax, es:2[bx]
|
||||
mov mcb_len_min, ax
|
||||
mov mcb_len_max, ax
|
||||
xor ax, ax
|
||||
mov cl, es:4[bx]
|
||||
mov mcb_ext, cl
|
||||
cmp cl, 2
|
||||
jnz mcb_ext_range
|
||||
mov ax, 2 ; Keep memory flag
|
||||
|
||||
mcb_ext_range: ; CODE XREF: get_mcb_pars+29j
|
||||
pop es
|
||||
mov dx, es:proc_flags
|
||||
and dx, 0Ch
|
||||
cmp ccp_dseg, 0 ; Do temporary blocks exist?
|
||||
jz mcb_noccpdseg
|
||||
and dx, 0FFFBh
|
||||
|
||||
mcb_noccpdseg: ; CODE XREF: get_mcb_pars+3Dj
|
||||
or ax, dx
|
||||
mov mcb_keep_flag, al
|
||||
mov cx, 2Bh ; Bad Parameter
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
common_alloc: ; CODE XREF: MC_ABSALLOC+3j
|
||||
; MC_ABSMAX+9j ...
|
||||
cmp mcb_ext, 2 ; Remain after termination?
|
||||
ja mc_anyleft
|
||||
call allocate_block
|
||||
|
||||
mc_anyleft: ; CODE XREF: MC_ALLFREE+10j
|
||||
; MC_FREE+1Dj ...
|
||||
push es
|
||||
pushf
|
||||
mov es, es:userDS
|
||||
mov di, offset mem_table-6
|
||||
xor dl, dl ; Not available
|
||||
call ml_find_free
|
||||
jnb mc_noneleft
|
||||
inc dl ; Available
|
||||
|
||||
mc_noneleft: ; CODE XREF: common_alloc+19j
|
||||
mov bx, caller_mcb
|
||||
mov es:4[bx], dl
|
||||
mov ax, mcb_segment
|
||||
mov es:[bx], ax
|
||||
mov ax, mcb_len_max
|
||||
mov es:2[bx], ax
|
||||
xor bx, bx
|
||||
popf
|
||||
pop es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
allocate_block: ; CODE XREF: common_alloc+7p
|
||||
mov cx, 43 ; Bad parameter
|
||||
mov ax, mcb_len_min
|
||||
mov bx, mcb_len_max
|
||||
push ax
|
||||
or ax, bx
|
||||
pop ax
|
||||
jz mcb_param_err
|
||||
cmp ax, bx
|
||||
ja mcb_param_err
|
||||
cmp mcb_segment, 0
|
||||
jz mcb_not_abs
|
||||
|
||||
mcb_abs_retry: ; CODE XREF: allocate_block+36j
|
||||
mov dx, mcb_segment ; Find the memory list entry
|
||||
; controlling this segment.
|
||||
call ml_find_byseg
|
||||
jnb mcb_param_err ; If failed, segment not in the memory arena.
|
||||
mov al, 4[di] ; Get the PID of the memory owner
|
||||
cmp al, 0FEh ; Does the entry contain free memory?
|
||||
jz mcb_wasfree ; Yes. Allocate in it.
|
||||
test byte ptr 5[di], 1; Is it owned by a temporary block?
|
||||
jz mcb_nofree
|
||||
push ax ; Free all temporary blocks
|
||||
call free_temp_block
|
||||
pop ax ; And if that worked, try again
|
||||
jb mcb_abs_retry
|
||||
|
||||
mcb_nofree: ; CODE XREF: allocate_block+2Fj
|
||||
cmp al, es:proc_pid ; Block is in use. By the current
|
||||
; process?
|
||||
jnz mcb_param_err
|
||||
mov ax, [di] ; Suppose so.
|
||||
cmp ax, mcb_segment ; Does the passed start address match the
|
||||
; start of the block?
|
||||
jnz mcb_param_err
|
||||
;
|
||||
; In this case, we're trying to allocate a block
|
||||
; which was allocated already. Update its
|
||||
; flags and then leave it.
|
||||
;
|
||||
mov al, mcb_keep_flag
|
||||
or 5[di], al
|
||||
jmps mcb_allocated
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_wasfree: ; CODE XREF: allocate_block+29j
|
||||
mov ax, [di] ; Start of block
|
||||
add ax, 2[di] ; End of block
|
||||
sub ax, mcb_segment ; Max size to allocate
|
||||
cmp ax, mcb_len_min ; Is it > min size requested?
|
||||
jb mcb_param_err
|
||||
call ml_checksplit
|
||||
jnb mcb_didntsplit
|
||||
mov byte ptr 4[si], 0FEh; Mark the new block as free
|
||||
mov di, si
|
||||
|
||||
mcb_didntsplit: ; CODE XREF: allocate_block+61j
|
||||
jmps mcb_doalloc
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_not_avail: ; CODE XREF: allocate_block+96j
|
||||
mov cx, 3
|
||||
|
||||
mcb_param_err: ; CODE XREF: allocate_block+Ej
|
||||
; allocate_block+12j
|
||||
; ...
|
||||
clc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_not_abs: ; CODE XREF: allocate_block+19j
|
||||
; allocate_block+90j
|
||||
xor dx, dx
|
||||
mov di, offset mem_table-6
|
||||
|
||||
not_abs_next: ; CODE XREF: allocate_block+89j
|
||||
call ml_find_free
|
||||
jnb not_abs_endscan
|
||||
mov ax, 2[di] ; Length of free block
|
||||
cmp dx, ax ; Suitable candidate?
|
||||
jnb not_abs_small
|
||||
mov dx, ax
|
||||
mov si, di ; Keep it in mind
|
||||
|
||||
not_abs_small: ; CODE XREF: allocate_block+7Fj
|
||||
cmp ax, mcb_len_max
|
||||
jb not_abs_next ; Block isn't ideal
|
||||
jmps mcb_doalloc; Got an ideal block. Use it.
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
not_abs_endscan: ; CODE XREF: allocate_block+78j
|
||||
call free_temp_block ; Free temp blocks and try again
|
||||
jb mcb_not_abs
|
||||
cmp dx, mcb_len_min ; Can we at least get the minimum?
|
||||
jb mcb_not_avail
|
||||
mov ax, 2[si] ; OK, make do with the best one we found
|
||||
mov mcb_len_max, ax
|
||||
mov di, si
|
||||
|
||||
mcb_doalloc: ; CODE XREF: allocate_block+69j
|
||||
; allocate_block+8Bj
|
||||
mov ax, [di]
|
||||
mov mcb_segment, ax
|
||||
call ml_splittail ; If not all the block was taken,
|
||||
; mark the remainder as free.
|
||||
jnb mcb_tookall
|
||||
mov byte ptr 4[si], 0FEh
|
||||
|
||||
mcb_tookall: ; CODE XREF: allocate_block+A8j
|
||||
mov al, mcb_keep_flag
|
||||
mov 5[di], al
|
||||
mov al, es:proc_pid
|
||||
test mcb_keep_flag, 4
|
||||
jz mcb_gotowner
|
||||
mov al, 0FCh ; Owner -4 for blocks that persist
|
||||
|
||||
mcb_gotowner: ; CODE XREF: allocate_block+BDj
|
||||
mov 4[di], al
|
||||
|
||||
mcb_allocated: ; CODE XREF: allocate_block+4Dj
|
||||
mov ax, 2[di]
|
||||
mov mcb_len_max, ax
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
free_temp_block: ; CODE XREF: allocate_block+32p
|
||||
; allocate_block+8Dp
|
||||
mov di, offset mem_table-6
|
||||
clc
|
||||
pushf
|
||||
|
||||
freetmp_loop: ; CODE XREF: free_temp_block+Ej
|
||||
; free_temp_block+1Ej
|
||||
call ml_next
|
||||
jnb freetmp_done
|
||||
test byte ptr 5[di], 1; Temporary?
|
||||
jz freetmp_loop
|
||||
popf
|
||||
stc
|
||||
pushf
|
||||
push di ; If so, free it
|
||||
call ml_freeblk
|
||||
pop di
|
||||
mov ccp_dseg, 0
|
||||
jmps freetmp_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
freetmp_done: ; CODE XREF: free_temp_block+8j
|
||||
popf
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
free_allmem: ; CODE XREF: MC_ALLFREE+Dp
|
||||
; MC_FREE+Dp ...
|
||||
mov di, offset mem_table-6
|
||||
push dx
|
||||
|
||||
freeall_loop: ; CODE XREF: free_allmem+10j
|
||||
; free_allmem+19j ...
|
||||
call ml_next
|
||||
jnb allmem_freed
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al ; Owned by this process?
|
||||
jnz freeall_loop
|
||||
pop dx
|
||||
mov al, 5[di] ; Flags
|
||||
test al, dl
|
||||
push dx
|
||||
jnz freeall_loop
|
||||
test al, 2
|
||||
mov byte ptr 4[di], 0FDh
|
||||
jnz freeall_loop
|
||||
call ml_freeblk
|
||||
jmps freeall_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
allmem_freed: ; CODE XREF: free_allmem+7j
|
||||
pop dx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_free: ; CODE XREF: MC_FREE+16p
|
||||
mov dx, mcb_segment
|
||||
call ml_find_byseg ; Find memory list entry for this segment
|
||||
jnb ml_freefail
|
||||
cmp byte ptr 4[di], 0FDh
|
||||
jz ml_canfree ; Owned by ??? shared ???
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al ; Owned by this process?
|
||||
jz ml_canfree
|
||||
mov cx, 20h ; Don't own resource
|
||||
jmps ml_freefail
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_canfree: ; CODE XREF: ml_free+Dj ml_free+16j
|
||||
cmp dx, [di] ; Block start matches?
|
||||
jz ml_freeblk
|
||||
call ml_splitblk ; No. Split block
|
||||
mov di, si
|
||||
jb ml_freeblk
|
||||
|
||||
ml_freefail: ; CODE XREF: ml_free+7j ml_free+1Bj
|
||||
clc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_freeblk: ; CODE XREF: free_temp_block+14p
|
||||
; free_allmem+23p ...
|
||||
mov ax, 0FEh
|
||||
mov 4[di], al ; Owner = free
|
||||
mov byte ptr 5[di], 0; Persist = 0
|
||||
mov si, di
|
||||
mov dx, [si]
|
||||
dec dx ; Who owns the para before the memory
|
||||
; we're freeing?
|
||||
push ax
|
||||
call ml_find_byseg
|
||||
pop ax
|
||||
jnb no_coalesce ; Not found
|
||||
cmp 4[di], al
|
||||
jnz no_coalesce ; Not free
|
||||
mov cx, 2[si]
|
||||
add 2[di], cx ; Merge blocks
|
||||
mov byte ptr 4[si], 0FFh
|
||||
mov si, di ; Destroy this block
|
||||
|
||||
no_coalesce: ; CODE XREF: ml_freeblk+14j
|
||||
; ml_freeblk+19j
|
||||
mov di, si
|
||||
mov dx, [di]
|
||||
add dx, 2[di] ; Now try the same with the following
|
||||
; block.
|
||||
push ax
|
||||
call ml_find_byseg
|
||||
pop ax
|
||||
jnb no_coalesce2
|
||||
cmp 4[di], al
|
||||
jnz no_coalesce2
|
||||
mov cx, 2[di]
|
||||
add 2[si], cx
|
||||
mov byte ptr 4[di], 0FFh
|
||||
|
||||
no_coalesce2: ; CODE XREF: ml_freeblk+33j
|
||||
; ml_freeblk+38j
|
||||
mov di, si
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_checksplit: ; CODE XREF: allocate_block+5Ep
|
||||
mov ax, mcb_segment
|
||||
mov dx, ax ; DX = first requested para
|
||||
sub ax, [di] ; AX = paras before allocated area
|
||||
cmp ax, 1 ; If there are some...
|
||||
jnb ml_splitblk ; Then split the block
|
||||
clc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_splittail: ; CODE XREF: allocate_block+A5p
|
||||
mov dx, mcb_len_max
|
||||
mov ax, 2[di]
|
||||
sub ax, dx
|
||||
cmp ax, 1
|
||||
jnb ml_dospltail
|
||||
clc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_dospltail: ; CODE XREF: ml_splittail+Cj
|
||||
add dx, mcb_segment
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_splitblk: ; CODE XREF: ml_free+21p ml_checksplit+Aj
|
||||
mov cx, 12h
|
||||
push di
|
||||
mov di, offset mem_table-6
|
||||
|
||||
ml_split1: ; CODE XREF: ml_splitblk+10j
|
||||
call ml_next
|
||||
jnb ml_split2
|
||||
cmp byte ptr 4[di], 0FFh
|
||||
jnz ml_split1
|
||||
pop si
|
||||
xchg si, di
|
||||
mov [si], dx
|
||||
mov ax, [di]
|
||||
add ax, 2[di]
|
||||
sub ax, dx
|
||||
mov 2[si], ax
|
||||
sub dx, [di]
|
||||
mov 2[di], dx
|
||||
stc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_split2: ; CODE XREF: ml_splitblk+Aj
|
||||
pop di
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_find_byseg: ; CODE XREF: allocate_block+1Fp
|
||||
; ml_free+4p ...
|
||||
mov di, offset mem_table-6
|
||||
mov cx, 3
|
||||
|
||||
mlfbs_loop: ; CODE XREF: ml_find_byseg+Fj
|
||||
; ml_find_byseg+15j ...
|
||||
call ml_next
|
||||
jnb mlfbs_end
|
||||
cmp byte ptr 4[di], 0FFh
|
||||
jz mlfbs_loop
|
||||
mov ax, [di]
|
||||
cmp ax, dx
|
||||
ja mlfbs_loop
|
||||
add ax, 2[di]
|
||||
cmp dx, ax
|
||||
jnb mlfbs_loop
|
||||
|
||||
mlfbs_end: ; CODE XREF: ml_find_byseg+9j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_find_free: ; CODE XREF: common_alloc+16p
|
||||
; allocate_block+75p
|
||||
; ...
|
||||
call ml_next
|
||||
jnb no_free_ml
|
||||
cmp byte ptr 4[di], 0FEh
|
||||
jnz ml_find_free
|
||||
stc
|
||||
|
||||
no_free_ml: ; CODE XREF: ml_find_free+3j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_next: ; CODE XREF: mc_temp_untemp+Dp
|
||||
; mc_cleanprg+Dp ...
|
||||
add di, 6
|
||||
mov ax, offset msg_cannot_load
|
||||
cmp di, ax
|
||||
retn
|
||||
|
||||
|
||||
dseg
|
||||
|
||||
mcb_len_min dw 0 ; DATA XREF: MC_ABSMAX+3w MC_MAX+9w
|
||||
; ...
|
||||
mcb_len_max dw 0 ; DATA XREF: get_mcb_pars+19w
|
||||
; common_alloc+2Br ...
|
||||
mcb_segment dw 0 ; DATA XREF: MC_ALLOC+3w MC_MAX+3w
|
||||
; ...
|
||||
mcb_keep_flag db 0 ; DATA XREF: get_mcb_pars+45w
|
||||
; allocate_block+47r
|
||||
; ...
|
||||
caller_mcb dw 0 ; DATA XREF: get_mcb_parsw
|
||||
; common_alloc+1Dr
|
||||
mcb_ext db 0 ; DATA XREF: MC_ALLFREE+3r
|
||||
; MC_FREE+3r ...
|
||||
end
|
||||
|
@@ -0,0 +1,451 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
dseg
|
||||
extrn rlr:word
|
||||
extrn login_vector:word
|
||||
extrn readonly_vector:word
|
||||
extrn date_days:word
|
||||
extrn date_secs:byte
|
||||
extrn bdos_8087_inuse:word
|
||||
extrn cio_flags:word
|
||||
extrn ccp_dseg:word
|
||||
extrn sysvar_131:byte
|
||||
extrn sysvar_132:byte
|
||||
extrn sysvar_142:byte
|
||||
extrn sysvar_143:byte
|
||||
extrn sysvar_144:byte
|
||||
extrn search_path:byte
|
||||
extrn proc_count:byte
|
||||
extrn time_slice:byte
|
||||
extrn page_mode:byte
|
||||
extrn temp_drive:byte
|
||||
extrn max_x:byte
|
||||
extrn max_y:byte
|
||||
extrn bdos_ver:word
|
||||
extrn boot_drive:byte
|
||||
cseg
|
||||
|
||||
public misc_init
|
||||
public misc_main
|
||||
|
||||
extrn cwd_for_drive:near
|
||||
|
||||
db 'COPYRIGHT(C)1983,DIGITAL RESEARCH'
|
||||
db '(06-FEB-85)'
|
||||
|
||||
sernumber:
|
||||
include serial.a86
|
||||
|
||||
misc_init: ; DATA XREF: dseg:0016o
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
misc_functions dw offset P_RSX_default ; DATA XREF: bdos:2317o
|
||||
dw offset S_BDOSVER
|
||||
dw offset DRV_LOGINVEC
|
||||
dw offset DRV_GET
|
||||
dw offset F_DMAOFF
|
||||
dw offset DRV_ROVEC
|
||||
dw offset F_USERNUM
|
||||
dw offset F_MULTISEC
|
||||
dw offset F_ERRMODE
|
||||
dw offset S_SYSVAR
|
||||
dw offset F_DMASEG
|
||||
dw offset F_DMAGET
|
||||
dw offset T_SET
|
||||
dw offset T_GET
|
||||
dw offset S_SERIAL
|
||||
dw offset P_CODE
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
misc_main: ; DATA XREF: dseg:0014o
|
||||
jmp cs:misc_functions[si]
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_RSX_default: ; DATA XREF: bdos:22EFo
|
||||
mov bx, 0FFFFh
|
||||
mov cx, 2
|
||||
retn
|
||||
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_BDOSVER: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F1o
|
||||
mov bx, bdos_ver
|
||||
retn
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_SYSVAR: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2301o
|
||||
mov si, dx ; Caller SCBPB
|
||||
mov dx, ds ; Our DS
|
||||
push ds
|
||||
push es
|
||||
mov ds, es:userDS ; Caller DS
|
||||
mov di, offset public_sysvars
|
||||
xor bx, bx
|
||||
mov bl, [si]
|
||||
cmp bl, 6
|
||||
jb sysvar_valid
|
||||
sub bl, 80h
|
||||
jb sysvar_invalid
|
||||
mov di, offset private_sysvars
|
||||
cmp bl, 10h
|
||||
jb sysvar_valid
|
||||
|
||||
sysvar_invalid: ; CODE XREF: S_SYSVAR+1Aj S_SYSVAR+4Fj
|
||||
; ...
|
||||
mov bx, 0FFFFh
|
||||
jmps s_sysvar_ret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
sysvar_valid: ; CODE XREF: S_SYSVAR+15j S_SYSVAR+22j
|
||||
shl bx, 1
|
||||
shl bx, 1
|
||||
mov cx, cs:[bx+di]
|
||||
test ch, 80h ; Process variable?
|
||||
jz not_proc_var
|
||||
mov dx, es
|
||||
|
||||
not_proc_var: ; CODE XREF: S_SYSVAR+33j
|
||||
mov di, cs:2[bx+di]
|
||||
test byte ptr 1[si], 0FFh
|
||||
lea si, 2[si]
|
||||
jnz sysvar_set
|
||||
xchg si, di
|
||||
push ds
|
||||
pop es
|
||||
|
||||
mov ds, dx
|
||||
|
||||
jmps sysvar_access
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
sysvar_set: ; CODE XREF: S_SYSVAR+42j
|
||||
test ch, 40h ; Read-only?
|
||||
jnz sysvar_invalid
|
||||
cmp es:proc_background, 0
|
||||
jz sysvar_is_fg
|
||||
test ch, 20h ; Owned by FG process?
|
||||
jnz sysvar_invalid
|
||||
|
||||
sysvar_is_fg: ; CODE XREF: S_SYSVAR+57j
|
||||
mov es, dx
|
||||
|
||||
sysvar_access: ; CODE XREF: S_SYSVAR+4Aj
|
||||
test ch, 10h ; Volatile?
|
||||
jz sysvar_nocli
|
||||
cli
|
||||
|
||||
sysvar_nocli: ; CODE XREF: S_SYSVAR+63j
|
||||
xor ch, ch
|
||||
rep movsb
|
||||
sti
|
||||
xor bx, bx
|
||||
|
||||
s_sysvar_ret: ; CODE XREF: S_SYSVAR+27j
|
||||
pop es
|
||||
pop ds
|
||||
|
||||
retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
public_sysvars dw 2001h ; DATA XREF: S_SYSVAR+Bo
|
||||
dw offset max_x
|
||||
dw 2001h
|
||||
dw offset max_y
|
||||
dw 2001h
|
||||
dw offset page_mode
|
||||
dw 6001h
|
||||
dw offset xios_bh_ticks
|
||||
dw 2001h
|
||||
dw offset temp_drive
|
||||
dw 1005h
|
||||
dw offset date_days
|
||||
private_sysvars dw 2001h ; DATA XREF: S_SYSVAR+1Co
|
||||
dw offset xios_bh_8087
|
||||
dw 0E001h
|
||||
dw offset proc_pid
|
||||
dw 801Ah
|
||||
dw offset proc_drive
|
||||
dw 2001h
|
||||
dw offset sysvar_131
|
||||
dw 20FFh
|
||||
dw offset sysvar_132
|
||||
dw 3002h
|
||||
dw offset ccp_dseg
|
||||
dw 20FFh
|
||||
dw offset boot_drive
|
||||
dw 3004h
|
||||
dw offset search_path
|
||||
dw 0E001h
|
||||
dw offset proc_background
|
||||
dw 6001h
|
||||
dw offset proc_count
|
||||
dw 2001h
|
||||
dw offset time_slice
|
||||
dw 6002h ; BUG? this is 2002h in PCP/M 2.04e
|
||||
dw offset cio_flags
|
||||
dw 6001h
|
||||
dw offset bdos_8087_inuse
|
||||
dw 9004h
|
||||
dw offset proc_onblock
|
||||
dw 02021h
|
||||
dw offset sysvar_142
|
||||
dw 02003h
|
||||
dw offset sysvar_143
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_SERIAL: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:230Bo
|
||||
push es
|
||||
mov es, es:userDS
|
||||
mov di, dx
|
||||
mov si, offset sernumber+10
|
||||
mov cx, 3
|
||||
db 0F3h, 2Eh ;REP CS:
|
||||
movsw
|
||||
pop es
|
||||
mov bx, cx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_CODE: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:230Do
|
||||
inc dx
|
||||
jz p_code_get
|
||||
dec dx
|
||||
mov es:proc_errcode, dx
|
||||
|
||||
p_code_get: ; CODE XREF: P_CODE+1j
|
||||
mov bx, es:proc_errcode
|
||||
retn
|
||||
;
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
nop_iret:
|
||||
nop
|
||||
iret
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Copy bits for floating drives from their hosts
|
||||
|
||||
ret_drv_vector: ; CODE XREF: DRV_LOGINVEC+4j
|
||||
; DRV_ROVEC+4j
|
||||
mov cx, 3
|
||||
|
||||
rdv_float: ; CODE XREF: ret_drv_vector+23j
|
||||
push cx
|
||||
add cl, 0Ch
|
||||
mov al, cl
|
||||
mov dx, 1
|
||||
shl dx, cl
|
||||
mov cl, 0FFh
|
||||
push bx
|
||||
call cwd_for_drive
|
||||
pop bx
|
||||
mov cl, al ; Get the host drive
|
||||
mov ax, 1
|
||||
shl ax, cl
|
||||
test bx, ax ; Is the corresponding bit set for it?
|
||||
jz rdv_nofloat
|
||||
or bx, dx
|
||||
|
||||
rdv_nofloat: ; CODE XREF: ret_drv_vector+1Ej
|
||||
pop cx
|
||||
loop rdv_float
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_LOGINVEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F3o
|
||||
mov bx, login_vector
|
||||
call ret_drv_vector ; Copy bits for floating drives from their hosts
|
||||
ret
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_GET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F5o
|
||||
mov bl, es:proc_drive
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMAOFF: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F7o
|
||||
mov es:word ptr proc_dma, dx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_ROVEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F9o
|
||||
mov bx, readonly_vector
|
||||
jmp ret_drv_vector ; Copy bits for floating drives from their hosts
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_USERNUM: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FBo
|
||||
mov al, dl
|
||||
cmp al, 0FFh
|
||||
jnz f_setuid
|
||||
mov bl, es:proc_uid
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
f_setuid: ; CODE XREF: F_USERNUM+4j
|
||||
and al, 0Fh
|
||||
mov es:proc_uid, al
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_MULTISEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FDo
|
||||
xor bx, bx
|
||||
or dl, dl
|
||||
jz f_bad_multisec
|
||||
cmp dl, 81h
|
||||
jnb f_bad_multisec
|
||||
mov es:proc_multisec, dl
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
f_bad_multisec: ; CODE XREF: F_MULTISEC+4j
|
||||
; F_MULTISEC+9j
|
||||
dec bx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_ERRMODE: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FFo
|
||||
mov es:proc_errmode, dl
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMASEG: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2303o
|
||||
mov es:word ptr proc_dma+2, dx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMAGET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2305o
|
||||
mov ax, es:word ptr proc_dma+2
|
||||
mov es:userES, ax
|
||||
mov bx, es:word ptr proc_dma
|
||||
retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
T_SET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2307o
|
||||
mov si, dx
|
||||
mov di, offset date_days
|
||||
pushf
|
||||
cli
|
||||
push es
|
||||
push ds
|
||||
mov ds, es:userDS
|
||||
pop es
|
||||
|
||||
movsw
|
||||
movsw
|
||||
push es
|
||||
pop ds
|
||||
pop es
|
||||
|
||||
mov date_secs, 0
|
||||
push cs
|
||||
call nop_iret
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
T_GET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2309o
|
||||
mov di, dx
|
||||
mov si, offset date_days
|
||||
push es
|
||||
mov es, es:userDS
|
||||
pushf
|
||||
cli
|
||||
movsw
|
||||
movsw
|
||||
mov bl, date_secs
|
||||
push cs
|
||||
call nop_iret
|
||||
pop es
|
||||
retn
|
||||
|
||||
end
|
||||
|
@@ -0,0 +1,45 @@
|
||||
|
||||
include equates.a86
|
||||
cseg
|
||||
|
||||
extrn bdos_rsx:near
|
||||
|
||||
dseg
|
||||
|
||||
public proc1
|
||||
;
|
||||
; First process
|
||||
;
|
||||
proc1 dw 0
|
||||
dw offset proc2 ; DATA XREF: bdos:0044r bdos:0050w
|
||||
rw 2
|
||||
db 'INIT '
|
||||
db 0
|
||||
rw 4
|
||||
db '$'
|
||||
|
||||
rb 45
|
||||
db 1
|
||||
rw 5
|
||||
dw offset bdos_rsx
|
||||
rb 10Ch
|
||||
|
||||
proc2 dw 0
|
||||
dw proc3
|
||||
db 2, 1
|
||||
rb 15Ah
|
||||
|
||||
proc3 dw 0
|
||||
dw proc4
|
||||
db 2, 2
|
||||
rb 15Ah
|
||||
|
||||
|
||||
proc4 dw 0
|
||||
dw 0
|
||||
db 2, 3
|
||||
rb 15Ah
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1 @@
|
||||
BDOS 3.3 for Apricot PCP/M-86 3.1
|
@@ -0,0 +1,897 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
|
||||
|
||||
dseg
|
||||
extrn rlr:word
|
||||
extrn drl:word
|
||||
extrn bdos_conowner:word
|
||||
extrn lp_sysflag_chg:dword
|
||||
extrn time_slice:byte
|
||||
extrn pq_disk:word
|
||||
extrn lst_owner:byte
|
||||
extrn aux_owner:byte
|
||||
extrn bdos_8087_inuse:byte
|
||||
extrn proc_count:byte
|
||||
extrn bdos_sysflags:word
|
||||
|
||||
cseg
|
||||
extrn bdos_dseg:word
|
||||
extrn bdos_callback:near
|
||||
extrn far_ret_1:near
|
||||
|
||||
public rtm_main
|
||||
public rtm_init
|
||||
public rtm_timeslice
|
||||
public rtm_sysflag
|
||||
|
||||
rtm_init: ; DATA XREF: dseg:0006o
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
rtm_main: ; DATA XREF: dseg:0004o
|
||||
call cs:rtm_functions[si]; 0208, get new process
|
||||
jb proc_ok
|
||||
mov bx, 0FFFFh
|
||||
|
||||
proc_ok: ; CODE XREF: bdos:0EDFj
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rtm_functions dw offset P_TERMCPM ; DATA XREF: bdos:0EDAo
|
||||
dw offset P_WAITFLAG
|
||||
dw offset P_DELAY
|
||||
dw offset P_DISPATCH
|
||||
dw offset P_0204 ; Enter a process-queue controlled area
|
||||
dw offset P_0205 ; Leave a process-queue controlled area
|
||||
dw offset P_0206
|
||||
dw offset P_0207 ; Check runnable processes
|
||||
dw offset get_new_process; 0208, get new process
|
||||
dw offset P_0209 ; Wake a process (DX = process segment)
|
||||
dw offset P_020A ; Terminate foreground process
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_WAITFLAG: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE7o
|
||||
cli
|
||||
call lookup_flag
|
||||
jnb pwf_badflag
|
||||
cmp ax, 0FFFEh
|
||||
jz pwf_minus2
|
||||
ja pwf_block
|
||||
mov cx, 6
|
||||
clc
|
||||
jmps pwf_badflag
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pwf_block: ; CODE XREF: P_WAITFLAG+Bj
|
||||
mov [bx], es ; Process waiting on flag
|
||||
mov es:proc_status, 3; Make process wait
|
||||
mov es:proc_countdown, dx
|
||||
call delay_dispatch
|
||||
jmps pwf_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pwf_minus2: ; CODE XREF: P_WAITFLAG+9j
|
||||
mov word ptr [bx], 0FFFFh
|
||||
|
||||
pwf_done: ; CODE XREF: P_WAITFLAG+23j
|
||||
stc
|
||||
|
||||
pwf_badflag: ; CODE XREF: P_WAITFLAG+4j
|
||||
; P_WAITFLAG+11j
|
||||
sti
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
rtm_sysflag: ; CODE XREF: xios_int09+EDu
|
||||
; DATA XREF: dseg:0038o
|
||||
cmp dl, 1
|
||||
jnz bsf_not1
|
||||
mov xios_bh_delay, 0
|
||||
mov ax, bdos_conowner
|
||||
push es
|
||||
|
||||
bsf_checktimer: ; CODE XREF: rtm_sysflag+34j
|
||||
mov es, ax
|
||||
cmp es:proc_status, 1; Waiting on timer
|
||||
jnz bsf_nexttimer
|
||||
mov xios_bh_delay, 0FFh
|
||||
call is_proc_busy
|
||||
jb bsf_wakeproc
|
||||
dec es:proc_countdown
|
||||
jnz bsf_nexttimer
|
||||
|
||||
bsf_wakeproc: ; CODE XREF: rtm_sysflag+20j
|
||||
mov dx, es
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
|
||||
bsf_nexttimer: ; CODE XREF: rtm_sysflag+16j
|
||||
; rtm_sysflag+27j
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
jnz bsf_checktimer
|
||||
xor ax, ax
|
||||
pop es
|
||||
jmps bsf_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_not1: ; CODE XREF: rtm_sysflag+3j
|
||||
pushf
|
||||
cli
|
||||
call lookup_flag
|
||||
jnb bsf_badflag
|
||||
cmp ax, 0FFFEh
|
||||
jz bsf_overrun
|
||||
ja bsf_nowake
|
||||
mov word ptr [bx], 0FFFFh
|
||||
mov dx, ax
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
jmps bsf_woken
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_nowake: ; CODE XREF: rtm_sysflag+47j
|
||||
mov word ptr [bx], 0FFFEh
|
||||
|
||||
bsf_woken: ; CODE XREF: rtm_sysflag+52j
|
||||
xor ax, ax
|
||||
jmps bsf_popret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_overrun: ; CODE XREF: rtm_sysflag+45j
|
||||
mov cx, 5
|
||||
|
||||
bsf_badflag: ; CODE XREF: rtm_sysflag+40j
|
||||
mov ax, 0FFFFh
|
||||
|
||||
bsf_popret: ; CODE XREF: rtm_sysflag+5Aj
|
||||
popf
|
||||
|
||||
bsf_done: ; CODE XREF: rtm_sysflag+39j
|
||||
mov bx, ax
|
||||
retf
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
lookup_flag: ; CODE XREF: P_WAITFLAG+1p
|
||||
; rtm_sysflag+3Dp
|
||||
mov cx, 4
|
||||
cmp dl, xios_bh_lastflg
|
||||
ja luf_badflag
|
||||
xor dh, dh
|
||||
mov bx, bdos_sysflags
|
||||
add bx, dx
|
||||
add bx, dx
|
||||
mov ax, [bx]
|
||||
stc
|
||||
|
||||
luf_badflag: ; CODE XREF: lookup_flag+7j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; 0208, get new process
|
||||
|
||||
get_new_process: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EF5o
|
||||
push ds
|
||||
mov bx, bdos_conowner
|
||||
mov cx, 4
|
||||
|
||||
gnp_loop: ; CODE XREF: get_new_process+14j
|
||||
mov ds, bx
|
||||
|
||||
cmp proc_status, 2 ; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jz gnp_found
|
||||
add bx, 16h
|
||||
loop gnp_loop
|
||||
pop ds
|
||||
|
||||
clc
|
||||
mov cx, 0Ch
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
gnp_found: ; CODE XREF: get_new_process+Fj
|
||||
pop ds
|
||||
inc proc_count
|
||||
xor cx, cx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_DELAY: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE9o
|
||||
cmp xios_bh_ticks, 0
|
||||
jnz delay_haveclock
|
||||
mov cx, 45 ; No tick
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
delay_haveclock: ; CODE XREF: P_DELAY+5j
|
||||
mov tick_wait_proc, es
|
||||
cli
|
||||
mov xios_bh_delay, 0FFh; Ask for ticks, because
|
||||
mov es:proc_status, 1; there's now a process waiting
|
||||
mov es:proc_countdown, dx
|
||||
jmp delay_dispatch
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Terminate foreground process
|
||||
|
||||
P_020A: ; CODE XREF: bdos:0EDAu P_TERMCPM+4Cp
|
||||
; DATA XREF: ...
|
||||
xor bp, bp
|
||||
jmps proc_doterm
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
proc_term_bg: ; CODE XREF: P_TERMCPM+5Bp
|
||||
mov bp, 1
|
||||
|
||||
proc_doterm: ; CODE XREF: P_020A+2j
|
||||
push ds
|
||||
push es
|
||||
mov di, offset proc_passwd+6; BDOS pointer - 4
|
||||
lds si, es:4[di]
|
||||
|
||||
proc_unhook_rsx: ; CODE XREF: proc_term_bg+29j
|
||||
; proc_term_bg+58j
|
||||
mov ax, 4[si]
|
||||
or ax, 6[si]
|
||||
jz proc_unhooked
|
||||
mov byte ptr 18[si], 0FFh
|
||||
test bp, bp
|
||||
jnz proc_free_rsx
|
||||
cmp byte ptr 3[si], 0
|
||||
jnz proc_free_rsx
|
||||
push si
|
||||
pop di
|
||||
push ds
|
||||
pop es
|
||||
|
||||
lds si, 4[si]
|
||||
jmps proc_unhook_rsx
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_free_rsx: ; CODE XREF: proc_term_bg+1Aj
|
||||
; proc_term_bg+20j
|
||||
mov ax, 20[si]
|
||||
lds si, 4[si]
|
||||
mov es:4[di], si
|
||||
mov es:6[di], ds
|
||||
push si
|
||||
push ds
|
||||
push di
|
||||
push es
|
||||
push bp
|
||||
mov ds, cs:bdos_dseg
|
||||
mov es, rlr
|
||||
|
||||
mov mcb_to_free, ax
|
||||
mov dx, offset mcb_to_free
|
||||
mov cx, 39h ; MC_FREE
|
||||
call bdos_callback
|
||||
pop bp
|
||||
pop es
|
||||
pop di
|
||||
pop ds
|
||||
pop si
|
||||
jmps proc_unhook_rsx
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_unhooked: ; CODE XREF: proc_term_bg+12j
|
||||
pop es
|
||||
pop ds
|
||||
retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
kill_process: ; CODE XREF: delay_dispatch+6Aj
|
||||
; delay_dispatch+128j
|
||||
mov ax, es
|
||||
cli
|
||||
mov ss, ax
|
||||
mov sp, 100h
|
||||
sti
|
||||
mov al, es:proc_pid
|
||||
cmp aux_owner, al
|
||||
jnz dont_free_aux
|
||||
mov aux_owner, 0FFh
|
||||
|
||||
dont_free_aux: ; CODE XREF: kill_process+11j
|
||||
cmp lst_owner, al
|
||||
jnz dont_free_lst
|
||||
mov lst_owner, 0FFh
|
||||
|
||||
dont_free_lst: ; CODE XREF: kill_process+1Cj
|
||||
and es:proc_flags, 0FFFEh
|
||||
mov es:proc_errcode, 0FFFEh
|
||||
cmp es:proc_fx, 0Ah ; If broken into line input
|
||||
mov es:proc_fx, 0
|
||||
jnz dont_reset_disk
|
||||
mov cx, 0Dh ; Then reset disks
|
||||
call bdos_callback ; presumably so ^C at command prompt
|
||||
; does what the user expects.
|
||||
|
||||
dont_reset_disk: ; CODE XREF: kill_process+3Dj
|
||||
call release_queues ; Release all process queues owned by a process
|
||||
|
||||
call_termcpm: ; CODE XREF: P_0206+1Bj
|
||||
xor cx, cx
|
||||
mov dx, cx
|
||||
jmp bdos_callback
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_0206: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EF1o
|
||||
mov tick_wait_proc, es
|
||||
dec es:proc_indisk
|
||||
jnz P_0207 ; Check runnable processes
|
||||
test es:proc_flags, 1
|
||||
jz P_0207 ; Check runnable processes
|
||||
and es:proc_flags, 0FFFEh
|
||||
jmps call_termcpm
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_TERMCPM: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE5o
|
||||
cli
|
||||
mov es:word ptr proc_onblock, offset far_ret_1
|
||||
mov es:word ptr proc_onblock+2, cs
|
||||
sti
|
||||
push dx
|
||||
call release_queues ; Release all process queues owned by a process
|
||||
mov cx, 723h
|
||||
call bdos_callback
|
||||
pop dx
|
||||
mov cx, 307h
|
||||
call bdos_callback
|
||||
cmp es:proc_background, 0
|
||||
jnz ptc_background
|
||||
call P_020A ; Kill foreground process
|
||||
mov cx, 103h ; Bring CCP to foreground
|
||||
jmp bdos_callback
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ptc_background: ; CODE XREF: P_TERMCPM+4Aj
|
||||
call proc_term_bg ; Terminate background process
|
||||
dec proc_count
|
||||
test es:proc_flags, 2; Was using 8087?
|
||||
jz ptc_not8087
|
||||
and es:proc_flags, 0FFFDh
|
||||
mov bdos_8087_inuse, 0
|
||||
|
||||
ptc_not8087: ; CODE XREF: P_TERMCPM+69j
|
||||
mov tick_wait_proc, es
|
||||
mov es:proc_status, 2; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jmp delay_dispatch
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Check runnable processes
|
||||
|
||||
P_0207: ; CODE XREF: bdos:0EDAu P_0206+9j
|
||||
; ...
|
||||
xor ax, ax
|
||||
mov tick_wait_proc, ax
|
||||
cmp drl, ax ; Anything waiting to run?
|
||||
jnz P_DISPATCH ; If so, give it a go
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Release all process queues owned by a process
|
||||
|
||||
release_queues: ; CODE XREF: P_TERMCPM+2Ep
|
||||
; kill_process+45p
|
||||
mov bx, offset pq_disk
|
||||
|
||||
release_loop: ; CODE XREF: release_queues+Cj
|
||||
push bx
|
||||
call P_0205 ; Leave a process-queue controlled area
|
||||
pop bx
|
||||
mov bx, [bx]
|
||||
test bx, bx
|
||||
jnz release_loop
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Enter a process-queue controlled area
|
||||
|
||||
P_0204: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EEDo
|
||||
mov ax, es
|
||||
mov tick_wait_proc, ax
|
||||
xchg ax, 2[bx] ; Is there already a process waiting?
|
||||
test ax, ax
|
||||
jz P_0207 ; Check runnable processes
|
||||
mov 2[bx], ax ; Yes. Add us to the chain.
|
||||
lea bx, 4[bx]
|
||||
call add_to_chain
|
||||
jmps delay_dispatch
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Leave a process-queue controlled area
|
||||
|
||||
P_0205: ; CODE XREF: bdos:0EDAu release_queues+4p
|
||||
; DATA XREF: ...
|
||||
mov ax, es
|
||||
cmp 2[bx], ax
|
||||
jz pq_leave_1
|
||||
clc ; Queue isn't owned by this process
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pq_leave_1: ; CODE XREF: P_0205+5j
|
||||
mov tick_wait_proc, es
|
||||
push es
|
||||
push bx
|
||||
lea bx, 4[bx]
|
||||
call next_runnable
|
||||
pop bx
|
||||
mov 2[bx], es
|
||||
mov dx, es
|
||||
pop es
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
jmp P_0207 ; Check runnable processes
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Wake a process (DX = process segment)
|
||||
|
||||
P_0209: ; CODE XREF: bdos:0EDAu rtm_sysflag+2Bp
|
||||
; ...
|
||||
test dx, dx
|
||||
jz wake_none
|
||||
push es
|
||||
mov es, dx
|
||||
mov bx, offset drl
|
||||
pushf
|
||||
cli
|
||||
mov es:proc_status, 0; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
call add_to_chain
|
||||
popf
|
||||
pop es
|
||||
stc
|
||||
|
||||
wake_none: ; CODE XREF: P_0209+2j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
delay_dispatch: ; CODE XREF: P_WAITFLAG+20p
|
||||
; P_DELAY+20j ...
|
||||
mov bx, offset delay_cbk
|
||||
jmps disp_general
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
P_DISPATCH: ; CODE XREF: bdos:0EDAu P_0207+9j
|
||||
; DATA XREF: ...
|
||||
mov bx, offset dispatch_cbk
|
||||
|
||||
disp_general: ; CODE XREF: delay_dispatch+3j
|
||||
mov tick_wait_proc, es
|
||||
mov cbk_function, bx
|
||||
pushf
|
||||
push cs
|
||||
mov ax, offset dispret
|
||||
push ax
|
||||
push ds
|
||||
jmps dsptch
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dispret: ; DATA XREF: delay_dispatch+12o
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
rtm_timeslice: ; CODE XREF: xios_int09+EDu
|
||||
; DATA XREF: dseg:0034o
|
||||
cli
|
||||
cmp tick_wait_proc, 0
|
||||
jz twp_is_0
|
||||
pop ds
|
||||
iret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
twp_is_0: ; CODE XREF: delay_dispatch+23j
|
||||
mov tick_wait_proc, 0FFFFh
|
||||
sti
|
||||
mov cbk_function, offset dispatch_cbk
|
||||
|
||||
dsptch: ; CODE XREF: delay_dispatch+17j
|
||||
; delay_dispatch+1A1j
|
||||
sti
|
||||
mov dsptch_es, es
|
||||
mov es, rlr
|
||||
mov es:proc_ax, ax
|
||||
mov ax, dsptch_es
|
||||
mov es:proc_es, ax
|
||||
mov es:proc_ss, ss
|
||||
mov es:proc_sp, sp
|
||||
mov ax, ds
|
||||
cli
|
||||
mov ss, ax
|
||||
|
||||
mov sp, offset dsptch_stack
|
||||
sti
|
||||
call check_timeslice
|
||||
cld
|
||||
call is_proc_busy
|
||||
jnb dont_kill
|
||||
mov tick_wait_proc, 0
|
||||
jmp kill_process
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dont_kill: ; CODE XREF: delay_dispatch+62j
|
||||
cmp cbk_function, offset dispatch_cbk
|
||||
jnz disp_switchproc
|
||||
xor ax, ax
|
||||
cmp drl, ax
|
||||
jnz disp_switchproc
|
||||
cmp es:proc_nextready, ax
|
||||
jz j_leave_disp
|
||||
cmp es:proc_background, 0
|
||||
jnz disp_switchproc
|
||||
|
||||
proc_can_run: ; CODE XREF: delay_dispatch+8Aj
|
||||
cmp time_to_switch, 0
|
||||
jz slice_expired
|
||||
dec time_to_switch
|
||||
|
||||
j_leave_disp: ; CODE XREF: delay_dispatch+82j
|
||||
jmp leave_disp
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
slice_expired: ; CODE XREF: delay_dispatch+99j
|
||||
mov al, time_slice
|
||||
mov time_to_switch, al
|
||||
|
||||
disp_switchproc: ; CODE XREF: delay_dispatch+73j
|
||||
; delay_dispatch+7Bj
|
||||
; ...
|
||||
mov es:proc_bx, bx
|
||||
mov es:proc_cx, cx
|
||||
mov es:proc_dx, dx
|
||||
mov es:proc_bp, bp
|
||||
mov es:proc_di, di
|
||||
mov es:proc_si, si
|
||||
xor ax, ax
|
||||
mov ds, ax
|
||||
|
||||
mov si, ax
|
||||
mov di, offset proc_int0
|
||||
mov dx, 4
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
mov cx, dx
|
||||
add si, dx
|
||||
rep movsw
|
||||
mov si, offset INT_E0
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
xor ax, ax
|
||||
callf es:dword ptr proc_onblock
|
||||
mov ds, cs:bdos_dseg
|
||||
|
||||
mov bx, offset rlr
|
||||
call next_runnable
|
||||
jmp cbk_function
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
delay_cbk: ; DATA XREF: delay_dispatcho
|
||||
jmps check_ready
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dispatch_cbk: ; DATA XREF: delay_dispatch+5o
|
||||
; delay_dispatch+2Eo
|
||||
; ...
|
||||
call add_to_chain
|
||||
|
||||
check_ready: ; CODE XREF: delay_dispatch+F9j
|
||||
; delay_dispatch+10Ej
|
||||
; ...
|
||||
mov bx, offset drl
|
||||
cli
|
||||
call next_runnable
|
||||
sti
|
||||
jnb check_ready1
|
||||
mov bx, offset rlr
|
||||
call proc_makeready
|
||||
jmps check_ready
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
check_ready1: ; CODE XREF: delay_dispatch+106j
|
||||
call check_timeslice
|
||||
mov ax, rlr
|
||||
test ax, ax
|
||||
jz check_ready
|
||||
mov es, ax
|
||||
call is_proc_busy
|
||||
jnb proc_switchin
|
||||
cli
|
||||
mov tick_wait_proc, 0
|
||||
jmp kill_process
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_switchin: ; CODE XREF: delay_dispatch+11Fj
|
||||
mov ax, 1
|
||||
callf es:dword ptr proc_onblock
|
||||
mov ds, cs:bdos_dseg
|
||||
mov ds, rlr
|
||||
mov si, offset proc_int0
|
||||
xor ax, ax
|
||||
mov es, ax
|
||||
|
||||
mov di, ax
|
||||
mov dx, 4
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
mov cx, dx
|
||||
add di, dx
|
||||
rep movsw
|
||||
mov di, offset INT_E0
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
push ds
|
||||
pop es
|
||||
|
||||
mov ds, cs:bdos_dseg
|
||||
mov bx, es:proc_bx
|
||||
mov cx, es:proc_cx
|
||||
mov dx, es:proc_dx
|
||||
mov bp, es:proc_bp
|
||||
mov di, es:proc_di
|
||||
mov si, es:proc_si
|
||||
|
||||
leave_disp: ; CODE XREF: delay_dispatch+9Fj
|
||||
cli
|
||||
mov ss, es:proc_ss
|
||||
|
||||
mov sp, es:proc_sp
|
||||
sti
|
||||
mov ax, es:proc_ax
|
||||
mov es, es:proc_es
|
||||
cli
|
||||
cmp drl, 0
|
||||
jz drl_is_empty
|
||||
mov cbk_function, offset dispatch_cbk
|
||||
jmp dsptch
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
drl_is_empty: ; CODE XREF: delay_dispatch+199j
|
||||
mov tick_wait_proc, 0
|
||||
pop ds
|
||||
iret
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
proc_makeready: ; CODE XREF: delay_dispatch+10Bp
|
||||
mov ax, [bx]
|
||||
mov [bx], es
|
||||
test ax, ax
|
||||
jz pmr_1
|
||||
mov es:proc_nextready, ax
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pmr_1: ; CODE XREF: proc_makeready+6j
|
||||
mov 2[bx], es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
add_to_chain: ; CODE XREF: P_0204+12p P_0209+12p
|
||||
; ...
|
||||
mov ax, 2[bx]
|
||||
mov 2[bx], es
|
||||
test ax, ax
|
||||
jz added_to_chain
|
||||
push ds
|
||||
mov ds, ax
|
||||
|
||||
mov proc_nextready, es
|
||||
pop ds
|
||||
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
added_to_chain: ; CODE XREF: add_to_chain+8j
|
||||
mov [bx], es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
next_runnable: ; CODE XREF: P_0205+12p delay_dispatch+F2p
|
||||
; ...
|
||||
mov ax, [bx]
|
||||
test ax, ax
|
||||
mov es, ax
|
||||
jz nxtrun_2
|
||||
mov ax, es:proc_nextready
|
||||
mov es:proc_nextready, 0
|
||||
mov [bx], ax
|
||||
test ax, ax
|
||||
jnz nxtrun_1
|
||||
mov 2[bx], ax
|
||||
|
||||
nxtrun_1: ; CODE XREF: next_runnable+17j
|
||||
stc
|
||||
|
||||
nxtrun_2: ; CODE XREF: next_runnable+6j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
is_proc_busy: ; CODE XREF: rtm_sysflag+1Dp
|
||||
; delay_dispatch+5Fp
|
||||
; ...
|
||||
test es:proc_flags, 1
|
||||
jz proc_notbusy
|
||||
cmp es:proc_indisk, 1
|
||||
|
||||
proc_notbusy: ; CODE XREF: is_proc_busy+7j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
check_timeslice: ; CODE XREF: delay_dispatch+5Bp
|
||||
; delay_dispatch+110p
|
||||
dec timeslice
|
||||
jnz not_expired
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
mov es, bdos_conowner
|
||||
|
||||
cts_process: ; CODE XREF: check_timeslice+39j
|
||||
test es:proc_flags, 1
|
||||
jz cts_nextproc
|
||||
cmp es:proc_indisk, 0
|
||||
jnz cts_nextproc
|
||||
cli
|
||||
cmp es:proc_status, 3; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jnz cts_nextproc
|
||||
mov dx, es:proc_countdown
|
||||
callf dword ptr lp_sysflag_chg
|
||||
sti
|
||||
|
||||
cts_nextproc: ; CODE XREF: check_timeslice+14j
|
||||
; check_timeslice+1Cj
|
||||
; ...
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
mov es, ax
|
||||
jnz cts_process
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
mov es, rlr
|
||||
mov timeslice, 1Eh
|
||||
|
||||
not_expired: ; CODE XREF: check_timeslice+4j
|
||||
retn
|
||||
|
||||
|
||||
dseg
|
||||
mcb_to_free dw 0
|
||||
dw 0
|
||||
db 0
|
||||
|
||||
time_to_switch db 10h ; DATA XREF: delay_dispatch+94r
|
||||
; delay_dispatch+9Bw
|
||||
; ...
|
||||
timeslice db 1Eh ; DATA XREF: check_timeslicew
|
||||
; check_timeslice+42w
|
||||
tick_wait_proc dw 0 ; DATA XREF: P_DELAY+Bw P_TERMCPM+77w
|
||||
; ...
|
||||
cbk_function dw 0 ; DATA XREF: delay_dispatch+Cw
|
||||
; delay_dispatch+2Ew
|
||||
; ...
|
||||
dsptch_es dw 0 ; DATA XREF: delay_dispatch+35w
|
||||
; delay_dispatch+41r
|
||||
dw 0CCCCh, 0CCCCh, 0CCCCh, 0CCCCh
|
||||
dw 0CCCCh, 0CCCCh, 0CCCCh, 0CCCCh
|
||||
dw 0CCCCh, 0CCCCh, 0CCCCh, 0CCCCh
|
||||
dw 0CCCCh, 0CCCCh, 0CCCCh, 0CCCCh
|
||||
|
||||
dsptch_stack db 0 ; DATA XREF: delay_dispatch+57o
|
||||
|
@@ -0,0 +1 @@
|
||||
db 'XXXX-0000-654321'
|
1989
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.3/sup.a86
Normal file
1989
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 3.3/sup.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 65B0h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 79
|
||||
SCR_MAXY equ 24
|
||||
SCR_ECHODEL equ 0
|
||||
|
Binary file not shown.
11349
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 4.1/bdos.a86
Normal file
11349
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 4.1/bdos.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,131 @@
|
||||
bdos41.exe=entry,
|
||||
sup,
|
||||
rtm,
|
||||
mem,
|
||||
cio,
|
||||
misc,
|
||||
bdos,
|
||||
proctbl[nop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
2219
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 4.1/cio.a86
Normal file
2219
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 4.1/cio.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,144 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "cmdio.h"
|
||||
|
||||
static byte zeroes[16];
|
||||
|
||||
void zero_cmd(cmd_desc *cmdfile)
|
||||
{
|
||||
cmdfile->cs = cmdfile->ds = NULL;
|
||||
cmdfile->cs_base = cmdfile->ds_base = 0;
|
||||
cmdfile->cs_len = cmdfile->ds_len = 0;
|
||||
cmdfile->cs_max = cmdfile->ds_max = 0;
|
||||
}
|
||||
|
||||
void free_cmd (cmd_desc *cmdfile)
|
||||
{
|
||||
if (cmdfile->ds) free(cmdfile->ds);
|
||||
if (cmdfile->cs) free(cmdfile->cs);
|
||||
zero_cmd(cmdfile);
|
||||
}
|
||||
|
||||
char *alloc_cmd(cmd_desc *cmdfile, long cs_len, long ds_len)
|
||||
{
|
||||
if (!cs_len || !ds_len) return "cs_len or ds_len is 0.";
|
||||
cmdfile->cs = malloc(cs_len);
|
||||
cmdfile->ds = malloc(ds_len);
|
||||
if (!cmdfile->ds || !cmdfile->cs)
|
||||
{
|
||||
free_cmd(cmdfile);
|
||||
return "Out of memory.";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *load_cmd(char *filename, cmd_desc *cmdfile)
|
||||
{
|
||||
FILE *fp;
|
||||
char *boo;
|
||||
byte cmd_header[128];
|
||||
|
||||
fp = fopen(filename, "rb");
|
||||
if (!fp) return "Failed to open file.";
|
||||
|
||||
if (fread(cmd_header, 1, sizeof(cmd_header), fp) < sizeof(cmd_header))
|
||||
{
|
||||
fclose(fp);
|
||||
return "Too short to be a CMD file.";
|
||||
}
|
||||
cmdfile->cs_len = peekw(cmd_header, 1);
|
||||
cmdfile->cs_base = peekw(cmd_header, 3);
|
||||
cmdfile->cs_max = peekw(cmd_header, 5);
|
||||
cmdfile->ds_len = peekw(cmd_header, 10);
|
||||
cmdfile->ds_base = peekw(cmd_header, 12);
|
||||
cmdfile->ds_max = peekw(cmd_header, 14);
|
||||
|
||||
if (!cmdfile->cs_len || !cmdfile->ds_len)
|
||||
{
|
||||
fclose(fp);
|
||||
return "Not a 2-segment CMD file";
|
||||
}
|
||||
boo = alloc_cmd(cmdfile, 16 * cmdfile->cs_max, 16 * cmdfile->ds_max);
|
||||
if (boo)
|
||||
{
|
||||
fclose(fp);
|
||||
return boo;
|
||||
}
|
||||
if (fread(cmdfile->cs, 16, cmdfile->cs_len, fp) < cmdfile->cs_len)
|
||||
{
|
||||
fclose(fp);
|
||||
free_cmd(cmdfile);
|
||||
return "Failed to load code segment.";
|
||||
}
|
||||
if (fread(cmdfile->ds, 16, cmdfile->ds_len, fp) < cmdfile->ds_len)
|
||||
{
|
||||
fclose(fp);
|
||||
free_cmd(cmdfile);
|
||||
return "Failed to load data segment.";
|
||||
}
|
||||
fclose(fp);
|
||||
cmdfile->cs_len *= 16L;
|
||||
cmdfile->ds_len *= 16L;
|
||||
cmdfile->cs_max *= 16L;
|
||||
cmdfile->ds_max *= 16L;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void pokew(byte *base, word a, word v)
|
||||
{
|
||||
base[a ] = (v) & 0xFF;
|
||||
base[a+1] = (v >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
word peekw(byte *base, word a)
|
||||
{
|
||||
return base[a] | (((word)base[a+1]) << 8);
|
||||
}
|
||||
|
||||
|
||||
char *save_cmd(char *cmdname, cmd_desc *cmdfile, int absolute)
|
||||
{
|
||||
FILE *fp;
|
||||
word csparas, cmparas;
|
||||
word dsparas, dmparas;
|
||||
byte header[128];
|
||||
|
||||
csparas = cmdfile->cs_len >> 4;
|
||||
dsparas = cmdfile->ds_len >> 4;
|
||||
cmparas = cmdfile->cs_max >> 4;
|
||||
dmparas = cmdfile->ds_max >> 4;
|
||||
|
||||
memset(header, 0, sizeof(header));
|
||||
header[0] = 1; /* Code segment */
|
||||
pokew(header, 1, csparas);
|
||||
if (absolute) pokew(header, 3, cmdfile->cs_base);
|
||||
pokew(header, 5, cmparas);
|
||||
header[9] = 2; /* Data segment */
|
||||
pokew(header, 10, dsparas);
|
||||
if (absolute) pokew(header, 12, cmdfile->ds_base);
|
||||
pokew(header, 14, dmparas);
|
||||
|
||||
fp = fopen(cmdname, "wb");
|
||||
if (!fp)
|
||||
{
|
||||
return "Cannot open file to write.";
|
||||
}
|
||||
if (fwrite(header, 1, 128, fp) < 128 ||
|
||||
fwrite(cmdfile->cs, 16, csparas, fp) < csparas ||
|
||||
fwrite(cmdfile->ds, 16, dsparas, fp) < dsparas)
|
||||
{
|
||||
fclose(fp);
|
||||
return "Error writing to CMD file";
|
||||
}
|
||||
/* Pack out to a multiple of 128 bytes */
|
||||
while ((csparas + dsparas) & 7)
|
||||
{
|
||||
fwrite(zeroes, 1, 16, fp);
|
||||
++dsparas;
|
||||
}
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
typedef unsigned long dword;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte *cs;
|
||||
byte *ds;
|
||||
word cs_base;
|
||||
word ds_base;
|
||||
dword cs_len;
|
||||
dword ds_len;
|
||||
dword cs_max;
|
||||
dword ds_max;
|
||||
} cmd_desc;
|
||||
|
||||
void zero_cmd (cmd_desc *cmdfile);
|
||||
void free_cmd (cmd_desc *cmdfile);
|
||||
char *alloc_cmd(cmd_desc *cmdfile, long cs_len, long ds_len);
|
||||
|
||||
char *load_cmd(char *filename, cmd_desc *cmdfile);
|
||||
char *save_cmd(char *filename, cmd_desc *cmdfile, int absolute);
|
||||
|
||||
word peekw(byte *base, word a);
|
||||
void pokew(byte *base, word a, word v);
|
||||
|
@@ -0,0 +1,134 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "cmdio.h"
|
||||
|
||||
cmd_desc dosplus_sys, bdos_cmd, xios_cmd, ccp_cmd, dos_cmd;
|
||||
|
||||
int gl_base = 0x60;
|
||||
|
||||
void dump_cmd(char *caption, cmd_desc *cmd)
|
||||
{
|
||||
printf("%s CS: base=%04x length=%05lx\n",
|
||||
caption, cmd->cs_base, cmd->cs_len);
|
||||
printf("%s DS: base=%04x length=%05lx\n",
|
||||
caption, cmd->ds_base, cmd->ds_len);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *boo;
|
||||
long o = 0;
|
||||
long xios_cs, dos_cs, dos_ds, ccp_cs, ccp_ds;
|
||||
int n;
|
||||
/* Load the component parts */
|
||||
|
||||
for (n = 1; n < argc; n++)
|
||||
{
|
||||
if (!strncmp(argv[n], "base=", 5))
|
||||
{
|
||||
if (!sscanf(&argv[n][5], "%x", &gl_base))
|
||||
{
|
||||
fprintf(stderr, "base= option incorrect.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boo = load_cmd("bdos.cmd", &bdos_cmd);
|
||||
if (boo) { fprintf(stderr, "bdos.cmd: %s\n", boo); return 1; }
|
||||
boo = load_cmd("xios.cmd", &xios_cmd);
|
||||
if (boo) { fprintf(stderr, "xios.cmd: %s\n", boo); return 1; }
|
||||
boo = load_cmd("ccp.cmd", &ccp_cmd);
|
||||
if (boo) { fprintf(stderr, "ccp.cmd: %s\n", boo); return 1; }
|
||||
load_cmd("dos.cmd", &dos_cmd);
|
||||
|
||||
/* Work out segment sizes */
|
||||
dosplus_sys.cs_max =
|
||||
dosplus_sys.cs_len = bdos_cmd.cs_len + xios_cmd.cs_len +
|
||||
ccp_cmd.cs_len + ccp_cmd.ds_len +
|
||||
dos_cmd.cs_len + dos_cmd.ds_len;
|
||||
dosplus_sys.cs_base = gl_base;
|
||||
dosplus_sys.ds_len = xios_cmd.ds_len;
|
||||
dosplus_sys.ds_max = xios_cmd.ds_max;
|
||||
dosplus_sys.ds_base = gl_base + (dosplus_sys.cs_len >> 4);
|
||||
|
||||
boo = alloc_cmd(&dosplus_sys, dosplus_sys.cs_len, dosplus_sys.ds_len);
|
||||
if (boo) { fprintf(stderr, "%s", boo); return 1; }
|
||||
|
||||
printf("Code segment at %04x:0000 length 0x%05lx\n",
|
||||
dosplus_sys.cs_base,
|
||||
dosplus_sys.cs_len);
|
||||
printf("Data segment at %04x:0000 length 0x%05lx\n",
|
||||
dosplus_sys.ds_base,
|
||||
dosplus_sys.ds_len);
|
||||
|
||||
/* OK. Now copy the modules into the SYS file */
|
||||
|
||||
memcpy(dosplus_sys.cs + o, bdos_cmd.cs, bdos_cmd.cs_len);
|
||||
o += bdos_cmd.cs_len;
|
||||
xios_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, xios_cmd.cs, xios_cmd.cs_len);
|
||||
o += xios_cmd.cs_len;
|
||||
if (dos_cmd.cs_len)
|
||||
{
|
||||
dos_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, dos_cmd.cs, dos_cmd.cs_len);
|
||||
o += dos_cmd.cs_len;
|
||||
}
|
||||
ccp_cs = o;
|
||||
memcpy(dosplus_sys.cs + o, ccp_cmd.cs, ccp_cmd.cs_len);
|
||||
o += ccp_cmd.cs_len;
|
||||
ccp_ds = o;
|
||||
memcpy(dosplus_sys.cs + o, ccp_cmd.ds, ccp_cmd.ds_len);
|
||||
o += ccp_cmd.ds_len;
|
||||
if (dos_cmd.ds_len)
|
||||
{
|
||||
dos_ds = o;
|
||||
memcpy(dosplus_sys.cs + o, dos_cmd.ds, dos_cmd.ds_len);
|
||||
o += dos_cmd.ds_len;
|
||||
}
|
||||
memcpy(dosplus_sys.ds, xios_cmd.ds, xios_cmd.ds_len);
|
||||
memcpy(dosplus_sys.ds, bdos_cmd.ds, bdos_cmd.ds_len);
|
||||
|
||||
/* Set up the pointers to modules correctly */
|
||||
pokew(dosplus_sys.cs, 6, dosplus_sys.ds_base);
|
||||
pokew(dosplus_sys.cs, xios_cs + 6, dosplus_sys.ds_base);
|
||||
if (dos_cmd.ds_len)
|
||||
{
|
||||
pokew(dosplus_sys.cs, dos_cs + 6, dosplus_sys.ds_base);
|
||||
pokew(dosplus_sys.cs, dos_cs + 8, (dos_ds >> 4) + gl_base);
|
||||
}
|
||||
pokew(dosplus_sys.cs, ccp_ds , ccp_cmd.cs_len);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 3, (ccp_cs >> 4) + gl_base);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 6, ccp_cmd.ds_len);
|
||||
pokew(dosplus_sys.cs, ccp_ds + 9, (ccp_ds >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x2A, (xios_cs >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x2E, (xios_cs >> 4) + gl_base);
|
||||
if (dos_cmd.ds_len)
|
||||
pokew(dosplus_sys.ds, 0x42, (dos_cs >> 4) + gl_base);
|
||||
else pokew(dosplus_sys.ds, 0x42, 0);
|
||||
pokew(dosplus_sys.ds, 0x44, (ccp_ds >> 4) + gl_base);
|
||||
pokew(dosplus_sys.ds, 0x48, (dosplus_sys.cs_max +
|
||||
dosplus_sys.ds_max + 0x10 * gl_base) >> 4);
|
||||
/* SYS file has been generated. Write it. */
|
||||
|
||||
dump_cmd("BDOS ", &bdos_cmd);
|
||||
dump_cmd("XIOS ", &xios_cmd);
|
||||
if (dos_cmd.cs_len) dump_cmd("DOS ", &dos_cmd);
|
||||
dump_cmd("CCP ", &ccp_cmd);
|
||||
dump_cmd("SYS ", &dosplus_sys);
|
||||
|
||||
/* Now start writing the stuff out */
|
||||
boo = save_cmd("new.sys", &dosplus_sys, 1);
|
||||
if (boo) fprintf(stderr, "new.sys: %s\n", boo);
|
||||
free_cmd(&dosplus_sys);
|
||||
free_cmd(&bdos_cmd);
|
||||
free_cmd(&xios_cmd);
|
||||
free_cmd(&ccp_cmd);
|
||||
free_cmd(&dos_cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,566 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
dseg
|
||||
|
||||
cseg
|
||||
|
||||
extrn rtm_sysflag:near
|
||||
extrn cio_keyboard:near
|
||||
extrn rtm_timeslice:near
|
||||
|
||||
public bdos_start
|
||||
public bdos_rsx
|
||||
public bdos_callback
|
||||
public far_ret_1
|
||||
public bdos_dseg
|
||||
|
||||
jmp bdos_start
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmp bdos_int_E0
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bdos_dseg dw seg bdos_segment
|
||||
; ...
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_start: ; CODE XREF: bdos:0000j
|
||||
cli
|
||||
cld
|
||||
sub ax, ax
|
||||
mov ds, ax
|
||||
mov word ptr INT_E0, offset bdos_int_E0
|
||||
mov word ptr INT_E0+2, cs
|
||||
mov bx, cs:bdos_dseg
|
||||
mov ds, bx
|
||||
mov ax, rlr
|
||||
mov cl, 4
|
||||
shr ax, cl
|
||||
add ax, bx
|
||||
mov rlr, ax
|
||||
mov process_table, ax
|
||||
mov bdos_conowner, ax
|
||||
mov ss, ax
|
||||
mov sp, 160h
|
||||
|
||||
init_proctab: ; CODE XREF: bdos:0054j
|
||||
mov es, ax
|
||||
mov es:word ptr proc_onblock, offset far_ret_1
|
||||
|
||||
g003f: ; DATA XREF: P_TERMCPM+16r
|
||||
mov es:word ptr proc_onblock+2, cs
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
jz procs_inited
|
||||
shr ax, cl
|
||||
add ax, bx
|
||||
mov es:proc_nextseg, ax
|
||||
jmps init_proctab
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
procs_inited: ; CODE XREF: bdos:004Aj
|
||||
mov es, rlr
|
||||
mov bdos_segment, cs
|
||||
mov es:proc_bdos_seg, cs
|
||||
callf dword ptr lp_xios_init
|
||||
sti
|
||||
mov es, rlr
|
||||
mov al, boot_drive
|
||||
mov es:proc_drive, al
|
||||
mov sysvar_144, al
|
||||
cmp word ptr lp_dos_module+2, 0
|
||||
jz no_dos
|
||||
callf dword ptr lp_dos_module
|
||||
|
||||
no_dos: ; CODE XREF: bdos:007Bj
|
||||
cmp word ptr lp_other_init+2, 0
|
||||
jz no_other
|
||||
callf dword ptr lp_other_init
|
||||
|
||||
no_other: ; CODE XREF: bdos:0086j
|
||||
push es
|
||||
xor si, si
|
||||
push ds
|
||||
mov ds, si
|
||||
|
||||
mov word ptr INT_E0, offset bdos_int_E0
|
||||
mov word ptr INT_E0+2, cs
|
||||
mov di, offset proc_int0
|
||||
mov cx, 4
|
||||
rep movsw
|
||||
mov cl, 4
|
||||
add si, cx
|
||||
rep movsw
|
||||
mov si, offset INT_E0
|
||||
mov cl, 4
|
||||
rep movsw
|
||||
pop es
|
||||
pop ds
|
||||
|
||||
mov di, offset cpu_vectors
|
||||
mov si, offset proc_int0
|
||||
mov cl, 0Ch
|
||||
rep movsw
|
||||
xor cx, cx
|
||||
mov dx, cx
|
||||
int 0E0h ; used by BASIC while in interpreter
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bdos_functions db 20h ; DATA XREF: bdos:01F2o
|
||||
; P_TERMCPM
|
||||
db 60h ; C_READ
|
||||
db 61h ; C_WRITE
|
||||
db 62h ; A_READ
|
||||
db 63h ; A_WRITE
|
||||
db 64h ; L_WRITE
|
||||
db 65h ; C_RAWIO
|
||||
db 66h ; A_STATIN
|
||||
db 67h ; A_STATOUT
|
||||
db 68h ; C_WRITESTR
|
||||
db 69h ; C_READSTR
|
||||
db 6Ah ; C_STAT
|
||||
db 0A1h ; S_BDOSVER
|
||||
db 0C0h ; DRV_ALLRESET
|
||||
db 0C1h ; DRV_SET
|
||||
db 0C2h ; F_OPEN
|
||||
db 0C3h ; F_CLOSE
|
||||
db 0C4h ; F_SFIRST
|
||||
db 0C5h ; F_SNEXT
|
||||
db 0C6h ; F_DELETE
|
||||
db 0C7h ; F_READ
|
||||
db 0C8h ; F_WRITE
|
||||
db 0C9h ; F_MAKE
|
||||
db 0CAh ; F_RENAME
|
||||
db 0A2h ; DRV_LOGINVEC
|
||||
db 0A3h ; DRV_GET
|
||||
db 0A4h ; F_DMAOFF
|
||||
db 0CBh ; DRV_ALLOCVEC
|
||||
db 0CCh ; DRV_SETRO
|
||||
db 0A5h ; DRV_ROVEC
|
||||
db 0CDh ; F_ATTRIB
|
||||
db 0CEh ; DRV_DPB
|
||||
db 0A6h ; F_USERNUM
|
||||
db 0CFh ; F_READRAND
|
||||
db 0D0h ; F_WRITERAND
|
||||
db 0D1h ; F_SIZE
|
||||
db 0D2h ; F_RANDREC
|
||||
db 0D3h ; DRV_RESET
|
||||
db 0A0h ; (access drives)
|
||||
db 0D5h ; DRV_FREE
|
||||
db 0D6h ; F_WRITEZF
|
||||
db 0A0h, 0A0h, 0A0h ; MP/M file lock functions
|
||||
db 0A7h ; F_MULTISEC
|
||||
db 0A8h ; F_ERRMODE
|
||||
db 0D9h ; DRV_SPACE
|
||||
db 0 ; P_CHAIN
|
||||
db 0DAh ; DRV_FLUSH
|
||||
db 0A9h ; S_SYSVAR
|
||||
db 6Bh ; S_BIOS
|
||||
db 0AAh ; F_DMASEG
|
||||
db 0ABh ; F_DMAGET
|
||||
db 40h ; MC_MAX
|
||||
db 41h ; MC_ABSMAX
|
||||
db 42h ; MC_ALLOC
|
||||
db 43h ; MC_ABSALLOC
|
||||
db 44h ; MC_FREE
|
||||
db 45h ; MC_ALLFREE
|
||||
db 1 ; P_LOAD
|
||||
db 0A0h ; P_RSX
|
||||
db 0DBh ; Clean up disc
|
||||
db 0DCh ; F_TRUNCATE
|
||||
db 0DDh ; DRV_SETLABEL
|
||||
db 0DEh ; DRV_GETLABEL
|
||||
db 0DFh ; F_TIMEDATE
|
||||
db 0E0h ; F_WRITEXFCB
|
||||
db 0ACh ; T_SET
|
||||
db 0ADh ; T_GET
|
||||
db 0E1h ; F_PASSWD
|
||||
db 0AEh ; S_SERIAL
|
||||
db 0AFh ; P_CODE
|
||||
db 6Ch ; C_MODE
|
||||
db 6Dh ; C_DELIMIT
|
||||
db 6Eh ; C_WRITEBLK
|
||||
db 6Fh ; L_WRITEBLK
|
||||
db 0A0h ; PCP/M direct screen access
|
||||
db 0A0h ; Unused in all versions
|
||||
db 0A0h ; GSX
|
||||
db 0E2h ; Set file timestamp
|
||||
db 0E4h ; INT13h helper
|
||||
db 4 ; 76h
|
||||
db 5 ; 77h
|
||||
db 21h ; Wait on system flag
|
||||
db 0A0h ; Set system flag
|
||||
db 0A0h ; Create message queue
|
||||
db 0A0h ; Open message queue
|
||||
db 0A0h ; Delete message queue
|
||||
db 0A0h ; Read message queue
|
||||
db 0A0h ; Conditional read queue
|
||||
db 0A0h ; Write to message queue
|
||||
db 0A0h ; Conditional write message queue
|
||||
db 22h ; P_DELAY
|
||||
db 23h ; P_DISPATCH
|
||||
db 20h ; P_TERM
|
||||
db 0A0h, 0A0h, 0A0h
|
||||
db 70h ; C_DETACH
|
||||
db 0A0h, 0A0h, 0A0h, 0A0h
|
||||
db 2 ; F_PARSE
|
||||
db 0A0h ; Get default console
|
||||
db 0B2h ; S_SYSDATE
|
||||
db 0A0h ; Get system time/date (MP/M)
|
||||
db 0A0h ; Get process descriptor (MP/M)
|
||||
db 0A0h ; Kill process
|
||||
db 0A0h ; L_ATTACH
|
||||
db 0A0h ; L_DETACH
|
||||
db 0A0h ; L_CATTACH
|
||||
db 0A0h ; Select list device
|
||||
db 0A0h ; C_CATTACH
|
||||
db 0B3h ; S_OSVER
|
||||
db 0A0h ; L_GET
|
||||
db 71h ; A_ATTACH
|
||||
db 72h ; A_DETACH
|
||||
db 73h ; A_CATTACH
|
||||
db 74h ; A_SET
|
||||
db 75h ; A_GET
|
||||
db 66h ; Function AAh
|
||||
db 67h ; Function ABh
|
||||
db 76h ; A_READBLK
|
||||
db 77h ; A_WRITEBLK
|
||||
db 0A0h ; Function AEh
|
||||
db 0A0h ; Function AFh
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_int_E0: ; CODE XREF: bdos:0003j
|
||||
; DATA XREF: bdos:000Eo ...
|
||||
push ds
|
||||
mov ds, cs:bdos_dseg
|
||||
mov ax, es
|
||||
mov es, rlr
|
||||
pop ds
|
||||
cmp es:proc_incpm, 0
|
||||
jnz already_in_cpm
|
||||
mov es:word ptr userStack+2, ss
|
||||
mov es:word ptr userStack, sp
|
||||
push es
|
||||
pop ss
|
||||
mov sp, offset proc_cpm_stack
|
||||
|
||||
already_in_cpm: ; CODE XREF: bdos:0155j
|
||||
inc es:proc_incpm
|
||||
sti
|
||||
cld
|
||||
mov es:userES, ax
|
||||
mov es:proc_fx, cl
|
||||
push si
|
||||
push di
|
||||
push bp
|
||||
callf es:dword ptr proc_bdos_offs
|
||||
pop bp
|
||||
pop di
|
||||
pop si
|
||||
mov ax, bx
|
||||
dec es:proc_incpm
|
||||
jnz still_in_cpm
|
||||
cli
|
||||
mov ss, es:word ptr userStack+2
|
||||
mov sp, es:word ptr userStack
|
||||
|
||||
still_in_cpm: ; CODE XREF: bdos:0188j
|
||||
mov es, es:userES
|
||||
cmp ax, 0FFFFh
|
||||
jz check_result
|
||||
xor cx, cx
|
||||
|
||||
check_result: ; CODE XREF: bdos:019Dj
|
||||
iret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_rsx: ; DATA XREF: proc1:0052o
|
||||
jmp bdos_rsx_main
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rs 5
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_rsx_main: ; CODE XREF: bdos:01A2j
|
||||
push es:userDS
|
||||
mov es:userDS, ds
|
||||
mov ds, cs:bdos_dseg
|
||||
callf dword ptr lp_bdos_entry
|
||||
mov ds, es:userDS
|
||||
pop es:userDS
|
||||
|
||||
far_ret_1: ; DATA XREF: bdos:0038o P_CHAIN+71o
|
||||
; ...
|
||||
retf
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_entry: ; CODE XREF: x_dev_waitflag+2u
|
||||
; x_p_delay+2u
|
||||
; DATA XREF: ...
|
||||
jmp bdos_func
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rs 5
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_func: ; CODE XREF: bdos:01C8j
|
||||
cld
|
||||
mov al, cl
|
||||
cmp al, 3Ch
|
||||
jbe bdos_gotfunc
|
||||
sub al, 25h
|
||||
cmp al, 3Dh
|
||||
jb bdos_badfunc
|
||||
cmp al, 52h
|
||||
jbe bdos_gotfunc
|
||||
sub al, 0Ch
|
||||
cmp al, 53h
|
||||
jb bdos_badfunc
|
||||
cmp al, 7Ch
|
||||
jbe bdos_gotfunc
|
||||
|
||||
bdos_badfunc: ; CODE XREF: bdos:01DBj bdos:01E5j
|
||||
mov bx, 0FFFFh
|
||||
mov cx, 2
|
||||
retf
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bdos_gotfunc: ; CODE XREF: bdos:01D5j bdos:01DFj
|
||||
; ...
|
||||
mov bx, offset bdos_functions
|
||||
xlat cs:byte ptr [bx]
|
||||
mov cl, al
|
||||
rol al, 1
|
||||
rol al, 1
|
||||
rol al, 1
|
||||
and al, 7
|
||||
mov ah, 1Fh
|
||||
cmp al, 6
|
||||
jb mask_fxn
|
||||
mov ah, 3Fh
|
||||
and al, 6
|
||||
|
||||
mask_fxn: ; CODE XREF: bdos:0205j
|
||||
and cl, ah
|
||||
|
||||
entry_bdos: ; DATA XREF: dseg:0010o
|
||||
call inner_callback
|
||||
retf
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
inner_callback: ; CODE XREF: bdos:020Dp bdos_callback+8p
|
||||
xor ah, ah
|
||||
mov ch, ah
|
||||
mov di, ax ; AL = function class
|
||||
shl di, 1 ; CL = function number within class
|
||||
shl di, 1
|
||||
mov si, cx
|
||||
shl si, 1
|
||||
jmp function_tables[di]
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
bdos_callback: ; CODE XREF: get_proc_dskdat+Bp
|
||||
; release+3p ...
|
||||
test ch, ch
|
||||
jz callback_00
|
||||
dec ch
|
||||
mov al, ch
|
||||
call inner_callback
|
||||
jmps bdos_cbk_end
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
callback_00: ; CODE XREF: bdos_callback+2j
|
||||
callf es:dword ptr proc_bdos_offs
|
||||
|
||||
bdos_cbk_end: ; CODE XREF: bdos_callback+Bj
|
||||
mov ax, bx
|
||||
retn
|
||||
|
||||
extrn sup_main:near
|
||||
extrn sup_init:near
|
||||
extrn rtm_main:near
|
||||
extrn rtm_init:near
|
||||
extrn mem_main:near
|
||||
extrn mem_init:near
|
||||
extrn cio_main:near
|
||||
extrn cio_init:near
|
||||
extrn misc_main:near
|
||||
extrn misc_init:near
|
||||
extrn bdos_main:near
|
||||
extrn bdos_init:near
|
||||
|
||||
dseg
|
||||
|
||||
extrn freemem:byte
|
||||
extrn proc1:word
|
||||
extrn dirname_1:word
|
||||
extrn dirdata_0:word
|
||||
|
||||
public function_tables
|
||||
public bdos_8087_inuse
|
||||
public rlr
|
||||
public drl
|
||||
public pq_disk
|
||||
public pq_loader
|
||||
public pq_memmgr
|
||||
public pq_error
|
||||
public pq_filesystem
|
||||
public search_path
|
||||
public temp_drive
|
||||
public cpu_vectors
|
||||
public lp_xios_entry
|
||||
public lp_dos_module
|
||||
public lp_sysflag_chg
|
||||
public lp_kbd_callback
|
||||
public time_slice
|
||||
public proc_count
|
||||
public bdos_conowner
|
||||
public bdos_sysflags
|
||||
public ccp_dseg
|
||||
public cur_x
|
||||
public max_x
|
||||
public max_y
|
||||
public sysvar_131
|
||||
public sysvar_132
|
||||
public sysvar_144
|
||||
public echo_backspaced
|
||||
public echo_deleted
|
||||
public boot_drive
|
||||
public free_dirnames
|
||||
public free_dirdata
|
||||
public bdos_ver
|
||||
public date_days
|
||||
public date_secs
|
||||
public comsize
|
||||
public page_mode
|
||||
|
||||
function_tables dw offset sup_main ; DATA XREF: inner_callback+Eo
|
||||
dw offset sup_init
|
||||
dw offset rtm_main
|
||||
dw offset rtm_init
|
||||
dw offset mem_main
|
||||
dw offset mem_init
|
||||
dw offset cio_main
|
||||
dw offset cio_init
|
||||
dw offset entry_bdos
|
||||
bdos_segment dw 0 ; DATA XREF: bdos:005Aw
|
||||
off_A15_14 dw offset misc_main
|
||||
dw offset misc_init
|
||||
off_A15_18 dw offset bdos_main
|
||||
off_A15_1A dw offset bdos_init
|
||||
a080586 db '08-05-86'
|
||||
lp_other_init dw 0,0 ; DATA XREF: bdos:0088r bdos:0081r
|
||||
lp_xios_entry dw 3 ; Offset of XIOS entry
|
||||
seg_A15_2A dw seg lp_xios_entry ; -> XIOS segment
|
||||
lp_xios_init dw 0 ; Offset of XIOS init function
|
||||
dw seg lp_xios_entry ; -> XIOS segment
|
||||
lp_bdos_entry dw offset bdos_entry ; DATA XREF: bdos:01B9r x_dev_waitflag+2r
|
||||
; ...
|
||||
dw seg bdos_start
|
||||
|
||||
lp_timeslice dw offset rtm_timeslice
|
||||
dw seg rtm_timeslice
|
||||
|
||||
lp_sysflag_chg dw offset rtm_sysflag
|
||||
dw seg rtm_sysflag
|
||||
|
||||
lp_kbd_callback dw offset cio_keyboard
|
||||
dw seg cio_keyboard
|
||||
|
||||
lp_dos_module dw 0,0 ; DATA XREF: bdos:007Dr P_CHAIN+A9r
|
||||
; ...
|
||||
ccp_dseg dw 0 ; DATA XREF: mc_temp_untempr
|
||||
; get_mcb_pars+38r ...
|
||||
; 0 if no temporary memory blocks allocated
|
||||
dw seg bdos_start
|
||||
dw seg freemem
|
||||
bdos_conowner dw offset proc1 ; DATA XREF: bdos:002Ew bdos_sysflag+Ar
|
||||
; ...
|
||||
bdos_sysflags dw SYSFLAGS ; This should get set by GENCPM
|
||||
|
||||
rlr dw offset proc1 ; DATA XREF: bdos:001Fr bdos:0028w
|
||||
; ...
|
||||
; Current process
|
||||
process_table dw 0 ; DATA XREF: bdos:002Bw
|
||||
drl dw 0 ; DATA XREF: P_0207+5r P_0209+7o
|
||||
; ...
|
||||
; Processes that have just become
|
||||
; ready to run
|
||||
dw 0
|
||||
proc_count db 1 ; DATA XREF: get_new_process+1Dw
|
||||
; P_TERMCPM+5Ew ...
|
||||
bdos_ver dw 1041h ; DATA XREF: S_BDOSVERr
|
||||
bdos_8087_inuse db 0 ; DATA XREF: call_p_load+10w
|
||||
; retake_8087+Br ...
|
||||
search_path db 0, 10h, 0FFh, 0FFh
|
||||
; ...
|
||||
temp_drive db 0 ; DATA XREF: rsx_find+53o bdos:23AEo
|
||||
date_days dw 2DBh ; DATA XREF: bdos:23B2o bdos:2540o
|
||||
; ...
|
||||
date_hours db 0 ; DATA XREF: xios_hook_timer+85w
|
||||
; xios_int08+5Dr ...
|
||||
date_mins db 0 ; DATA XREF: xios_hook_timer+7Dw
|
||||
; xios_int08+4Br ...
|
||||
date_secs db 0 ; DATA XREF: bdos:2551w bdos:2566r
|
||||
; ...
|
||||
cur_x db 0 ; DATA XREF: bdos_char_out+44r
|
||||
; bdos_char_out+70w ...
|
||||
max_x db SCR_MAXX ; DATA XREF: input_putchar+12r
|
||||
; expand_tabs+14r ...
|
||||
max_y db SCR_MAXY ; DATA XREF: bdos:23A2o
|
||||
page_mode db 0FFh ; DATA XREF: bdos:23A6o
|
||||
echo_backspaced db 0 ; DATA XREF: input_ctlH+9r
|
||||
echo_deleted db SCR_ECHODEL ; DATA XREF: input_delete+9r
|
||||
;
|
||||
; Process queues for single-threaded parts of the system.
|
||||
;
|
||||
; Format of process queue:
|
||||
; DW offset of next queue, 0 for none
|
||||
; DW segment of process currently in that section, 0 for none
|
||||
; DW linked list of processes waiting for that section, 0 for none
|
||||
; DW 0
|
||||
;
|
||||
pq_disk dw offset pq_loader ; DATA XREF: get_proc_dskdat+5o
|
||||
; release_DMAo ...
|
||||
rw 3
|
||||
pq_loader dw offset pq_filesystem
|
||||
rw 3
|
||||
pq_filesystem dw offset pq_error ; DATA XREF: funcs_F_main+8o
|
||||
; funcs_F_main+124o ...
|
||||
rw 3
|
||||
pq_error dw 8Ah ; DATA XREF: funcs_F_main+136o
|
||||
; funcs_F_main+1C7o ...
|
||||
rw 3
|
||||
pq_memmgr rw 4 ; DATA XREF: funcs_MC+2o funcs_MC+24o
|
||||
; ...
|
||||
boot_drive db 0 ; DATA XREF: bdos:006Cr bdos:23CEo
|
||||
; ...
|
||||
rb 8
|
||||
db 1,3,4,5,2
|
||||
rb 0F1h
|
||||
db 0
|
||||
free_dirnames dw offset dirname_1 ; DATA XREF: proc_dupdirs+Ar
|
||||
; proc_dupdirs+10w ...
|
||||
free_dirdata dw offset dirdata_0 ; DATA XREF: proc_dupdirs+22r
|
||||
; proc_dupdirs+2Fw ...
|
||||
rb 1Dh
|
||||
comsize dw 0 ; DATA XREF: bdos:23F2o
|
||||
dw 0
|
||||
db 0
|
||||
sysvar_144 db 0 ; DATA XREF: bdos:0073w bdos:23F6o
|
||||
; ...
|
||||
db 0
|
||||
sysvar_131 db 0 ; DATA XREF: copy_to_history+14w
|
||||
; bdos:1CFFr ...
|
||||
sysvar_132 rb 100h ; DATA XREF: copy_to_history+Do
|
||||
; bdos:1CFAo ...
|
||||
time_slice db 10h ; DATA XREF: delay_dispatch+A2r
|
||||
; bdos:23DEo
|
||||
cpu_vectors rw 12
|
||||
|
||||
end
|
||||
|
||||
|
@@ -0,0 +1,98 @@
|
||||
|
||||
NO equ 0
|
||||
YES equ NOT NO
|
||||
|
||||
dseg
|
||||
;
|
||||
; Addresses in the Zero Page
|
||||
;
|
||||
INT_E0 equ dword ptr .0380h
|
||||
;
|
||||
; Addresses in the XIOS
|
||||
;
|
||||
xios_bh_delay equ byte ptr .0F00h ;XIOS header
|
||||
xios_bh_ticks equ byte ptr .0F01h
|
||||
xios_bh_gdopen equ byte ptr .0F02h
|
||||
xios_bh_inint equ byte ptr .0F03h
|
||||
xios_bh_nextflg equ byte ptr .0F04h
|
||||
xios_bh_lastflg equ byte ptr .0F05h
|
||||
xios_bh_intconi equ byte ptr .0F06h
|
||||
xios_bh_8087 equ byte ptr .0F07h
|
||||
mem_table equ word ptr .0F56h
|
||||
msg_cannot_load equ word ptr .1016h
|
||||
addr_cpm_error equ word ptr .101Ch ;Localised messages
|
||||
addr_bdos_fn equ word ptr .101Eh
|
||||
addr_file equ word ptr .1020h
|
||||
addr_writeerr equ word ptr .1022h
|
||||
addr_rodisk equ word ptr .1024h
|
||||
addr_rofile equ word ptr .1026h
|
||||
addr_invaliddrv equ word ptr .1028h
|
||||
addr_pwderr equ word ptr .102Ah
|
||||
addr_filexists equ word ptr .102Ch
|
||||
addr_ambiguous equ word ptr .102Eh
|
||||
country_info equ word ptr .1030h ;DOS country info
|
||||
switch_char equ byte ptr .1050h ;DOS switch character
|
||||
;
|
||||
; Addresses in the process table
|
||||
;
|
||||
proc_nextready equ word ptr .00h ;Link to next ready process
|
||||
proc_nextseg equ word ptr .02h ;Link to next process in
|
||||
;numerical order
|
||||
proc_status equ byte ptr .04h ; 0 => Runnable
|
||||
; 1 => Waiting on timer
|
||||
; 2 => Terminated
|
||||
; 3 => Waiting on flag
|
||||
proc_pid equ byte ptr .05h
|
||||
proc_flags equ word ptr .06h ; Bit 0 => killed
|
||||
; Bit 1 => Using 8087
|
||||
proc_name equ byte ptr .08h
|
||||
proc_incpm equ byte ptr .10h
|
||||
proc_dirname equ word ptr .11h
|
||||
proc_indisk equ byte ptr .13h
|
||||
proc_errcode equ word ptr .14h
|
||||
proc_conmode equ word ptr .16h
|
||||
proc_background equ byte ptr .18h
|
||||
proc_delimiter equ byte ptr .19h
|
||||
proc_sp equ word ptr .1Ah
|
||||
proc_ss equ word ptr .1Ch
|
||||
proc_ax equ word ptr .1Eh
|
||||
proc_bx equ word ptr .20h
|
||||
proc_cx equ word ptr .22h
|
||||
proc_dx equ word ptr .24h
|
||||
proc_di equ word ptr .26h
|
||||
proc_si equ word ptr .28h
|
||||
proc_bp equ word ptr .2Ah
|
||||
proc_es equ word ptr .2Ch
|
||||
userDS equ word ptr .2Eh
|
||||
userES equ word ptr .30h
|
||||
userStack equ word ptr .32h
|
||||
proc_drive equ byte ptr .36h
|
||||
proc_uid equ byte ptr. 37h
|
||||
proc_dma equ dword ptr .38h
|
||||
proc_fx equ byte ptr .3Ch
|
||||
proc_find1st equ dword ptr .3Eh
|
||||
proc_errmode equ byte ptr .46h
|
||||
proc_multisec equ byte ptr .47h
|
||||
proc_passwd equ byte ptr .48h
|
||||
proc_countdown equ word ptr .50h
|
||||
proc_bdos_offs equ word ptr .52h
|
||||
proc_bdos_seg equ word ptr .54h
|
||||
proc_int0 equ dword ptr .56h
|
||||
proc_using_drvs equ word ptr .6Eh
|
||||
proc_onblock equ dword ptr .70h
|
||||
proc_xxseg equ word ptr .74h
|
||||
proc_redir_i equ word ptr .76h
|
||||
proc_redir_o equ word ptr .78h
|
||||
|
||||
proc_cpm_stack equ byte ptr .100h
|
||||
;
|
||||
; Addresses in the file redirection structure
|
||||
;
|
||||
redir_mode equ byte ptr .0 ; Bit 0: 0=write 1=read
|
||||
; Bits 1-2: 0=file 1=aux 2=lst
|
||||
redir_fcb equ byte ptr .1 ; FCB for redirected file
|
||||
redir_buf_count equ byte ptr .25h ; Count of bytes in current buffer
|
||||
redir_cwd equ word ptr .26h ; Current directory for redirected file
|
||||
redir_buf equ byte ptr .28h ; Current record
|
||||
|
||||
|
@@ -0,0 +1,193 @@
|
||||
/* Convert the Personal CP/M-86 BDOS (compiled as a small-model EXE)
|
||||
* to CMD.
|
||||
* Copyright (C) 2003, 2007 John Elliott <jce@seasip.demon.co.uk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DS_LEN 0xF0 /* Length of data segment (paras) */
|
||||
|
||||
int gl_base = 0x60;
|
||||
|
||||
/* EXE header (plus first 8 bytes of EXE file) */
|
||||
unsigned char exe_header[0x208];
|
||||
|
||||
/* CMD header */
|
||||
unsigned char cmd_header[0x80];
|
||||
|
||||
|
||||
/* Read a word from the EXE header */
|
||||
unsigned short peek(int offset)
|
||||
{
|
||||
unsigned short l = exe_header[offset];
|
||||
unsigned short h = exe_header[offset + 1];
|
||||
return (h << 8) | l;
|
||||
}
|
||||
|
||||
/* Add a group to the CMD header */
|
||||
void addgroup(int type, unsigned short paras, unsigned short base,
|
||||
unsigned short minparas, unsigned short maxparas)
|
||||
{
|
||||
static unsigned char *group = cmd_header;
|
||||
*group++ = type;
|
||||
*group++ = (paras & 0xFF);
|
||||
*group++ = (paras >> 8);
|
||||
*group++ = (base & 0xFF);
|
||||
*group++ = (base >> 8);
|
||||
*group++ = (minparas & 0xFF);
|
||||
*group++ = (minparas >> 8);
|
||||
*group++ = (maxparas & 0xFF);
|
||||
*group++ = (maxparas >> 8);
|
||||
printf("Group %d: len=%04x base=%04x min=%04x max=%04x\n",
|
||||
type, paras, base, minparas, maxparas);
|
||||
}
|
||||
|
||||
/* Copy bytes from one file to another.
|
||||
* TODO: Warn if error. */
|
||||
void mvbytes(FILE *fpexe, FILE *fpcmd, long count)
|
||||
{
|
||||
int c;
|
||||
|
||||
while (count)
|
||||
{
|
||||
c = fgetc(fpexe);
|
||||
fputc(c, fpcmd);
|
||||
--count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
FILE *fpexe, *fpcmd;
|
||||
unsigned short cseg,dseg,sseg,dstop;
|
||||
unsigned short dsmin, dsmax, exeparas;
|
||||
unsigned long exelen, dsbytes;
|
||||
long pos;
|
||||
int n;
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
fprintf(stderr, "Syntax: exe2cmd <exefile> <cmdfile>\n");
|
||||
return 1;
|
||||
}
|
||||
for (n = 3; n < argc; n++)
|
||||
{
|
||||
if (!strncmp(argv[n], "base=", 5))
|
||||
{
|
||||
if (!sscanf(&argv[n][5], "%x", &gl_base))
|
||||
{
|
||||
fprintf(stderr, "base= option incorrect.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Load EXE header, and extract the segment info. This code depends
|
||||
* on the word at CS:6 being the length of the code segment in
|
||||
* paragraphs. */
|
||||
fpexe = fopen(argv[1], "rb");
|
||||
if (!fpexe)
|
||||
{
|
||||
perror(argv[1]);
|
||||
return 1;
|
||||
}
|
||||
if (fread(exe_header, 1, sizeof(exe_header), fpexe) < (int)sizeof(exe_header)
|
||||
/* Check for CP/M-86 BDOS:
|
||||
* 32 header paragraphs
|
||||
* First relocation is at address 6 or less */
|
||||
|| peek(8) != 32 || peek(32) > 6)
|
||||
{
|
||||
fclose(fpexe);
|
||||
fprintf(stderr, "%s is not a BDOS image\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
cseg = 0;
|
||||
dseg = peek(0x206);
|
||||
sseg = peek(14);
|
||||
exelen = 512L * peek(4);
|
||||
if (peek(2)) exelen -= (512 - peek(2));
|
||||
exeparas = (exelen + 15) >> 4;
|
||||
/*
|
||||
dstop = exeparas - peek(8);
|
||||
ssparas = dstop - sseg;
|
||||
dsmin = dstop - dseg + peek(10);
|
||||
dsmax = dstop - dseg + peek(12);
|
||||
*/
|
||||
/* This is CP/M-86, the DSEG is a fixed size */
|
||||
dsmin = dsmax = DS_LEN;
|
||||
dstop = dseg + DS_LEN;
|
||||
printf("EXE length = %04lx\n", exelen);
|
||||
printf("EXE header len = %04x\n", peek(8));
|
||||
printf("EXE paras = %04x\n", exeparas);
|
||||
printf("DS top = %04x\n", dstop);
|
||||
printf("CS: %04x length %04x\n", cseg, dseg - cseg);
|
||||
printf("DS: %04x length %04x\n", dseg, dstop - dseg);
|
||||
|
||||
/* Now generate CP/M-86 header. */
|
||||
addgroup(1, dseg - cseg, 0, dseg - cseg, 0);
|
||||
addgroup(2, dstop - dseg, 0, dsmin, 0);
|
||||
|
||||
fpcmd = fopen(argv[2], "wb");
|
||||
if (fpcmd == NULL)
|
||||
{
|
||||
perror(argv[2]);
|
||||
fclose(fpexe);
|
||||
return 2;
|
||||
}
|
||||
if (fwrite(cmd_header, 1, sizeof(cmd_header), fpcmd) < (int)sizeof(cmd_header)
|
||||
|| fwrite(exe_header+0x200, 1, 8, fpcmd) < 8)
|
||||
{
|
||||
fclose(fpcmd);
|
||||
fclose(fpexe);
|
||||
perror(argv[2]);
|
||||
return 2;
|
||||
}
|
||||
/* Write the code segment. The first 8 bytes have been done. */
|
||||
mvbytes(fpexe, fpcmd, 16L * (dseg - cseg) - 8);
|
||||
/* Write the data segment. */
|
||||
dsbytes = 16L * (dstop - dseg);
|
||||
mvbytes(fpexe, fpcmd, 40);
|
||||
/* Apply fixups to offsets within the data segment */
|
||||
for (n = 0; n < 8; n++)
|
||||
{
|
||||
unsigned seg;
|
||||
if (n == 6)
|
||||
{
|
||||
mvbytes(fpexe, fpcmd, 4);/* Address of DOS module */
|
||||
continue;
|
||||
}
|
||||
mvbytes(fpexe, fpcmd, 2); /* Offset */
|
||||
fread(exe_header, 1, 2, fpexe);
|
||||
seg = peek(0) + gl_base;
|
||||
fputc(seg & 0xFF, fpcmd);
|
||||
fputc(seg >> 8, fpcmd);
|
||||
}
|
||||
mvbytes(fpexe, fpcmd, dsbytes - 72);
|
||||
/* Pad the CMD file out to a whole number of records */
|
||||
pos = ftell(fpcmd);
|
||||
while (pos & 0x7F)
|
||||
{
|
||||
fputc(0, fpcmd);
|
||||
++pos;
|
||||
}
|
||||
fclose(fpcmd);
|
||||
fclose(fpexe);
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
|
||||
ZIPFILES= bdos.a86 cmdio.c equates.a86 mem.a86 system.a86 \
|
||||
serial.a86 cmdio.h exe2cmd.c misc.a86 proctbl.a86 \
|
||||
xios.cmd ccp.cmd dpgen.c makefile rtm.a86 \
|
||||
cio.a86 entry.a86 sup.a86 bdos41ex.inp \
|
||||
makefile.211 readme.txt sysdosp.a86 serdosp.a86 \
|
||||
sys211e.a86 sys211d.a86 sys204e.a86 sys204d.a86 sys202e.a86 sys202d.a86 \
|
||||
ser211e.a86 ser211d.a86 ser204e.a86 ser204d.a86 ser202e.a86 ser202d.a86
|
||||
|
||||
OBJECTS=entry.obj sup.obj rtm.obj mem.obj cio.obj misc.obj bdos.obj proctbl.obj
|
||||
|
||||
all: bdos.cmd new.sys
|
||||
|
||||
new.sys: bdos.cmd ccp.cmd xios.cmd dpgen.exe
|
||||
dpgen
|
||||
|
||||
bdos41.exe: $(OBJECTS)
|
||||
linkexe bdos41ex[i
|
||||
|
||||
bdos.cmd: bdos41.exe exe2cmd.exe
|
||||
exe2cmd bdos41.exe bdos.cmd
|
||||
|
||||
%.obj: %.a86 equates.a86 system.a86
|
||||
rasm86 $<
|
||||
|
||||
misc.obj: misc.a86 equates.a86 system.a86 serial.a86
|
||||
|
||||
dpgen.exe: dpgen.c cmdio.c cmdio.h
|
||||
pacc -Bl dpgen.c cmdio.c
|
||||
|
||||
exe2cmd.exe: exe2cmd.c
|
||||
pacc -Bs $<
|
||||
|
||||
clean:
|
||||
xdel $(OBJECTS)
|
||||
xdel bdos.cmd new.sys
|
||||
|
||||
zip:
|
||||
zip bdos41.zip $(ZIPFILES)
|
@@ -0,0 +1,36 @@
|
||||
|
||||
ZIPFILES= bdos.a86 cmdio.c equates.a86 mem.a86 system.a86 \
|
||||
serial.a86 cmdio.h exe2cmd.c misc.a86 proctbl.a86 \
|
||||
xios.cmd ccp.cmd dpgen.c makefile rtm.a86 \
|
||||
cio.a86 entry.a86 Makefile sup.a86 bdos41ex.inp
|
||||
|
||||
OBJECTS=entry.obj sup.obj rtm.obj mem.obj cio.obj misc.obj bdos.obj proctbl.obj
|
||||
|
||||
all: bdos.cmd new.sys
|
||||
|
||||
new.sys: bdos.cmd ccp.cmd xios.cmd dpgen.exe
|
||||
dpgen base=70
|
||||
|
||||
bdos41.exe: $(OBJECTS)
|
||||
linkexe bdos41ex[i
|
||||
|
||||
bdos.cmd: bdos41.exe exe2cmd.exe
|
||||
exe2cmd bdos41.exe bdos.cmd base=70
|
||||
|
||||
%.obj: %.a86 equates.a86 system.a86
|
||||
rasm86 $<
|
||||
|
||||
misc.obj: misc.a86 equates.a86 system.a86 serial.a86
|
||||
|
||||
dpgen.exe: dpgen.c cmdio.c cmdio.h
|
||||
pacc -Bl dpgen.c cmdio.c
|
||||
|
||||
exe2cmd.exe: exe2cmd.c
|
||||
pacc -Bs $<
|
||||
|
||||
clean:
|
||||
xdel $(OBJECTS)
|
||||
xdel bdos.cmd new.sys
|
||||
|
||||
zip:
|
||||
zip pcpm204e.zip $(ZIPFILES)
|
@@ -0,0 +1,737 @@
|
||||
|
||||
include equates.a86
|
||||
|
||||
dseg
|
||||
extrn pq_memmgr:word
|
||||
extrn ccp_dseg:word
|
||||
|
||||
cseg
|
||||
extrn bdos_callback:near
|
||||
|
||||
public mem_init
|
||||
public mem_main
|
||||
;
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mem_init: retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mem_main: push dx
|
||||
push si
|
||||
mov bx, offset pq_memmgr
|
||||
mov cx, 204h
|
||||
call bdos_callback
|
||||
inc es:proc_indisk
|
||||
pop si
|
||||
pop dx
|
||||
call cs:mem_functions[si]
|
||||
jb mc_success
|
||||
mov bx, 0FFFFh
|
||||
|
||||
mc_success: ; CODE XREF: funcs_MC+17j
|
||||
push bx
|
||||
push cx
|
||||
mov cx, 206h
|
||||
call bdos_callback
|
||||
mov bx, offset pq_memmgr
|
||||
mov cx, 205h
|
||||
call bdos_callback
|
||||
pop cx
|
||||
pop bx
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mem_functions dw offset MC_MAX ; DATA XREF: funcs_MC+12o
|
||||
dw offset MC_ABSMAX
|
||||
dw offset MC_ALLOC
|
||||
dw offset MC_ABSALLOC
|
||||
dw offset MC_FREE
|
||||
dw offset MC_ALLFREE
|
||||
dw offset mc_temp_untemp
|
||||
dw offset mc_cleanprg
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ABSALLOC: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+36o
|
||||
call get_mcb_pars
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ABSMAX: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+32o
|
||||
call get_mcb_pars
|
||||
mov mcb_len_min, 1
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ALLFREE: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Ao
|
||||
call get_mcb_pars
|
||||
cmp mcb_ext, 2
|
||||
jnb mcaf_just_anyle
|
||||
mov dx, 8
|
||||
call free_allmem
|
||||
|
||||
mcaf_just_anyle: ; CODE XREF: MC_ALLFREE+8j
|
||||
jmp mc_anyleft
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_ALLOC: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+34o
|
||||
call get_mcb_pars
|
||||
mov mcb_segment, 0
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_FREE: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+38o
|
||||
call get_mcb_pars
|
||||
mov al, mcb_ext
|
||||
cmp al, 0FFh
|
||||
jnz free_onemem
|
||||
mov dx, 8
|
||||
call free_allmem
|
||||
jmps free_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
free_onemem: ; CODE XREF: MC_FREE+8j
|
||||
cmp al, 2
|
||||
jnb free_done
|
||||
call ml_free
|
||||
jmps free_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jmps free_done
|
||||
|
||||
free_done: ; CODE XREF: MC_FREE+10j MC_FREE+14j
|
||||
; ...
|
||||
jmp mc_anyleft
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
MC_MAX: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+30o
|
||||
call get_mcb_pars
|
||||
mov mcb_segment, 0
|
||||
mov mcb_len_min, 1
|
||||
jmp common_alloc
|
||||
|
||||
|
||||
;
|
||||
; Resets the 'temporary' flag on all temporary allocations,
|
||||
; making them permanent.
|
||||
;
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mc_temp_untemp: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Co
|
||||
mov bx, ccp_dseg ; Temp blocks exist?
|
||||
test bx, bx
|
||||
jnz mctu_temp_found
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mctu_temp_found: ; CODE XREF: mc_temp_untemp+6j
|
||||
push bx
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mctu_loop: ; CODE XREF: mc_temp_untemp+16j
|
||||
call ml_next
|
||||
jnb mctu_done
|
||||
and byte ptr 5[di], 0FEh
|
||||
jmps mctu_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mctu_done: ; CODE XREF: mc_temp_untemp+10j
|
||||
pop bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
mc_cleanprg: ; CODE XREF: funcs_MC+12u
|
||||
; DATA XREF: funcs_MC+3Eo
|
||||
push dx
|
||||
;
|
||||
; If bit 2 set in process flags, look for all memory blocks
|
||||
; with bit 2 set in their flags and set bit 0
|
||||
;
|
||||
test es:proc_flags, 4
|
||||
jz mccp_endlabel
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mccp_label: ; CODE XREF: mc_cleanprg+16j
|
||||
; mc_cleanprg+1Cj
|
||||
call ml_next
|
||||
jnb mccp_endlabel
|
||||
test byte ptr 5[di], 4
|
||||
jz mccp_label
|
||||
or byte ptr 5[di], 1
|
||||
jmps mccp_label
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_endlabel: ; CODE XREF: mc_cleanprg+8j
|
||||
; mc_cleanprg+10j
|
||||
pop dx
|
||||
cmp dl, 1
|
||||
jz mccp_type1
|
||||
xor dx, dx
|
||||
call free_allmem
|
||||
jmps mccp_end
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_type1: ; CODE XREF: mc_cleanprg+22j
|
||||
mov di, offset mem_table-6
|
||||
|
||||
mccp_type1_loop: ; CODE XREF: mc_cleanprg+3Aj
|
||||
; mc_cleanprg+40j
|
||||
call ml_next
|
||||
jnb mccp_end
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al
|
||||
jnz mccp_type1_loop
|
||||
mov byte ptr 4[di], 0FDh
|
||||
jmps mccp_type1_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mccp_end: ; CODE XREF: mc_cleanprg+29j
|
||||
; mc_cleanprg+31j
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
get_mcb_pars: ; CODE XREF: MC_ABSALLOCp MC_ABSMAXp
|
||||
; ...
|
||||
mov caller_mcb, dx
|
||||
mov bx, dx
|
||||
push es
|
||||
mov es, es:userDS
|
||||
mov ax, es:[bx]
|
||||
mov mcb_segment, ax
|
||||
mov ax, es:2[bx]
|
||||
mov mcb_len_min, ax
|
||||
mov mcb_len_max, ax
|
||||
xor ax, ax
|
||||
mov cl, es:4[bx]
|
||||
mov mcb_ext, cl
|
||||
cmp cl, 2
|
||||
jnz mcb_ext_range
|
||||
mov ax, 2 ; Keep memory flag
|
||||
|
||||
mcb_ext_range: ; CODE XREF: get_mcb_pars+29j
|
||||
pop es
|
||||
mov dx, es:proc_flags
|
||||
and dx, 0Ch
|
||||
cmp ccp_dseg, 0 ; Do temporary blocks exist?
|
||||
jz mcb_noccpdseg
|
||||
and dx, 0FFFBh
|
||||
|
||||
mcb_noccpdseg: ; CODE XREF: get_mcb_pars+3Dj
|
||||
or ax, dx
|
||||
mov mcb_keep_flag, al
|
||||
mov cx, 2Bh ; Bad Parameter
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
common_alloc: ; CODE XREF: MC_ABSALLOC+3j
|
||||
; MC_ABSMAX+9j ...
|
||||
cmp mcb_ext, 2 ; Remain after termination?
|
||||
ja mc_anyleft
|
||||
call allocate_block
|
||||
|
||||
mc_anyleft: ; CODE XREF: MC_ALLFREE+10j
|
||||
; MC_FREE+1Dj ...
|
||||
push es
|
||||
pushf
|
||||
mov es, es:userDS
|
||||
mov di, offset mem_table-6
|
||||
xor dl, dl ; Not available
|
||||
call ml_find_free
|
||||
jnb mc_noneleft
|
||||
inc dl ; Available
|
||||
|
||||
mc_noneleft: ; CODE XREF: common_alloc+19j
|
||||
mov bx, caller_mcb
|
||||
mov es:4[bx], dl
|
||||
mov ax, mcb_segment
|
||||
mov es:[bx], ax
|
||||
mov ax, mcb_len_max
|
||||
mov es:2[bx], ax
|
||||
xor bx, bx
|
||||
popf
|
||||
pop es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
allocate_block: ; CODE XREF: common_alloc+7p
|
||||
mov cx, 43 ; Bad parameter
|
||||
mov ax, mcb_len_min
|
||||
mov bx, mcb_len_max
|
||||
push ax
|
||||
or ax, bx
|
||||
pop ax
|
||||
jz mcb_param_err
|
||||
cmp ax, bx
|
||||
ja mcb_param_err
|
||||
cmp mcb_segment, 0
|
||||
jz mcb_not_abs
|
||||
|
||||
mcb_abs_retry: ; CODE XREF: allocate_block+36j
|
||||
mov dx, mcb_segment ; Find the memory list entry
|
||||
; controlling this segment.
|
||||
call ml_find_byseg
|
||||
jnb mcb_param_err ; If failed, segment not in the memory arena.
|
||||
mov al, 4[di] ; Get the PID of the memory owner
|
||||
cmp al, 0FEh ; Does the entry contain free memory?
|
||||
jz mcb_wasfree ; Yes. Allocate in it.
|
||||
test byte ptr 5[di], 1; Is it owned by a temporary block?
|
||||
jz mcb_nofree
|
||||
push ax ; Free all temporary blocks
|
||||
call free_temp_block
|
||||
pop ax ; And if that worked, try again
|
||||
jb mcb_abs_retry
|
||||
|
||||
mcb_nofree: ; CODE XREF: allocate_block+2Fj
|
||||
cmp al, es:proc_pid ; Block is in use. By the current
|
||||
; process?
|
||||
jnz mcb_param_err
|
||||
mov ax, [di] ; Suppose so.
|
||||
cmp ax, mcb_segment ; Does the passed start address match the
|
||||
; start of the block?
|
||||
jnz mcb_param_err
|
||||
;
|
||||
; In this case, we're trying to allocate a block
|
||||
; which was allocated already. Update its
|
||||
; flags and then leave it.
|
||||
;
|
||||
mov al, mcb_keep_flag
|
||||
or 5[di], al
|
||||
jmps mcb_allocated
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_wasfree: ; CODE XREF: allocate_block+29j
|
||||
mov ax, [di] ; Start of block
|
||||
add ax, 2[di] ; End of block
|
||||
sub ax, mcb_segment ; Max size to allocate
|
||||
cmp ax, mcb_len_min ; Is it > min size requested?
|
||||
jb mcb_param_err
|
||||
call ml_checksplit
|
||||
jnb mcb_didntsplit
|
||||
mov byte ptr 4[si], 0FEh; Mark the new block as free
|
||||
mov di, si
|
||||
|
||||
mcb_didntsplit: ; CODE XREF: allocate_block+61j
|
||||
jmps mcb_doalloc
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_not_avail: ; CODE XREF: allocate_block+96j
|
||||
mov cx, 3
|
||||
|
||||
mcb_param_err: ; CODE XREF: allocate_block+Ej
|
||||
; allocate_block+12j
|
||||
; ...
|
||||
clc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mcb_not_abs: ; CODE XREF: allocate_block+19j
|
||||
; allocate_block+90j
|
||||
xor dx, dx
|
||||
mov di, offset mem_table-6
|
||||
|
||||
not_abs_next: ; CODE XREF: allocate_block+89j
|
||||
call ml_find_free
|
||||
jnb not_abs_endscan
|
||||
mov ax, 2[di] ; Length of free block
|
||||
cmp dx, ax ; Suitable candidate?
|
||||
jnb not_abs_small
|
||||
mov dx, ax
|
||||
mov si, di ; Keep it in mind
|
||||
|
||||
not_abs_small: ; CODE XREF: allocate_block+7Fj
|
||||
cmp ax, mcb_len_max
|
||||
jb not_abs_next ; Block isn't ideal
|
||||
jmps mcb_doalloc; Got an ideal block. Use it.
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
not_abs_endscan: ; CODE XREF: allocate_block+78j
|
||||
call free_temp_block ; Free temp blocks and try again
|
||||
jb mcb_not_abs
|
||||
cmp dx, mcb_len_min ; Can we at least get the minimum?
|
||||
jb mcb_not_avail
|
||||
mov ax, 2[si] ; OK, make do with the best one we found
|
||||
mov mcb_len_max, ax
|
||||
mov di, si
|
||||
|
||||
mcb_doalloc: ; CODE XREF: allocate_block+69j
|
||||
; allocate_block+8Bj
|
||||
mov ax, [di]
|
||||
mov mcb_segment, ax
|
||||
call ml_splittail ; If not all the block was taken,
|
||||
; mark the remainder as free.
|
||||
jnb mcb_tookall
|
||||
mov byte ptr 4[si], 0FEh
|
||||
|
||||
mcb_tookall: ; CODE XREF: allocate_block+A8j
|
||||
mov al, mcb_keep_flag
|
||||
mov 5[di], al
|
||||
mov al, es:proc_pid
|
||||
test mcb_keep_flag, 4
|
||||
jz mcb_gotowner
|
||||
mov al, 0FCh ; Owner -4 for blocks that persist
|
||||
|
||||
mcb_gotowner: ; CODE XREF: allocate_block+BDj
|
||||
mov 4[di], al
|
||||
|
||||
mcb_allocated: ; CODE XREF: allocate_block+4Dj
|
||||
mov ax, 2[di]
|
||||
mov mcb_len_max, ax
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
free_temp_block: ; CODE XREF: allocate_block+32p
|
||||
; allocate_block+8Dp
|
||||
mov di, offset mem_table-6
|
||||
clc
|
||||
pushf
|
||||
|
||||
freetmp_loop: ; CODE XREF: free_temp_block+Ej
|
||||
; free_temp_block+1Ej
|
||||
call ml_next
|
||||
jnb freetmp_done
|
||||
test byte ptr 5[di], 1; Temporary?
|
||||
jz freetmp_loop
|
||||
popf
|
||||
stc
|
||||
pushf
|
||||
push di ; If so, free it
|
||||
call ml_freeblk
|
||||
pop di
|
||||
mov ccp_dseg, 0
|
||||
jmps freetmp_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
freetmp_done: ; CODE XREF: free_temp_block+8j
|
||||
popf
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
free_allmem: ; CODE XREF: MC_ALLFREE+Dp
|
||||
; MC_FREE+Dp ...
|
||||
mov di, offset mem_table-6
|
||||
push dx
|
||||
|
||||
freeall_loop: ; CODE XREF: free_allmem+10j
|
||||
; free_allmem+19j ...
|
||||
call ml_next
|
||||
jnb allmem_freed
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al ; Owned by this process?
|
||||
jnz freeall_loop
|
||||
pop dx
|
||||
mov al, 5[di] ; Flags
|
||||
test al, dl
|
||||
push dx
|
||||
jnz freeall_loop
|
||||
test al, 2
|
||||
mov byte ptr 4[di], 0FDh
|
||||
jnz freeall_loop
|
||||
call ml_freeblk
|
||||
jmps freeall_loop
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
allmem_freed: ; CODE XREF: free_allmem+7j
|
||||
pop dx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_free: ; CODE XREF: MC_FREE+16p
|
||||
mov dx, mcb_segment
|
||||
call ml_find_byseg ; Find memory list entry for this segment
|
||||
jnb ml_freefail
|
||||
cmp byte ptr 4[di], 0FDh
|
||||
jz ml_canfree ; Owned by ??? shared ???
|
||||
mov al, es:proc_pid
|
||||
cmp 4[di], al ; Owned by this process?
|
||||
jz ml_canfree
|
||||
mov cx, 20h ; Don't own resource
|
||||
jmps ml_freefail
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_canfree: ; CODE XREF: ml_free+Dj ml_free+16j
|
||||
cmp dx, [di] ; Block start matches?
|
||||
jz ml_freeblk
|
||||
call ml_splitblk ; No. Split block
|
||||
mov di, si
|
||||
jb ml_freeblk
|
||||
|
||||
ml_freefail: ; CODE XREF: ml_free+7j ml_free+1Bj
|
||||
clc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_freeblk: ; CODE XREF: free_temp_block+14p
|
||||
; free_allmem+23p ...
|
||||
mov ax, 0FEh
|
||||
mov 4[di], al ; Owner = free
|
||||
mov byte ptr 5[di], 0; Persist = 0
|
||||
mov si, di
|
||||
mov dx, [si]
|
||||
dec dx ; Who owns the para before the memory
|
||||
; we're freeing?
|
||||
push ax
|
||||
call ml_find_byseg
|
||||
pop ax
|
||||
jnb no_coalesce ; Not found
|
||||
cmp 4[di], al
|
||||
jnz no_coalesce ; Not free
|
||||
mov cx, 2[si]
|
||||
add 2[di], cx ; Merge blocks
|
||||
mov byte ptr 4[si], 0FFh
|
||||
mov si, di ; Destroy this block
|
||||
|
||||
no_coalesce: ; CODE XREF: ml_freeblk+14j
|
||||
; ml_freeblk+19j
|
||||
mov di, si
|
||||
mov dx, [di]
|
||||
add dx, 2[di] ; Now try the same with the following
|
||||
; block.
|
||||
push ax
|
||||
call ml_find_byseg
|
||||
pop ax
|
||||
jnb no_coalesce2
|
||||
cmp 4[di], al
|
||||
jnz no_coalesce2
|
||||
mov cx, 2[di]
|
||||
add 2[si], cx
|
||||
mov byte ptr 4[di], 0FFh
|
||||
|
||||
no_coalesce2: ; CODE XREF: ml_freeblk+33j
|
||||
; ml_freeblk+38j
|
||||
mov di, si
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_checksplit: ; CODE XREF: allocate_block+5Ep
|
||||
mov ax, mcb_segment
|
||||
mov dx, ax ; DX = first requested para
|
||||
sub ax, [di] ; AX = paras before allocated area
|
||||
cmp ax, 1 ; If there are some...
|
||||
jnb ml_splitblk ; Then split the block
|
||||
clc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_splittail: ; CODE XREF: allocate_block+A5p
|
||||
mov dx, mcb_len_max
|
||||
mov ax, 2[di]
|
||||
sub ax, dx
|
||||
cmp ax, 1
|
||||
jnb ml_dospltail
|
||||
clc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_dospltail: ; CODE XREF: ml_splittail+Cj
|
||||
add dx, mcb_segment
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_splitblk: ; CODE XREF: ml_free+21p ml_checksplit+Aj
|
||||
mov cx, 12h
|
||||
push di
|
||||
mov di, offset mem_table-6
|
||||
|
||||
ml_split1: ; CODE XREF: ml_splitblk+10j
|
||||
call ml_next
|
||||
jnb ml_split2
|
||||
cmp byte ptr 4[di], 0FFh
|
||||
jnz ml_split1
|
||||
pop si
|
||||
xchg si, di
|
||||
mov [si], dx
|
||||
mov ax, [di]
|
||||
add ax, 2[di]
|
||||
sub ax, dx
|
||||
mov 2[si], ax
|
||||
sub dx, [di]
|
||||
mov 2[di], dx
|
||||
stc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ml_split2: ; CODE XREF: ml_splitblk+Aj
|
||||
pop di
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_find_byseg: ; CODE XREF: allocate_block+1Fp
|
||||
; ml_free+4p ...
|
||||
mov di, offset mem_table-6
|
||||
mov cx, 3
|
||||
|
||||
mlfbs_loop: ; CODE XREF: ml_find_byseg+Fj
|
||||
; ml_find_byseg+15j ...
|
||||
call ml_next
|
||||
jnb mlfbs_end
|
||||
cmp byte ptr 4[di], 0FFh
|
||||
jz mlfbs_loop
|
||||
mov ax, [di]
|
||||
cmp ax, dx
|
||||
ja mlfbs_loop
|
||||
add ax, 2[di]
|
||||
cmp dx, ax
|
||||
jnb mlfbs_loop
|
||||
|
||||
mlfbs_end: ; CODE XREF: ml_find_byseg+9j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_find_free: ; CODE XREF: common_alloc+16p
|
||||
; allocate_block+75p
|
||||
; ...
|
||||
call ml_next
|
||||
jnb no_free_ml
|
||||
cmp byte ptr 4[di], 0FEh
|
||||
jnz ml_find_free
|
||||
stc
|
||||
|
||||
no_free_ml: ; CODE XREF: ml_find_free+3j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
ml_next: ; CODE XREF: mc_temp_untemp+Dp
|
||||
; mc_cleanprg+Dp ...
|
||||
add di, 6
|
||||
mov ax, offset msg_cannot_load
|
||||
cmp di, ax
|
||||
retn
|
||||
|
||||
|
||||
dseg
|
||||
|
||||
mcb_len_min dw 0 ; DATA XREF: MC_ABSMAX+3w MC_MAX+9w
|
||||
; ...
|
||||
mcb_len_max dw 0 ; DATA XREF: get_mcb_pars+19w
|
||||
; common_alloc+2Br ...
|
||||
mcb_segment dw 0 ; DATA XREF: MC_ALLOC+3w MC_MAX+3w
|
||||
; ...
|
||||
mcb_keep_flag db 0 ; DATA XREF: get_mcb_pars+45w
|
||||
; allocate_block+47r
|
||||
; ...
|
||||
caller_mcb dw 0 ; DATA XREF: get_mcb_parsw
|
||||
; common_alloc+1Dr
|
||||
mcb_ext db 0 ; DATA XREF: MC_ALLFREE+3r
|
||||
; MC_FREE+3r ...
|
||||
end
|
||||
|
@@ -0,0 +1,598 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
dseg
|
||||
extrn rlr:word
|
||||
extrn login_vector:word
|
||||
extrn readonly_vector:word
|
||||
extrn date_days:word
|
||||
extrn date_secs:byte
|
||||
extrn free_dirnames:word
|
||||
extrn free_dirdata:word
|
||||
extrn bdos_8087_inuse:word
|
||||
extrn cio_flags:word
|
||||
extrn comsize:word
|
||||
extrn ccp_dseg:word
|
||||
extrn sysvar_131:byte
|
||||
extrn sysvar_132:byte
|
||||
extrn sysvar_144:byte
|
||||
extrn search_path:byte
|
||||
extrn proc_count:byte
|
||||
extrn time_slice:byte
|
||||
extrn page_mode:byte
|
||||
extrn temp_drive:byte
|
||||
extrn max_x:byte
|
||||
extrn max_y:byte
|
||||
extrn bdos_ver:word
|
||||
extrn boot_drive:byte
|
||||
cseg
|
||||
|
||||
public misc_init
|
||||
public misc_main
|
||||
|
||||
extrn cwd_for_drive:near
|
||||
|
||||
db '(C)1985,DIGITAL RESEARCH'
|
||||
|
||||
sernumber:
|
||||
include serial.a86
|
||||
|
||||
misc_init: ; DATA XREF: dseg:0016o
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
misc_functions dw offset P_RSX_default ; DATA XREF: bdos:2317o
|
||||
dw offset S_BDOSVER
|
||||
dw offset DRV_LOGINVEC
|
||||
dw offset DRV_GET
|
||||
dw offset F_DMAOFF
|
||||
dw offset DRV_ROVEC
|
||||
dw offset F_USERNUM
|
||||
dw offset F_MULTISEC
|
||||
dw offset F_ERRMODE
|
||||
dw offset S_SYSVAR
|
||||
dw offset F_DMASEG
|
||||
dw offset F_DMAGET
|
||||
dw offset T_SET
|
||||
dw offset T_GET
|
||||
dw offset S_SERIAL
|
||||
dw offset P_CODE
|
||||
dw offset proc_dupdirs
|
||||
dw offset proc_freedirs
|
||||
dw offset S_SYSDAT
|
||||
dw offset S_OSVER
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
misc_main: ; DATA XREF: dseg:0014o
|
||||
jmp cs:misc_functions[si]
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_RSX_default: ; DATA XREF: bdos:22EFo
|
||||
mov bx, 0FFFFh
|
||||
mov cx, 2
|
||||
retn
|
||||
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_BDOSVER: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F1o
|
||||
mov bx, bdos_ver
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_OSVER: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2315o
|
||||
mov bx, 1012h
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_SYSVAR: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2301o
|
||||
mov si, dx ; Caller SCBPB
|
||||
mov dx, ds ; Our DS
|
||||
push ds
|
||||
push es
|
||||
mov ds, es:userDS ; Caller DS
|
||||
mov di, offset public_sysvars
|
||||
xor bx, bx
|
||||
mov bl, [si]
|
||||
cmp bl, 6
|
||||
jb sysvar_valid
|
||||
sub bl, 80h
|
||||
jb sysvar_invalid
|
||||
mov di, offset private_sysvars
|
||||
cmp bl, 13h
|
||||
jb sysvar_valid
|
||||
|
||||
sysvar_invalid: ; CODE XREF: S_SYSVAR+1Aj S_SYSVAR+4Fj
|
||||
; ...
|
||||
mov bx, 0FFFFh
|
||||
jmps s_sysvar_ret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
sysvar_valid: ; CODE XREF: S_SYSVAR+15j S_SYSVAR+22j
|
||||
shl bx, 1
|
||||
shl bx, 1
|
||||
mov cx, cs:[bx+di]
|
||||
test ch, 80h ; Process variable?
|
||||
jz not_proc_var
|
||||
mov dx, es
|
||||
|
||||
not_proc_var: ; CODE XREF: S_SYSVAR+33j
|
||||
mov di, cs:2[bx+di]
|
||||
test byte ptr 1[si], 0FFh
|
||||
lea si, 2[si]
|
||||
jnz sysvar_set
|
||||
xchg si, di
|
||||
push ds
|
||||
pop es
|
||||
|
||||
mov ds, dx
|
||||
|
||||
jmps sysvar_access
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
sysvar_set: ; CODE XREF: S_SYSVAR+42j
|
||||
test ch, 40h ; Read-only?
|
||||
jnz sysvar_invalid
|
||||
cmp es:proc_background, 0
|
||||
jz sysvar_is_fg
|
||||
test ch, 20h ; Owned by FG process?
|
||||
jnz sysvar_invalid
|
||||
|
||||
sysvar_is_fg: ; CODE XREF: S_SYSVAR+57j
|
||||
mov es, dx
|
||||
|
||||
sysvar_access: ; CODE XREF: S_SYSVAR+4Aj
|
||||
test ch, 10h ; Volatile?
|
||||
jz sysvar_nocli
|
||||
cli
|
||||
|
||||
sysvar_nocli: ; CODE XREF: S_SYSVAR+63j
|
||||
xor ch, ch
|
||||
rep movsb
|
||||
sti
|
||||
xor bx, bx
|
||||
|
||||
s_sysvar_ret: ; CODE XREF: S_SYSVAR+27j
|
||||
pop es
|
||||
pop ds
|
||||
|
||||
retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
public_sysvars dw 2001h ; DATA XREF: S_SYSVAR+Bo
|
||||
dw offset max_x
|
||||
dw 2001h
|
||||
dw offset max_y
|
||||
dw 2001h
|
||||
dw offset page_mode
|
||||
dw 6001h
|
||||
dw offset xios_bh_ticks
|
||||
dw 2001h
|
||||
dw offset temp_drive
|
||||
dw 1005h
|
||||
dw offset date_days
|
||||
private_sysvars dw 2001h ; DATA XREF: S_SYSVAR+1Co
|
||||
dw offset xios_bh_8087
|
||||
dw 0E001h
|
||||
dw offset proc_pid
|
||||
dw 801Ah
|
||||
dw offset proc_drive
|
||||
dw 2001h
|
||||
dw offset sysvar_131
|
||||
dw 20FFh
|
||||
dw offset sysvar_132
|
||||
dw 3002h
|
||||
dw offset ccp_dseg
|
||||
dw 20FFh
|
||||
dw offset boot_drive
|
||||
dw 3004h
|
||||
dw offset search_path
|
||||
dw 0E001h
|
||||
dw offset proc_background
|
||||
dw 6001h
|
||||
dw offset proc_count
|
||||
dw 2001h
|
||||
dw offset time_slice
|
||||
dw 2002h
|
||||
dw offset cio_flags
|
||||
dw 6001h
|
||||
dw offset bdos_8087_inuse
|
||||
dw 9004h
|
||||
dw offset proc_onblock
|
||||
dw 0E002h
|
||||
dw offset proc_dirname
|
||||
dw 2005h
|
||||
dw offset comsize
|
||||
dw 6001h
|
||||
dw offset sysvar_144
|
||||
dw 1020h
|
||||
dw offset country_info
|
||||
dw 1001h
|
||||
dw offset switch_char
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_SERIAL: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:230Bo
|
||||
push es
|
||||
mov es, es:userDS
|
||||
mov di, dx
|
||||
mov si, offset sernumber+10
|
||||
mov cx, 3
|
||||
db 0F3h, 2Eh ;REP CS:
|
||||
movsw
|
||||
pop es
|
||||
mov bx, cx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_CODE: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:230Do
|
||||
inc dx
|
||||
jz p_code_get
|
||||
dec dx
|
||||
mov es:proc_errcode, dx
|
||||
|
||||
p_code_get: ; CODE XREF: P_CODE+1j
|
||||
mov bx, es:proc_errcode
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
proc_dupdirs: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:230Fo
|
||||
mov si, es:proc_dirname
|
||||
test si, si
|
||||
jz proc_has_no_cwd
|
||||
cli
|
||||
mov di, free_dirnames; Take the head of the free list
|
||||
mov ax, [di]
|
||||
mov free_dirnames, ax
|
||||
sti
|
||||
push es
|
||||
push ds
|
||||
pop es
|
||||
;
|
||||
; Now duplicate the entries for each drive
|
||||
;
|
||||
|
||||
|
||||
dup_drvdir: ; CODE XREF: proc_dupdirs+3Cj
|
||||
lodsw
|
||||
push si
|
||||
test ax, ax
|
||||
jnz dup_dirdata_cpy
|
||||
stosw
|
||||
jmps dup_dirdata_nxt
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dup_dirdata_cpy: ; CODE XREF: proc_dupdirs+1Bj
|
||||
xchg ax, si
|
||||
cli
|
||||
mov ax, free_dirdata
|
||||
stosw
|
||||
test ax, ax
|
||||
jz dup_dirdata_nxt
|
||||
push cx
|
||||
push di
|
||||
xchg ax, di
|
||||
mov ax, [di]
|
||||
mov free_dirdata, ax
|
||||
sti
|
||||
mov cx, 5
|
||||
rep movsw
|
||||
pop di
|
||||
pop cx
|
||||
|
||||
dup_dirdata_nxt: ; CODE XREF: proc_dupdirs+1Ej
|
||||
; proc_dupdirs+28j
|
||||
sti
|
||||
pop si
|
||||
loop dup_drvdir
|
||||
movsw
|
||||
movsw
|
||||
pop es
|
||||
|
||||
sub di, 24h
|
||||
mov es:proc_dirname, di
|
||||
|
||||
proc_has_no_cwd: ; CODE XREF: proc_dupdirs+7j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
proc_freedirs: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2311o
|
||||
mov si, es:proc_dirname
|
||||
test si, si
|
||||
jz pfd_done
|
||||
mov cx, 10h
|
||||
|
||||
pfd_freedata: ; CODE XREF: proc_freedirs+22j
|
||||
lodsw
|
||||
xchg ax, bx
|
||||
test bx, bx
|
||||
jz pfd_next_data
|
||||
dec word ptr 8[bx] ; Decrease reference count
|
||||
jnz pfd_next_data
|
||||
cli
|
||||
mov ax, free_dirdata; If it's 0
|
||||
mov [bx], ax ; Add the DIRDATA to the free list
|
||||
mov free_dirdata, bx
|
||||
sti
|
||||
|
||||
pfd_next_data: ; CODE XREF: proc_freedirs+10j
|
||||
; proc_freedirs+15j
|
||||
loop pfd_freedata
|
||||
dec word ptr [si]
|
||||
jnz pfd_done
|
||||
sub si, 20h
|
||||
cli
|
||||
mov bx, free_dirnames; Now free the DIRNAMES structure
|
||||
mov [si], bx
|
||||
mov free_dirnames, si
|
||||
sti
|
||||
push ds
|
||||
mov ds, rlr
|
||||
|
||||
mov proc_dirname, 0 ; Release it from PROC
|
||||
pop ds
|
||||
|
||||
|
||||
pfd_done: ; CODE XREF: proc_freedirs+7j
|
||||
; proc_freedirs+26j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
S_SYSDAT: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2313o
|
||||
mov es:userES, ds
|
||||
sub bx, bx
|
||||
sub ax, ax
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
nop_iret:
|
||||
nop
|
||||
iret
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Copy bits for floating drives from their hosts
|
||||
|
||||
ret_drv_vector: ; CODE XREF: DRV_LOGINVEC+4j
|
||||
; DRV_ROVEC+4j
|
||||
mov cx, 3
|
||||
|
||||
rdv_float: ; CODE XREF: ret_drv_vector+23j
|
||||
push cx
|
||||
add cl, 0Ch
|
||||
mov al, cl
|
||||
mov dx, 1
|
||||
shl dx, cl
|
||||
mov cl, 0FFh
|
||||
push bx
|
||||
call cwd_for_drive
|
||||
pop bx
|
||||
mov cl, al ; Get the host drive
|
||||
mov ax, 1
|
||||
shl ax, cl
|
||||
test bx, ax ; Is the corresponding bit set for it?
|
||||
jz rdv_nofloat
|
||||
or bx, dx
|
||||
|
||||
rdv_nofloat: ; CODE XREF: ret_drv_vector+1Ej
|
||||
pop cx
|
||||
loop rdv_float
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_LOGINVEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F3o
|
||||
mov bx, login_vector
|
||||
jmp ret_drv_vector ; Copy bits for floating drives from their hosts
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_GET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F5o
|
||||
mov bl, es:proc_drive
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMAOFF: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F7o
|
||||
mov es:word ptr proc_dma, dx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
DRV_ROVEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22F9o
|
||||
mov bx, readonly_vector
|
||||
jmp ret_drv_vector ; Copy bits for floating drives from their hosts
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_USERNUM: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FBo
|
||||
mov al, dl
|
||||
cmp al, 0FFh
|
||||
jnz f_setuid
|
||||
mov bl, es:proc_uid
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
f_setuid: ; CODE XREF: F_USERNUM+4j
|
||||
and al, 0Fh
|
||||
mov es:proc_uid, al
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_MULTISEC: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FDo
|
||||
xor bx, bx
|
||||
or dl, dl
|
||||
jz f_bad_multisec
|
||||
cmp dl, 81h
|
||||
jnb f_bad_multisec
|
||||
mov es:proc_multisec, dl
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
f_bad_multisec: ; CODE XREF: F_MULTISEC+4j
|
||||
; F_MULTISEC+9j
|
||||
dec bx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_ERRMODE: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:22FFo
|
||||
mov es:proc_errmode, dl
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMASEG: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2303o
|
||||
mov es:word ptr proc_dma+2, dx
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
F_DMAGET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2305o
|
||||
mov ax, es:word ptr proc_dma+2
|
||||
mov es:userES, ax
|
||||
mov bx, es:word ptr proc_dma
|
||||
retn
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
T_SET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2307o
|
||||
mov si, dx
|
||||
mov di, offset date_days
|
||||
cli
|
||||
push es
|
||||
push ds
|
||||
mov ds, es:userDS
|
||||
pop es
|
||||
|
||||
movsw
|
||||
movsw
|
||||
push es
|
||||
pop ds
|
||||
pop es
|
||||
|
||||
mov date_secs, 0
|
||||
sti
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
T_GET: ; CODE XREF: bdos:2317u
|
||||
; DATA XREF: bdos:2309o
|
||||
mov di, dx
|
||||
mov si, offset date_days
|
||||
push es
|
||||
mov es, es:userDS
|
||||
cli
|
||||
movsw
|
||||
movsw
|
||||
mov bl, date_secs
|
||||
sti
|
||||
pop es
|
||||
retn
|
||||
|
||||
end
|
||||
|
@@ -0,0 +1,48 @@
|
||||
|
||||
include equates.a86
|
||||
cseg
|
||||
|
||||
extrn bdos_rsx:near
|
||||
|
||||
dseg
|
||||
extrn dirname_0:word
|
||||
|
||||
public proc1
|
||||
;
|
||||
; First process
|
||||
;
|
||||
proc1 dw 0
|
||||
dw offset proc2 ; DATA XREF: bdos:0044r bdos:0050w
|
||||
rw 2
|
||||
db 'Init '
|
||||
db 0
|
||||
dw offset dirname_0
|
||||
rw 3
|
||||
db '$'
|
||||
|
||||
rb 45
|
||||
db 1
|
||||
rw 5
|
||||
dw offset bdos_rsx
|
||||
rb 10Ch
|
||||
|
||||
proc2 dw 0
|
||||
dw proc3
|
||||
db 2, 1
|
||||
rb 15Ah
|
||||
|
||||
proc3 dw 0
|
||||
dw proc4
|
||||
db 2, 2
|
||||
rb 15Ah
|
||||
|
||||
|
||||
proc4 dw 0
|
||||
dw 0
|
||||
db 2, 3
|
||||
rb 15Ah
|
||||
|
||||
rb 0A0h
|
||||
|
||||
|
||||
|
@@ -0,0 +1 @@
|
||||
BDOS 4.1 for PCP/M-86 2.x
|
@@ -0,0 +1,82 @@
|
||||
BDOS 4.1 source tree
|
||||
====================
|
||||
|
||||
This file contains disassembled source code and a build system for the
|
||||
CP/M-86 BDOS, version 4.1. This is the version that is included in
|
||||
Personal CP/M-86 2.x and also DOS Plus 1.2.
|
||||
|
||||
How to build
|
||||
============
|
||||
|
||||
In order to use the build system, you will need:
|
||||
* The Digital Research assembler and linker: RASM86 and LINKEXE.
|
||||
* Pacific C, to build the C tools EXE2CMD and DPGEN.
|
||||
* GNU Make.
|
||||
|
||||
You should just be able to type 'make' and a new system file (new.sys)
|
||||
will be generated containing the newly-built BDOS.
|
||||
|
||||
Note, however, that certain structures need to be paragraph-aligned, and
|
||||
the A86 files do not enforce this. Therefore if you add or remove
|
||||
code or variables, you will need to check for bits marked PADDING and ensure
|
||||
they do pad out the correct number of bytes.
|
||||
|
||||
Notes on the source
|
||||
===================
|
||||
|
||||
The source code was disassembled using the IDA disassembler. It has been
|
||||
split up into modules named after their counterparts in Concurrent CP/M
|
||||
(SUP, RTM etc.) plus a few extras.
|
||||
|
||||
Rather than use LINKCMD to generate a CMD file, I was forced to use
|
||||
LINKEXE to generate an EXE, and then write a custom EXE2CMD program to
|
||||
convert the one to the other. This is because LINKCMD starts the data
|
||||
segment at offset 100h, but to build the BDOS you need it at 0. The
|
||||
'official' DRI way of doing this involves a patched linker (LINK0.CMD) but
|
||||
there's no DOS version and it didn't seem to like running in a CP/M emulator,
|
||||
so I was forced to adopt other tactics.
|
||||
|
||||
There are two variables which, despite being in the BDOS data segment, refer
|
||||
to addresses in the XIOS. These are:
|
||||
|
||||
freemem: The address of the first segment available for programs. This
|
||||
is left as an unresolved external symbol in the provided
|
||||
source code, and is populated by DPGEN.
|
||||
|
||||
bdos_sysflags: The address of the system flag table in the XIOS. The only
|
||||
way I found of making that come out right was to store its
|
||||
value as an EQU directive in SYSTEM.A86. When I was writing
|
||||
my modified XIOS for DOS Plus, I came across the same problem
|
||||
from the other direction; the modified XIOS initialises this
|
||||
variable at startup time so that the value in the BDOS is no
|
||||
longer relevant.
|
||||
|
||||
Support for multiple versions
|
||||
=============================
|
||||
|
||||
The build system is currently configured to build Personal CP/M v2.04e. If
|
||||
you want to build other versions:
|
||||
|
||||
1. Get hold of the .SYS file for the version you want to build.
|
||||
2. Use DPSPLIT (not supplied) to break it into BDOS.CMD, XIOS.CMD and CCP.CMD.
|
||||
Delete BDOS.CMD but hang on to the other two.
|
||||
3. Copy the correct SYS*.A86 to SYSTEM.A86, and the correct SER*.A86 to
|
||||
SERIAL.A86:
|
||||
|
||||
System Version Language Files to copy
|
||||
==========================================================================
|
||||
PCP/M 2.02 German SER202D.A86 / SYS202D.A86
|
||||
PCP/M 2.02 English SER202E.A86 / SYS202E.A86
|
||||
PCP/M 2.04 German SER204D.A86 / SYS204D.A86
|
||||
PCP/M 2.04 English SER204E.A86 / SYS204E.A86
|
||||
PCP/M 2.11 German SER211D.A86 / SYS211D.A86
|
||||
PCP/M 2.11 English SER211E.A86 / SYS211E.A86
|
||||
DOS Plus 1.2 English SERDOSP.A86 / SYSDOSP.A86
|
||||
|
||||
4. Rerun the build.
|
||||
|
||||
From the point of view of the BDOS, the changes are mostly trivial:
|
||||
differences are mostly caused by such things as a different serial number,
|
||||
alternative screen dimensions etc. One exception is that DOS Plus omits a
|
||||
few BDOS patches which are present in all known PCP/M-86 2.x versions.
|
||||
|
@@ -0,0 +1,934 @@
|
||||
|
||||
include equates.a86
|
||||
include system.a86
|
||||
|
||||
|
||||
dseg
|
||||
extrn rlr:word
|
||||
extrn drl:word
|
||||
extrn bdos_conowner:word
|
||||
extrn lp_sysflag_chg:dword
|
||||
extrn time_slice:byte
|
||||
extrn pq_disk:word
|
||||
extrn lst_owner:byte
|
||||
extrn aux_owner:byte
|
||||
extrn bdos_8087_inuse:byte
|
||||
extrn proc_count:byte
|
||||
extrn bdos_sysflags:word
|
||||
|
||||
cseg
|
||||
extrn bdos_dseg:word
|
||||
extrn bdos_callback:near
|
||||
extrn far_ret_1:near
|
||||
|
||||
public rtm_main
|
||||
public rtm_init
|
||||
public rtm_timeslice
|
||||
public rtm_sysflag
|
||||
|
||||
rtm_init: ; DATA XREF: dseg:0006o
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
rtm_main: ; DATA XREF: dseg:0004o
|
||||
call cs:rtm_functions[si]; 0208, get new process
|
||||
jb proc_ok
|
||||
mov bx, 0FFFFh
|
||||
|
||||
proc_ok: ; CODE XREF: bdos:0EDFj
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rtm_functions dw offset P_TERMCPM ; DATA XREF: bdos:0EDAo
|
||||
dw offset P_WAITFLAG
|
||||
dw offset P_DELAY
|
||||
dw offset P_DISPATCH
|
||||
dw offset P_0204 ; Enter a process-queue controlled area
|
||||
dw offset P_0205 ; Leave a process-queue controlled area
|
||||
dw offset P_0206
|
||||
dw offset P_0207 ; Check runnable processes
|
||||
dw offset get_new_process; 0208, get new process
|
||||
dw offset P_0209 ; Wake a process (DX = process segment)
|
||||
dw offset P_020A ; Terminate foreground process
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_WAITFLAG: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE7o
|
||||
cli
|
||||
call lookup_flag
|
||||
jnb pwf_badflag
|
||||
cmp ax, 0FFFEh
|
||||
jz pwf_minus2
|
||||
ja pwf_block
|
||||
mov cx, 6
|
||||
clc
|
||||
jmps pwf_badflag
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pwf_block: ; CODE XREF: P_WAITFLAG+Bj
|
||||
mov [bx], es ; Process waiting on flag
|
||||
mov es:proc_status, 3; Make process wait
|
||||
mov es:proc_countdown, dx
|
||||
call delay_dispatch
|
||||
jmps pwf_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pwf_minus2: ; CODE XREF: P_WAITFLAG+9j
|
||||
mov word ptr [bx], 0FFFFh
|
||||
|
||||
pwf_done: ; CODE XREF: P_WAITFLAG+23j
|
||||
stc
|
||||
|
||||
pwf_badflag: ; CODE XREF: P_WAITFLAG+4j
|
||||
; P_WAITFLAG+11j
|
||||
sti
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
rtm_sysflag: ; CODE XREF: xios_int09+EDu
|
||||
; DATA XREF: dseg:0038o
|
||||
cmp dl, 1
|
||||
jnz bsf_not1
|
||||
mov xios_bh_delay, 0
|
||||
mov ax, bdos_conowner
|
||||
push es
|
||||
|
||||
bsf_checktimer: ; CODE XREF: rtm_sysflag+34j
|
||||
mov es, ax
|
||||
cmp es:proc_status, 1; Waiting on timer
|
||||
jnz bsf_nexttimer
|
||||
mov xios_bh_delay, 0FFh
|
||||
call is_proc_busy
|
||||
jb bsf_wakeproc
|
||||
dec es:proc_countdown
|
||||
jnz bsf_nexttimer
|
||||
|
||||
bsf_wakeproc: ; CODE XREF: rtm_sysflag+20j
|
||||
mov dx, es
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
|
||||
bsf_nexttimer: ; CODE XREF: rtm_sysflag+16j
|
||||
; rtm_sysflag+27j
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
jnz bsf_checktimer
|
||||
xor ax, ax
|
||||
pop es
|
||||
jmps bsf_done
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_not1: ; CODE XREF: rtm_sysflag+3j
|
||||
pushf
|
||||
cli
|
||||
call lookup_flag
|
||||
jnb bsf_badflag
|
||||
cmp ax, 0FFFEh
|
||||
jz bsf_overrun
|
||||
ja bsf_nowake
|
||||
mov word ptr [bx], 0FFFFh
|
||||
mov dx, ax
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
jmps bsf_woken
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_nowake: ; CODE XREF: rtm_sysflag+47j
|
||||
mov word ptr [bx], 0FFFEh
|
||||
|
||||
bsf_woken: ; CODE XREF: rtm_sysflag+52j
|
||||
xor ax, ax
|
||||
jmps bsf_popret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bsf_overrun: ; CODE XREF: rtm_sysflag+45j
|
||||
mov cx, 5
|
||||
|
||||
bsf_badflag: ; CODE XREF: rtm_sysflag+40j
|
||||
mov ax, 0FFFFh
|
||||
|
||||
bsf_popret: ; CODE XREF: rtm_sysflag+5Aj
|
||||
popf
|
||||
|
||||
bsf_done: ; CODE XREF: rtm_sysflag+39j
|
||||
mov bx, ax
|
||||
retf
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
lookup_flag: ; CODE XREF: P_WAITFLAG+1p
|
||||
; rtm_sysflag+3Dp
|
||||
mov cx, 4
|
||||
cmp dl, xios_bh_lastflg
|
||||
ja luf_badflag
|
||||
xor dh, dh
|
||||
mov bx, bdos_sysflags
|
||||
add bx, dx
|
||||
add bx, dx
|
||||
mov ax, [bx]
|
||||
stc
|
||||
|
||||
luf_badflag: ; CODE XREF: lookup_flag+7j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; 0208, get new process
|
||||
|
||||
get_new_process: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EF5o
|
||||
push ds
|
||||
mov bx, bdos_conowner
|
||||
mov cx, 4
|
||||
|
||||
gnp_loop: ; CODE XREF: get_new_process+14j
|
||||
mov ds, bx
|
||||
|
||||
cmp proc_status, 2 ; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jz gnp_found
|
||||
add bx, 16h
|
||||
loop gnp_loop
|
||||
pop ds
|
||||
|
||||
clc
|
||||
mov cx, 0Ch
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
gnp_found: ; CODE XREF: get_new_process+Fj
|
||||
pop ds
|
||||
inc proc_count
|
||||
xor cx, cx
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_DELAY: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE9o
|
||||
cmp xios_bh_ticks, 0
|
||||
jnz delay_haveclock
|
||||
mov cx, 45 ; No tick
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
delay_haveclock: ; CODE XREF: P_DELAY+5j
|
||||
mov tick_wait_proc, es
|
||||
cli
|
||||
mov xios_bh_delay, 0FFh; Ask for ticks, because
|
||||
mov es:proc_status, 1; there's now a process waiting
|
||||
mov es:proc_countdown, dx
|
||||
jmp delay_dispatch
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Terminate foreground process
|
||||
|
||||
P_020A: ; CODE XREF: bdos:0EDAu P_TERMCPM+4Cp
|
||||
; DATA XREF: ...
|
||||
xor bp, bp
|
||||
jmps proc_doterm
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
proc_term_bg: ; CODE XREF: P_TERMCPM+5Bp
|
||||
mov bp, 1
|
||||
|
||||
proc_doterm: ; CODE XREF: P_020A+2j
|
||||
push ds
|
||||
push es
|
||||
mov di, offset proc_passwd+6; BDOS pointer - 4
|
||||
lds si, es:4[di]
|
||||
|
||||
proc_unhook_rsx: ; CODE XREF: proc_term_bg+29j
|
||||
; proc_term_bg+58j
|
||||
mov ax, 4[si]
|
||||
or ax, 6[si]
|
||||
jz proc_unhooked
|
||||
mov byte ptr 18[si], 0FFh
|
||||
test bp, bp
|
||||
jnz proc_free_rsx
|
||||
cmp byte ptr 3[si], 0
|
||||
jnz proc_free_rsx
|
||||
push si
|
||||
pop di
|
||||
push ds
|
||||
pop es
|
||||
|
||||
lds si, 4[si]
|
||||
jmps proc_unhook_rsx
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_free_rsx: ; CODE XREF: proc_term_bg+1Aj
|
||||
; proc_term_bg+20j
|
||||
mov ax, 20[si]
|
||||
lds si, 4[si]
|
||||
mov es:4[di], si
|
||||
mov es:6[di], ds
|
||||
push si
|
||||
push ds
|
||||
push di
|
||||
push es
|
||||
push bp
|
||||
mov ds, cs:bdos_dseg
|
||||
mov es, rlr
|
||||
|
||||
mov mcb_to_free, ax
|
||||
mov dx, offset mcb_to_free
|
||||
mov cx, 39h ; MC_FREE
|
||||
call bdos_callback
|
||||
pop bp
|
||||
pop es
|
||||
pop di
|
||||
pop ds
|
||||
pop si
|
||||
jmps proc_unhook_rsx
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_unhooked: ; CODE XREF: proc_term_bg+12j
|
||||
pop es
|
||||
pop ds
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_TERMCPM: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EE5o
|
||||
cli
|
||||
mov es:word ptr proc_onblock, offset far_ret_1
|
||||
mov es:word ptr proc_onblock+2, cs
|
||||
sti
|
||||
|
||||
;
|
||||
; This is a patch in PCP/M 2.04e. It makes a certain amount of sense,
|
||||
; because what is the reference to CS:42h below supposed to mean?
|
||||
;
|
||||
if PCPM204E
|
||||
|
||||
jmp ptc_termproper
|
||||
db 18h
|
||||
dw 0
|
||||
|
||||
else
|
||||
|
||||
cmp es:byte ptr proc_background, 0
|
||||
|
||||
endif
|
||||
jnz ptc_termproper
|
||||
cmp cs:word ptr .42h, 0
|
||||
jz ptc_termproper
|
||||
mov ah, 51h
|
||||
int 21h ; DOS - 2+ internal - GET PSP SEGMENT
|
||||
; Return: BX = current PSP segment (see AH=26h for format)
|
||||
test bx, bx
|
||||
jz ptc_termproper
|
||||
mov ax, 4C00h
|
||||
int 21h ; DOS - 2+ - QUIT WITH EXIT CODE (EXIT)
|
||||
; AL = exit code
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ptc_hang: ; CODE XREF: P_TERMCPM+2Bj
|
||||
jmps ptc_hang
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ptc_termproper: ; CODE XREF: P_TERMCPM+Ej P_TERMCPM+14j
|
||||
; ...
|
||||
push dx
|
||||
call release_queues ; Release all process queues owned by a process
|
||||
mov cx, 723h
|
||||
call bdos_callback
|
||||
pop dx
|
||||
mov cx, 307h
|
||||
call bdos_callback
|
||||
mov cx, 418h
|
||||
call bdos_callback
|
||||
cmp es:proc_background, 0
|
||||
jnz ptc_background
|
||||
call P_020A ; Kill foreground process
|
||||
mov cx, 103h ; Bring CCP to foreground
|
||||
jmp bdos_callback
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ptc_background: ; CODE XREF: P_TERMCPM+4Aj
|
||||
mov cx, 611h
|
||||
call bdos_callback ; Free CWD structures
|
||||
call proc_term_bg ; Terminate background process
|
||||
dec proc_count
|
||||
test es:proc_flags, 2; Was using 8087?
|
||||
jz ptc_not8087
|
||||
and es:proc_flags, 0FFFDh
|
||||
mov bdos_8087_inuse, 0
|
||||
|
||||
ptc_not8087: ; CODE XREF: P_TERMCPM+69j
|
||||
mov tick_wait_proc, es
|
||||
mov es:proc_status, 2; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jmp delay_dispatch
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
kill_process: ; CODE XREF: delay_dispatch+6Aj
|
||||
; delay_dispatch+128j
|
||||
mov ax, es
|
||||
cli
|
||||
mov ss, ax
|
||||
mov sp, 100h
|
||||
sti
|
||||
mov al, es:proc_pid
|
||||
cmp aux_owner, al
|
||||
jnz dont_free_aux
|
||||
mov aux_owner, 0FFh
|
||||
|
||||
dont_free_aux: ; CODE XREF: kill_process+11j
|
||||
cmp lst_owner, al
|
||||
jnz dont_free_lst
|
||||
mov lst_owner, 0FFh
|
||||
|
||||
dont_free_lst: ; CODE XREF: kill_process+1Cj
|
||||
and es:proc_flags, 0FFFEh
|
||||
mov es:proc_errcode, 0FFFEh
|
||||
cmp es:proc_fx, 0Ah ; If broken into line input
|
||||
mov es:proc_fx, 0
|
||||
jnz dont_reset_disk
|
||||
mov cx, 0Dh ; Then reset disks
|
||||
call bdos_callback ; presumably so ^C at command prompt
|
||||
; does what the user expects.
|
||||
|
||||
dont_reset_disk: ; CODE XREF: kill_process+3Dj
|
||||
call release_queues ; Release all process queues owned by a process
|
||||
|
||||
call_termcpm: ; CODE XREF: P_0206+1Bj
|
||||
xor cx, cx
|
||||
mov dx, cx
|
||||
jmp bdos_callback
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
P_0206: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EF1o
|
||||
mov tick_wait_proc, es
|
||||
dec es:proc_indisk
|
||||
jnz P_0207 ; Check runnable processes
|
||||
test es:proc_flags, 1
|
||||
jz P_0207 ; Check runnable processes
|
||||
and es:proc_flags, 0FFFEh
|
||||
jmps call_termcpm
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Check runnable processes
|
||||
|
||||
P_0207: ; CODE XREF: bdos:0EDAu P_0206+9j
|
||||
; ...
|
||||
xor ax, ax
|
||||
mov tick_wait_proc, ax
|
||||
cmp drl, ax ; Anything waiting to run?
|
||||
jnz P_DISPATCH ; If so, give it a go
|
||||
stc
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Release all process queues owned by a process
|
||||
|
||||
release_queues: ; CODE XREF: P_TERMCPM+2Ep
|
||||
; kill_process+45p
|
||||
mov bx, offset pq_disk
|
||||
|
||||
release_loop: ; CODE XREF: release_queues+Cj
|
||||
push bx
|
||||
call P_0205 ; Leave a process-queue controlled area
|
||||
pop bx
|
||||
mov bx, [bx]
|
||||
test bx, bx
|
||||
jnz release_loop
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Enter a process-queue controlled area
|
||||
|
||||
P_0204: ; CODE XREF: bdos:0EDAu
|
||||
; DATA XREF: bdos:0EEDo
|
||||
mov ax, es
|
||||
mov tick_wait_proc, ax
|
||||
xchg ax, 2[bx] ; Is there already a process waiting?
|
||||
test ax, ax
|
||||
jz P_0207 ; Check runnable processes
|
||||
mov 2[bx], ax ; Yes. Add us to the chain.
|
||||
lea bx, 4[bx]
|
||||
call add_to_chain
|
||||
jmps delay_dispatch
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Leave a process-queue controlled area
|
||||
|
||||
P_0205: ; CODE XREF: bdos:0EDAu release_queues+4p
|
||||
; DATA XREF: ...
|
||||
mov ax, es
|
||||
cmp 2[bx], ax
|
||||
jz pq_leave_1
|
||||
clc ; Queue isn't owned by this process
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pq_leave_1: ; CODE XREF: P_0205+5j
|
||||
mov tick_wait_proc, es
|
||||
push es
|
||||
push bx
|
||||
lea bx, 4[bx]
|
||||
call next_runnable
|
||||
pop bx
|
||||
mov 2[bx], es
|
||||
mov dx, es
|
||||
pop es
|
||||
call P_0209 ; Wake a process (DX = process segment)
|
||||
jmp P_0207 ; Check runnable processes
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
; Wake a process (DX = process segment)
|
||||
|
||||
P_0209: ; CODE XREF: bdos:0EDAu rtm_sysflag+2Bp
|
||||
; ...
|
||||
test dx, dx
|
||||
jz wake_none
|
||||
push es
|
||||
mov es, dx
|
||||
mov bx, offset drl
|
||||
pushf
|
||||
cli
|
||||
mov es:proc_status, 0; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
call add_to_chain
|
||||
popf
|
||||
pop es
|
||||
stc
|
||||
|
||||
wake_none: ; CODE XREF: P_0209+2j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
delay_dispatch: ; CODE XREF: P_WAITFLAG+20p
|
||||
; P_DELAY+20j ...
|
||||
mov bx, offset delay_cbk
|
||||
jmps disp_general
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
P_DISPATCH: ; CODE XREF: bdos:0EDAu P_0207+9j
|
||||
; DATA XREF: ...
|
||||
mov bx, offset dispatch_cbk
|
||||
|
||||
disp_general: ; CODE XREF: delay_dispatch+3j
|
||||
mov tick_wait_proc, es
|
||||
mov cbk_function, bx
|
||||
pushf
|
||||
push cs
|
||||
mov ax, offset dispret
|
||||
push ax
|
||||
push ds
|
||||
jmps dsptch
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dispret: ; DATA XREF: delay_dispatch+12o
|
||||
xor bx, bx
|
||||
stc
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
rtm_timeslice: ; CODE XREF: xios_int09+EDu
|
||||
; DATA XREF: dseg:0034o
|
||||
cli
|
||||
cmp tick_wait_proc, 0
|
||||
jz twp_is_0
|
||||
pop ds
|
||||
iret
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
twp_is_0: ; CODE XREF: delay_dispatch+23j
|
||||
mov tick_wait_proc, 0FFFFh
|
||||
sti
|
||||
mov cbk_function, offset dispatch_cbk
|
||||
|
||||
dsptch: ; CODE XREF: delay_dispatch+17j
|
||||
; delay_dispatch+1A1j
|
||||
sti
|
||||
mov dsptch_es, es
|
||||
mov es, rlr
|
||||
mov es:proc_ax, ax
|
||||
mov ax, dsptch_es
|
||||
mov es:proc_es, ax
|
||||
mov es:proc_ss, ss
|
||||
mov es:proc_sp, sp
|
||||
mov ax, ds
|
||||
cli
|
||||
mov ss, ax
|
||||
|
||||
mov sp, offset dsptch_stack
|
||||
sti
|
||||
call check_timeslice
|
||||
cld
|
||||
call is_proc_busy
|
||||
jnb dont_kill
|
||||
mov tick_wait_proc, 0
|
||||
jmp kill_process
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dont_kill: ; CODE XREF: delay_dispatch+62j
|
||||
cmp cbk_function, offset dispatch_cbk
|
||||
jnz disp_switchproc
|
||||
xor ax, ax
|
||||
cmp drl, ax
|
||||
jnz disp_switchproc
|
||||
cmp es:proc_nextready, ax
|
||||
jz j_leave_disp
|
||||
cmp es:proc_background, 0
|
||||
jz proc_can_run
|
||||
cmp es:proc_background, 0FFh
|
||||
jnz disp_switchproc
|
||||
|
||||
proc_can_run: ; CODE XREF: delay_dispatch+8Aj
|
||||
cmp time_to_switch, 0
|
||||
jz slice_expired
|
||||
dec time_to_switch
|
||||
|
||||
j_leave_disp: ; CODE XREF: delay_dispatch+82j
|
||||
jmp leave_disp
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
slice_expired: ; CODE XREF: delay_dispatch+99j
|
||||
mov al, time_slice
|
||||
mov time_to_switch, al
|
||||
|
||||
disp_switchproc: ; CODE XREF: delay_dispatch+73j
|
||||
; delay_dispatch+7Bj
|
||||
; ...
|
||||
mov es:proc_bx, bx
|
||||
mov es:proc_cx, cx
|
||||
mov es:proc_dx, dx
|
||||
mov es:proc_bp, bp
|
||||
mov es:proc_di, di
|
||||
mov es:proc_si, si
|
||||
xor ax, ax
|
||||
mov ds, ax
|
||||
|
||||
mov si, ax
|
||||
mov di, offset proc_int0
|
||||
mov dx, 4
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
mov cx, dx
|
||||
add si, dx
|
||||
rep movsw
|
||||
mov si, offset INT_E0
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
xor ax, ax
|
||||
callf es:dword ptr proc_onblock
|
||||
mov ds, cs:bdos_dseg
|
||||
|
||||
mov bx, offset rlr
|
||||
call next_runnable
|
||||
jmp cbk_function
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
delay_cbk: ; DATA XREF: delay_dispatcho
|
||||
jmps check_ready
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
dispatch_cbk: ; DATA XREF: delay_dispatch+5o
|
||||
; delay_dispatch+2Eo
|
||||
; ...
|
||||
call add_to_chain
|
||||
|
||||
check_ready: ; CODE XREF: delay_dispatch+F9j
|
||||
; delay_dispatch+10Ej
|
||||
; ...
|
||||
mov bx, offset drl
|
||||
cli
|
||||
call next_runnable
|
||||
sti
|
||||
jnb check_ready1
|
||||
mov bx, offset rlr
|
||||
call proc_makeready
|
||||
jmps check_ready
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
check_ready1: ; CODE XREF: delay_dispatch+106j
|
||||
call check_timeslice
|
||||
mov ax, rlr
|
||||
test ax, ax
|
||||
jz check_ready
|
||||
mov es, ax
|
||||
call is_proc_busy
|
||||
jnb proc_switchin
|
||||
cli
|
||||
mov tick_wait_proc, 0
|
||||
jmp kill_process
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
proc_switchin: ; CODE XREF: delay_dispatch+11Fj
|
||||
mov ax, 1
|
||||
callf es:dword ptr proc_onblock
|
||||
mov ds, cs:bdos_dseg
|
||||
mov ds, rlr
|
||||
mov si, offset proc_int0
|
||||
xor ax, ax
|
||||
mov es, ax
|
||||
|
||||
mov di, ax
|
||||
mov dx, 4
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
mov cx, dx
|
||||
add di, dx
|
||||
rep movsw
|
||||
mov di, offset INT_E0
|
||||
mov cx, dx
|
||||
rep movsw
|
||||
push ds
|
||||
pop es
|
||||
|
||||
mov ds, cs:bdos_dseg
|
||||
mov bx, es:proc_bx
|
||||
mov cx, es:proc_cx
|
||||
mov dx, es:proc_dx
|
||||
mov bp, es:proc_bp
|
||||
mov di, es:proc_di
|
||||
mov si, es:proc_si
|
||||
|
||||
leave_disp: ; CODE XREF: delay_dispatch+9Fj
|
||||
cli
|
||||
mov ss, es:proc_ss
|
||||
|
||||
mov sp, es:proc_sp
|
||||
sti
|
||||
mov ax, es:proc_ax
|
||||
mov es, es:proc_es
|
||||
cli
|
||||
cmp drl, 0
|
||||
jz drl_is_empty
|
||||
mov cbk_function, offset dispatch_cbk
|
||||
jmp dsptch
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
drl_is_empty: ; CODE XREF: delay_dispatch+199j
|
||||
mov tick_wait_proc, 0
|
||||
pop ds
|
||||
iret
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
proc_makeready: ; CODE XREF: delay_dispatch+10Bp
|
||||
mov ax, [bx]
|
||||
mov [bx], es
|
||||
test ax, ax
|
||||
jz pmr_1
|
||||
mov es:proc_nextready, ax
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pmr_1: ; CODE XREF: proc_makeready+6j
|
||||
mov 2[bx], es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
add_to_chain: ; CODE XREF: P_0204+12p P_0209+12p
|
||||
; ...
|
||||
mov ax, 2[bx]
|
||||
mov 2[bx], es
|
||||
test ax, ax
|
||||
jz added_to_chain
|
||||
push ds
|
||||
mov ds, ax
|
||||
|
||||
mov proc_nextready, es
|
||||
pop ds
|
||||
|
||||
retn
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
added_to_chain: ; CODE XREF: add_to_chain+8j
|
||||
mov [bx], es
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
next_runnable: ; CODE XREF: P_0205+12p delay_dispatch+F2p
|
||||
; ...
|
||||
mov ax, [bx]
|
||||
test ax, ax
|
||||
mov es, ax
|
||||
jz nxtrun_2
|
||||
mov ax, es:proc_nextready
|
||||
mov es:proc_nextready, 0
|
||||
mov [bx], ax
|
||||
test ax, ax
|
||||
jnz nxtrun_1
|
||||
mov 2[bx], ax
|
||||
|
||||
nxtrun_1: ; CODE XREF: next_runnable+17j
|
||||
stc
|
||||
|
||||
nxtrun_2: ; CODE XREF: next_runnable+6j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
is_proc_busy: ; CODE XREF: rtm_sysflag+1Dp
|
||||
; delay_dispatch+5Fp
|
||||
; ...
|
||||
test es:proc_flags, 1
|
||||
jz proc_notbusy
|
||||
cmp es:proc_indisk, 1
|
||||
|
||||
proc_notbusy: ; CODE XREF: is_proc_busy+7j
|
||||
retn
|
||||
|
||||
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
; S u b r o u t i n e
|
||||
|
||||
check_timeslice: ; CODE XREF: delay_dispatch+5Bp
|
||||
; delay_dispatch+110p
|
||||
dec timeslice
|
||||
jnz not_expired
|
||||
push bx
|
||||
push cx
|
||||
push dx
|
||||
mov es, bdos_conowner
|
||||
|
||||
cts_process: ; CODE XREF: check_timeslice+39j
|
||||
test es:proc_flags, 1
|
||||
jz cts_nextproc
|
||||
cmp es:proc_indisk, 0
|
||||
jnz cts_nextproc
|
||||
cli
|
||||
cmp es:proc_status, 3; 0 => Runnable
|
||||
; 1 => waiting on timer
|
||||
; 2 => terminated
|
||||
; 3 => waiting on flag
|
||||
jnz cts_nextproc
|
||||
mov dx, es:proc_countdown
|
||||
callf dword ptr lp_sysflag_chg
|
||||
sti
|
||||
|
||||
cts_nextproc: ; CODE XREF: check_timeslice+14j
|
||||
; check_timeslice+1Cj
|
||||
; ...
|
||||
mov ax, es:proc_nextseg
|
||||
test ax, ax
|
||||
mov es, ax
|
||||
jnz cts_process
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
mov es, rlr
|
||||
mov timeslice, 1Eh
|
||||
|
||||
not_expired: ; CODE XREF: check_timeslice+4j
|
||||
retn
|
||||
|
||||
|
||||
dseg
|
||||
mcb_to_free dw 0
|
||||
dw 0
|
||||
db 0
|
||||
|
||||
time_to_switch db 10h ; DATA XREF: delay_dispatch+94r
|
||||
; delay_dispatch+9Bw
|
||||
; ...
|
||||
timeslice db 1Eh ; DATA XREF: check_timeslicew
|
||||
; check_timeslice+42w
|
||||
tick_wait_proc dw 0 ; DATA XREF: P_DELAY+Bw P_TERMCPM+77w
|
||||
; ...
|
||||
cbk_function dw 0 ; DATA XREF: delay_dispatch+Cw
|
||||
; delay_dispatch+2Ew
|
||||
; ...
|
||||
dsptch_es dw 0 ; DATA XREF: delay_dispatch+35w
|
||||
; delay_dispatch+41r
|
||||
rw 20h
|
||||
dsptch_stack db 0 ; DATA XREF: delay_dispatch+57o
|
||||
|
@@ -0,0 +1 @@
|
||||
db '1053-0673-029641'
|
@@ -0,0 +1 @@
|
||||
db '1053-0673-029641'
|
@@ -0,0 +1 @@
|
||||
db '1053-0673-026387'
|
@@ -0,0 +1 @@
|
||||
db '1053-0673-029458'
|
@@ -0,0 +1 @@
|
||||
db '1053-0673-005434'
|
@@ -0,0 +1 @@
|
||||
db '1053-0673-061962'
|
@@ -0,0 +1 @@
|
||||
db '1053-0000-654321'
|
@@ -0,0 +1 @@
|
||||
db '1053-0673-029458'
|
2033
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 4.1/sup.a86
Normal file
2033
CPM OPERATING SYSTEMS/CPM.Z80.DE/PERSONAL/PCPM-86/BDOS 4.1/sup.a86
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
||||
;
|
||||
; Include various BDOS patches found in PCP/M 2.04e?
|
||||
;
|
||||
PCPM204E equ YES
|
||||
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 3980h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 79
|
||||
SCR_MAXY equ 23
|
||||
SCR_ECHODEL equ 0FFh
|
||||
|
@@ -0,0 +1,18 @@
|
||||
;
|
||||
; Include various BDOS patches found in PCP/M 2.04e?
|
||||
;
|
||||
PCPM204E equ YES
|
||||
|
||||
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 3980h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 79
|
||||
SCR_MAXY equ 23
|
||||
SCR_ECHODEL equ 0FFh
|
||||
|
@@ -0,0 +1,17 @@
|
||||
;
|
||||
; Include various BDOS patches found in PCP/M 2.04e?
|
||||
;
|
||||
PCPM204E equ YES
|
||||
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 35F0h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 79
|
||||
SCR_MAXY equ 23
|
||||
SCR_ECHODEL equ 0FFh
|
||||
|
@@ -0,0 +1,17 @@
|
||||
;
|
||||
; Include various BDOS patches found in PCP/M 2.04e?
|
||||
;
|
||||
PCPM204E equ YES
|
||||
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 3590h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 79
|
||||
SCR_MAXY equ 23
|
||||
SCR_ECHODEL equ 0FFh
|
||||
|
@@ -0,0 +1,19 @@
|
||||
;
|
||||
; Include various BDOS patches found in PCP/M 2.04e?
|
||||
;
|
||||
PCPM204E equ YES
|
||||
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 38A0h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 78
|
||||
SCR_MAXY equ 22
|
||||
SCR_ECHODEL equ 0
|
||||
|
||||
|
||||
|
@@ -0,0 +1,19 @@
|
||||
;
|
||||
; Include various BDOS patches found in PCP/M 2.04e?
|
||||
;
|
||||
PCPM204E equ YES
|
||||
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 38F0h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 78
|
||||
SCR_MAXY equ 22
|
||||
SCR_ECHODEL equ 0
|
||||
|
||||
|
||||
|
@@ -0,0 +1,22 @@
|
||||
;
|
||||
; Include various BDOS patches found in PCP/M 2.04e?
|
||||
;
|
||||
PCPM204E equ NO
|
||||
;
|
||||
; Use the 2.02e serial number?
|
||||
;
|
||||
PCPM202E equ NO
|
||||
|
||||
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 2C90h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 79
|
||||
SCR_MAXY equ 23
|
||||
SCR_ECHODEL equ 0
|
||||
|
@@ -0,0 +1,17 @@
|
||||
;
|
||||
; Include various BDOS patches found in PCP/M 2.04e?
|
||||
;
|
||||
PCPM204E equ YES
|
||||
|
||||
;
|
||||
; These values would, I think, normally be generated by GENCPM.
|
||||
;
|
||||
SYSFLAGS equ 3590h
|
||||
|
||||
;
|
||||
; Screen dimensions and other trivia
|
||||
;
|
||||
SCR_MAXX equ 79
|
||||
SCR_MAXY equ 23
|
||||
SCR_ECHODEL equ 0FFh
|
||||
|
Binary file not shown.
@@ -0,0 +1,60 @@
|
||||
|
||||
DR-DOS XDIR /C /S
|
||||
|
||||
--A--- 2002-05-24 \PCPM86_B.105\FILE_ID.DIZ
|
||||
|
||||
--A--- 4.017 2002-05-24 01:05 \PCPM86_B.105\FILES.TXT
|
||||
--A--- 851 2002-05-24 01:05 C719 \PCPM86_B.105\LICENSE.TXT
|
||||
--A--- 12.453 2002-05-24 01:05 F7FF \PCPM86_B.105\README.TXT
|
||||
|
||||
--A--- 15.232 2002-05-24 01:05 EDBF \PCPM86_B.105\BIN\BACK.CMD
|
||||
--A--- 7.168 2002-05-24 01:05 E06F \PCPM86_B.105\BIN\CCP.CMD
|
||||
--A--- 3.840 2002-05-24 01:05 F1EC \PCPM86_B.105\BIN\DATE.CMD
|
||||
--A--- 14.336 2002-05-24 01:05 9DB9 \PCPM86_B.105\BIN\DDT86.CMD
|
||||
--A--- 19.840 2002-05-24 01:05 FEF9 \PCPM86_B.105\BIN\DEVICE.CMD
|
||||
--A--- 11.648 2002-05-24 01:05 4984 \PCPM86_B.105\BIN\DIR.CMD
|
||||
--A--- 31.104 2002-05-24 01:05 91BC \PCPM86_B.105\BIN\DSKMAINT.CMD
|
||||
--A--- 2.944 2002-05-24 01:05 4EAF \PCPM86_B.105\BIN\DUMP86.CMD
|
||||
--A--- 9.728 2002-05-24 01:05 E763 \PCPM86_B.105\BIN\ED.CMD
|
||||
--A--- 3.968 2002-05-24 01:05 DC89 \PCPM86_B.105\BIN\ERASE.CMD
|
||||
--A--- 640 2002-05-24 01:05 9BC7 \PCPM86_B.105\BIN\EXTERN.CMD
|
||||
--A--- 18.688 2002-05-24 01:05 FD67 \PCPM86_B.105\BIN\GENRSX.CMD
|
||||
--A--- 9.088 2002-05-24 01:05 9E70 \PCPM86_B.105\BIN\GET.CMD
|
||||
--A--- 3.328 2002-05-24 01:05 3A82 \PCPM86_B.105\BIN\GETRSX.RSX
|
||||
--A--- 3.328 2002-05-24 01:05 257C \PCPM86_B.105\BIN\HDPARK.CMD
|
||||
--A--- 30.336 2002-05-24 01:05 6713 \PCPM86_B.105\BIN\HDPARTY.CMD
|
||||
--A--- 7.680 2002-05-24 01:05 DBC2 \PCPM86_B.105\BIN\HELP.CMD
|
||||
--A--- 54.016 2002-05-24 01:05 4448 \PCPM86_B.105\BIN\HELP.HLP
|
||||
--A--- 35.840 2002-05-24 01:05 BEA9 \PCPM86_B.105\BIN\INITDIR.CMD
|
||||
--A--- 640 2002-05-24 01:05 1BC7 \PCPM86_B.105\BIN\INTERN.CMD
|
||||
--A--- 3.328 2002-05-24 01:05 0A90 \PCPM86_B.105\BIN\PATCH86.CMD
|
||||
--A--- 47.488 2002-05-24 01:05 3166 \PCPM86_B.105\BIN\PCPM.SYS
|
||||
--A--- 9.472 2002-05-24 01:05 845E \PCPM86_B.105\BIN\PIP.CMD
|
||||
--A--- 8.832 2002-05-24 01:05 1E84 \PCPM86_B.105\BIN\PUT.CMD
|
||||
--A--- 3.584 2002-05-24 01:05 8C7B \PCPM86_B.105\BIN\PUTRSX.RSX
|
||||
--A--- 4.480 2002-05-24 01:05 6ABF \PCPM86_B.105\BIN\READ.ME
|
||||
--A--- 3.200 2002-05-24 01:05 15D1 \PCPM86_B.105\BIN\RENAME.CMD
|
||||
--A--- 9.344 2002-05-24 01:05 737C \PCPM86_B.105\BIN\SET.CMD
|
||||
--A--- 5.120 2002-05-24 01:05 D248 \PCPM86_B.105\BIN\SETDEF.CMD
|
||||
--A--- 8.704 2002-05-24 01:05 AFDE \PCPM86_B.105\BIN\SHOW.CMD
|
||||
--A--- 2.304 2002-05-24 01:05 C8C4 \PCPM86_B.105\BIN\STOP.CMD
|
||||
--A--- 11.008 2002-05-24 01:05 97A5 \PCPM86_B.105\BIN\SUBMIT.CMD
|
||||
--A--- 4.096 2002-05-24 01:05 35A4 \PCPM86_B.105\BIN\TYPE.CMD
|
||||
|
||||
--A--- 2.590 2002-05-24 01:05 C26F \PCPM86_B.105\IMG\GETIMAGE.BAT
|
||||
--A--- 1.351 2002-05-24 01:05 E27C \PCPM86_B.105\IMG\MAKEDISK.BAT
|
||||
--A--- 309.971 2002-05-24 01:05 8967 \PCPM86_B.105\IMG\PCPM105B.DSK
|
||||
--A--- 737.280 2002-05-24 01:05 2027 \PCPM86_B.105\IMG\PCPM105B.IMG
|
||||
--A--- 1.101 2002-05-24 01:05 C299 \PCPM86_B.105\IMG\S5PG685.DEF
|
||||
|
||||
--A--- 369.910 2002-05-24 01:05 A20B \PCPM86_B.105\SRC\BACK.A86
|
||||
--A--- 227.289 2002-05-24 01:05 DA00 \PCPM86_B.105\SRC\CCP.A86
|
||||
--A--- 506.666 2002-05-24 01:05 8F84 \PCPM86_B.105\SRC\DEVICE.A86
|
||||
--A--- 366.457 2002-05-24 01:05 2A51 \PCPM86_B.105\SRC\DSKMAINT.A86
|
||||
--A--- 18.312 2002-05-24 01:05 A779 \PCPM86_B.105\SRC\HDPARK.A86
|
||||
--A--- 587.356 2002-05-24 01:05 1B96 \PCPM86_B.105\SRC\HDPARTY.A86
|
||||
--A--- 940.070 2002-05-24 01:05 3F7F \PCPM86_B.105\SRC\INITDIR.A86
|
||||
--A--- 93.285 2002-05-24 01:05 9740 \PCPM86_B.105\SRC\PATCH86.A86
|
||||
--A--- 1.475.274 2002-05-24 01:05 A3F9 \PCPM86_B.105\SRC\PCPM.A86
|
||||
|
||||
|
@@ -0,0 +1,23 @@
|
||||
----------------------------------------
|
||||
Digital Research Personal CP/M-86 1.0/5b
|
||||
(1985) for Siemens Simatic S5 / PG685
|
||||
----------------------------------------
|
||||
|
||||
This file PCPM105S.ZIP represents part 2
|
||||
of a distribution made up of 2 archives.
|
||||
|
||||
It contains the disassembled source code
|
||||
for some of the binaries in \SRC\.
|
||||
|
||||
The individual binaries in \BIN\ and the
|
||||
floppy disk image files in \IMG\ can be
|
||||
found in the accompaning part 1 in an
|
||||
archive named PCPM105B.ZIP.
|
||||
|
||||
See FILES.TXT for further details.
|
||||
|
||||
Read README.TXT/LICENSE.TXT before use.
|
||||
|
||||
Last edit: 2002-05-24
|
||||
----------------------------------------
|
||||
|
@@ -0,0 +1,26 @@
|
||||
|
||||
License agreement for the CP/M material presented on this site
|
||||
==============================================================
|
||||
|
||||
Subject: Re: Unofficial CP/M Website/licensing of CP/M material
|
||||
To: Gaby Chaudry <gaby@gaby.de>
|
||||
Date sent: Fri, 19 Oct 2001 10:36:31 -0600
|
||||
|
||||
|
||||
Let this email represent a right to use, distribute, modify, enhance and
|
||||
otherwise make available in a nonexclusive manner the CP/M technology as
|
||||
part of the "Unofficial CP/M Web Site" with its maintainers, developers and
|
||||
community.
|
||||
|
||||
I further state that as Chairman and CEO of Lineo, Inc. that I have the
|
||||
right to do offer such a license.
|
||||
|
||||
Lineo and its affiliates, partners and employees make no warranties of any
|
||||
kind with regards to this technology and its usefulness or lack thereof.
|
||||
|
||||
---
|
||||
Bryan Sparks
|
||||
CEO Lineo, Inc.
|
||||
http://www.lineo.com
|
||||
|
||||
|
@@ -0,0 +1,274 @@
|
||||
This archive represents a German issue of Digital Research's Personal CP/M-86 1.0/5b for the Siemens Simatic S5 programming device PG685. Sources are in Assembler, and have been disassembled with Sourcer v. 7.00.
|
||||
|
||||
/README.TXT
|
||||
|
||||
|
||||
Last edit: 2002-05-24 MPAUL
|
||||
|
||||
|
||||
Digital Research Personal CP/M-86 1.0/5b (1985)
|
||||
===============================================
|
||||
for
|
||||
===
|
||||
Siemens Simatic S5 / PG685
|
||||
==========================
|
||||
|
||||
|
||||
Summary
|
||||
-------
|
||||
|
||||
This archive represents a German issue of Digital Research's
|
||||
Personal CP/M-86 1.0/5b for the Siemens Simatic S5 programming
|
||||
device PG685.
|
||||
|
||||
This release of PCP/M-86 is dated 1985-10-09 (or 1985-09-10?),
|
||||
and contains Digital Research copyright strings going back to
|
||||
1981, 1982, and for the most part 1983.
|
||||
|
||||
Many of the .CMD files contain "CP/M-86 Plus" strings, leading
|
||||
to the assumption that Personal CP/M-86 1.x and 2.x represent
|
||||
nothing but this rumored product CP/M-86 Plus or that they are
|
||||
at least very close relatives, with Personal CP/M-86 being derived
|
||||
from CP/M-86 Plus. There are also hints that the single-user
|
||||
Personal CP/M-86 1.x and 2.x issues in some way correspond with
|
||||
the multi-user Concurrent CP/M-86 3.1.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Since 1999-07, Lineo, Inc., Utah, USA, is the copyright owner of all
|
||||
original Digital Research CP/M operating system technology by way of
|
||||
Caldera Thin Clients, Inc. (since mid 1998), Caldera, Inc. (since
|
||||
1996-07), Novell, Inc. (since 1991-07) and Digital Research, Inc.
|
||||
|
||||
On 2001-10-19, Lineo's (then-times) Chairman and CEO Bryan Sparks
|
||||
issued a public CP/M distribution and usage license as detailed
|
||||
in the file LICENSE.TXT accompaning this distribution archive.
|
||||
|
||||
This historic issue of CP/M is expressively made available "AS IS"
|
||||
under the terms of this license, and without warranties or support
|
||||
of any kind. Use the files and information solely at your own risk.
|
||||
|
||||
However, while the meaning is pretty clear in "human language",
|
||||
the actual wording is in another sense so vague that I suggest you
|
||||
still better check with Lineo in case you plan to utilize this
|
||||
stuff for anything beyond the sole purpose of studying the CP/M
|
||||
and DOS history or personal non-commercial use.
|
||||
|
||||
(Disclaimer: I am no spokesperson of Lineo, and I have no direct
|
||||
affiliation with Lineo at the time of this writing.)
|
||||
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
According to the documentation on the disk, this issue of PCP/M-86
|
||||
supports one 96 tpi floppy disk drive and one hard disk drive (at
|
||||
least up to 85 Mb), apparently up to 512 Kb RAM, and up to three
|
||||
background processes.
|
||||
|
||||
It can read and write these floppy formats:
|
||||
|
||||
PG695 / PC16-11 : 80 track floppies formatted under CCP/M-86 version 2.0/3
|
||||
or CCP/M-86 version 3.1/1 or PCP/M-86 version 1.0/x
|
||||
|
||||
It can read, but not write these formats:
|
||||
|
||||
PG675 : 40 track floppies formatted under CP/M-86 version 1.1/2
|
||||
and PCP/M-86 version 1.0/x
|
||||
|
||||
IBM-PC XT : 40 track floppies formatted under CP/M-86 since
|
||||
version 1.1, CCP/M-86 all versions if written
|
||||
with single- or dual-sided CP/M formats.
|
||||
|
||||
I have no idea what kind of machine this "Siemens Simatic S5
|
||||
Programmierger„t PG685" was, but I assume it was some sort of
|
||||
programmable industrial control. It must have been small enough
|
||||
to be portable (whatever this means). The documentation mentions
|
||||
an optional external graphics monitor "BMG" in addition to
|
||||
the internal display. The video was capable of both, text
|
||||
and graphics mode and the documentation mentions GSX-86.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
All this information provided here was leaked from reading the READ.ME
|
||||
file on the floppy disk and some examination of the binaries.
|
||||
|
||||
Apparently there was a small German Siemens publication:
|
||||
|
||||
"Simatic S5 - Personal CP/M-86 Betriebssystem - Tabellenheft",
|
||||
93 pages, Order No. C79000-B8500-C352-01
|
||||
|
||||
And there was a comprehensive manual for Personal CP/M-86 as well,
|
||||
but I have no further info about it, unfortunately.
|
||||
|
||||
|
||||
File versions
|
||||
-------------
|
||||
|
||||
File name: File size: CRC: Date strings: Version strings:
|
||||
|
||||
BACK.CMD 15.232 EDBF 1983-11-16
|
||||
CCP.CMD 7.168 E06F 1983-11-11
|
||||
DATE.CMD 3.840 F1EC 1983-11-16
|
||||
DDT86.CMD 14.336 9DB9 1981 1.2
|
||||
DEVICE.CMD 19.840 FEF9 1983-11-16
|
||||
DIR.CMD 11.648 4984 1983-11-16
|
||||
DSKMAINT.CMD 31.104 91BC 1983-01-26,"09.10.1985" 2.3 for PG685 on
|
||||
PCP/M-86 1.0
|
||||
or CCP/M-86 3.1 with
|
||||
CCP/M-86 XIOS 3.1
|
||||
DUMP86.CMD 2.944 4EAF 1983-10-03 3.0,3.1
|
||||
ED.CMD 9.728 E763 1983-11-16
|
||||
ERASE.CMD 3.968 DC89 1983-11-16
|
||||
EXTERN.CMD 640 9BC7 N/A
|
||||
GENRSX.CMD 18.688 FD67 1983-10-04,1983-11-16
|
||||
GET.CMD 9.088 9E70 1983-11-16
|
||||
GETRSX.RSX 3.328 3A82 N/A
|
||||
HDPARK.CMD 3.328 257C N/A 1.0 for PG685
|
||||
HDPARTY.CMD 30.336 6713 1983-01-26 2.5/3 on PCP/M-86 1.0
|
||||
or CCP/M-86 3.1
|
||||
HELP.CMD 7.680 DBC2 1983-11-16 1.1
|
||||
HELP.HLP 54.016 4448 (1982-08-14)
|
||||
INITDIR.CMD 35.840 BEA9 N/A
|
||||
INTERN.CMD 640 1BC7 N/A
|
||||
PATCH86.CMD 3.328 0A90 1983-10-03 3.1
|
||||
PCPM.SYS 47.488 3166 1983-11-11,1983-11-16
|
||||
PIP.CMD 9.472 845E 1983-11-16,1983-09-02 3.1
|
||||
PUT.CMD 8.832 1E84 1983-11-16
|
||||
PUTRSX.RSX 3.584 8C7B N/A
|
||||
READ.ME 4.480 6ABF N/A
|
||||
RENAME.CMD 3.200 15D1 1983-11-16
|
||||
SET.CMD 9.344 737C 1982,1983-11-16
|
||||
SETDEF.CMD 5.120 D248 1983-11-16
|
||||
SHOW.CMD 8.704 AFDE 1983-11-16
|
||||
STOP.CMD 2.304 C8C4 1983-11-16
|
||||
SUBMIT.CMD 11.008 97A5 1983-11-16
|
||||
TYPE.CMD 4.096 35A4 1983-11-16
|
||||
|
||||
The CRC checksums were calculated with DR-DOS XDIR /C.
|
||||
|
||||
The date strings found in the binaries do not necessarily match with
|
||||
the file date stamps (which might be stored on the PCP/M-86 floppy image -
|
||||
I simply don't know, as Sydex 22DISK has no options to read them).
|
||||
|
||||
To avoid further confusion all dates were converted to the international
|
||||
date format as per ISO 8601 ("ccyy-mm-dd") unless it was not possible
|
||||
for me to track down the actual date due to the ambiguity between the
|
||||
US ("mmddccyy") and the (old) European date format ("ddmmccyy"), which
|
||||
were for sure both used on the floppy. The uncertain date is given in
|
||||
quotes. (Please note that both separators '/' and '.' are in use for
|
||||
both the US and the European format, only the ISO 8601 format makes
|
||||
the '-' mandantory in case a separator is used.)
|
||||
|
||||
|
||||
A little attempt in Personal CP/M-86 geneology
|
||||
----------------------------------------------
|
||||
|
||||
Within this file, PCP/M-86 and Personal CP/M-86 are used as synonyms,
|
||||
just like CCP/M-86 is used as an abbreviation to Concurrent CP/M-86.
|
||||
|
||||
This issue of PCP/M-86 1.0/5b contains these date stamps:
|
||||
|
||||
"01/26/83" -> 1983-01-26
|
||||
"09/02/83" -> 1983-09-02
|
||||
"031083" -> 1983-10-03
|
||||
"10/4/83" -> 1983-10-04
|
||||
"111183" -> 1983-11-11
|
||||
"11/16/83" and "161183" -> 1983-11-16
|
||||
"09.10.85" -> 1985-10-09? (probably in European format)
|
||||
|
||||
Most probably the date 1982-08-14 was also some special date in the
|
||||
CP/M-86 history since the HELP DATE text uses this date as an example.
|
||||
|
||||
Mentionings of a Digital Research product named CP/M-86 Plus can
|
||||
be found in Usenet discussions like news:comp.os.cpm and various
|
||||
private discussions, as well as in the literature, for example:
|
||||
|
||||
Herwig Feichtinger "Arbeitsbuch Mikrocomputer", 2nd edition, 1987,
|
||||
Franzis Verlag, ISBN 3-7723-8022-0 (presumably the first edition
|
||||
was published in 1986 or earlier):
|
||||
|
||||
On page 466 the author mentions that CP/M-86 would featurewise
|
||||
correspond with CP/M(-80) 2.2, while a newer CP/M(-80) 3.0 alias
|
||||
CP/M Plus existed for the 8080/8085/Z80 CPU family, but not for
|
||||
the x86 family. He states that while the book went to press
|
||||
(1st or 2nd edition?), Digital Research was working on a new
|
||||
product named CP/M-86 Plus which would overcome most of the
|
||||
limitations of a CP/M(-80) 2.2 style implementation, presumably
|
||||
raising the compatibility level to a 3.0 implementation (just
|
||||
like for the CP/M-80 series).
|
||||
|
||||
However, so far (2002) noone seems to have found an "offical"
|
||||
copy of CP/M-86 Plus, leading to the assumption that Personal
|
||||
CP/M-86 1.x and 2.x, which contain many "CP/M-86 Plus" strings
|
||||
in the binaries, either are in fact CP/M-86 Plus or at least
|
||||
a further derivation of it.
|
||||
|
||||
The author also mentions that Concurrent CP/M-86 (CCP/M) was
|
||||
developed out of CP/M-86 (not as I assumed the other way around),
|
||||
and that CCP/M-86 would support up to four processes (what a
|
||||
coincidence with Personal CP/M-86, which supports three background
|
||||
processes, while MP/M-86 supports many more!), but that these
|
||||
processes can be utilized by a single user as well as getting
|
||||
assigned to different users on up to four serial terminals (not
|
||||
possible with Personal CP/M-86). He further states that CCP/M-86
|
||||
supports multiple screen windows, and that the system files
|
||||
XIOS.SYS, CCP/M.SYS and BDOSPC.COM together would consume 140 Kb.
|
||||
Unfortunately he does not mention the exact CCP/M-86 version number
|
||||
he is talking about in his book.
|
||||
|
||||
Taking into account that Personal CP/M-86 1.0/5b DSKMAINT.CMD
|
||||
2.3 contains strings that it requires "Personal CP/M 1.0" or
|
||||
"Concurrent CP/M 3.1" and "Concurrent CP/M XIOS 3.1",
|
||||
Personal CP/M-86 1.x looks much like some kind of a single-user
|
||||
edition of Concurrent CP/M-86 3.1 to me... (If CP/M-86 Plus
|
||||
actually existed, it could have been a single user version
|
||||
of CCP/M-86 3.0 then, but this is only guesswork on my part.)
|
||||
|
||||
More interesting is that he states CCP/M-86 3.1 would be able
|
||||
to emulate MS-DOS and that it would automatically determine the
|
||||
floppy disk format (CP/M or DOS), and that CCP/M-86 3.1 would
|
||||
be 30% faster than MS-DOS 1.0 when writing to floppy disks,
|
||||
but that CCP/M-86 3.1 would only support the old MS-DOS 1.0
|
||||
8 sectors/track floppies, not the newer 9 sectors/track floppies
|
||||
introduced with MS-DOS 2.0+, and that support for sub-directories
|
||||
was still lacking as well.
|
||||
|
||||
Well, neither Personal CP/M-86 1.0/5b nor 2.1/1 do support
|
||||
any kind of DOS emulation, and I cannot make any statement
|
||||
in regard to CCP/M-86 3.1 (which I have never seen), but knowing
|
||||
that Digital Research's successor DOS Plus 1.2 (as, for example,
|
||||
found on the Amstrad PC1512 and - judging from its internal
|
||||
strings "CPCDOS 4.1" - corresponding with Concurrent PC-DOS 4.1)
|
||||
or DOS Plus 2.1 (as used on the Acorn BBC Master 512) do both
|
||||
come with a MS-DOS 2.11 emulation layer, there is some coincidence
|
||||
here as well.
|
||||
|
||||
The only contradiction is the version number 3.1 or 4.1;
|
||||
if CCP/M-86 3.1 already supported an early form of DOS emulation,
|
||||
than PCP/M-86 1.x is *less* than a single-user edition of CCP/M-86 3.1.
|
||||
On the other hand, it could well be, that, what Herwig Feichtinger
|
||||
still called CCP/M-86, was already marketted as Concurrent PC-DOS 3.1
|
||||
(I know that at least a Concurrent PC-DOS 3.2 existed), so there
|
||||
is sort of coincidence again... Another unverified little theory is
|
||||
that Concurrent CP/M-86 3.x and Concurrent PC-DOS 3.x were in fact
|
||||
two flavours of basically the same product, with the latter having
|
||||
added an (optional) DOS emulation layer. Does someone know for sure?
|
||||
|
||||
If you have corrections, additions, or can shed some better light on
|
||||
these earliest pre-decessors of the later single user DR DOS and
|
||||
Multiuser DOS families (with their latest representants at the time
|
||||
of this writing being Lineo DR-DOS 7.03 and OEM DR-DOS 7.05 and
|
||||
ITERA/IMS REAL/32 7.93 and ITERA/IMS REAL NG now), I would very
|
||||
much appreciate your feedback.
|
||||
|
||||
Thanks and Enjoy!
|
||||
|
||||
Matthias Paul <mpaul@drdos.org>
|
||||
|
||||
EOF
|
||||
|
@@ -0,0 +1,270 @@
|
||||
|
||||
Last edit: 2002-05-24 MPAUL
|
||||
|
||||
|
||||
Digital Research Personal CP/M-86 1.0/5b (1985)
|
||||
===============================================
|
||||
for
|
||||
===
|
||||
Siemens Simatic S5 / PG685
|
||||
==========================
|
||||
|
||||
|
||||
Summary
|
||||
-------
|
||||
|
||||
This archive represents a German issue of Digital Research's
|
||||
Personal CP/M-86 1.0/5b for the Siemens Simatic S5 programming
|
||||
device PG685.
|
||||
|
||||
This release of PCP/M-86 is dated 1985-10-09 (or 1985-09-10?),
|
||||
and contains Digital Research copyright strings going back to
|
||||
1981, 1982, and for the most part 1983.
|
||||
|
||||
Many of the .CMD files contain "CP/M-86 Plus" strings, leading
|
||||
to the assumption that Personal CP/M-86 1.x and 2.x represent
|
||||
nothing but this rumored product CP/M-86 Plus or that they are
|
||||
at least very close relatives, with Personal CP/M-86 being derived
|
||||
from CP/M-86 Plus. There are also hints that the single-user
|
||||
Personal CP/M-86 1.x and 2.x issues in some way correspond with
|
||||
the multi-user Concurrent CP/M-86 3.1.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Since 1999-07, Lineo, Inc., Utah, USA, is the copyright owner of all
|
||||
original Digital Research CP/M operating system technology by way of
|
||||
Caldera Thin Clients, Inc. (since mid 1998), Caldera, Inc. (since
|
||||
1996-07), Novell, Inc. (since 1991-07) and Digital Research, Inc.
|
||||
|
||||
On 2001-10-19, Lineo's (then-times) Chairman and CEO Bryan Sparks
|
||||
issued a public CP/M distribution and usage license as detailed
|
||||
in the file LICENSE.TXT accompaning this distribution archive.
|
||||
|
||||
This historic issue of CP/M is expressively made available "AS IS"
|
||||
under the terms of this license, and without warranties or support
|
||||
of any kind. Use the files and information solely at your own risk.
|
||||
|
||||
However, while the meaning is pretty clear in "human language",
|
||||
the actual wording is in another sense so vague that I suggest you
|
||||
still better check with Lineo in case you plan to utilize this
|
||||
stuff for anything beyond the sole purpose of studying the CP/M
|
||||
and DOS history or personal non-commercial use.
|
||||
|
||||
(Disclaimer: I am no spokesperson of Lineo, and I have no direct
|
||||
affiliation with Lineo at the time of this writing.)
|
||||
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
According to the documentation on the disk, this issue of PCP/M-86
|
||||
supports one 96 tpi floppy disk drive and one hard disk drive (at
|
||||
least up to 85 Mb), apparently up to 512 Kb RAM, and up to three
|
||||
background processes.
|
||||
|
||||
It can read and write these floppy formats:
|
||||
|
||||
PG695 / PC16-11 : 80 track floppies formatted under CCP/M-86 version 2.0/3
|
||||
or CCP/M-86 version 3.1/1 or PCP/M-86 version 1.0/x
|
||||
|
||||
It can read, but not write these formats:
|
||||
|
||||
PG675 : 40 track floppies formatted under CP/M-86 version 1.1/2
|
||||
and PCP/M-86 version 1.0/x
|
||||
|
||||
IBM-PC XT : 40 track floppies formatted under CP/M-86 since
|
||||
version 1.1, CCP/M-86 all versions if written
|
||||
with single- or dual-sided CP/M formats.
|
||||
|
||||
I have no idea what kind of machine this "Siemens Simatic S5
|
||||
Programmierger<65>t PG685" was, but I assume it was some sort of
|
||||
programmable industrial control. It must have been small enough
|
||||
to be portable (whatever this means). The documentation mentions
|
||||
an optional external graphics monitor "BMG" in addition to
|
||||
the internal display. The video was capable of both, text
|
||||
and graphics mode and the documentation mentions GSX-86.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
All this information provided here was leaked from reading the READ.ME
|
||||
file on the floppy disk and some examination of the binaries.
|
||||
|
||||
Apparently there was a small German Siemens publication:
|
||||
|
||||
"Simatic S5 - Personal CP/M-86 Betriebssystem - Tabellenheft",
|
||||
93 pages, Order No. C79000-B8500-C352-01
|
||||
|
||||
And there was a comprehensive manual for Personal CP/M-86 as well,
|
||||
but I have no further info about it, unfortunately.
|
||||
|
||||
|
||||
File versions
|
||||
-------------
|
||||
|
||||
File name: File size: CRC: Date strings: Version strings:
|
||||
|
||||
BACK.CMD 15.232 EDBF 1983-11-16
|
||||
CCP.CMD 7.168 E06F 1983-11-11
|
||||
DATE.CMD 3.840 F1EC 1983-11-16
|
||||
DDT86.CMD 14.336 9DB9 1981 1.2
|
||||
DEVICE.CMD 19.840 FEF9 1983-11-16
|
||||
DIR.CMD 11.648 4984 1983-11-16
|
||||
DSKMAINT.CMD 31.104 91BC 1983-01-26,"09.10.1985" 2.3 for PG685 on
|
||||
PCP/M-86 1.0
|
||||
or CCP/M-86 3.1 with
|
||||
CCP/M-86 XIOS 3.1
|
||||
DUMP86.CMD 2.944 4EAF 1983-10-03 3.0,3.1
|
||||
ED.CMD 9.728 E763 1983-11-16
|
||||
ERASE.CMD 3.968 DC89 1983-11-16
|
||||
EXTERN.CMD 640 9BC7 N/A
|
||||
GENRSX.CMD 18.688 FD67 1983-10-04,1983-11-16
|
||||
GET.CMD 9.088 9E70 1983-11-16
|
||||
GETRSX.RSX 3.328 3A82 N/A
|
||||
HDPARK.CMD 3.328 257C N/A 1.0 for PG685
|
||||
HDPARTY.CMD 30.336 6713 1983-01-26 2.5/3 on PCP/M-86 1.0
|
||||
or CCP/M-86 3.1
|
||||
HELP.CMD 7.680 DBC2 1983-11-16 1.1
|
||||
HELP.HLP 54.016 4448 (1982-08-14)
|
||||
INITDIR.CMD 35.840 BEA9 N/A
|
||||
INTERN.CMD 640 1BC7 N/A
|
||||
PATCH86.CMD 3.328 0A90 1983-10-03 3.1
|
||||
PCPM.SYS 47.488 3166 1983-11-11,1983-11-16
|
||||
PIP.CMD 9.472 845E 1983-11-16,1983-09-02 3.1
|
||||
PUT.CMD 8.832 1E84 1983-11-16
|
||||
PUTRSX.RSX 3.584 8C7B N/A
|
||||
READ.ME 4.480 6ABF N/A
|
||||
RENAME.CMD 3.200 15D1 1983-11-16
|
||||
SET.CMD 9.344 737C 1982,1983-11-16
|
||||
SETDEF.CMD 5.120 D248 1983-11-16
|
||||
SHOW.CMD 8.704 AFDE 1983-11-16
|
||||
STOP.CMD 2.304 C8C4 1983-11-16
|
||||
SUBMIT.CMD 11.008 97A5 1983-11-16
|
||||
TYPE.CMD 4.096 35A4 1983-11-16
|
||||
|
||||
The CRC checksums were calculated with DR-DOS XDIR /C.
|
||||
|
||||
The date strings found in the binaries do not necessarily match with
|
||||
the file date stamps (which might be stored on the PCP/M-86 floppy image -
|
||||
I simply don't know, as Sydex 22DISK has no options to read them).
|
||||
|
||||
To avoid further confusion all dates were converted to the international
|
||||
date format as per ISO 8601 ("ccyy-mm-dd") unless it was not possible
|
||||
for me to track down the actual date due to the ambiguity between the
|
||||
US ("mmddccyy") and the (old) European date format ("ddmmccyy"), which
|
||||
were for sure both used on the floppy. The uncertain date is given in
|
||||
quotes. (Please note that both separators '/' and '.' are in use for
|
||||
both the US and the European format, only the ISO 8601 format makes
|
||||
the '-' mandantory in case a separator is used.)
|
||||
|
||||
|
||||
A little attempt in Personal CP/M-86 geneology
|
||||
----------------------------------------------
|
||||
|
||||
Within this file, PCP/M-86 and Personal CP/M-86 are used as synonyms,
|
||||
just like CCP/M-86 is used as an abbreviation to Concurrent CP/M-86.
|
||||
|
||||
This issue of PCP/M-86 1.0/5b contains these date stamps:
|
||||
|
||||
"01/26/83" -> 1983-01-26
|
||||
"09/02/83" -> 1983-09-02
|
||||
"031083" -> 1983-10-03
|
||||
"10/4/83" -> 1983-10-04
|
||||
"111183" -> 1983-11-11
|
||||
"11/16/83" and "161183" -> 1983-11-16
|
||||
"09.10.85" -> 1985-10-09? (probably in European format)
|
||||
|
||||
Most probably the date 1982-08-14 was also some special date in the
|
||||
CP/M-86 history since the HELP DATE text uses this date as an example.
|
||||
|
||||
Mentionings of a Digital Research product named CP/M-86 Plus can
|
||||
be found in Usenet discussions like news:comp.os.cpm and various
|
||||
private discussions, as well as in the literature, for example:
|
||||
|
||||
Herwig Feichtinger "Arbeitsbuch Mikrocomputer", 2nd edition, 1987,
|
||||
Franzis Verlag, ISBN 3-7723-8022-0 (presumably the first edition
|
||||
was published in 1986 or earlier):
|
||||
|
||||
On page 466 the author mentions that CP/M-86 would featurewise
|
||||
correspond with CP/M(-80) 2.2, while a newer CP/M(-80) 3.0 alias
|
||||
CP/M Plus existed for the 8080/8085/Z80 CPU family, but not for
|
||||
the x86 family. He states that while the book went to press
|
||||
(1st or 2nd edition?), Digital Research was working on a new
|
||||
product named CP/M-86 Plus which would overcome most of the
|
||||
limitations of a CP/M(-80) 2.2 style implementation, presumably
|
||||
raising the compatibility level to a 3.0 implementation (just
|
||||
like for the CP/M-80 series).
|
||||
|
||||
However, so far (2002) noone seems to have found an "offical"
|
||||
copy of CP/M-86 Plus, leading to the assumption that Personal
|
||||
CP/M-86 1.x and 2.x, which contain many "CP/M-86 Plus" strings
|
||||
in the binaries, either are in fact CP/M-86 Plus or at least
|
||||
a further derivation of it.
|
||||
|
||||
The author also mentions that Concurrent CP/M-86 (CCP/M) was
|
||||
developed out of CP/M-86 (not as I assumed the other way around),
|
||||
and that CCP/M-86 would support up to four processes (what a
|
||||
coincidence with Personal CP/M-86, which supports three background
|
||||
processes, while MP/M-86 supports many more!), but that these
|
||||
processes can be utilized by a single user as well as getting
|
||||
assigned to different users on up to four serial terminals (not
|
||||
possible with Personal CP/M-86). He further states that CCP/M-86
|
||||
supports multiple screen windows, and that the system files
|
||||
XIOS.SYS, CCP/M.SYS and BDOSPC.COM together would consume 140 Kb.
|
||||
Unfortunately he does not mention the exact CCP/M-86 version number
|
||||
he is talking about in his book.
|
||||
|
||||
Taking into account that Personal CP/M-86 1.0/5b DSKMAINT.CMD
|
||||
2.3 contains strings that it requires "Personal CP/M 1.0" or
|
||||
"Concurrent CP/M 3.1" and "Concurrent CP/M XIOS 3.1",
|
||||
Personal CP/M-86 1.x looks much like some kind of a single-user
|
||||
edition of Concurrent CP/M-86 3.1 to me... (If CP/M-86 Plus
|
||||
actually existed, it could have been a single user version
|
||||
of CCP/M-86 3.0 then, but this is only guesswork on my part.)
|
||||
|
||||
More interesting is that he states CCP/M-86 3.1 would be able
|
||||
to emulate MS-DOS and that it would automatically determine the
|
||||
floppy disk format (CP/M or DOS), and that CCP/M-86 3.1 would
|
||||
be 30% faster than MS-DOS 1.0 when writing to floppy disks,
|
||||
but that CCP/M-86 3.1 would only support the old MS-DOS 1.0
|
||||
8 sectors/track floppies, not the newer 9 sectors/track floppies
|
||||
introduced with MS-DOS 2.0+, and that support for sub-directories
|
||||
was still lacking as well.
|
||||
|
||||
Well, neither Personal CP/M-86 1.0/5b nor 2.1/1 do support
|
||||
any kind of DOS emulation, and I cannot make any statement
|
||||
in regard to CCP/M-86 3.1 (which I have never seen), but knowing
|
||||
that Digital Research's successor DOS Plus 1.2 (as, for example,
|
||||
found on the Amstrad PC1512 and - judging from its internal
|
||||
strings "CPCDOS 4.1" - corresponding with Concurrent PC-DOS 4.1)
|
||||
or DOS Plus 2.1 (as used on the Acorn BBC Master 512) do both
|
||||
come with a MS-DOS 2.11 emulation layer, there is some coincidence
|
||||
here as well.
|
||||
|
||||
The only contradiction is the version number 3.1 or 4.1;
|
||||
if CCP/M-86 3.1 already supported an early form of DOS emulation,
|
||||
than PCP/M-86 1.x is *less* than a single-user edition of CCP/M-86 3.1.
|
||||
On the other hand, it could well be, that, what Herwig Feichtinger
|
||||
still called CCP/M-86, was already marketted as Concurrent PC-DOS 3.1
|
||||
(I know that at least a Concurrent PC-DOS 3.2 existed), so there
|
||||
is sort of coincidence again... Another unverified little theory is
|
||||
that Concurrent CP/M-86 3.x and Concurrent PC-DOS 3.x were in fact
|
||||
two flavours of basically the same product, with the latter having
|
||||
added an (optional) DOS emulation layer. Does someone know for sure?
|
||||
|
||||
If you have corrections, additions, or can shed some better light on
|
||||
these earliest pre-decessors of the later single user DR DOS and
|
||||
Multiuser DOS families (with their latest representants at the time
|
||||
of this writing being Lineo DR-DOS 7.03 and OEM DR-DOS 7.05 and
|
||||
ITERA/IMS REAL/32 7.93 and ITERA/IMS REAL NG now), I would very
|
||||
much appreciate your feedback.
|
||||
|
||||
Thanks and Enjoy!
|
||||
|
||||
Matthias Paul <mpaul@drdos.org>
|
||||
|
||||
EOF
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,274 @@
|
||||
HDPARK.LST Sourcer v7.00
|
||||
|
||||
|
||||
PAGE 59,132
|
||||
|
||||
;==========================================================================
|
||||
;== ==
|
||||
;== HDPARK ==
|
||||
;== ==
|
||||
;== Created: ==
|
||||
;== Code type: special ==
|
||||
;== Passes: 9 Analysis Options on: QRSUX ==
|
||||
;== ==
|
||||
;==========================================================================
|
||||
|
||||
target EQU 'T3' ; Target assembler: TASM-3.0
|
||||
|
||||
|
||||
; The following equates show data references outside the range of the program.
|
||||
|
||||
= 0028 data_1e equ 28h ;*(051B:0028=0)
|
||||
= 0F0A data_2e equ 0F0Ah ;*(051B:0F0A=0)
|
||||
= 004E data_3e equ 4Eh ;*(3ABA:004E=3B0Ah)
|
||||
|
||||
;------------------------------------------------------------ seg_a ----
|
||||
|
||||
seg_a segment byte public
|
||||
assume cs:seg_a , ds:seg_a
|
||||
|
||||
4044:0000 01 data_4 db 1 ; Data table (indexed access)
|
||||
4044:0001 19 00 00 00 19 00 db 19h, 00h, 00h, 00h, 19h, 00h
|
||||
4044:0007 00 00 02 AD 00 00 db 00h, 00h, 02h,0ADh, 00h, 00h
|
||||
4044:000D 00 AD 00 00 db 00h,0ADh, 00h, 00h
|
||||
4044:0011 006F[00] db 111 dup (0)
|
||||
4044:0080 8C D8 8E D0 BC CA db 8Ch,0D8h, 8Eh,0D0h,0BCh,0CAh
|
||||
4044:0086 0A B1 09 BA 1B 09 db 0Ah,0B1h, 09h,0BAh, 1Bh, 09h
|
||||
4044:008C CD E0 B1 0C CD E0 db 0CDh,0E0h,0B1h, 0Ch,0CDh,0E0h
|
||||
4044:0092 3D 31 10 72 17 3D db 3Dh, 31h, 10h, 72h, 17h, 3Dh
|
||||
4044:0098 41 10 77 12 2B C0 db 41h, 10h, 77h, 12h, 2Bh,0C0h
|
||||
4044:009E 8E C0 26 C4 1E 3C db 8Eh,0C0h, 26h,0C4h, 1Eh, 3Ch
|
||||
4044:00A4 01 26 8A 07 24 F0 db 01h, 26h, 8Ah, 07h, 24h,0F0h
|
||||
4044:00AA 3C 50 74 0D BA 90 db 3Ch, 50h, 74h, 0Dh,0BAh, 90h
|
||||
4044:00B0 09 B1 09 CD E0 33 db 09h,0B1h, 09h,0CDh,0E0h, 33h
|
||||
4044:00B6 D2 8B CA CD E0 E8 db 0D2h, 8Bh,0CAh,0CDh,0E0h,0E8h
|
||||
4044:00BC CB 00 E8 DC 00 3C db 0CBh, 00h,0E8h,0DCh, 00h, 3Ch
|
||||
4044:00C2 FF 74 0D B1 09 BA db 0FFh, 74h, 0Dh,0B1h, 09h,0BAh
|
||||
4044:00C8 C2 09 CD E0 33 C9 db 0C2h, 09h,0CDh,0E0h, 33h,0C9h
|
||||
4044:00CE 33 D2 CD E0 db 33h,0D2h,0CDh,0E0h
|
||||
4044:00D2 loc_1:
|
||||
4044:00D2 A1 0102 mov ax,word ptr ds:[102h] ; (4044:0102=51Bh)
|
||||
4044:00D5 8E C0 mov es,ax
|
||||
4044:00D7 26: 8B 1E 0F0A mov bx,es:data_2e ; (051B:0F0A=0)
|
||||
4044:00DC 83 FB 00 cmp bx,0
|
||||
4044:00DF 75 0D jne loc_2 ; Jump if not equal
|
||||
4044:00E1 BA 093F mov dx,93Fh
|
||||
4044:00E4 B1 09 mov cl,9
|
||||
4044:00E6 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:00E8 33 D2 xor dx,dx ; Zero register
|
||||
4044:00EA 8B CA mov cx,dx
|
||||
4044:00EC CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:00EE loc_2: ; xref 4044:00DF
|
||||
4044:00EE 26: 8B 47 21 mov ax,es:[bx+21h]
|
||||
4044:00F2 05 0001 add ax,1
|
||||
4044:00F5 A3 010C mov word ptr ds:[10Ch],ax ; (4044:010C=0Ah)
|
||||
4044:00F8 C7 06 010E 0000 mov word ptr ds:[10Eh],0 ; (4044:010E=6C6h)
|
||||
4044:00FE C7 06 0112 051B mov word ptr ds:[112h],51Bh ; (4044:0112=0C601h)
|
||||
4044:0104 8C 1E 0110 mov word ptr ds:[110h],ds ; (4044:0110=10Ah)
|
||||
4044:0108 C7 06 0114 000A mov word ptr ds:[114h],0Ah ; (4044:0114=0B06h)
|
||||
4044:010E C6 06 010A 01 mov byte ptr ds:[10Ah],1 ; (4044:010A=14h)
|
||||
4044:0113 C6 06 010B 01 mov byte ptr ds:[10Bh],1 ; (4044:010B=1)
|
||||
4044:0118 E8 00B3 call sub_3 ; (01CE)
|
||||
4044:011B loc_3: ; xref 4044:0186
|
||||
4044:011B ,B1 6D mov cl,6Dh ; 'm'
|
||||
4044:011D BA FFFF mov dx,0FFFFh
|
||||
4044:0120 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:0122 0D 0004 or ax,4
|
||||
4044:0125 8B D0 mov dx,ax
|
||||
4044:0127 B1 6D mov cl,6Dh ; 'm'
|
||||
4044:0129 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:012B B1 09 mov cl,9
|
||||
4044:012D BA 0A0A mov dx,0A0Ah
|
||||
4044:0130 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:0132 loc_4: ; xref 4044:013A
|
||||
4044:0132 B1 06 mov cl,6
|
||||
4044:0134 B2 FD mov dl,0FDh
|
||||
4044:0136 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:0138 3C 03 cmp al,3
|
||||
4044:013A 75 F6 jne loc_4 ; Jump if not equal
|
||||
4044:013C B1 09 mov cl,9
|
||||
4044:013E BA 093A mov dx,93Ah
|
||||
4044:0141 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:0143 B1 6D mov cl,6Dh ; 'm'
|
||||
4044:0145 BA FFFF mov dx,0FFFFh
|
||||
4044:0148 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:014A 25 FFFB and ax,0FFFBh
|
||||
4044:014D 8B D0 mov dx,ax
|
||||
4044:014F B1 6D mov cl,6Dh ; 'm'
|
||||
4044:0151 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:0153 C7 06 010C 0000 mov word ptr ds:[10Ch],0 ; (4044:010C=0Ah)
|
||||
4044:0159 C7 06 010E 0000 mov word ptr ds:[10Eh],0 ; (4044:010E=6C6h)
|
||||
4044:015F C7 06 0112 051B mov word ptr ds:[112h],51Bh ; (4044:0112=0C601h)
|
||||
4044:0165 8C 1E 0110 mov word ptr ds:[110h],ds ; (4044:0110=10Ah)
|
||||
4044:0169 C7 06 0114 000A mov word ptr ds:[114h],0Ah ; (4044:0114=0B06h)
|
||||
4044:016F C6 06 010A 01 mov byte ptr ds:[10Ah],1 ; (4044:010A=14h)
|
||||
4044:0174 C6 06 010B 01 mov byte ptr ds:[10Bh],1 ; (4044:010B=1)
|
||||
4044:0179 E8 0052 call sub_3 ; (01CE)
|
||||
4044:017C B1 0D mov cl,0Dh
|
||||
4044:017E CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:0180 33 D2 xor dx,dx ; Zero register
|
||||
4044:0182 8B CA mov cx,dx
|
||||
4044:0184 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:0186 E9 FF92 ;* jmp loc_3 ; (011B)
|
||||
4044:0186 db 0E9h, 92h,0FFh ; Fixup - byte match
|
||||
|
||||
;==========================================================================
|
||||
; SUBROUTINE
|
||||
;==========================================================================
|
||||
|
||||
4044:0189 sub_1 proc near
|
||||
4044:0189 1E push ds
|
||||
4044:018A 06 push es
|
||||
4044:018B B1 1F mov cl,1Fh
|
||||
4044:018D CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:018F 26: A1 004E mov ax,es:data_3e ; (3ABA:004E=3B0Ah)
|
||||
4044:0193 A3 0100 mov word ptr ds:[100h],ax ; (4044:0100=112h)
|
||||
4044:0196 8C 06 0102 mov word ptr ds:[102h],es ; (4044:0102=51Bh)
|
||||
4044:019A 07 pop es
|
||||
4044:019B 1F pop ds
|
||||
4044:019C C3 retn
|
||||
sub_1 endp
|
||||
|
||||
|
||||
;==========================================================================
|
||||
; SUBROUTINE
|
||||
;==========================================================================
|
||||
|
||||
4044:019D sub_2 proc near
|
||||
4044:019D 1E push ds
|
||||
4044:019E 06 push es
|
||||
4044:019F BA 0104 mov dx,104h
|
||||
4044:01A2 B1 3C mov cl,3Ch ; '<'
|
||||
4044:01A4 CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:01A6 07 pop es
|
||||
4044:01A7 1F pop ds
|
||||
4044:01A8 3D FFFF cmp ax,0FFFFh
|
||||
4044:01AB 75 1B jne loc_5 ; Jump if not equal
|
||||
4044:01AD 1E push ds
|
||||
4044:01AE 06 push es
|
||||
4044:01AF BB 0107 mov bx,107h
|
||||
4044:01B2 C6 07 89 mov byte ptr [bx],89h
|
||||
4044:01B5 C6 47 01 00 mov byte ptr [bx+1],0
|
||||
4044:01B9 8B D3 mov dx,bx
|
||||
4044:01BB B1 31 mov cl,31h ; '1'
|
||||
4044:01BD CD E0 int 0E0h ; ??INT Non-standard interrupt
|
||||
4044:01BF 07 pop es
|
||||
4044:01C0 1F pop ds
|
||||
4044:01C1 80 3E 0109 01 cmp byte ptr ds:[109h],1 ; (4044:0109=6)
|
||||
4044:01C6 74 03 je loc_6 ; Jump if equal
|
||||
4044:01C8 loc_5: ; xref 4044:01AB
|
||||
4044:01C8 B0 00 mov al,0
|
||||
4044:01CA C3 retn
|
||||
4044:01CB loc_6: ; xref 4044:01C6
|
||||
4044:01CB B0 FF mov al,0FFh
|
||||
4044:01CD C3 retn
|
||||
sub_2 endp
|
||||
|
||||
|
||||
;==========================================================================
|
||||
; SUBROUTINE
|
||||
;
|
||||
; Called from: 4044:0118, 0179
|
||||
;==========================================================================
|
||||
|
||||
4044:01CE sub_3 proc near
|
||||
4044:01CE 06 push es
|
||||
4044:01CF 1E push ds
|
||||
4044:01D0 8E 06 0100 mov es,word ptr ds:[100h] ; (4044:0100=112h)
|
||||
4044:01D4 8A 0E 010A mov cl,byte ptr ds:[10Ah] ; (4044:010A=14h)
|
||||
4044:01D8 8A 2E 010B mov ch,byte ptr ds:[10Bh] ; (4044:010B=1)
|
||||
4044:01DC 51 push cx
|
||||
4044:01DD 8B 0E 010C mov cx,word ptr ds:[10Ch] ; (4044:010C=0Ah)
|
||||
4044:01E1 51 push cx
|
||||
4044:01E2 8B 0E 010E mov cx,word ptr ds:[10Eh] ; (4044:010E=6C6h)
|
||||
4044:01E6 51 push cx
|
||||
4044:01E7 8B 0E 0110 mov cx,word ptr ds:[110h] ; (4044:0110=10Ah)
|
||||
4044:01EB 51 push cx
|
||||
4044:01EC 8B 0E 0112 mov cx,word ptr ds:[112h] ; (4044:0112=0C601h)
|
||||
4044:01F0 51 push cx
|
||||
4044:01F1 A1 0114 mov ax,word ptr ds:[114h] ; (4044:0114=0B06h)
|
||||
4044:01F4 8E 1E 0102 mov ds,word ptr ds:[102h] ; (4044:0102=51Bh)
|
||||
4044:01F8 FF 1E 0028 call dword ptr ds:data_1e ; (051B:0028=0)
|
||||
4044:01FC 83 C4 0A add sp,0Ah
|
||||
4044:01FF 1F pop ds
|
||||
4044:0200 07 pop es
|
||||
4044:0201 C3 retn
|
||||
sub_3 endp
|
||||
|
||||
4044:0202 0112[00] db 274 dup (0)
|
||||
4044:0314 96 00 FF db 96h, 00h,0FFh
|
||||
4044:0317 0814[00] db 2068 dup (0)
|
||||
4044:0B2B 0D 48 44 50 41 52 db 0Dh, 'HDPARK Utility V1.0', 0Dh, 0Ah
|
||||
4044:0B31 4B 20 55 74 69 6C
|
||||
4044:0B37 69 74 79 20 56 31
|
||||
4044:0B3D 2E 30 0D 0A
|
||||
4044:0B41 50 47 20 36 38 35 db 'PG 685', 0Dh, 0Ah, '$'
|
||||
4044:0B47 0D 0A 24
|
||||
4044:0B4A 5E 43 0D 0A 24 db '^C', 0Dh, 0Ah, '$'
|
||||
4044:0B4F 0D 0A 44 69 65 20 db 0Dh, 0Ah, 'Die Festplatte besitzt'
|
||||
4044:0B55 46 65 73 74 70 6C
|
||||
4044:0B5B 61 74 74 65 20 62
|
||||
4044:0B61 65 73 69 74 7A 74
|
||||
4044:0B67 20 6B 65 69 6E 65 db ' keine PCP/M-Partition oder ist '
|
||||
4044:0B6D 20 50 43 50 2F 4D
|
||||
4044:0B73 2D 50 61 72 74 69
|
||||
4044:0B79 74 69 6F 6E 20 6F
|
||||
4044:0B7F 64 65 72 20 69 73
|
||||
4044:0B85 74 20
|
||||
4044:0B87 6E 6F 63 68 20 6E db 'noch nicht formatiert.', 0Dh, 0Ah
|
||||
4044:0B8D 69 63 68 74 20 66
|
||||
4044:0B93 6F 72 6D 61 74 69
|
||||
4044:0B99 65 72 74 2E 0D 0A
|
||||
4044:0B9F 24 db '$'
|
||||
4044:0BA0 0D 0A 46 61 6C 73 db 0Dh, 0Ah, 'Falsches Betriebssyste'
|
||||
4044:0BA6 63 68 65 73 20 42
|
||||
4044:0BAC 65 74 72 69 65 62
|
||||
4044:0BB2 73 73 79 73 74 65
|
||||
4044:0BB8 6D 20 6F 64 65 72 db 'm oder falsches Geraet.', 0Dh, 0Ah
|
||||
4044:0BBE 20 66 61 6C 73 63
|
||||
4044:0BC4 68 65 73 20 47 65
|
||||
4044:0BCA 72 61 65 74 2E 0D
|
||||
4044:0BD0 0A
|
||||
4044:0BD1 24 db '$'
|
||||
4044:0BD2 0D 0A 48 44 50 41 db 0Dh, 0Ah, 'HDPARK kann nicht gest'
|
||||
4044:0BD8 52 4B 20 6B 61 6E
|
||||
4044:0BDE 6E 20 6E 69 63 68
|
||||
4044:0BE4 74 20 67 65 73 74
|
||||
4044:0BEA 61 72 74 65 74 20 db 'artet werden, solange andere Pro'
|
||||
4044:0BF0 77 65 72 64 65 6E
|
||||
4044:0BF6 2C 20 73 6F 6C 61
|
||||
4044:0BFC 6E 67 65 20 61 6E
|
||||
4044:0C02 64 65 72 65 20 50
|
||||
4044:0C08 72 6F
|
||||
4044:0C0A 7A 65 73 73 65 20 db 'zesse laufen.', 0Dh, 0Ah, '$'
|
||||
4044:0C10 6C 61 75 66 65 6E
|
||||
4044:0C16 2E 0D 0A 24
|
||||
4044:0C1A 0D 0A 46 65 73 74 db 0Dh, 0Ah, 'Festplatte in Transpor'
|
||||
4044:0C20 70 6C 61 74 74 65
|
||||
4044:0C26 20 69 6E 20 54 72
|
||||
4044:0C2C 61 6E 73 70 6F 72
|
||||
4044:0C32 74 70 6F 73 69 74 db 'tposition,', 0Dh, 0Ah, 'bitte Ge'
|
||||
4044:0C38 69 6F 6E 2C 0D 0A
|
||||
4044:0C3E 62 69 74 74 65 20
|
||||
4044:0C44 47 65
|
||||
4044:0C46 72 61 65 74 20 61 db 'raet ausschalten.', 0Dh, 0Ah, '$'
|
||||
4044:0C4C 75 73 73 63 68 61
|
||||
4044:0C52 6C 74 65 6E 2E 0D
|
||||
4044:0C58 0A 24
|
||||
4044:0C5A 00A6[00] db 166 dup (0)
|
||||
|
||||
seg_a ends
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
__________________ Interrupt Usage Synopsis __________________
|
||||
|
||||
14 Ocurrences of non-standard interrupts used (search for ??).
|
||||
|
||||
__________________ I/O Port Usage Synopsis __________________
|
||||
|
||||
No I/O ports used.
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,57 @@
|
||||
|
||||
DR-DOS XDIR /C /S
|
||||
|
||||
--A--- 2002-05-24 \PCPM86.211\FILE_ID.DIZ
|
||||
|
||||
--A--- 3.687 2002-05-24 02:11 \PCPM86.211\FILES.TXT
|
||||
--A--- 851 2002-05-24 02:11 C719 \PCPM86.211\LICENSE.TXT
|
||||
--A--- 13.069 2002-05-24 02:11 A413 \PCPM86.211\README.TXT
|
||||
|
||||
--A--- 15.232 2002-05-24 02:11 3DBB \PCPM86.211\BIN\BACK.CMD
|
||||
--A--- 7.168 2002-05-24 02:11 FB7C \PCPM86.211\BIN\CCP.CMD
|
||||
--A--- 3.840 2002-05-24 02:11 AEAF \PCPM86.211\BIN\DATE.CMD
|
||||
--A--- 14.336 2002-05-24 02:11 9DB9 \PCPM86.211\BIN\DDT86.CMD
|
||||
--A--- 13.312 2002-05-24 02:11 5A10 \PCPM86.211\BIN\DEVICE.CMD
|
||||
--A--- 11.648 2002-05-24 02:11 C723 \PCPM86.211\BIN\DIR.CMD
|
||||
--A--- 31.232 2002-05-24 02:11 6FA8 \PCPM86.211\BIN\DSKMAINT.CMD
|
||||
--A--- 2.944 2002-05-24 02:11 88E9 \PCPM86.211\BIN\DUMP86.CMD
|
||||
--A--- 9.728 2002-05-24 02:11 6313 \PCPM86.211\BIN\ED.CMD
|
||||
--A--- 3.968 2002-05-24 02:11 7598 \PCPM86.211\BIN\ERASE.CMD
|
||||
--A--- 640 2002-05-24 02:11 9BC7 \PCPM86.211\BIN\EXTERN.CMD
|
||||
--A--- 18.688 2002-05-24 02:11 92ED \PCPM86.211\BIN\GENRSX.CMD
|
||||
--A--- 9.088 2002-05-24 02:11 D771 \PCPM86.211\BIN\GET.CMD
|
||||
--A--- 3.328 2002-05-24 02:11 3A82 \PCPM86.211\BIN\GETRSX.RSX
|
||||
--A--- 3.328 2002-05-24 02:11 257C \PCPM86.211\BIN\HDPARK.CMD
|
||||
--A--- 31.232 2002-05-24 02:11 950A \PCPM86.211\BIN\HDPARTY.CMD
|
||||
--A--- 7.680 2002-05-24 02:11 BE7A \PCPM86.211\BIN\HELP.CMD
|
||||
--A--- 54.016 2002-05-24 02:11 4448 \PCPM86.211\BIN\HELP.HLP
|
||||
--A--- 35.840 2002-05-24 02:11 BEA9 \PCPM86.211\BIN\INITDIR.CMD
|
||||
--A--- 640 2002-05-24 02:11 1BC7 \PCPM86.211\BIN\INTERN.CMD
|
||||
--A--- 3.328 2002-05-24 02:11 C4CB \PCPM86.211\BIN\PATCH86.CMD
|
||||
--A--- 56.320 2002-05-24 02:11 FD85 \PCPM86.211\BIN\PCPM.SYS
|
||||
--A--- 9.472 2002-05-24 02:11 F147 \PCPM86.211\BIN\PIP.CMD
|
||||
--A--- 8.832 2002-05-24 02:11 9412 \PCPM86.211\BIN\PUT.CMD
|
||||
--A--- 3.584 2002-05-24 02:11 8C7B \PCPM86.211\BIN\PUTRSX.RSX
|
||||
--A--- 3.328 2002-05-24 02:11 D8A0 \PCPM86.211\BIN\READ.ME
|
||||
--A--- 3.200 2002-05-24 02:11 C645 \PCPM86.211\BIN\RENAME.CMD
|
||||
--A--- 9.344 2002-05-24 02:11 E6E3 \PCPM86.211\BIN\SET.CMD
|
||||
--A--- 5.120 2002-05-24 02:11 BD60 \PCPM86.211\BIN\SETDEF.CMD
|
||||
--A--- 8.704 2002-05-24 02:11 F1F5 \PCPM86.211\BIN\SHOW.CMD
|
||||
--A--- 2.304 2002-05-24 02:11 72F8 \PCPM86.211\BIN\STOP.CMD
|
||||
--A--- 11.008 2002-05-24 02:11 9EE2 \PCPM86.211\BIN\SUBMIT.CMD
|
||||
--A--- 28.416 2002-05-24 02:11 676D \PCPM86.211\BIN\SYSTRAN.CMD
|
||||
--A--- 4.096 2002-05-24 02:11 3775 \PCPM86.211\BIN\TYPE.CMD
|
||||
|
||||
--A--- 2.586 2002-05-24 02:11 5ABF \PCPM86.211\IMG\GETIMAGE.BAT
|
||||
--A--- 1.348 2002-05-24 02:11 E1EA \PCPM86.211\IMG\MAKEDISK.BAT
|
||||
--A--- 315.135 2002-05-24 02:11 500E \PCPM86.211\IMG\PCPM211.DSK
|
||||
--A--- 737.280 2002-05-24 02:11 13AC \PCPM86.211\IMG\PCPM211.IMG
|
||||
--A--- 1.101 2002-05-24 02:11 C299 \PCPM86.211\IMG\S5PG685.DEF
|
||||
|
||||
--A--- 451.853 2002-05-24 02:11 9E33 \PCPM86.211\SRC\DEVICE.A86
|
||||
--A--- 312.250 2002-05-24 02:11 82C2 \PCPM86.211\SRC\DSKMAINT.A86
|
||||
--A--- 550.903 2002-05-24 02:11 0B4D \PCPM86.211\SRC\HDPARTY.A86
|
||||
--A--- 1.822.926 2002-05-24 02:11 FC0C \PCPM86.211\SRC\PCPM.A86
|
||||
--A--- 475.730 2002-05-24 02:11 D037 \PCPM86.211\SRC\SYSTRAN.A86
|
||||
|
||||
|
@@ -0,0 +1,23 @@
|
||||
----------------------------------------
|
||||
Digital Research Personal CP/M-86 2.1/1
|
||||
(1987) for Siemens Simatic S5 / PG685
|
||||
----------------------------------------
|
||||
|
||||
This file PCPM211S.ZIP represents part 2
|
||||
of a distribution made up of 2 archives.
|
||||
|
||||
It contains the disassembled source code
|
||||
for some of the binaries in \SRC\.
|
||||
|
||||
The individual binaries in \BIN\ and the
|
||||
floppy disk image files in \IMG\ can be
|
||||
found in the accompaning part 1 in an
|
||||
archive named PCPM211B.ZIP.
|
||||
|
||||
See FILES.TXT for further details.
|
||||
|
||||
Read README.TXT/LICENSE.TXT before use.
|
||||
|
||||
Last edit: 2002-05-24
|
||||
----------------------------------------
|
||||
|
@@ -0,0 +1,26 @@
|
||||
|
||||
License agreement for the CP/M material presented on this site
|
||||
==============================================================
|
||||
|
||||
Subject: Re: Unofficial CP/M Website/licensing of CP/M material
|
||||
To: Gaby Chaudry <gaby@gaby.de>
|
||||
Date sent: Fri, 19 Oct 2001 10:36:31 -0600
|
||||
|
||||
|
||||
Let this email represent a right to use, distribute, modify, enhance and
|
||||
otherwise make available in a nonexclusive manner the CP/M technology as
|
||||
part of the "Unofficial CP/M Web Site" with its maintainers, developers and
|
||||
community.
|
||||
|
||||
I further state that as Chairman and CEO of Lineo, Inc. that I have the
|
||||
right to do offer such a license.
|
||||
|
||||
Lineo and its affiliates, partners and employees make no warranties of any
|
||||
kind with regards to this technology and its usefulness or lack thereof.
|
||||
|
||||
---
|
||||
Bryan Sparks
|
||||
CEO Lineo, Inc.
|
||||
http://www.lineo.com
|
||||
|
||||
|
@@ -0,0 +1,284 @@
|
||||
This archive represents a German issue of Digital Research's Personal CP/M-86 2.1/1 for the Siemens Simatic S5 programming device PG685. Sources are in Assembler, and have been disassembled with Sourcer v. 7.00. Please check out the [Binaries page](http://www.cpm.z80.de/binary.html) of this site for the binaries for both versions.
|
||||
|
||||
/README.TXT
|
||||
|
||||
Last edit: 2002-05-24 MPAUL
|
||||
|
||||
|
||||
Digital Research Personal CP/M-86 2.1/1 (1987)
|
||||
==============================================
|
||||
for
|
||||
===
|
||||
Siemens Simatic S5 / PG685
|
||||
==========================
|
||||
|
||||
|
||||
Summary
|
||||
-------
|
||||
|
||||
This archive represents a German issue of Digital Research's
|
||||
Personal CP/M-86 2.1/1 for the Siemens Simatic S5 programming
|
||||
device PG685.
|
||||
|
||||
This release of PCP/M-86 is dated 1987-01-11 (or 1987-11-01?),
|
||||
and contains Digital Research copyright strings going back to
|
||||
1981, 1982, 1983, 1985 and 1986.
|
||||
|
||||
Many of the .CMD files contain "CP/M-86 Plus" strings, leading
|
||||
to the assumption that Personal CP/M-86 1.x and 2.x represent
|
||||
nothing but this rumored product CP/M-86 Plus or that they are
|
||||
at least very close relatives, with Personal CP/M-86 being derived
|
||||
from CP/M-86 Plus. There are also hints that the single-user
|
||||
Personal CP/M-86 1.x and 2.x issues in some way correspond with
|
||||
the multi-user Concurrent CP/M-86 3.1.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Since 1999-07, Lineo, Inc., Utah, USA, is the copyright owner of all
|
||||
original Digital Research CP/M operating system technology by way of
|
||||
Caldera Thin Clients, Inc. (since mid 1998), Caldera, Inc. (since
|
||||
1996-07), Novell, Inc. (since 1991-07) and Digital Research, Inc.
|
||||
|
||||
On 2001-10-19, Lineo's (then-times) Chairman and CEO Bryan Sparks
|
||||
issued a public CP/M distribution and usage license as detailed
|
||||
in the file LICENSE.TXT accompaning this distribution archive.
|
||||
|
||||
This historic issue of CP/M is expressively made available "AS IS"
|
||||
under the terms of this license, and without warranties or support
|
||||
of any kind. Use the files and information solely at your own risk.
|
||||
|
||||
However, while the meaning is pretty clear in "human language",
|
||||
the actual wording is in another sense so vague that I suggest you
|
||||
still better check with Lineo in case you plan to utilize this
|
||||
stuff for anything beyond the sole purpose of studying the CP/M
|
||||
and DOS history or personal non-commercial use.
|
||||
|
||||
(Disclaimer: I am no spokesperson of Lineo, and I have no direct
|
||||
affiliation with Lineo at the time of this writing.)
|
||||
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
According to the documentation on the disk, this issue of PCP/M-86
|
||||
supports one 96 tpi floppy disk drive and one hard disk drive (at
|
||||
least up to 85 Mb), apparently up to 512 Kb RAM, and up to three
|
||||
background processes.
|
||||
|
||||
It can read and write these floppy formats:
|
||||
|
||||
PG695 / PC16-11 : 80 track floppies formatted under CCP/M-86 version 2.0/3
|
||||
or PCP/M-86.
|
||||
|
||||
PG675 : 40 track floppies formatted under CP/M-86 version 1.1/2
|
||||
and PCP/M-86.
|
||||
|
||||
PC16-20 : 40 and 80 track floppies formatted with PCP/M-86,
|
||||
CCP/M-86 and CDOS-86 if written with single- or
|
||||
dual-sides CP/M formats.
|
||||
|
||||
(The list has changed compared to the READ.ME found in the earlier
|
||||
PCP/M-86 1.0/5b issue, in particular there is no longer a mentioning
|
||||
of a PC-XT 40 track format, although I assume this is now covered by
|
||||
the new PC16-20 entry. Note, that the earlier PCP/M-86 1.0/5b did not
|
||||
came with a SYSTRAN.CMD CP/M <-> MS-DOS file transfer utility.)
|
||||
|
||||
I have no idea what kind of machine this "Siemens Simatic S5
|
||||
Programmierger<65>t PG685" was, but I assume it was some sort of
|
||||
programmable industrial control. It must have been small enough
|
||||
to be portable (whatever this means). The documentation mentions
|
||||
an optional external graphics monitor "BMG" in addition to the
|
||||
internal display, and an "upgrade kit". The video was capable of
|
||||
both, text and graphics mode and the documentation mentions GSX-86.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
All this information provided here was leaked from reading the READ.ME
|
||||
file on the floppy disk and some examination of the binaries.
|
||||
|
||||
Apparently there was a small German Siemens publication:
|
||||
|
||||
"Simatic S5 - Personal CP/M-86 Betriebssystem - Tabellenheft",
|
||||
93 pages, Order No. C79000-B8500-C352-01
|
||||
|
||||
And there was a comprehensive manual for Personal CP/M-86 as well,
|
||||
but I have no further info about it, unfortunately.
|
||||
|
||||
|
||||
File versions
|
||||
-------------
|
||||
|
||||
File name: File size: CRC: Date strings: Version strings:
|
||||
|
||||
BACK.CMD 15.232 3DBB 1983-11-16
|
||||
CCP.CMD 7.168 FB7C 1983-11-11
|
||||
DATE.CMD 3.840 AEAF 1983-11-16
|
||||
DDT86.CMD 14.336 9DB9* 1981 1.2
|
||||
DEVICE.CMD 13.312! 5A10 1983-11-16
|
||||
DIR.CMD 11.648 C723 1983-11-16
|
||||
DSKMAINT.CMD 31.232! 6FA8 1983-01-26 3.0 for PG685 on PCP/M-86 1.0
|
||||
or 2.0, or CCP/M-86 3.1
|
||||
with CCP/M-86 XIOS 3.1
|
||||
DUMP86.CMD 2.944 88E9 1983-10-03 3.0,3.1
|
||||
ED.CMD 9.728 6313 1983-11-16
|
||||
ERASE.CMD 3.968 7598 1983-11-16
|
||||
EXTERN.CMD 640 9BC7* N/A
|
||||
GENRSX.CMD 18.688 92ED 1983-10-04,1983-11-16
|
||||
GET.CMD 9.088 D771 1983-11-16
|
||||
GETRSX.RSX 3.328 3A82 N/A
|
||||
HDPARK.CMD 3.328 257C* N/A 1.0 for PG685
|
||||
HDPARTY.CMD 31.232! 950A 1983-01-26 2.5/4c on PCP/M-86 1.0 or
|
||||
CCP/M-86 3.1
|
||||
HELP.CMD 7.680 BE7A 1983-11-16 1.1
|
||||
HELP.HLP 54.016 4448* (1982-08-14)
|
||||
INITDIR.CMD 35.840 BEA9* N/A
|
||||
INTERN.CMD 640 1BC7* N/A
|
||||
PATCH86.CMD 3.328 C4CB 1983-10-03 3.1
|
||||
PCPM.SYS 56.320! FD85 1983-11-11,1985,"08-05-1986"
|
||||
PIP.CMD 9.472 F147 1983-11-16,1983-09-02 3.1
|
||||
PUT.CMD 8.832 9412 1983-11-16
|
||||
PUTRSX.RSX 3.584 8C7B N/A
|
||||
READ.ME 3.328! D8A0 N/A
|
||||
RENAME.CMD 3.200 C645 1983-11-16
|
||||
SET.CMD 9.344 E6E3 1982,1983-11-16
|
||||
SETDEF.CMD 5.120 BD60 1983-11-16
|
||||
SHOW.CMD 8.704 F1F5 1983-11-16
|
||||
STOP.CMD 2.304 72F8 1983-11-16
|
||||
SUBMIT.CMD 11.008 9EE2 1983-11-16
|
||||
SYSTRAN.CMD 28.416 676D N/A 1.10 on PCP/M-86, CCP/M 2.0, or
|
||||
CCP/M-86 3.1 with XIOS 3.1
|
||||
TYPE.CMD 4.096 3775 1983-11-16
|
||||
|
||||
The CRC checksums were calculated with DR-DOS XDIR /C.
|
||||
|
||||
Those files marked with * are binary identical to the files found in
|
||||
earlier PCP/M-86 1.0/5b, many other files also have the same file sizes
|
||||
but different checksums, most probably because of different serial numbers.
|
||||
Only those files marked with ! have changed in file size compared to 1.0/5b.
|
||||
|
||||
The date strings found in the binaries do not necessarily match with
|
||||
the file date stamps (which might be stored on the PCP/M-86 floppy image -
|
||||
I simply don't know, as Sydex 22DISK has no options to read them).
|
||||
|
||||
To avoid further confusion all dates were converted to the international
|
||||
date format as per ISO 8601 ("ccyy-mm-dd") unless it was not possible
|
||||
for me to track down the actual date due to the ambiguity between the
|
||||
US ("mmddccyy") and the (old) European date format ("ddmmccyy"), which
|
||||
were for sure both used on the floppy. These two uncertain dates are
|
||||
given in quotes. (Please note that all three possible separators '/',
|
||||
'.', and '-' are in use for both the US and the European format, only
|
||||
the ISO 8601 format makes the '-' mandantory in case a separator is used.)
|
||||
|
||||
|
||||
A little attempt in Personal CP/M-86 geneology
|
||||
----------------------------------------------
|
||||
|
||||
Within this file, PCP/M-86 and Personal CP/M-86 are used as synonyms,
|
||||
just like CCP/M-86 is used as an abbreviation to Concurrent CP/M-86.
|
||||
|
||||
This issue of PCP/M-86 2.1/1 contains these date stamps:
|
||||
|
||||
"01/26/83" -> 1983-01-26
|
||||
"09/02/83" -> 1983-09-02
|
||||
"031083" -> 1983-10-03
|
||||
"10/4/83" -> 1983-10-04
|
||||
"111183" -> 1983-11-11
|
||||
"161183" -> 1983-11-16
|
||||
"08-05-86" -> 1986 (either in US or European format)
|
||||
"11.01.87" -> 1987-01-11? (most probably in European format)
|
||||
|
||||
Most probably the date 1982-08-14 was also some special date in the
|
||||
CP/M-86 history since the HELP DATE text uses this date as an example.
|
||||
|
||||
Mentionings of a Digital Research product named CP/M-86 Plus can
|
||||
be found in Usenet discussions like news:comp.os.cpm and various
|
||||
private discussions, as well as in the literature, for example:
|
||||
|
||||
Herwig Feichtinger "Arbeitsbuch Mikrocomputer", 2nd edition, 1987,
|
||||
Franzis Verlag, ISBN 3-7723-8022-0 (presumably the first edition
|
||||
was published in 1986 or earlier):
|
||||
|
||||
On page 466 the author mentions that CP/M-86 would featurewise
|
||||
correspond with CP/M(-80) 2.2, while a newer CP/M(-80) 3.0 alias
|
||||
CP/M Plus existed for the 8080/8085/Z80 CPU family, but not for
|
||||
the x86 family. He states that while the book went to press
|
||||
(1st or 2nd edition?), Digital Research was working on a new
|
||||
product named CP/M-86 Plus which would overcome most of the
|
||||
limitations of a CP/M(-80) 2.2 style implementation, presumably
|
||||
raising the compatibility level to a 3.0 implementation (just
|
||||
like for the CP/M-80 series).
|
||||
|
||||
However, so far (2002) noone seems to have found an "offical"
|
||||
copy of CP/M-86 Plus, leading to the assumption that Personal
|
||||
CP/M-86 1.x and 2.x, which contain many "CP/M-86 Plus" strings
|
||||
in the binaries, either are in fact CP/M-86 Plus or at least
|
||||
a further derivation of it.
|
||||
|
||||
The author also mentions that Concurrent CP/M-86 (CCP/M) was
|
||||
developed out of CP/M-86 (not as I assumed the other way around),
|
||||
and that CCP/M-86 would support up to four processes (what a
|
||||
coincidence with Personal CP/M-86, which supports three background
|
||||
processes, while MP/M-86 supports many more!), but that these
|
||||
processes can be utilized by a single user as well as getting
|
||||
assigned to different users on up to four serial terminals (not
|
||||
possible with Personal CP/M-86). He further states that CCP/M-86
|
||||
supports multiple screen windows, and that the system files
|
||||
XIOS.SYS, CCP/M.SYS and BDOSPC.COM together would consume 140 Kb.
|
||||
Unfortunately he does not mention the exact CCP/M-86 version number
|
||||
he is talking about in his book.
|
||||
|
||||
Taking into account that Personal CP/M-86 1.0/5b DSKMAINT.CMD
|
||||
2.3 contains strings that it requires "Personal CP/M 1.0" or
|
||||
"Concurrent CP/M 3.1" and "Concurrent CP/M XIOS 3.1",
|
||||
Personal CP/M-86 1.x looks much like some kind of a single-user
|
||||
edition of Concurrent CP/M-86 3.1 to me... (If CP/M-86 Plus
|
||||
actually existed, it could have been a single user version
|
||||
of CCP/M-86 3.0 then, but this is only guesswork on my part.)
|
||||
|
||||
More interesting is that he states CCP/M-86 3.1 would be able
|
||||
to emulate MS-DOS and that it would automatically determine the
|
||||
floppy disk format (CP/M or DOS), and that CCP/M-86 3.1 would
|
||||
be 30% faster than MS-DOS 1.0 when writing to floppy disks,
|
||||
but that CCP/M-86 3.1 would only support the old MS-DOS 1.0
|
||||
8 sectors/track floppies, not the newer 9 sectors/track floppies
|
||||
introduced with MS-DOS 2.0+, and that support for sub-directories
|
||||
was still lacking as well.
|
||||
|
||||
Well, neither Personal CP/M-86 1.0/5b nor 2.1/1 do support
|
||||
any kind of DOS emulation, and I cannot make any statement
|
||||
in regard to CCP/M-86 3.1 (which I have never seen), but knowing
|
||||
that Digital Research's successor DOS Plus 1.2 (as, for example,
|
||||
found on the Amstrad PC1512 and - judging from its internal
|
||||
strings "CPCDOS 4.1" - corresponding with Concurrent PC-DOS 4.1)
|
||||
or DOS Plus 2.1 (as used on the Acorn BBC Master 512) do both
|
||||
come with a MS-DOS 2.11 emulation layer, there is some coincidence
|
||||
here as well.
|
||||
|
||||
The only contradiction is the version number 3.1 or 4.1;
|
||||
if CCP/M-86 3.1 already supported an early form of DOS emulation,
|
||||
than PCP/M-86 1.x is *less* than a single-user edition of CCP/M-86 3.1.
|
||||
On the other hand, it could well be, that, what Herwig Feichtinger
|
||||
still called CCP/M-86, was already marketted as Concurrent PC-DOS 3.1
|
||||
(I know that at least a Concurrent PC-DOS 3.2 existed), so there
|
||||
is sort of coincidence again... Another unverified little theory is
|
||||
that Concurrent CP/M-86 3.x and Concurrent PC-DOS 3.x were in fact
|
||||
two flavours of basically the same product, with the latter having
|
||||
added an (optional) DOS emulation layer. Does someone know for sure?
|
||||
|
||||
If you have corrections, additions, or can shed some better light on
|
||||
these earliest pre-decessors of the later single user DR DOS and
|
||||
Multiuser DOS families (with their latest representants at the time
|
||||
of this writing being Lineo DR-DOS 7.03 and OEM DR-DOS 7.05 and
|
||||
ITERA/IMS REAL/32 7.93 and ITERA/IMS REAL NG now), I would very
|
||||
much appreciate your feedback.
|
||||
|
||||
Thanks and Enjoy!
|
||||
|
||||
Matthias Paul <mpaul@drdos.org>
|
||||
|
||||
EOF
|
||||
|
@@ -0,0 +1,281 @@
|
||||
|
||||
Last edit: 2002-05-24 MPAUL
|
||||
|
||||
|
||||
Digital Research Personal CP/M-86 2.1/1 (1987)
|
||||
==============================================
|
||||
for
|
||||
===
|
||||
Siemens Simatic S5 / PG685
|
||||
==========================
|
||||
|
||||
|
||||
Summary
|
||||
-------
|
||||
|
||||
This archive represents a German issue of Digital Research's
|
||||
Personal CP/M-86 2.1/1 for the Siemens Simatic S5 programming
|
||||
device PG685.
|
||||
|
||||
This release of PCP/M-86 is dated 1987-01-11 (or 1987-11-01?),
|
||||
and contains Digital Research copyright strings going back to
|
||||
1981, 1982, 1983, 1985 and 1986.
|
||||
|
||||
Many of the .CMD files contain "CP/M-86 Plus" strings, leading
|
||||
to the assumption that Personal CP/M-86 1.x and 2.x represent
|
||||
nothing but this rumored product CP/M-86 Plus or that they are
|
||||
at least very close relatives, with Personal CP/M-86 being derived
|
||||
from CP/M-86 Plus. There are also hints that the single-user
|
||||
Personal CP/M-86 1.x and 2.x issues in some way correspond with
|
||||
the multi-user Concurrent CP/M-86 3.1.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Since 1999-07, Lineo, Inc., Utah, USA, is the copyright owner of all
|
||||
original Digital Research CP/M operating system technology by way of
|
||||
Caldera Thin Clients, Inc. (since mid 1998), Caldera, Inc. (since
|
||||
1996-07), Novell, Inc. (since 1991-07) and Digital Research, Inc.
|
||||
|
||||
On 2001-10-19, Lineo's (then-times) Chairman and CEO Bryan Sparks
|
||||
issued a public CP/M distribution and usage license as detailed
|
||||
in the file LICENSE.TXT accompaning this distribution archive.
|
||||
|
||||
This historic issue of CP/M is expressively made available "AS IS"
|
||||
under the terms of this license, and without warranties or support
|
||||
of any kind. Use the files and information solely at your own risk.
|
||||
|
||||
However, while the meaning is pretty clear in "human language",
|
||||
the actual wording is in another sense so vague that I suggest you
|
||||
still better check with Lineo in case you plan to utilize this
|
||||
stuff for anything beyond the sole purpose of studying the CP/M
|
||||
and DOS history or personal non-commercial use.
|
||||
|
||||
(Disclaimer: I am no spokesperson of Lineo, and I have no direct
|
||||
affiliation with Lineo at the time of this writing.)
|
||||
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
According to the documentation on the disk, this issue of PCP/M-86
|
||||
supports one 96 tpi floppy disk drive and one hard disk drive (at
|
||||
least up to 85 Mb), apparently up to 512 Kb RAM, and up to three
|
||||
background processes.
|
||||
|
||||
It can read and write these floppy formats:
|
||||
|
||||
PG695 / PC16-11 : 80 track floppies formatted under CCP/M-86 version 2.0/3
|
||||
or PCP/M-86.
|
||||
|
||||
PG675 : 40 track floppies formatted under CP/M-86 version 1.1/2
|
||||
and PCP/M-86.
|
||||
|
||||
PC16-20 : 40 and 80 track floppies formatted with PCP/M-86,
|
||||
CCP/M-86 and CDOS-86 if written with single- or
|
||||
dual-sides CP/M formats.
|
||||
|
||||
(The list has changed compared to the READ.ME found in the earlier
|
||||
PCP/M-86 1.0/5b issue, in particular there is no longer a mentioning
|
||||
of a PC-XT 40 track format, although I assume this is now covered by
|
||||
the new PC16-20 entry. Note, that the earlier PCP/M-86 1.0/5b did not
|
||||
came with a SYSTRAN.CMD CP/M <-> MS-DOS file transfer utility.)
|
||||
|
||||
I have no idea what kind of machine this "Siemens Simatic S5
|
||||
Programmierger<65>t PG685" was, but I assume it was some sort of
|
||||
programmable industrial control. It must have been small enough
|
||||
to be portable (whatever this means). The documentation mentions
|
||||
an optional external graphics monitor "BMG" in addition to the
|
||||
internal display, and an "upgrade kit". The video was capable of
|
||||
both, text and graphics mode and the documentation mentions GSX-86.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
All this information provided here was leaked from reading the READ.ME
|
||||
file on the floppy disk and some examination of the binaries.
|
||||
|
||||
Apparently there was a small German Siemens publication:
|
||||
|
||||
"Simatic S5 - Personal CP/M-86 Betriebssystem - Tabellenheft",
|
||||
93 pages, Order No. C79000-B8500-C352-01
|
||||
|
||||
And there was a comprehensive manual for Personal CP/M-86 as well,
|
||||
but I have no further info about it, unfortunately.
|
||||
|
||||
|
||||
File versions
|
||||
-------------
|
||||
|
||||
File name: File size: CRC: Date strings: Version strings:
|
||||
|
||||
BACK.CMD 15.232 3DBB 1983-11-16
|
||||
CCP.CMD 7.168 FB7C 1983-11-11
|
||||
DATE.CMD 3.840 AEAF 1983-11-16
|
||||
DDT86.CMD 14.336 9DB9* 1981 1.2
|
||||
DEVICE.CMD 13.312! 5A10 1983-11-16
|
||||
DIR.CMD 11.648 C723 1983-11-16
|
||||
DSKMAINT.CMD 31.232! 6FA8 1983-01-26 3.0 for PG685 on PCP/M-86 1.0
|
||||
or 2.0, or CCP/M-86 3.1
|
||||
with CCP/M-86 XIOS 3.1
|
||||
DUMP86.CMD 2.944 88E9 1983-10-03 3.0,3.1
|
||||
ED.CMD 9.728 6313 1983-11-16
|
||||
ERASE.CMD 3.968 7598 1983-11-16
|
||||
EXTERN.CMD 640 9BC7* N/A
|
||||
GENRSX.CMD 18.688 92ED 1983-10-04,1983-11-16
|
||||
GET.CMD 9.088 D771 1983-11-16
|
||||
GETRSX.RSX 3.328 3A82 N/A
|
||||
HDPARK.CMD 3.328 257C* N/A 1.0 for PG685
|
||||
HDPARTY.CMD 31.232! 950A 1983-01-26 2.5/4c on PCP/M-86 1.0 or
|
||||
CCP/M-86 3.1
|
||||
HELP.CMD 7.680 BE7A 1983-11-16 1.1
|
||||
HELP.HLP 54.016 4448* (1982-08-14)
|
||||
INITDIR.CMD 35.840 BEA9* N/A
|
||||
INTERN.CMD 640 1BC7* N/A
|
||||
PATCH86.CMD 3.328 C4CB 1983-10-03 3.1
|
||||
PCPM.SYS 56.320! FD85 1983-11-11,1985,"08-05-1986"
|
||||
PIP.CMD 9.472 F147 1983-11-16,1983-09-02 3.1
|
||||
PUT.CMD 8.832 9412 1983-11-16
|
||||
PUTRSX.RSX 3.584 8C7B N/A
|
||||
READ.ME 3.328! D8A0 N/A
|
||||
RENAME.CMD 3.200 C645 1983-11-16
|
||||
SET.CMD 9.344 E6E3 1982,1983-11-16
|
||||
SETDEF.CMD 5.120 BD60 1983-11-16
|
||||
SHOW.CMD 8.704 F1F5 1983-11-16
|
||||
STOP.CMD 2.304 72F8 1983-11-16
|
||||
SUBMIT.CMD 11.008 9EE2 1983-11-16
|
||||
SYSTRAN.CMD 28.416 676D N/A 1.10 on PCP/M-86, CCP/M 2.0, or
|
||||
CCP/M-86 3.1 with XIOS 3.1
|
||||
TYPE.CMD 4.096 3775 1983-11-16
|
||||
|
||||
The CRC checksums were calculated with DR-DOS XDIR /C.
|
||||
|
||||
Those files marked with * are binary identical to the files found in
|
||||
earlier PCP/M-86 1.0/5b, many other files also have the same file sizes
|
||||
but different checksums, most probably because of different serial numbers.
|
||||
Only those files marked with ! have changed in file size compared to 1.0/5b.
|
||||
|
||||
The date strings found in the binaries do not necessarily match with
|
||||
the file date stamps (which might be stored on the PCP/M-86 floppy image -
|
||||
I simply don't know, as Sydex 22DISK has no options to read them).
|
||||
|
||||
To avoid further confusion all dates were converted to the international
|
||||
date format as per ISO 8601 ("ccyy-mm-dd") unless it was not possible
|
||||
for me to track down the actual date due to the ambiguity between the
|
||||
US ("mmddccyy") and the (old) European date format ("ddmmccyy"), which
|
||||
were for sure both used on the floppy. These two uncertain dates are
|
||||
given in quotes. (Please note that all three possible separators '/',
|
||||
'.', and '-' are in use for both the US and the European format, only
|
||||
the ISO 8601 format makes the '-' mandantory in case a separator is used.)
|
||||
|
||||
|
||||
A little attempt in Personal CP/M-86 geneology
|
||||
----------------------------------------------
|
||||
|
||||
Within this file, PCP/M-86 and Personal CP/M-86 are used as synonyms,
|
||||
just like CCP/M-86 is used as an abbreviation to Concurrent CP/M-86.
|
||||
|
||||
This issue of PCP/M-86 2.1/1 contains these date stamps:
|
||||
|
||||
"01/26/83" -> 1983-01-26
|
||||
"09/02/83" -> 1983-09-02
|
||||
"031083" -> 1983-10-03
|
||||
"10/4/83" -> 1983-10-04
|
||||
"111183" -> 1983-11-11
|
||||
"161183" -> 1983-11-16
|
||||
"08-05-86" -> 1986 (either in US or European format)
|
||||
"11.01.87" -> 1987-01-11? (most probably in European format)
|
||||
|
||||
Most probably the date 1982-08-14 was also some special date in the
|
||||
CP/M-86 history since the HELP DATE text uses this date as an example.
|
||||
|
||||
Mentionings of a Digital Research product named CP/M-86 Plus can
|
||||
be found in Usenet discussions like news:comp.os.cpm and various
|
||||
private discussions, as well as in the literature, for example:
|
||||
|
||||
Herwig Feichtinger "Arbeitsbuch Mikrocomputer", 2nd edition, 1987,
|
||||
Franzis Verlag, ISBN 3-7723-8022-0 (presumably the first edition
|
||||
was published in 1986 or earlier):
|
||||
|
||||
On page 466 the author mentions that CP/M-86 would featurewise
|
||||
correspond with CP/M(-80) 2.2, while a newer CP/M(-80) 3.0 alias
|
||||
CP/M Plus existed for the 8080/8085/Z80 CPU family, but not for
|
||||
the x86 family. He states that while the book went to press
|
||||
(1st or 2nd edition?), Digital Research was working on a new
|
||||
product named CP/M-86 Plus which would overcome most of the
|
||||
limitations of a CP/M(-80) 2.2 style implementation, presumably
|
||||
raising the compatibility level to a 3.0 implementation (just
|
||||
like for the CP/M-80 series).
|
||||
|
||||
However, so far (2002) noone seems to have found an "offical"
|
||||
copy of CP/M-86 Plus, leading to the assumption that Personal
|
||||
CP/M-86 1.x and 2.x, which contain many "CP/M-86 Plus" strings
|
||||
in the binaries, either are in fact CP/M-86 Plus or at least
|
||||
a further derivation of it.
|
||||
|
||||
The author also mentions that Concurrent CP/M-86 (CCP/M) was
|
||||
developed out of CP/M-86 (not as I assumed the other way around),
|
||||
and that CCP/M-86 would support up to four processes (what a
|
||||
coincidence with Personal CP/M-86, which supports three background
|
||||
processes, while MP/M-86 supports many more!), but that these
|
||||
processes can be utilized by a single user as well as getting
|
||||
assigned to different users on up to four serial terminals (not
|
||||
possible with Personal CP/M-86). He further states that CCP/M-86
|
||||
supports multiple screen windows, and that the system files
|
||||
XIOS.SYS, CCP/M.SYS and BDOSPC.COM together would consume 140 Kb.
|
||||
Unfortunately he does not mention the exact CCP/M-86 version number
|
||||
he is talking about in his book.
|
||||
|
||||
Taking into account that Personal CP/M-86 1.0/5b DSKMAINT.CMD
|
||||
2.3 contains strings that it requires "Personal CP/M 1.0" or
|
||||
"Concurrent CP/M 3.1" and "Concurrent CP/M XIOS 3.1",
|
||||
Personal CP/M-86 1.x looks much like some kind of a single-user
|
||||
edition of Concurrent CP/M-86 3.1 to me... (If CP/M-86 Plus
|
||||
actually existed, it could have been a single user version
|
||||
of CCP/M-86 3.0 then, but this is only guesswork on my part.)
|
||||
|
||||
More interesting is that he states CCP/M-86 3.1 would be able
|
||||
to emulate MS-DOS and that it would automatically determine the
|
||||
floppy disk format (CP/M or DOS), and that CCP/M-86 3.1 would
|
||||
be 30% faster than MS-DOS 1.0 when writing to floppy disks,
|
||||
but that CCP/M-86 3.1 would only support the old MS-DOS 1.0
|
||||
8 sectors/track floppies, not the newer 9 sectors/track floppies
|
||||
introduced with MS-DOS 2.0+, and that support for sub-directories
|
||||
was still lacking as well.
|
||||
|
||||
Well, neither Personal CP/M-86 1.0/5b nor 2.1/1 do support
|
||||
any kind of DOS emulation, and I cannot make any statement
|
||||
in regard to CCP/M-86 3.1 (which I have never seen), but knowing
|
||||
that Digital Research's successor DOS Plus 1.2 (as, for example,
|
||||
found on the Amstrad PC1512 and - judging from its internal
|
||||
strings "CPCDOS 4.1" - corresponding with Concurrent PC-DOS 4.1)
|
||||
or DOS Plus 2.1 (as used on the Acorn BBC Master 512) do both
|
||||
come with a MS-DOS 2.11 emulation layer, there is some coincidence
|
||||
here as well.
|
||||
|
||||
The only contradiction is the version number 3.1 or 4.1;
|
||||
if CCP/M-86 3.1 already supported an early form of DOS emulation,
|
||||
than PCP/M-86 1.x is *less* than a single-user edition of CCP/M-86 3.1.
|
||||
On the other hand, it could well be, that, what Herwig Feichtinger
|
||||
still called CCP/M-86, was already marketted as Concurrent PC-DOS 3.1
|
||||
(I know that at least a Concurrent PC-DOS 3.2 existed), so there
|
||||
is sort of coincidence again... Another unverified little theory is
|
||||
that Concurrent CP/M-86 3.x and Concurrent PC-DOS 3.x were in fact
|
||||
two flavours of basically the same product, with the latter having
|
||||
added an (optional) DOS emulation layer. Does someone know for sure?
|
||||
|
||||
If you have corrections, additions, or can shed some better light on
|
||||
these earliest pre-decessors of the later single user DR DOS and
|
||||
Multiuser DOS families (with their latest representants at the time
|
||||
of this writing being Lineo DR-DOS 7.03 and OEM DR-DOS 7.05 and
|
||||
ITERA/IMS REAL/32 7.93 and ITERA/IMS REAL NG now), I would very
|
||||
much appreciate your feedback.
|
||||
|
||||
Thanks and Enjoy!
|
||||
|
||||
Matthias Paul <mpaul@drdos.org>
|
||||
|
||||
EOF
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user