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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
*************************************************************************
* *
* INTERFACE MODULE BETWEEN *
* CCP and THE BDOS *
* *
* *
* THIS IS THE DUAL PROCESSOR,ROMABLE CP/M-68K SYSTEM *
* ================================================== *
* *
* (C) Copyright Digital Research 1983 all rights reserved *
* *
*************************************************************************
.globl _bdos
_bdos: move.w 4(sp),d0
move.l 6(sp),d1
trap #2
rts

View File

@@ -0,0 +1,158 @@
/*--------------------------------------------------------------*\
| ccp_def.c DEFINES v1.0 |
| ======= |
| |
| CP/M 68k: A CP/M derived operating system |
| |
| File contents: |
| ------------- |
| This file contains all of the #defines |
| used by the console command processor. |
| |
| created by : Tom Saulpaugh Date: 7/13/82 |
| ---------- |
| last modified: 10/29/82 |
| ------------- |
| |
| (c) COPYRIGHT Digital Research 1982 |
| all rights reserved |
| |
\*--------------------------------------------------------------*/
/*-------------------------------------------*\
| CP/M Transient Commands |
\*-------------------------------------------*/
#define DIRCMD 0
#define TYPECMD 1
#define RENCMD 2
#define ERACMD 3
#define UCMD 4
#define CH_DISK 5
#define SUBCMD 6
#define SUB_FILE 7
#define FILE 8
#define DIRSCMD 9
#define SEARCH 10
/*-------------------------------------------*\
| Modes and Flags |
\*-------------------------------------------*/
#define ON 1
#define OFF 0
#define MATCH 0
#define GOOD 1
#define BAD 0
#define FILL 1
#define NOFILL 0
#define VOID /*no return value*/
#define NO_FILE 98
#define STOP 99
#define USER_ZERO 0
#define DISK_A 1
#define SOURCEDRIVE 88
#define DESTDRIVE 99
#define BYTE char
#define REG register
#define WORD signed short
#define UWORD unsigned int
#define LONG signed long
#define ULONG unsigned long
#define GET_MEM_REG 18
#define ZERO 0
#define NULL '\0'
#define TRUE 1
#define FALSE 0
#define NO_READ 255
#define BLANK ' '
#define BACKSLH '\\'
#define EXLIMPT '!'
#define CMASK 0177
#define ONE (long)49
#define TAB 9
#define Cr 13
#define Lf 10
#define CR (long)13
#define LF (long)10
#define EOF 26
#define BLANKS (long)32
#define PERIOD (long)46
#define COLON (long)58
#define ARROW (long)62
/*-------------------------------------------*\
| Data Structure Size Constants |
\*-------------------------------------------*/
#define CMD_LEN 128
#define BIG_CMD_LEN 255
#define MAX_ARGS 4
#define ARG_LEN 26
#define NO_OF_DRIVES 16
#define NUMDELS 16
#define FCB_LEN 36
#define DMA_LEN 128
#define FILES_PER_LINE 5
#define SCR_HEIGHT 23
#define BIG_WIDTH 80
#define SMALL_WIDTH 40
/*-------------------------------------------*\
| BDOS Function Calls |
\*-------------------------------------------*/
#define WARMBOOT 0
#define CONIN 1
#define CONSOLE_OUTPUT 2
#define READER_INPUT 3
#define PUNCH_OUTPUT 4
#define LIST_OUTPUT 5
#define DIR_CONS_I/O 6
#define GET_I/O_BYTE 7
#define SET_I/O_BYTE 8
#define PRINT_STRING 9
#define READ_CONS_BUF 10
#define GET_CONS_STAT 11
#define RET_VERSION_NO 12
#define RESET_DISK_SYS 13
#define SELECT_DISK 14
#define OPEN_FILE 15
#define CLOSE_FILE 16
#define SEARCH_FIRST 17
#define SEARCH_NEXT 18
#define DELETE_FILE 19
#define READ_SEQ 20
#define WRITE_SEQ 21
#define MAKE_FILE 22
#define RENAME_FILE 23
#define RET_LOGIN_VEC 24
#define RET_CUR_DISK 25
#define SET_DMA_ADDR 26
#define GET_ADDR(ALLOC) 27
#define WRITE_PROT_DISK 28
#define GET_READ/O_VEC 29
#define SET_FILE_ATTRIB 30
#define GET_ADDR_D_PARM 31
#define GET_USER_NO 32
#define READ_RANDOM 33
#define WRITE_RANDOM 34
#define COMP_FILE-SIZE 35
#define SET_RANDOM_REC 36
#define RESET_DRIVE 37
#define WRITE_RAN_ZERO 40
#define BIOS_CALL 50
#define LOAD_PROGRAM 59
/*----------------------------------------------*\
| MACROS |
\*----------------------------------------------*/
#define isalpha(c) (islower(c) || isupper(c))
#define islower(c) ('a' <= (c) && (c) <= 'z')
#define isupper(c) ('A' <= (c) && (c) <= 'Z')
#define tolower(c) (isupper(c) ? ((c)+040):(c))
#define toupper(c) (islower(c) ? ((c)-040):(c))
#define isdigit(c) ('0' <= (c) && (c) <= '9')

View File

@@ -0,0 +1,113 @@
*************************************************************************
* *
* CPM68K INTERFACE MODULE FOR *
* THE CONSOLE COMMAND PROCESSOR *
* *
* THIS IS THE DUAL-PROCESSOR,ROMABLE CP/M-68K SYSTEM *
* ================================================== *
* *
* (C) Copyright Digital Research 1983 all rights reserved *
* *
*************************************************************************
.globl _bios1
.globl _bdos
.globl _load68k
.globl _load_tbl
.globl init_tbl
.globl _load_try
.globl _autorom
.globl flags
.globl TPAB
.globl stack
.globl _bdosini
.globl _main
.globl _submit
.globl _morecmds
.globl _autost
.globl _usercmd
.globl _init
.globl _ccp
.globl _patch
.globl cpm
.text
cpm:
jmp.l ccpstart * start ccp with possible initial command
jmp.l ccpclear * clear auto start flag
.bss
_autost: .ds.b 1 * autostart command flag
_usercmd: .ds.b 130 * user command buffer
.text
copy: .dc.b 'COPYRIGHT (C) 1982, Digital Research '
.text
ccpclear:
clr.b _autost * clear the autostart flag
ccpstart:
lea stack,sp * set up the stack pointer
clr.b _autost * clear the auto start flag
jsr _init * call bios init
move.w d0,dskuser * save user # & disk
*
*
* ROM SYSTEM INITIALIZATION
* OF BSS VARIABLES
*
*
clr.b _load_try
clr.b _submit
clr.b _morecmds
move.b #$1,_autorom
clr.w flags
clr.w TPAB
jsr init_tbl
jsr _bdosini * do bdos init
move.w #32,d0 * get user bdos func #
clr.l d1 * clear out d1
move.b dskuser,d1 * get the user #
trap #2 * set the user number
clr.l d0 * clear d0
move.w #14,d0 * select function
clr.l d1 * clear d1
move.w dskuser,d1 * get disk to be selected
andi #$0ff,d1 * mask off the user #
trap #2 * select the disk
_ccp:
lea stack,sp * set up the stack pointer
jsr _main * call the CCP
bra _ccp
.bss
.even
dskuser: .ds.w 1
.even
_submit: .ds.b 1
.even
_morecmds: .ds.b 1
.even
_patch .ds.l 25
.end

View File

@@ -0,0 +1,188 @@
*****************************************************************
* *
* COMMAND FILE LOADER FOR CPM68K *
* ============================== *
* *
* (c) COPYRIGHT Digital Research 1983 *
* all rights reserved *
* *
* THIS IS THE DUAL PROCESSOR,ROMABLE CP/M-68K SYSTEM *
* ================================================== *
* *
* Description: *
* ----------- The command file loader is envoked by *
* the CCP after the CCP has successfully *
* opened that file. The loader must *
* call the BDOS to obtain the boundries *
* of the TPA. The load parameter block *
* defined in this loader holds all the *
* memory size and location details. *
* Next the loader returns the system to *
* its original user #. The CCP might *
* have switched to user zero during its *
* search for the file. Next the default *
* dma address is set for the loaded *
* program. Next the command tail is *
* placed,along with the first two parsed *
* fcb's,into the user basepage. *
* Lastly the user stack pointer is set up *
* and the return address is put on the *
* user stack. An RTE transferes control. *
* If a load was not successfull, the *
* appropriate error message is printed. *
* *
* Created by: Tom Saulpaugh *
* *
* Last Modified: 3/02/83 *
* *
*****************************************************************
.globl _load68k * make this procedure public
.globl _user * global user # before load occured
.globl _cmdfcb * parsed fcb
.globl _tail * global pointer to command tail
.globl _fill_fcb * procedure to fill fcb's
.globl flags * ROM SYSTEM INITIALIZATION
.globl TPAB * ROM SYSTEM INITIALIZATION
reboot = 0
printstr = 9
setdma = 26
chuser = 32
pgmldf = 59
gettpa = 63
_load68k:
*
* Load the 68k file into the TPA
* ------------------------------
*
.text
move.l #TPAB,d1 * move in address of tpa parameter block
move.w #gettpa,d0 * get function number
trap #2 * get the tpa limits
move.l low,lowadr * put it in the lpb
move.l high,hiadr * put high tpa addr in lpb
move.l #_cmdfcb,LPB * get address of opened fcb
move.l #pgmldf,d0 * move in bdos function no
move.l #LPB,d1 * d1 points to load block
trap #2 * do the program load
tst d0 * was the load successful?
bne lderr * if not print error message and return
*
* return to original user #
* -------------------------
move.w _user,d1 * put user # to switch to in d1
move.l #chuser,d0 * put bdos func # in d0
trap #2 * do the user # change
*
* set the default dma address
* ---------------------------
clr.l d1 * clear d1 register
move.l baspag,d1 * d1 points to user base page
add #$80,d1 * d1 points to default dma in base page
movea.l d1,a1 * save it for later use
move #setdma,d0 * move in bdos function no
trap #2 * set the default dma address
*
* move in the command tail
* ------------------------
move.l a1,a2 * save a pointer to the count field
add.l #$01,a1 * point past count field
move.l _tail,a0 * point to command tail
clr.l d0 * clear out d0
mvtail: cmpi.b #$00,(a0) * check for a NULL ending byte
beq done * NULL byte terminates command
cmpi.b #$21,(a0) * check for an '!'
beq done * '!' ends the command
move.b (a0)+,(a1)+ * move a byte of the command tail
addq #1,d0 * bump up the character count
bra mvtail * continue byte move
done: move.b d0,(a2) * put in the character count
move.b #$00,(a1) * terminate cmd tail with a NULL byte
*
* fill fcb1 & fcb2
* ----------------
move.l #_cmdfcb,-(sp) * put address of fcb buffer onto stack
move.w #1,-(sp) * put 1 on stack(parm1)
jsr _fill_fcb * jump to 'C' code & fill cmdfcb with parm1
add.l #6,sp * clean off the stack
clr.l d0 * clear register d0
moveq #$5c,d0 * put basepage address of fcb1 in d0
bsr movfcb * put fcb1 in the basepage
move.l #_cmdfcb,-(sp) * put address of fcb buffer onto stack
move.w #2,-(sp) * put 2 on stack(parm2)
jsr _fill_fcb * jump to 'C' code & fill cmdfcb with parm2
add.l #6,sp * clean off the stack
clr.l d0 * clear register d0
moveq #$38,d0 * put basepage address of fcb1 in d0
bsr movfcb * put fcb2 in the basepage
*
* now push rte stuff on stack
* ---------------------------
movea.l usrstk,a0 * get user stack pointer
move.l baspag,a1 * get basepage address
move.l 8(a1),-(sp) * push address we want to jump to
move sr,d0 * get the status register in d0
andi #$5f00,d0 * mask trace,system bits,user flags
move.w d0,-(sp) * push it on stack
move.l a1,-(a0) * push addr of basepage onto user stack
move.l #cmdrtn,-(a0) * push return address onto user stack
move.l a0,usp * set up user stack pointer
rte
*
* load error
* ----------
lderr:
rts * return with error code in d0
cmdrtn:
move #reboot,d0 * reboot CPM
trap #2
movfcb:
add.l baspag,d0 * get offset into basepage
move.l d0,a0 * move address into a0
move.l #_cmdfcb,a1 * a1 points to fcb to be moved
clr.l d0 * clear register d0
moveq #35,d0 * get length of fcb
mov1:
move.b (a1)+,(a0)+ * move a byte into the basepage
dbf d0,mov1 * if not done branch to mov1
rts
.bss
.even
*
* LOAD PARAMETER BLOCK
*
LPB: .ds.l 1
lowadr: .ds.l 1
hiadr: .ds.l 1
baspag: .ds.l 1
usrstk: .ds.l 1
flags: .ds.w 1
*
* TPA Parameter Block
*
.even
TPAB: .ds.w 1
low: .ds.l 1
high: .ds.l 1
.end

View File

@@ -0,0 +1,106 @@
*
* CP/M-68K table driven file search module
* ========================================
*
* GLOBALS
.globl _load_tbl * loader table
.globl _load68k * default load program
.globl init_tbl * initializes table on COLD BOOT
.text
*************************************************************************
* *
* This is the DUAL PROCESSOR,ROMABLE version of CP/M-68K *
* ====================================================== *
* *
* (c) Copyright Digital Research 1983 *
* all rights reserved *
* *
*************************************************************************
*
* The following code allows CP/M-68K to be ROM-able.
* -------------------------------------------------
*
init_tbl:
move.l #typ1,typ1p
move.l #typ2,typ2p * init the pointers to the filetypes
move.l #typ3,typ3p
move.l #null,typ4p
move.l #_load68k,pgld1
move.l #_load68k,pgld2 * init the pointers to the loaders
move.l #_load68k,pgld3
move.l #_load68k,pgld4
rts
.bss
.even
*************************************************************************
* *
* CP/M-68K LOADER TABLE *
* ===================== *
* *
*-----------------------------------------------------------------------*
* *
* STRUCTURE OF A LOADER TABLE ENTRY: *
* ================================= *
* *
* (1) LONG WORD pointer to a filetype *
* (2) LONG WORD address of the program loader for the above type *
* (3) BYTE flag #1 *
* (4) BYTE flag #2 *
* *
*************************************************************************
_load_tbl:
typ1p: .ds.l 1
pgld1: .ds.l 1
.ds.b 1
.ds.b 1
typ2p: .ds.l 1
pgld2: .ds.l 1
.ds.b 1
.ds.b 1
typ3p: .ds.l 1
pgld3: .ds.l 1
.ds.b 1
.ds.b 1
typ4p: .ds.l 1
pgld4: .ds.l 1
.ds.b 1
.ds.b 1
*****************************************
* *
* FILETYPE TABLE *
* ============== *
* *
*****************************************
.data
.even
typ1: .dc.b '68K',0
.even
typ2: .dc.b ' ',0
.even
typ3: .dc.b 'SUB',0
.even
null: .dc.l 0
.end

View File

@@ -0,0 +1,21 @@
$ num
CCP.C
CCP.lis
$ num
CCPBDOS.S
CCPBDOS.lis
$ num
CCPDEF.H
CCPDEF.lst
$ num
CCPIF.S
CCPIF.lis
$ num
CCPLOAD.S
CCPLOAD.lis
$ num
FILETYPS.S
FILETYPS.lis
$ num
STACK.S
STACK.lis

View File

@@ -0,0 +1,14 @@
Directory DRB0:[STEVE.CPM68K.CCP]
CCP.C;65
CCPBDOS.S;14
CCPDEF.H;1
CCPIF.S;175
CCPLOAD.S;9
FILETYPS.S;12
LIST.COM;1
SEND.COM;2
STACK.S;2
Total of 9 files.

View File

@@ -0,0 +1,10 @@
$ set noon
$ vsend CCP.C
$ vsend CCPBDOS.S
$ vsend CCPDEF.H
$ vsend CCPIF.S
$ vsend CCPLOAD.S
$ vsend FILETYPS.S
$ vsend SEND.COM
$ vsend STACK.S
$ vsend done

View File

@@ -0,0 +1,15 @@
*************************************************************************
* *
* THIS IS THE SYSTEM STACK AREA *
* *
* *
* THIS IS THE DUAL PROCESSOR,ROMABLE CP/M-68K SYSTEM *
* ================================================== *
*************************************************************************
.globl stack
.bss
.ds.l 300
stack:
.ds.w 1
.end