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

View File

@@ -0,0 +1,94 @@
.text
*
* Global Code addresses
*
.globl _init
.globl _biosinit
.globl _flush
.globl _wboot
.globl _cbios
.globl _dskia
.globl _dskic
.globl _setimask
.globl _ccp
.globl cpm * Lowest addr of CP/M
.globl _end * Highest addr of CP/M
*
* Global data addresses
*
.globl _memtab * memory region table
.globl _dpb3 * RAM disk dpb address
.globl _memdsk * -> First memory disk location
*
* Vector Addresses
*
dskint: .equ $3fc * UDC Interrupt vector
trap3: .equ $8c * Trap 3 vector
buserr: .equ $8 * Bus error vector
*
*
_init: lea entry,a0
move.l a0,trap3
lea _dskia,a0
move.l a0,dskint
*
* Auto-Size TPA
*
lea _memtab,a0 * a0 -> Memory region table
move.w #1,(a0)+ * 1 region
move.l #$400,(a0)+ * TPA starts at 400
move.l #cpm-$408,(a0)+ * Ends where CP/M begins
*
* Auto-Size RAM disk
*
move.l buserr,-(sp) * Push bus err vector
lea _end,a0 * a0 -> Last location in CP/M
add.l #cpm,a0 * Linker doesn't reloc this!!
move.l a0,_memdsk * -> first location in RAM disk
move.l #quit,buserr * set up vector -> ourselves
loop:
tst.w (a0)+ * Find
bra loop * End of memory
quit:
add.l #14,a7 * Clear buserr gorp
move.l (a7)+,buserr * Pop buserr vector
sub.l #_end,a0 * a0 = # bytes in RAM disk
sub.l #cpm,a0 * Relocation bug
move.l a0,d0 * Into D reg for shift
move.l #11,d1 * Load shift count
lsr.l d1,d0 * Divide by 2048
move.w d0,_dpb3+6 * Load DRM field of dpb
move #$2000,sr
jsr _biosinit
clr.l d0
rts
*
_wboot: clr.l d0
jmp _ccp
*
entry: move.l d2,-(a7)
move.l d1,-(a7)
move.w d0,-(a7)
jsr _cbios
add #10,a7
rte
*
_dskia: link a6,#0
movem.l d0-d7/a0-a5,-(a7)
jsr _dskic
movem.l (a7)+,d0-d7/a0-a5
unlk a6
rte
*
_setimask: move sr,d0
lsr #8,d0
and.l #7,d0
move sr,d1
ror.w #8,d1
and.w #$fff8,d1
add.w 4(a7),d1
ror.w #8,d1
move d1,sr
rts
.end

View File

@@ -0,0 +1,3 @@
#define LOADER 0
#define CTLTYPE 0
#define MEMDSK 4

View File

@@ -0,0 +1,23 @@
/************************************************/
/* */
/* Portable type definitions for use */
/* with the C BIOS according to */
/* CP/M-68K (tm) standard usage. */
/* */
/************************************************/
#define LONG long
#define ULONG unsigned long
#define WORD short int
#define UWORD unsigned short
#define BYTE char
#define UBYTE unsigned char
#define VOID
#define REG register
#define LOCAL auto
#define MLOCAL static
#define GLOBAL extern
#define EXTERN extern
/************************************************/

View File

@@ -0,0 +1,59 @@
***************************************
* Information to go on the 256 byte *
* boot sector of an ExorMacs *
***************************************
.text
.dc.l $4000 * starting stack pointer
.dc.l start * starting program counter
.dc.w 1 * garbage
.dc.w 1 * length of SAT
.dc.l 2 * secondary directory start
.dc.l 0 * primary directory PSN list start
.dc.l 0 * start of boot loader
.dc.w 26 * length of boot loader
.dc.l $0 * boot execution address
.dc.l $0 * boot load address
.dc.b '9/30' * generation date
.dc.b 'CP/M-68K of 9/30/82 ' * volume descriptor
.dc.b '0020' * version/revision
.dc.w $0a484 * checksum (god help us)
.dc.l $0f1e2d3c * diagnostic test pattern
.dc.l $4b5a6978
.dc.l $8796a5b4
.dc.l $c3d2e1f0
.dc.l $0f1e2d3c * diagnostic test pattern
.dc.l $4b5a6978
.dc.l $8796a5b4
.dc.l $c3d2e1f0
.dc.l $4f8f0f07 * diagnostic test pattern
.dc.l $0b0d0e06
.dc.l $0a0c0408
.dc.l $04020100
.dc.l 00, 00, 00, 00 * diagnostic test pattern
.dc.l 0 * diagnostic test area directory
.dc.l 0 * start of dump area
.dc.w 0 * length of dump area
.dc.l 0 * start of sector lockout table
.dc.w 0 * length of sector lockout table
.dc.l 0,0,0,0,0,0,0 * unused, reserved
.dc.l 0,0,0,0,0,0
.dc.l 0,0,0,0,0,0,0
.dc.l 0,0,0,0,0,0
.dc.b 'EXORMACS' * let's hear it for Motorola
*
* end of volume id
*
* begin boot info proper
*
.ds.b $300 * skip over exception vectors
.even
start: move #$2700,sr
move.l #$8,a0
move.w #253,d0
exlp: move.l #expdef,(a0)+
dbf d0,exlp
jmp grunt
expdef: rte
grunt: move #$2000,sr
.end

View File

@@ -0,0 +1,168 @@
_submit 4EA2 global bss
_morecmd 4EA4 global bss
_autost 4E1C global bss
_usercmd 4E1D global bss
_ccp A4 global text
_patch 4EA6 global bss
cpm 0 global text
_bdos B2 global text
_load68k BE global text
flags 4F1E global bss
TPAB 4F20 global bss
_cmd_tbl 4922 global data
_msg 4952 global data
_msg2 496C global data
_msg3 497E global data
_msg4 4990 global data
_msg5 49A2 global data
_msg6 49B8 global data
_msg7 49C2 global data
_msg8 49DA global data
_msg9 49F8 global data
_msg10 4A08 global data
_msg11 4A1A global data
_msg12 4A30 global data
_msg13 4A48 global data
_lderr1 4A5E global data
_lderr2 4A86 global data
_lderr3 4AA2 global data
_lderror 4AC4 global data
_del 4AD8 global data
_cr_lf 1AC global text
_cpy 1D8 global text
_strcmp 1F8 global text
_copy_cm 240 global text
_prompt 28C global text
_echo_cm 334 global text
_decode 3A4 global text
_fill_fc 7B6 global text
_delim 73A global text
_check_c 4EA global text
_get_cmd 56C global text
_scan_cm 64C global text
_get_par 68A global text
_true_ch 77E global text
_too_man 9DA global text
_find_co A12 global text
_chk_col A4A global text
_dir_cmd A9A global text
_type_cm CA6 global text
_ren_cmd DD8 global text
_era_cmd 1124 global text
_user_cm 1272 global text
_cmd_fil 133E global text
_sub_rea 1858 global text
_dollar 1886 global text
_comment 19CC global text
_transla 1AB0 global text
_submit_ 1C72 global text
_execute 1D8C global text
_main 1EDE global text
_bios1 2124 global text
_bios2 2120 global text
_bios3 211A global text
_bios4 2114 global text
_bios5 210E global text
_bios6 2124 global text
_traphnd 20D6 global text
_swap 2134 global text
_udiv 2140 global text
_constat 2156 global text
_conbrk 2176 global text
_conout 220A global text
_tabout 2278 global text
_cookdou 22B4 global text
_getch 22F6 global text
_conin 2350 global text
_rawconi 238C global text
_prt_lin 23D0 global text
_newline 23FE global text
_backsp 2434 global text
_readlin 24AE global text
_copyrt 4B6E global data
_serial 4B72 global data
_bdosini 26AA global text
_warmboo 274E global text
_prt_err 27B6 global text
_abrt_er 27E8 global text
_ext_err 27FE global text
_ro_err 289E global text
_error 2984 global text
_setexc 29FC global text
_set_tpa 2A70 global text
_rdwrt 2ACC global text
_dir_rd 2B66 global text
_dir_wr 2B84 global text
_dchksum 2BD6 global text
_dirscan 2C12 global text
_setaloc 2D40 global text
_clraloc 2D8C global text
_chkaloc 2DDE global text
_getaloc 2E1C global text
_alloc 2E7E global text
_seldsk 2EF8 global text
_move 3036 global text
_match 3060 global text
_openfil 30E8 global text
_flushit 3148 global text
_close 3186 global text
_close_f 32CC global text
_alltrue 32FE global text
_matchit 330A global text
_search 3326 global text
_create 33B2 global text
_delete 3436 global text
_rename 34D6 global text
_set_att 3550 global text
_extsize 35A2 global text
_setran 35DA global text
_fsize 3618 global text
_getsize 3672 global text
_free_sp 36E2 global text
_blkindx 3750 global text
_blknum 379C global text
_setblk 37DA global text
_do_io 3826 global text
_new_ext 3878 global text
_calcext 3990 global text
_get_rc 39FA global text
_bdosrw 3A44 global text
__bdos 3C1E global text
_tmp_sel 4034 global text
_do_phio 4080 global text
_pgmld 41B2 global text
_initexc 4660 global text
_load_tb 4F74 global bss
init_tbl 48D0 global text
stack 55DC global bss
_sub_ind 55DE global bss
_log_dsk 55E0 global bss
_load_tr 55E2 global bss
_gbls 55E4 global bss
_crit_ds 56D6 global bss
_tail 56D8 global bss
_cur_dis 56DC global bss
_parm 56DE global bss
_dma 5746 global bss
_init 57CA global bss
_sub_use 57D0 global bss
_save_su 57D2 global bss
_subfcb 5854 global bss
_first_s 5878 global bss
_subdma 587A global bss
_tpa_hp 58FA global bss
_user 58FE global bss
_tpa_lp 5900 global bss
_tpa_ht 5904 global bss
_user_pt 5908 global bss
_ro_dsk 590C global bss
_tpa_lt 590E global bss
_autorom 5912 global bss
_subprom 5914 global bss
_end_of_ 5916 global bss
_subcom 5918 global bss
_glb_ind 599A global bss
_chain_s 599E global bss
_index 59A0 global bss
_dirflag 59A2 global bss
_cmdfcb 59A4 global bss

View File

@@ -0,0 +1,288 @@
*****************************************************************
* *
* CP/M-68K Loader BIOS *
* Basic Input/Output Subsystem *
* For ERG 68000 with Tarbell floppy disk controller *
* *
*****************************************************************
.globl _bios * declare external entry point
_bios:
cmpi #nfuncs,d0
bge nogood
lsl #2,d0 * multiply bios function by 4
movea.l 6(pc,d0),a0 * get handler address
jsr (a0) * call handler
nogood:
rts
biosbase:
.dc.l nogood
.dc.l nogood
.dc.l constat
.dc.l conin
.dc.l conout
.dc.l nogood
.dc.l nogood
.dc.l nogood
.dc.l home
.dc.l seldsk
.dc.l settrk
.dc.l setsec
.dc.l setdma
.dc.l read
.dc.l nogood
.dc.l nogood
.dc.l sectran
.dc.l setdma
.dc.l getseg
.dc.l nogood
.dc.l nogood
.dc.l nogood
.dc.l setexc
nfuncs=(*-biosbase)/4
constat: move.b $ffff01,d0 * get status byte
andi.w #2,d0 * data available bit on?
beq noton * branch if not
moveq.l #$1,d0 * set result to true
rts
noton: clr.l d0 * set result to false
rts
conin: bsr constat * see if key pressed
tst d0
beq conin * wait until key pressed
move.b $ffff00,d0 * get key
and.l #$7f,d0 * clear all but low 7 bits
rts
conout: move.b $ffff01,d0 * get status
and.b #$1,d0 * check for transmitter buffer empty
beq conout * wait until our port has aged...
move.b d1,$ffff00 * and output it
rts * and exit
*
* Disk Handlers for Tarbell 1793 floppy disk controller
*
maxdsk = 2 * this BIOS supports 2 floppy drives
dphlen = 26 * length of disk parameter header
iobase = $00fffff8 * Tarbell floppy disk port base address
dcmd = iobase * output port for command
dstat = iobase * input status port
dtrk = iobase+1 * disk track port
dsect = iobase+2 * disk sector port
ddata = iobase+3 * disk data port
dwait = iobase+4 * input port to wait for op finished
dcntrl = iobase+4 * output control port for drive selection
home: clr.b track
rts
seldsk:
* select disk A
clr.b seldrv * select drive A
clr.b selcode * select code is 00 for drv 0, $10 for drv 1
move.l #dph0,d0
selrtn: rts
settrk: move.b d1,track
rts
setsec: move.b d1,sector
rts
sectran:
* translate sector in d1 with translate table pointed to by d2
* result in d0
movea.l d2,a0
ext.l d1
move.b #0(a0,d1),d0
ext.l d0
rts
setdma:
move.l d1,dma
rts
read:
* Read one sector from requested disk, track, sector to dma address
* Retry if necessary, return in d0 00 if ok, else non-zero
move.b #10,errcnt * set up retry counter
rretry:
bsr setup
ori #$88,d3 * OR read command with head load bit
move.b d3,dcmd * output it to FDC
rloop: btst #7,dwait
beq rdone * if end of read, exit
move.b ddata,(a0)+ * else, move next byte of data
bra rloop
rdone:
bsr rstatus * get FDC status
bne rerror
clr.l d0
rts
rerror: bsr errchk * go to error handler
subq.b #1,errcnt
bne rretry
move.l #$ffffffff,d0
rts
setup:
* common read and write setup code
* select disk, set track, set sector were all deferred until now
move.b #$d0,dcmd * clear controller, get status
move.b curdrv,d3
cmp.b seldrv,d3
bne newdrive * if drive not selected, do it
move.b track,d3
cmp.b oldtrk,d3
bne newtrk * if not on right track, do it
clr.l d3 * if head already loaded, no head load delay
btst #5,dstat * if head unloaded, treat as new disk
bne sexit
newdrive:
move.b selcode,dcntrl * select the drive
move.b seldrv,curdrv
newtrk:
bsr chkseek * seek to correct track if required
moveq #4,d3 * force head load delay
sexit:
move.b sector,dsect * set up sector number
move.b track,dtrk * set up track number
move.l dma,a0 * dma address to a0
rts
errchk:
btst.b #4,d7
bne chkseek * if record not found error, reseek
rts
chkseek:
* check for correct track, seek if necessary
bsr readid * find out what track we're on
beq chks1 * if read id ok, skip restore code
restore:
* home the drive and reseek to correct track
move.b #$0B,dcmd * restore command to command port
rstwait:
btst #7,dwait
bne rstwait * loop until restore completed
btst #2,dstat
beq restore * if not at track 0, try again
clr.l d3 * track number returned in d3 from readid
chks1:
move.b d3,dtrk * update track register in FDC
move.b track,oldtrk * update oldtrk
cmp.b track,d3 * are we at right track?
beq chkdone * if yes, exit
move.b track,ddata * else, put desired track in data reg of FDC
move.b #$18,dcmd * and issue a seek command
chks2: btst #7,dwait
bne chks2 * loop until seek complete
move.b dstat,d3 * read status to clear FDC
chkdone:
rts
readid:
* read track id, return track number in d3
move.b #$c4,dcmd * issue read id command
move.b dwait,d7 * wait for intrq
move.b ddata,d3 * track byte to d3
rid2:
btst #7,dwait
beq rstatus * wait for intrq
move.b ddata,d7 * read another byte
bra rid2 * and loop
rstatus:
move.b dstat,d7
andi.b #$9d,d7 * set condition codes
rts
getseg:
move.l #memrgn,d0 * return address of mem region table
rts
setexc:
andi.l #$ff,d1 * do only for exceptions 0 - 255
lsl #2,d1 * multiply exception number by 4
movea.l d1,a0
move.l (a0),d0 * return old vector value
move.l d2,(a0) * insert new vector
rts
.data
seldrv: .dc.b $ff * drive requested by seldsk
curdrv: .dc.b $ff * currently selected drive
track: .dc.b 0 * track requested by settrk
oldtrk: .dc.b 0 * track we were on
sector: .dc.w 0
dma: .dc.l 0
selcode: .dc.b 0 * drive select code
errcnt: .dc.b 10 * retry counter
memrgn: .dc.w 1 * 1 memory region
.dc.l $18000 * load the system at 18000 hex
.dc.l $8000
* disk parameter headers
dph0: .dc.l xlt
.dc.w 0 * dummy
.dc.w 0
.dc.w 0
.dc.l dirbuf * ptr to directory buffer
.dc.l dpb * ptr to disk parameter block
.dc.l 0 * ptr to check vector
.dc.l 0 * ptr to allocation vector
* disk parameter block
dpb: .dc.w 26 * sectors per track
.dc.b 3 * block shift
.dc.b 7 * block mask
.dc.b 0 * extent mask
.dc.b 0 * dummy fill
.dc.w 242 * disk size
.dc.w 63 * 64 directory entries
.dc.w $c000 * directory mask
.dc.w 16 * directory check size
.dc.w 2 * track offset
* sector translate table
xlt: .dc.b 1, 7,13,19
.dc.b 25, 5,11,17
.dc.b 23, 3, 9,15
.dc.b 21, 2, 8,14
.dc.b 20,26, 6,12
.dc.b 18,24, 4,10
.dc.b 16,22
.bss
dirbuf: .ds.b 128 * directory buffer
.end

View File

@@ -0,0 +1,360 @@
*****************************************************************
* *
* CP/M-68K BIOS *
* Basic Input/Output Subsystem *
* For ERG 68000 with Tarbell floppy disk controller *
* *
*****************************************************************
.globl _init * bios initialization entry point
.globl _ccp * ccp entry point
_init: move.l #traphndl,$8c * set up trap #3 handler
clr.l d0 * log on disk A, user 0
rts
traphndl:
cmpi #nfuncs,d0
bcc trapng
lsl #2,d0 * multiply bios function by 4
movea.l 6(pc,d0),a0 * get handler address
jsr (a0) * call handler
trapng:
rte
biosbase:
.dc.l _init
.dc.l wboot
.dc.l constat
.dc.l conin
.dc.l conout
.dc.l lstout
.dc.l pun
.dc.l rdr
.dc.l home
.dc.l seldsk
.dc.l settrk
.dc.l setsec
.dc.l setdma
.dc.l read
.dc.l write
.dc.l listst
.dc.l sectran
.dc.l setdma
.dc.l getseg
.dc.l getiob
.dc.l setiob
.dc.l flush
.dc.l setexc
nfuncs=(*-biosbase)/4
wboot: jmp _ccp
constat: move.b $ffff01,d0 * get status byte
andi.w #2,d0 * data available bit on?
beq noton * branch if not
moveq.l #$1,d0 * set result to true
rts
noton: clr.l d0 * set result to false
rts
conin: bsr constat * see if key pressed
tst d0
beq conin * wait until key pressed
move.b $ffff00,d0 * get key
and.l #$7f,d0 * clear all but low 7 bits
cmpi.b #1,d0
beq break
rts
break:
trap $f
.dc.w 0 * return to MACSBUG
rts
conout: move.b $ffff01,d0 * get status
and.b #$1,d0 * check for transmitter buffer empty
beq conout * wait until our port has aged...
move.b d1,$ffff00 * and output it
rts * and exit
lstout: rts
pun: rts
rdr: rts
listst: move.b #$ff,d0
rts
*
* Disk Handlers for Tarbell 1793 floppy disk controller
*
maxdsk = 2 * this BIOS supports 2 floppy drives
dphlen = 26 * length of disk parameter header
iobase = $00fffff8 * Tarbell floppy disk port base address
dcmd = iobase * output port for command
dstat = iobase * input status port
dtrk = iobase+1 * disk track port
dsect = iobase+2 * disk sector port
ddata = iobase+3 * disk data port
dwait = iobase+4 * input port to wait for op finished
dcntrl = iobase+4 * output control port for drive selection
home: clr.b track
rts
seldsk:
* select disk given by register d1.b
moveq #0,d0
cmp.b #maxdsk,d1 * valid drive number?
bpl selrtn * if no, return 0 in d0
move.b d1,seldrv * else, save drive number
lsl.b #4,d1
move.b d1,selcode * select code is 00 for drv 0, $10 for drv 1
move.b seldrv,d0
mulu #dphlen,d0
add.l #dph0,d0 * point d0 at correct dph
selrtn: rts
settrk: move.b d1,track
rts
setsec: move.b d1,sector
rts
sectran:
* translate sector in d1 with translate table pointed to by d2
* result in d0
movea.l d2,a0
ext.l d1
move.b #0(a0,d1),d0
ext.l d0
rts
setdma:
move.l d1,dma
rts
read:
* Read one sector from requested disk, track, sector to dma address
* Retry if necessary, return in d0 00 if ok, else non-zero
move.b #10,errcnt * set up retry counter
rretry:
bsr setup
ori #$88,d3 * OR read command with head load bit
move.b d3,dcmd * output it to FDC
rloop: btst #7,dwait
beq rdone * if end of read, exit
move.b ddata,(a0)+ * else, move next byte of data
bra rloop
rdone:
bsr rstatus * get FDC status
bne rerror
clr.l d0
rts
rerror: bsr errchk * go to error handler
subq.b #1,errcnt
bne rretry
move.l #$ffffffff,d0
rts
write:
* Write one sector to requested disk, track, sector from dma address
* Retry if necessary, return in d0 00 if ok, else non-zero
move.b #10,errcnt * set up retry counter
wretry:
bsr setup
ori #$a8,d3 * OR write command with head load bit
move.b d3,dcmd * output it to FDC
wloop: btst #7,dwait
beq wdone * if end of read, exit
move.b (a0)+,ddata * else, move next byte of data
bra wloop
wdone:
bsr rstatus * get FDC status
bne werror
clr.l d0
rts
werror: bsr errchk * go to error handler
subq.b #1,errcnt
bne wretry
move.l #$ffffffff,d0
rts
setup:
* common read and write setup code
* select disk, set track, set sector were all deferred until now
move.b #$d0,dcmd * clear controller, get status
move.b curdrv,d3
cmp.b seldrv,d3
bne newdrive * if drive not selected, do it
move.b track,d3
cmp.b oldtrk,d3
bne newtrk * if not on right track, do it
clr.l d3 * if head already loaded, no head load delay
btst #5,dstat * if head unloaded, treat as new disk
bne sexit
newdrive:
move.b selcode,dcntrl * select the drive
move.b seldrv,curdrv
newtrk:
bsr chkseek * seek to correct track if required
moveq #4,d3 * force head load delay
sexit:
move.b sector,dsect * set up sector number
move.b track,dtrk * set up track number
move.l dma,a0 * dma address to a0
rts
errchk:
btst.b #4,d7
bne chkseek * if record not found error, reseek
rts
chkseek:
* check for correct track, seek if necessary
bsr readid * find out what track we're on
beq chks1 * if read id ok, skip restore code
restore:
* home the drive and reseek to correct track
move.b #$0B,dcmd * restore command to command port
rstwait:
btst #7,dwait
bne rstwait * loop until restore completed
btst #2,dstat
beq restore * if not at track 0, try again
clr.l d3 * track number returned in d3 from readid
chks1:
move.b d3,dtrk * update track register in FDC
move.b track,oldtrk * update oldtrk
cmp.b track,d3 * are we at right track?
beq chkdone * if yes, exit
move.b track,ddata * else, put desired track in data reg of FDC
move.b #$18,dcmd * and issue a seek command
chks2: btst #7,dwait
bne chks2 * loop until seek complete
move.b dstat,d3 * read status to clear FDC
chkdone:
rts
readid:
* read track id, return track number in d3
move.b #$c4,dcmd * issue read id command
move.b dwait,d7 * wait for intrq
move.b ddata,d3 * track byte to d3
rid2:
btst #7,dwait
beq rstatus * wait for intrq
move.b ddata,d7 * read another byte
bra rid2 * and loop
rstatus:
move.b dstat,d7
andi.b #$9d,d7 * set condition codes
rts
flush:
clr.l d0 * return successful
rts
getseg:
move.l #memrgn,d0 * return address of mem region table
rts
getiob:
rts
setiob:
rts
setexc:
andi.l #$ff,d1 * do only for exceptions 0 - 255
cmpi #47,d1
beq noset * this BIOS doesn't set Trap 15
cmpi #9,d1 * or Trace
beq noset
lsl #2,d1 * multiply exception nmbr by 4
movea.l d1,a0
move.l (a0),d0 * return old vector value
move.l d2,(a0) * insert new vector
noset: rts
.data
seldrv: .dc.b $ff * drive requested by seldsk
curdrv: .dc.b $ff * currently selected drive
track: .dc.b 0 * track requested by settrk
oldtrk: .dc.b 0 * track we were on
sector: .dc.w 0
dma: .dc.l 0
selcode: .dc.b 0 * drive select code
errcnt: .dc.b 10 * retry counter
memrgn: .dc.w 1 * 1 memory region
.dc.l $800 * starts at 800 hex
.dc.l $17800 * goes until 18000 hex
* disk parameter headers
dph0: .dc.l xlt
.dc.w 0 * dummy
.dc.w 0
.dc.w 0
.dc.l dirbuf * ptr to directory buffer
.dc.l dpb * ptr to disk parameter block
.dc.l ckv0 * ptr to check vector
.dc.l alv0 * ptr to allocation vector
dph1: .dc.l xlt
.dc.w 0 * dummy
.dc.w 0
.dc.w 0
.dc.l dirbuf * ptr to directory buffer
.dc.l dpb * ptr to disk parameter block
.dc.l ckv1 * ptr to check vector
.dc.l alv1 * ptr to allocation vector
* disk parameter block
dpb: .dc.w 26 * sectors per track
.dc.b 3 * block shift
.dc.b 7 * block mask
.dc.b 0 * extent mask
.dc.b 0 * dummy fill
.dc.w 242 * disk size
.dc.w 63 * 64 directory entries
.dc.w $c000 * directory mask
.dc.w 16 * directory check size
.dc.w 2 * track offset
* sector translate table
xlt: .dc.b 1, 7,13,19
.dc.b 25, 5,11,17
.dc.b 23, 3, 9,15
.dc.b 21, 2, 8,14
.dc.b 20,26, 6,12
.dc.b 18,24, 4,10
.dc.b 16,22
.bss
dirbuf: .ds.b 128 * directory buffer
ckv0: .ds.b 16 * check vector
ckv1: .ds.b 16
alv0: .ds.b 32 * allocation vector
alv1: .ds.b 32
.end

View File

@@ -0,0 +1 @@
lo68 -r -o cpm.rel -ucpm cpmlib biosa.o bios.o

View File

@@ -0,0 +1,41 @@
.text
.globl _bios
.globl _biosinit
.globl _cbios
.globl _dskia
.globl _dskic
.globl _setimask
*
*
*
*
_bios: link a6,#0
move.l d2,-(a7)
move.l d1,-(a7)
move.w d0,-(a7)
move #$2000,sr
lea _dskia,a0
move.l a0,$3fc
jsr _cbios
unlk a6
rts
*
_dskia: link a6,#0
movem.l d0-d7/a0-a5,-(a7)
jsr _dskic
movem.l (a7)+,d0-d7/a0-a5
unlk a6
rte
*
_setimask: move sr,d0
lsr #8,d0
and.l #7,d0
move sr,d1
ror.w #8,d1
and.w #$fff8,d1
add.w 4(a7),d1
ror.w #8,d1
move d1,sr
rts
*
.end

View File

@@ -0,0 +1,3 @@
#define LOADER 1
#define CTLTYPE 0
#define MEMDSK 0

View File

@@ -0,0 +1,9 @@
pip biostype.h=loadbios.h
cp68 bios.c bios.i
c068 bios.i bios.ic bios.st
era bios.i
era bios.st
c168 bios.ic bios.s -l
as68 -u -l bios.s
as68 -u -l ldbiosa.s
pip ldbios.o=bios.o

View File

@@ -0,0 +1 @@
lo68 -s -t0 -uldr -o cpmldr.sys booter.o ldrlib ldbiosa.o ldbios.o

View File

@@ -0,0 +1,3 @@
#define LOADER 0
#define CTLTYPE 0
#define MEMDSK 4

View File

@@ -0,0 +1,8 @@
pip biostype.h=normbios.h
cp68 bios.c bios.i
c068 bios.i bios.ic bios.st
era bios.i
era bios.st
c168 bios.ic bios.s -l
as68 -u -l bios.s
as68 -u -l biosa.s

View File

@@ -0,0 +1,194 @@
*********************************************************
* *
* Program to Write Boot Tracks for CP/M-68K (tm) *
* *
* Copyright Digital Research 1982 *
* *
*********************************************************
*
*
*
prntstr = 9 BDOS Functions
dseldsk = 14
open = 15
readseq = 20
dsetdma = 26
*
seldsk = 9 BIOS Functions
settrk = 10
setsec = 11
isetdma = 12
write = 14
sectran = 16
flush = 21
*
bufcnt = $80
bufsize = $80*bufcnt
*
.text
*
start: link a6,#0
move.l 8(a6),a0 base page address
lea $5c(a0),a1
move.l a1,fcb
clr.b hflag
add #$81,a0 first character of command tail
scan: cmpi.b #$20,(a0)+ skip over blanks
beq scan
sub.l #1,a0
scan1: tst.b (a0)
beq erxit
cmpi.b #$2d,(a0)+ check for -H flag
bne nohyph
cmpi.b #$48,(a0)+
bne erxit
tst.b hflag
bne erxit
move.b #$ff,hflag
sub.l #$24,fcb change to 2nd default fcb
bra scan
nohyph: cmpi.b #$20,(a0)
bne scan1
scan2: cmpi.b #$20,(a0)+
beq scan2
cmpi.b #$61,-(a0) get disk letter
blt upper upshift
sub #$20,(a0)
upper: cmpi.b #$41,(a0) compare with range A - P
blt erxit
cmpi.b #$50,(a0)
bgt erxit
move.b (a0),d0
ext.w d0 put disk letter into range 0 - 15
sub.w #$41,d0
move.w d0,dsk
*
* open file to copy
*
move.w #open,d0
move.l fcb,d1
trap #2
cmpi.w #$00ff,d0
bne openok
move.l #opnfl,d1
jmp erx
openok: move.l fcb,a0
clr.b 32(a0)
*
* read
*
move.l #buf,d2
clr.w count
rloop: move.w #dsetdma,d0
move.l d2,d1
trap #2
move.w #readseq,d0
move.l fcb,d1
trap #2
tst.w d0
bne wrtout
add.l #128,d2
add.w #1,count
cmpi.w #bufcnt,count
bgt bufoflx
bra rloop
*
* write
*
wrtout: move.w #seldsk,d0 select the disk
move.w dsk,d1
clr.b d2
trap #3
tst.l d0 check for select error
beq selerx
move.l d0,a0
move.l 14(a0),a0 get DPB address
move.w (a0),spt get sectors per track
move.w 14(a0),off get offset
clr.w trk start at trk 0
move.w #1,sect start at sector 1
lea buf,a0
tst.b hflag
bne wrt1
cmpi.w #$601a,(a0)
bne wrt1
add.l #28,a0
wrt1: move.l a0,bufp
*
wloop: tst.w count
beq exit
move.w sect,d1 check for end-of-track
cmp.w spt,d1
ble sok
move.w #1,sect advance to new track
move.w trk,d0
add.w #1,d0
move.w d0,trk
cmp.w off,d0
bge oflex
sok: move.w #settrk,d0 set the track
move.w trk,d1
trap #3
move.w sect,d1 set sector
move.w #setsec,d0
trap #3
move.w #isetdma,d0 set up dma address for write
move.l bufp,d1
trap #3
move.w #write,d0 and write
clr.w d1
trap #3
tst.w d0 check for write error
bne wrterx
add #1,sect increment sector number
sub #1,count
add.l #128,bufp
bra wloop
*
exit: move.w #flush,d0 exit location - flush bios buffers
trap #3
unlk a6
rts and exit to CCP
*
erxit: move.l #erstr,d1 miscellaneous errors
erx: move.w #prntstr,d0 print error message and exit
trap #2
bra exit
*
selerx: move.l #selstr,d1 disk select error
bra erx
wrterx: move.l #wrtstr,d1 disk write error
bra erx
bufoflx: move.l #bufofl,d1 buffer overflow
bra erx
oflex: move.l #trkofl,d1
bra erx
*
*
.bss
*
.even
*
buf: .ds.b bufsize+128
*
fcb: .ds.l 1 fcb address
spt: .ds.w 1 sectors per track
sect: .ds.w 1 current sector
trk: .ds.w 1 current track
dsk: .ds.w 1 selected disk
off: .ds.w 1 1st track of non-boot area
count: .ds.w 1
bufp: .ds.l 1
hflag: .ds.b 1
*
.data
*
erstr: .dc.b 'Invalid Command Line',13,10,'$'
selstr: .dc.b 'Select Error',13,10,'$'
wrtstr: .dc.b 'Write Error',13,10,'$'
opnfl: .dc.b 'Cannot Open Source File',13,10,'$'
bufofl: .dc.b 'Buffer Overflow',13,10,'$'
trkofl: .dc.b 'Too Much Data for System Tracks',13,10,'$'
*
*
.end

View File

@@ -0,0 +1 @@
reloc -b$1 cpm.rel cpm.sys

View File

@@ -0,0 +1,17 @@
vax biosa.s s
vax biostyps.h s
vax booter.s s
vax bios.c s
vax eldbios.s s
vax ergbios.s s
vax lcpm.sub s
vax biostype.h s
vax ldbiosa.s s
vax loadbios.sub s
vax makeldr.sub s
vax normbios.h s
vax normbios.sub s
vax putboot.s s
vax relcpm.sub s
vax loadbios.h s
vax up1.sub s

View File

@@ -0,0 +1,14 @@
$ bios
$ set noon
$ !
$ ! VMS build file for EXORmacs bios using cross tools
$ !
$ copy loadbios.h biostype.h
$ cc68 bios
$ rename bios.o ldbios.o
$ as68 -u -l ldbiosa.s
$ as68 -u -l booter.s
$ copy normbios.h biostype.h
$ cc68 bios
$ as68 -u -l biosa.s
$ pur biostype.h

View File

@@ -0,0 +1,20 @@
$ set noon
$ vsend BIOS.C
$ vsend BIOSA.S
$ vsend BIOSTYPE.H
$ vsend BIOSTYPS.H
$ vsend BOOTER.S
$ vsend ELDBIOS.S
$ vsend ERGBIOS.S
$ vsend LCPM.SUB
$ vsend LDBIOSA.S
$ vsend LOADBIOS.H
$ vsend LOADBIOS.SUB
$ vsend MAKELDR.SUB
$ vsend NORMBIOS.H
$ vsend NORMBIOS.SUB
$ vsend PUTBOOT.S
$ vsend RELCPM.SUB
$ vsend UP1.SUB
$ vsend VMAKE.COM
$ vsend done