Compare commits

..

1 Commits
v2.6 ... v2.1.1

Author SHA1 Message Date
wayne
93ed1f826f Tagging v2.1.1 2012-10-23 08:03:27 +00:00
630 changed files with 16732 additions and 98262 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +0,0 @@
@echo off
setlocal
set PATH=..\Tools\tasm32;..\Tools\zx;%PATH%
set TASMTABS=..\Tools\tasm32
set ZXBINDIR=../tools/cpm/bin/
set ZXLIBDIR=../tools/cpm/lib/
set ZXINCDIR=../tools/cpm/include/
call :asm SysCopy || goto :eof
call :asm Assign || goto :eof
call :asm Format || goto :eof
call :asm Talk || goto :eof
zx Z80ASM -SYSGEN/F
goto :eof
:asm
echo.
echo Building %1...
tasm -t80 -b -g3 -fFF %1.asm %1.com %1.lst
goto :eof

View File

@@ -1,4 +0,0 @@
@echo off
if exist *.bin del *.bin
if exist *.com del *.com
if exist *.lst del *.lst

View File

@@ -1,28 +0,0 @@
;===============================================================================
; FORMAT - DISK FORMAT UTILITY FOR ROMWBW ADAPTATION OF CP/M 2.2
;===============================================================================
;
; AUTHOR: WAYNE WARTHEN (wwarthen@gmail.com)
;_______________________________________________________________________________
;
; CHANGELOG:
;_______________________________________________________________________________
;
; TODO:
;
;_______________________________________________________________________________
;
;
;===============================================================================
; MAIN PROGRAM PROCEDURE
;===============================================================================
;
.ORG 00100H
RET
;
STACKSAV .DW 0
STACKSIZ .EQU 40H ; WE ARE A STACK PIG
.FILL STACKSIZ,0
STACK .EQU $
;
.END

View File

@@ -1,856 +0,0 @@
;===============================================================================
; SysCopy - Copy System Image to/from reserved tracks of disk for RomWBW
; adaptation of CP/M 2.2
;===============================================================================
;
; Author: Wayne Warthen (wwarthen@gmail.com)
;_______________________________________________________________________________
;
; Usage:
; SYSCOPY <dest>[=<src>]
;
; <dest> and <src> may be a drive or a file reference
; If <src> is not specified, the system image will
; be read from the current drive
;_______________________________________________________________________________
;
; Change Log:
;_______________________________________________________________________________
;
; ToDo:
; 1) Add option to wait/prompt for disk change
; 2) Allow <src> and <dest> to be memory
;_______________________________________________________________________________
;
;===============================================================================
; Definitions
;===============================================================================
;
stksiz .equ $40 ; we are a stack pig
;
restart .equ $0000 ; CP/M restart vector
bdos .equ $0005 ; BDOS invocation vector
;
buf .equ $900 ; load point for system image (from original SYSGEN)
;
;===============================================================================
; Code Section
;===============================================================================
;
.org $100
; setup stack (save old value)
ld (stksav),sp ; save stack
ld sp,stack ; set new stack
; processing...
call main ; do the real work
call crlf ; formatting
; return
jp 0 ; return to CP/M via reset
;
;ld sp,(stksav) ; restore stack
;ret ; return to CP/M w/o reset
;
; Main routine
;
main:
call init ; initialize
ret nz ; abort on failure
call parse ; parse command tail
ret nz ; abort on failure
call confirm ; confirm pending action
ret nz ; abort on failure
call crlf ; formatting
ld de,msgrd
call prtstr ; display "reading" message
call rdimg ; do the image read
ret nz ; abort on failure
ld de,msgwrt
call prtstr ; display "writing" message
call wrtimg ; do the image write
ret nz ; abort on failure
ld de,msgdon ; completion message
call prtstr ; display it
ret
;
; Initialization
;
init:
; add check for RomWBW?
;
; locate cbios function table address
ld hl,(restart+1) ; load address of CP/M restart vector
ld de,-3 ; adjustment for start of table
add hl,de ; HL now has start of table
ld (cbftbl),hl ; save it
; save current drive no
ld c,$19 ; bdos func: get current drive
call bdos ; invoke BDOS function
inc a ; 1-based index for fcb
ld (defdrv),a ; save it
; return success
xor a
ret
;
; Parse command tail
;
parse:
ld hl,$81 ; point to start of command tail (after length byte)
call nonblank ; locate start of parms
jp z,erruse ; no parms
ld de,destfcb ; point to destination fcb
call convert ; convert destination spec
jp nz,erramb ; Error, ambiguous file specification
call nonblank ; skip blanks
or a ; end of command tail (null)?
jr z,parse2 ; setup default source fcb
cp '=' ; std delimiter
jr z,parse1 ; valid delimiter, continue
cp '_' ; alt delimiter
jr z,parse1 ; valid delimiter, continue
jp errdlm ; invalid delimiter
parse1:
inc hl ; skip delimiter
call nonblank ; skip blanks
parse2:
ld de,srcfcb ; point to source fcb
call convert ; convert spec to fcb
jp nz,erramb ; Error, ambiguous file specification
; return success
xor a ; signal success
ret ; done parsing
;
; Confirm pending action with user
;
confirm:
; prompt
call crlf
ld de,sconf1
call prtstr
ld hl,srcfcb
call prtfcb
ld de,sconf2
call prtstr
ld hl,destfcb
call prtfcb
ld de,sconf3
call prtstr
;
; get input
ld c,$0A ; get console buffer
ld de,buf ; into buf
ld a,1 ; max of 1 character
ld (de),a ; set up buffer
call bdos ; invoke BDOS
ld a,(buf+1) ; get num chars entered
dec a ; check that we got exactly one char
jr nz,confirm ; bad input, re-prompt
ld a,(buf+2) ; get the character
and $DF ; force upper case
cp 'Y' ; compare to Y
ret ; return with Z set appropriately
;
; Read system image
;
rdimg:
ld hl,srcfcb ; point to source fcb
call chkfcb ; check if for drive/file spec
bit 1,a ; is there a file spec?
jp nz,rdfil ; yes, read using file i/o
jp rddsk ; no, read using raw disk i/o
;
; Write system image
;
wrtimg:
ld hl,destfcb ; point to destination fcb
call chkfcb ; check it for drive/file spec
bit 1,a ; is there a file spec?
jp nz,wrfil ; yes, write using file i/o
jp wrdsk ; no, write using raw disk i/o
;
; Read system image from file system
;
rdfil:
; open the file
ld c,$0F ; bdos open file
ld de,srcfcb ; source fcb
ld (rwfcb),de ; save it
call bdos ; invoke bdos function
cp $FF ; $FF is error
jp z,errfil ; handle error condition
; read the header
ld a,$14 ; setup for bdos read sequential
ld (rwfun),a ; save bdos function
ld a,12 ; start with 1536 byte header (12 records)
ld (reccnt),a ; init record counter
ld hl,buf ; start of buffer
ld (bufptr),hl ; init buffer pointer
call rwfil ; read the header
ret nz ; abort on error (no need to close file)
; check header and get image size
call chkhdr ; verifies marker & ver, hl = image size
ret nz ; abort on error (no need to close file)
ld b,7 ; right shift 7 bits to get 128 byte record count
rdfil1: srl h ; shift right msb
rr l ; shift lsb w/ carry from msb
djnz rdfil1 ; loop till done
ld a,l ; record count to a
ld (reccnt),a ; set remaining records to read
add a,12 ; add the header back
ld (imgsiz),a ; and save the total image size (in records)
call rwfil ; do it
ret nz ; abort on error
; return via close file
jp closefile ; close file
;
; Write system image to file system
;
wrfil:
; check for pre-existing target file
ld c,$11 ; bdos find first
ld de,destfcb ; destination fcb
call bdos
cp $FF ; check for error
jr z,wrfil1 ; not there, skip delete
; delete target file if it exists
ld c,$13 ; bdos delete
ld de,destfcb ; destination fcb
call bdos
cp $FF ; check return code
jp z,errdel ; handle error
wrfil1: ; create target file
ld c,$16 ; bdos create file
ld de,destfcb ; destination fcb
ld (rwfcb),de ; save it
call bdos
cp $FF ; check return code
jp z,errfil ; handle error
; write the image
ld a,$15 ; setup for bdos write sequential
ld (rwfun),a ; save bdos function
ld a,(imgsiz) ; number of records to read
ld (reccnt),a ; init record counter
ld hl,buf ; start of buffer
ld (bufptr),hl ; init buffer pointer
call rwfil ; do it
ret nz ; abort on error
; return via close file
jp closefile ; close file
;
; Common routine to handle read/write for file system
;
rwfil:
ld c,$1A ; BDOS set dma
ld de,(bufptr) ; current buffer pointer
push de ; save pointer
call bdos ; do it
pop de ; recover pointer
ld hl,128 ; record length
add hl,de ; increment buffer pointer
ld (bufptr),hl ; save it
ld a,(rwfun) ; get the active function
ld c,a ; set it
ld de,(rwfcb) ; active fcb
call bdos ; do it
or a ; check return code
jp nz,errdos ; BDOS err
ld hl,reccnt ; point to record count
dec (hl) ; decrement record count
jr nz,rwfil ; loop till done
xor a ; signal success
ret ; done
;
; Close file
;
closefile:
ld c,$10 ; BDOS close file
ld de,(rwfcb) ; active fcb
call bdos ; do it
cp $FF ; $FF is error
jp z,errclo ; if error, handle it
xor a ; signal success
ret ; done
;
; Read image directly from disk system tracks using CBIOS
;
rddsk:
; force return to go through disk reset
ld hl,resdsk ; load address of reset disk routine
push hl ; and put it on the stack
; set drive for subsequent reads
ld a,(srcfcb) ; get the drive
dec a ; adjust for zero indexing
call setdsk ; setup disk
ret nz ; abort on error
; set function to read
ld hl,(cbftbl) ; get address of CBIOS function table
ld a,$27 ; $27 is CBIOS READ entry offset
call addhl ; set HL to resultant entry point
ld (actfnc),hl ; save it
; read the header
ld a,12 ; start with 1536 byte header (12 records)
ld (reccnt),a ; initialize record counter
call rwdsk ; read the header
ret nz ; abort on error
; check header and get image size
call chkhdr ; check integrity, HL = image size on return
ret nz ; abort on error
; convert image size to count of 128-byte records
ld b,7 ; right shift 7 bits to get 128 byte record count
rddsk1: srl h ; shift right msb
rr l ; shift lsb w/ carry from msb
djnz rddsk1 ; loop till done
; set the number of records pending to read
ld a,l ; record count to a
ld (reccnt),a ; set remaining records to read
; save the total image size (including header) for later
add a,12 ; add the header records back
ld (imgsiz),a ; and save the total image size (in records)
; read the remaining system image records
call rwdsk ; finish up
ret nz ; abort on error
; perform BDOS disk reset (critical since we mucked with CBIOS)
ld c,$0D ; BDOS reset disk
call bdos ; do it
; return
xor a ; signal success
ret ; done
;
; Write image directly to disk system tracks using CBIOS
;
wrdsk:
; force return to go through disk reset
ld hl,resdsk ; load address of reset disk routine
push hl ; and put it on the stack
; set drive for subsequent writes
ld a,(destfcb) ; get the drive
dec a ; adjust for zero indexing
call setdsk ; setup disk
ret nz ; abort on error
; set function to write
ld hl,(cbftbl) ; get address of CBIOS function table
ld a,$2A ; $2A is CBIOS WRITE entry offset
call addhl ; set HL to resultant entry point
ld (actfnc),hl ; save it
; setup the record count to write
ld a,(imgsiz) ; get previously recorded image size
ld (reccnt),a ; save it as pending record count
; write the image
call rwdsk ; write the image
ret nz ; abort on error
; return
xor a ; signal success
ret ; done
;
; Perform BDOS disk reset
; Required after making direct CBIOS disk calls
;
resdsk:
; perform BDOS disk reset
push af ; preserve status
ld c,$0D ; BDOS reset disk
call bdos ; do it
pop af ; restore status
ret
;
; Setup for CBIOS disk access
;
setdsk:
; select disk
ld (actdsk),a ; save active disk no
ld c,a ; move to c
ld e,0 ; treat as first select
call cbios ; invoke cbios with...
.db $1B ; SELDSK entry offset
; check return (sets HL to DPH address)
ld a,h
or l
jp z,errsel ; HL == 0 is select error
; set HL to DPB address
ld de,10 ; DPB address is 10 bytes into DPH
add hl,de ; HL := address of DPB pointer
ld a,(hl) ; dereference...
inc hl
ld h,(hl)
ld l,a ; HL := address of DPB
; extract sectors per track from first word of DPB
ld c,(hl)
inc hl
ld b,(hl) ; BC := sectors per track
ld (actspt),bc ; save it
; ensure there are system tracks (verify that offset field in DPB is not zero)
ld de,12 ; offset field is 12 bytes into DPB
add hl,de ; point to offset field in DPB
ld a,(hl) ; load first byte in A
inc hl ; point to second byte
or (hl) ; or with first byte
jp z,errsys ; if zero, abort (no system tracks)
; initialize for I/O
ld hl,0
ld (acttrk),hl ; active track := 0
ld (actsec),hl ; active sector := 0
ld hl,buf
ld (bufptr),hl ; reset buffer pointer
;
xor a ; signal success
ret ; done
;
; Read or write (reccnt) sectors to/from disk via CBIOS
;
rwdsk:
; setup to read/write a sector
ld bc,(acttrk) ; get active track
call cbios ; invoke cbios with...
.db $1E ; SETTRK entry offset
ld bc,(actsec) ; get active sector
call cbios ; invoke cbios with...
.db $21 ; SETSEC entry offset
ld bc,(bufptr) ; get active buffer pointer
call cbios ; invoke cbios with...
.db $24 ; SETDMA entry offset
; read/write sector
ld a,(reccnt) ; get the pending record count
dec a ; last record?
ld c,2 ; allow cached writes by default
jr nz,rwdsk1 ; not last record, continue
ld c,1 ; last record, no caching please
rwdsk1: ld hl,(actfnc) ; load the CBIOS function vector
call jphl ; indirect call (read or write)
or a ; set flags on return code
jp nz,errio ; if not zero, error abort
; adjust buffer pointer
ld hl,(bufptr) ; get buffer pointer
ld de,128 ; record length is 128 bytes
add hl,de ; adjust buffer ptr for next record
ld (bufptr),hl ; save it
; next sector
ld hl,(actsec) ; current sector
inc hl ; increment sector
ld (actsec),hl ; save it
; check for end of track
ld de,(actspt) ; get current sectors per track
or a ; clear CF
sbc hl,de ; current track == sectors per track?
jr nz,rwdsk2 ; no, skip track change
; next track
ld hl,0
ld (actsec),hl ; current sector := 0
ld hl,acttrk ; point to track variable
inc (hl) ; increment track
; check pending record count and loop or return
rwdsk2: ld hl,reccnt
dec (hl) ; decrement pending record count
ret z ; if zero, done, return with Z set
jr rwdsk ; otherwise, loop
;
jphl: jp (hl) ; indirect jump
;
; Verify system image header in buf by checking the expected signature.
; Compute and return image size (based on header values) in HL.
; NZ set if signature error.
;
chkhdr:
; check signature
ld hl,(buf+$580) ; get signature
ld de,$A55A ; signature value
or a ; clear CF
sbc hl,de ; compare
jp nz,errsig ; invalid signature
; compute the image size (does not include size of header)
ld hl,(buf+$5FC) ; get CPM_END
ld de,(buf+$5FA) ; get CPM_LOC
or a ; clear CF
sbc hl,de ; image size := CPM_END - CPM_LOC
xor a ; signal success
ret ; done
;
; Convert a filename at (HL) into an FCB at (DE).
; Includes wildcard expansion.
; On return, A=0 if unambiguous name specified, and
; (HL) points to character following filename spec
;
convert:
push de ; put fcb address on stack
ex de,hl
ld a,(de) ; get first character.
or a
jp z,convrt1
sbc a,'A'-1 ; might be a drive name, convert to binary.
ld b,a ; and save.
inc de ; check next character for a ':'.
ld a,(de)
cp ':'
jp z,convrt2
dec de ; nope, move pointer back to the start of the line.
convrt1:
ld a,(defdrv)
ld (hl),a
jp convrt3
convrt2:
ld a,b
ld (hl),b
inc de
; Convert the base file name.
convrt3:ld b,08h
convrt4:ld a,(de)
call delim
jp z,convrt8
inc hl
cp '*' ; note that an '*' will fill the remaining
jp nz,convrt5 ; field with '?'
ld (hl),'?'
jp convrt6
convrt5:ld (hl),a
inc de
convrt6:dec b
jp nz,convrt4
convrt7:ld a,(de)
call delim ; get next delimiter
jp z,getext
inc de
jp convrt7
convrt8:inc hl ; blank fill the file name
ld (hl),' '
dec b
jp nz,convrt8
getext: ld b,03h
cp '.'
jp nz,getext5
inc de
getext1:ld a,(de)
call delim
jp z,getext5
inc hl
cp '*'
jp nz,getext2
ld (hl),'?'
jp getext3
getext2:ld (hl),a
inc de
getext3:dec b
jp nz,getext1
getext4:ld a,(de)
call delim
jp z,getext6
inc de
jp getext4
getext5:inc hl
ld (hl),' '
dec b
jp nz,getext5
getext6:ld b,3
getext7:inc hl
ld (hl),0
dec b
jp nz,getext7
pop hl ; HL := start of FCB
push de ; save input line pointer
; Check to see if this is an ambiguous file name specification.
; Set the A register to non-zero if it is.
ld bc,11 ; set name length.
getext8:inc hl
ld a,(hl)
cp '?' ; any question marks?
jp nz,getext9
inc b ; count them.
getext9:dec c
jp nz,getext8
ld a,b
or a
pop hl ; return with updated input pointer
ret
;
; Print formatted FCB at (HL)
;
prtfcb:
push hl ; save HL
call chkfcb ; set flags indicating nature of FCB
pop hl ; restore HL
ret z ; nothing to print
push af ; save FCB flags
ld a,(hl) ; get first byte of FCB (drive)
inc hl ; point to next char
or a ; is drive specified (non-zero)?
jr z,prtfcb1 ; if zero, do not print drive letter
add a,'@' ; adjust drive number to alpha
call prtchr ; print it
ld a,':'
call prtchr ; print drive separator
prtfcb1:
pop af ; restore FCB flags
bit 1,a ; bit 1 set if filename specified
ret z ; return if no filename
ld b,8 ; base is 8 characters
call prtfcb2 ; print them
ld a,'.'
call prtchr ; print file extension separator
ld b,3 ; extension is 3 characters
prtfcb2:
ld a,(hl) ; load the next character
inc hl ; point to next character
cp ' ' ; check for blank
call nz,prtchr ; print char if it is not a blank
djnz prtfcb2 ; loop till done
ret ; return
;
; Check FCB to see if a drive and/or filename is specified.
; Set bit 0 for drive and bit 1 for filename in A
;
chkfcb:
ld c,0 ; use C for flags, start with none
ld a,(hl) ; get drive
or a ; anything there?
jr z,chkfcb1 ; skip if nothing there
set 0,c ; set bit zero to indicate a drive spec
chkfcb1:
ld b,11 ; set up to check 11 bytes (base & ext)
chkfcb2:
inc hl ; bump to next byte
ld a,(hl) ; get next
cp 'A' ; blank means empty byte
jr nc,chkfcb3 ; if not blank, we have a filename
djnz chkfcb2 ; loop
jr chkfcb4 ; nothing there
chkfcb3:
set 1,c ; set bit 1 to indicate a file spec
chkfcb4:
ld a,c ; put result in a
or a ; set flags
ret
;
; Print character in A without destroying any registers
;
prtchr:
push bc ; save registers
push de
push hl
ld e,a ; character to print in E
ld c,$02 ; BDOS function to output a character
call bdos ; do it
pop hl ; restore registers
pop de
pop bc
ret
;
; Print $ terminated string at (DE) without destroying any registers
;
prtstr:
push bc ; save registers
push de
push hl
ld c,$09 ; BDOS function to output a '$' terminated string
call bdos ; do it
pop hl ; restore registers
pop de
pop bc
ret
;
; Print the value in A in hex without destroying any registers
;
prthex:
push af ; save AF
push de ; save DE
call hexascii ; convert value in A to hex chars in DE
ld a,d ; get the high order hex char
call prtchr ; print it
ld a,e ; get the low order hex char
call prtchr ; print it
pop de ; restore DE
pop af ; restore AF
ret ; done
;
; Convert binary value in A to ascii hex characters in DE
;
hexascii:
ld d,a ; save A in D
call hexconv ; convert low nibble of A to hex
ld e,a ; save it in E
ld a,d ; get original value back
rlca ; rotate high order nibble to low bits
rlca
rlca
rlca
call hexconv ; convert nibble
ld d,a ; save it in D
ret ; done
;
; Convert low nibble of A to ascii hex
;
hexconv:
and $0F ; low nibble only
add a,$90
daa
adc a,$40
daa
ret
;
; Start a new line
;
crlf:
ld a,13 ; <CR>
call prtchr ; print it
ld a,10 ; <LF>
jr prtchr ; print it
;
; Get the next non-blank character from (HL).
;
nonblank:
ld a,(hl) ; load next character
or a ; string ends with a null
ret z ; if null, return pointing to null
cp ' ' ; check for blank
ret nz ; return if not blank
inc hl ; if blank, increment character pointer
jr nonblank ; and loop
;
; Check character at (DE) for delimiter.
;
delim: or a
ret z
cp ' ' ; blank
ret z
jr c,delim1 ; handle control characters
cp '=' ; equal
ret z
cp '_' ; underscore
ret z
cp '.' ; period
ret z
cp ':' ; colon
ret z
cp $3b ; semicolon
ret z
cp '<' ; less than
ret z
cp '>' ; greater than
ret
delim1:
; treat control chars as delimiters
xor a ; set Z
ret ; return
;
; Invoke CBIOS function
; The CBIOS function offset must be stored in the byte
; following the call instruction. ex:
; call cbios
; .db $0C ; offset of CONOUT CBIOS function
;
cbios:
ex (sp),hl
ld a,(hl) ; get the function offset
inc hl ; point past value following call instruction
ex (sp),hl ; put address back at top of stack and recover HL
ld hl,(cbftbl) ; address of CBIOS function table to HL
call addhl ; determine specific function address
jp (hl) ; invoke CBIOS
;
; Add the value in A to HL (HL := HL + A)
;
addhl:
add a,l ; A := A + L
ld l,a ; Put result back in L
ret nc ; if no carry, we are done
inc h ; if carry, increment H
ret ; and return
;
; Errors
;
erruse: ; command usage error (syntax)
ld de,msguse
jr err
erramb: ; ambiguous file spec (wild cards) is not allowed
ld de,msgamb
jr err
errdlm: ; invalid delimiter in command tail
ld de,msgdlm
jr err
errfil: ; source file not found
ld de,msgfil
jr err
errclo: ; file close error
ld de,msgclo
jr err
errdel: ; file delete error
ld de,msgdel
jr err
errsig: ; invalid system image signature error
ld de,msgsig
jr err
errsel: ; CBIOS drive select error
ld de,msgsel
jr err
errsys: ; no system tracks on drive error
ld de,msgsys
jr err
errio: ; I/O error
ld de,msgio
jr err
err: ; print error string and return error signal
call crlf ; print newline
call prtstr ; print error string
or $FF ; signal error
ret ; done
errdos: ; handle BDOS errors
push af ; save return code
call crlf ; newline
ld de,msgdos ; load
call prtstr ; and print error string
pop af ; recover return code
call prthex ; print error code
or $FF ; signal error
ret ; done
;
;===============================================================================
; Storage Section
;===============================================================================
;
defdrv .db 0 ; default drive for FCB
cbftbl .dw 0 ; address of CBIOS function table
imgsiz .db 0 ; image size (count of 128 byte records)
;
destfcb .fill 36,0 ; destination FCB
srcfcb .fill 36,0 ; source FCB
;
stksav .dw 0 ; stack pointer saved at start
.fill stksiz,0 ; stack
stack .equ $ ; stack top
;
rwfun .db 0 ; active read/write function
rwfcb .dw 0 ; active read/write FCB
reccnt .db 0 ; active remaining records to read/write
bufptr .dw 0 ; active pointer into buffer
;
actdsk .db 0 ; active disk no
acttrk .dw 0 ; active track
actsec .dw 0 ; active sector
actspt .dw 0 ; active sectors per track
actfnc .dw 0 ; active function (read or write)
;
; Messages
;
msguse .db "Usage: SYSCOPY <dest>[=<source>]$"
msgamb .db "Ambiguous file specification not allowed$"
msgdlm .db "Invalid delimiter$"
msgfil .db "File not found$"
msgclo .db "File close error$"
msgdel .db "Error deleting target file$"
msgsig .db "Invalid system image (bad signature)$"
msgdos .db "DOS error, return code=0x$"
msgsel .db "Disk select error$"
msgsys .db "Non-system disk error$"
msgio .db "Disk I/O error$"
msgrd .db "Reading image... $"
msgwrt .db "Writing image... $"
msgdon .db "Done$"
sconf1 .db "Transfer system image from $"
sconf2 .db " to $"
sconf3 .db " (Y/N)? $"
;
.end

View File

@@ -1,507 +0,0 @@
TITLE 'SYSGEN - SYSTEM GENERATION PROGRAM 8/79'
; SYSTEM GENERATION PROGRAM, VERSION FOR ROMWBW
VERS EQU 20 ; X.X
;
; COPYRIGHT (C) DIGITAL RESEARCH
; 1976, 1977, 1978, 1979
;
NDISKS EQU 16 ; NUMBER OF DISK DRIVES
SECSIZ EQU 128 ; SIZE OF EACH SECTOR
LOG2SEC EQU 7 ; LOG 2 SECSIZ
;
FCB EQU 05CH ; DEFAULT FCB LOCATION
FCBCR EQU FCB+32 ; CURRENT RECORD LOCATION
TPA EQU 0100H ; TRANSIENT PROGRAM AREA
LOADP EQU 900H ; LOAD POINT FOR SYSTEM DURING LOAD/STORE
BDOS EQU 5 ; DOS ENTRY POINT
BOOT EQU 0 ; JMP TO 'BOOT' TO REBOOT SYSTEM
CONI EQU 1 ; CONSOLE INPUT FUNCTION
CONO EQU 2 ; CONSOLE OUTPUT FUNCTION
OPENF EQU 15 ; DISK OPEN FUNCTION
DREADF EQU 20 ; DISK READ FUNCTION
;
CR EQU 0DH ; CARRIAGE RETURN
LF EQU 0AH ; LINE FEED
STKSIZE EQU 16 ; SIZE OF LOCAL STACK
;
WBOOT EQU 1 ; ADDRESS OF WARM BOOT (OTHER PATCH ENTRY
;
ORG TPA ; TRANSIENT PROGRAM AREA
JP START
DB 'COPYRIGHT (C) 1978, DIGITAL RESEARCH '
;
; UTILITY SUBROUTINES
;
GETCHAR:
; READ CONSOLE CHARACTER TO REGISTER A
LD C,CONI
CALL BDOS
; CONVERT TO UPPER CASE BEFORE RETURN
CP 'A' OR 20H
RET C ; RETURN IF BELOW LOWER CASE A
CP ('Z' OR 20H) + 1
RET NC ; RETURN IF ABOVE LOWER CASE Z
AND 5FH
RET
;
PUTCHAR:
; WRITE CHARACTER FROM A TO CONSOLE
LD E,A
LD C,CONO
CALL BDOS
RET
;
CRLF: ; SEND CARRIAGE RETURN, LINE FEED
LD A,CR
CALL PUTCHAR
LD A,LF
CALL PUTCHAR
RET
;
CRMSG: ; PRINT MESSAGE ADDRESSED BY H,L TIL ZERO
; WITH LEADING CRLF
PUSH HL
CALL CRLF
POP HL ; DROP THRU TO OUTMSG0
OUTMSG:
LD A,(HL)
OR A
RET Z
; MESSAGE NOT YET COMPLETED
PUSH HL
CALL PUTCHAR
POP HL
INC HL
JP OUTMSG
;
DREAD: ; DISK READ FUNCTION VIA BDOS
LD C,DREADF
JP BDOS
;
OPEN: ; FILE OPEN FUNCTION VIA BDOS
LD C,OPENF
JP BDOS
;
; READ IMAGE DIRECTLY FROM DISK SYSTEM TRACKS USING CBIOS
; DISK NUMBER MUST BE IN (ACTDSK)
;
RDDSK:
; FORCE RETURN TO GO THROUGH DISK RESET
LD HL,RESDSK ; LOAD ADDRESS OF RESET DISK ROUTINE
PUSH HL ; AND PUT IT ON THE STACK
; SET DRIVE FOR SUBSEQUENT READS
CALL SETDSK ; SETUP DISK SPECIFIED IN A
RET NZ ; ABORT ON ERROR
; SET FUNCTION TO READ
LD HL,(CBFTBL) ; GET ADDRESS OF CBIOS FUNCTION TABLE
LD A,027H ; $27 IS CBIOS READ ENTRY OFFSET
CALL ADDHL ; SET HL TO RESULTANT ENTRY POINT
LD (ACTFNC),HL ; SAVE IT
; READ THE HEADER
LD A,12 ; START WITH 1536 BYTE HEADER (12 RECORDS)
LD (RECCNT),A ; INITIALIZE RECORD COUNTER
CALL RWDSK ; READ THE HEADER
RET NZ ; ABORT ON ERROR
; CHECK HEADER AND GET IMAGE SIZE
CALL CHKHDR ; CHECK INTEGRITY, HL = IMAGE SIZE ON RETURN
RET NZ ; ABORT ON ERROR
; CONVERT IMAGE SIZE TO COUNT OF 128-BYTE RECORDS
LD B,7 ; RIGHT SHIFT 7 BITS TO GET 128 BYTE RECORD COUNT
RDDSK1: SRL H ; SHIFT RIGHT MSB
RR L ; SHIFT LSB W/ CARRY FROM MSB
DJNZ RDDSK1 ; LOOP TILL DONE
; SET THE NUMBER OF RECORDS PENDING TO READ
LD A,L ; RECORD COUNT TO A
LD (RECCNT),A ; SET REMAINING RECORDS TO READ
; SAVE THE TOTAL IMAGE SIZE (INCLUDING HEADER) FOR LATER
ADD A,12 ; ADD THE HEADER RECORDS BACK
LD (IMGSIZ),A ; AND SAVE THE TOTAL IMAGE SIZE (IN RECORDS)
; READ THE REMAINING SYSTEM IMAGE RECORDS
CALL RWDSK ; FINISH UP
RET NZ ; ABORT ON ERROR
; PERFORM BDOS DISK RESET (CRITICAL SINCE WE MUCKED WITH CBIOS)
LD C,0DH ; BDOS RESET DISK
CALL BDOS ; DO IT
; RETURN
XOR A ; SIGNAL SUCCESS
RET ; DONE
;
; WRITE IMAGE DIRECTLY TO DISK SYSTEM TRACKS USING CBIOS
; DISK NUMBER MUST BE IN (ACTDSK)
;
WRDSK:
; FORCE RETURN TO GO THROUGH DISK RESET
LD HL,RESDSK ; LOAD ADDRESS OF RESET DISK ROUTINE
PUSH HL ; AND PUT IT ON THE STACK
; SET DRIVE FOR SUBSEQUENT WRITES
CALL SETDSK ; SETUP DISK SPECIFIED IN A
RET NZ ; ABORT ON ERROR
; SET FUNCTION TO WRITE
LD HL,(CBFTBL) ; GET ADDRESS OF CBIOS FUNCTION TABLE
LD A,02AH ; $2A IS CBIOS WRITE ENTRY OFFSET
CALL ADDHL ; SET HL TO RESULTANT ENTRY POINT
LD (ACTFNC),HL ; SAVE IT
; SETUP THE RECORD COUNT TO WRITE
LD A,(IMGSIZ) ; GET PREVIOUSLY RECORDED IMAGE SIZE
LD (RECCNT),A ; SAVE IT AS PENDING RECORD COUNT
; WRITE THE IMAGE
CALL RWDSK ; WRITE THE IMAGE
RET NZ ; ABORT ON ERROR
; RETURN
XOR A ; SIGNAL SUCCESS
RET ; DONE
;
; PERFORM BDOS DISK RESET
; REQUIRED AFTER MAKING DIRECT CBIOS DISK CALLS
;
RESDSK:
; PERFORM BDOS DISK RESET
PUSH AF ; PRESERVE STATUS
LD C,0DH ; BDOS RESET DISK
CALL BDOS ; DO IT
POP AF ; RESTORE STATUS
RET
;
; SETUP FOR CBIOS DISK ACCESS
;
SETDSK:
; SELECT DISK
LD A,(ACTDSK) ; GET ACTIVE DISK
LD C,A ; MOVE TO C
LD E,0 ; TREAT AS FIRST SELECT
CALL CBIOS ; INVOKE CBIOS WITH...
DB 01BH ; SELDSK ENTRY OFFSET
; CHECK RETURN (SETS HL TO DPH ADDRESS)
LD A,H
OR L
JP Z,ERRSEL ; HL == 0 IS SELECT ERROR
; SET HL TO DPB ADDRESS
LD DE,10 ; DPB ADDRESS IS 10 BYTES INTO DPH
ADD HL,DE ; HL := ADDRESS OF DPB POINTER
LD A,(HL) ; DEREFERENCE...
INC HL
LD H,(HL)
LD L,A ; HL := ADDRESS OF DPB
; EXTRACT SECTORS PER TRACK FROM FIRST WORD OF DPB
LD C,(HL)
INC HL
LD B,(HL) ; BC := SECTORS PER TRACK
LD (ACTSPT),BC ; SAVE IT
; ENSURE THERE ARE SYSTEM TRACKS (VERIFY THAT OFFSET FIELD IN DPB IS NOT ZERO)
LD DE,12 ; OFFSET FIELD IS 12 BYTES INTO DPB
ADD HL,DE ; POINT TO OFFSET FIELD IN DPB
LD A,(HL) ; LOAD FIRST BYTE IN A
INC HL ; POINT TO SECOND BYTE
OR (HL) ; OR WITH FIRST BYTE
JP Z,ERRSYS ; IF ZERO, ABORT (NO SYSTEM TRACKS)
; INITIALIZE FOR I/O
LD HL,0
LD (ACTTRK),HL ; ACTIVE TRACK := 0
LD (ACTSEC),HL ; ACTIVE SECTOR := 0
LD HL,LOADP
LD (BUFPTR),HL ; RESET BUFFER POINTER
;
XOR A ; SIGNAL SUCCESS
RET ; DONE
;
; READ OR WRITE (RECCNT) SECTORS TO/FROM DISK VIA CBIOS
;
RWDSK:
; SETUP TO READ/WRITE A SECTOR
LD BC,(ACTTRK) ; GET ACTIVE TRACK
CALL CBIOS ; INVOKE CBIOS WITH...
DB 01EH ; SETTRK ENTRY OFFSET
LD BC,(ACTSEC) ; GET ACTIVE SECTOR
CALL CBIOS ; INVOKE CBIOS WITH...
DB 021H ; SETSEC ENTRY OFFSET
LD BC,(BUFPTR) ; GET ACTIVE BUFFER POINTER
CALL CBIOS ; INVOKE CBIOS WITH...
DB 024H ; SETDMA ENTRY OFFSET
; READ/WRITE SECTOR
LD A,(RECCNT) ; GET THE PENDING RECORD COUNT
DEC A ; LAST RECORD?
LD C,2 ; ALLOW CACHED WRITES BY DEFAULT
JR NZ,RWDSK1 ; NOT LAST RECORD, CONTINUE
LD C,1 ; LAST RECORD, NO CACHING PLEASE
RWDSK1: LD HL,(ACTFNC) ; LOAD THE CBIOS FUNCTION VECTOR
CALL JPHL ; INDIRECT CALL (READ OR WRITE)
OR A ; SET FLAGS ON RETURN CODE
JP NZ,ERRIO ; IF NOT ZERO, ERROR ABORT
; ADJUST BUFFER POINTER
LD HL,(BUFPTR) ; GET BUFFER POINTER
LD DE,128 ; RECORD LENGTH IS 128 BYTES
ADD HL,DE ; ADJUST BUFFER PTR FOR NEXT RECORD
LD (BUFPTR),HL ; SAVE IT
; NEXT SECTOR
LD HL,(ACTSEC) ; CURRENT SECTOR
INC HL ; INCREMENT SECTOR
LD (ACTSEC),HL ; SAVE IT
; CHECK FOR END OF TRACK
LD DE,(ACTSPT) ; GET CURRENT SECTORS PER TRACK
OR A ; CLEAR CF
SBC HL,DE ; CURRENT TRACK == SECTORS PER TRACK?
JR NZ,RWDSK2 ; NO, SKIP TRACK CHANGE
; NEXT TRACK
LD HL,0
LD (ACTSEC),HL ; CURRENT SECTOR := 0
LD HL,ACTTRK ; POINT TO TRACK VARIABLE
INC (HL) ; INCREMENT TRACK
; CHECK PENDING RECORD COUNT AND LOOP OR RETURN
RWDSK2: LD HL,RECCNT
DEC (HL) ; DECREMENT PENDING RECORD COUNT
RET Z ; IF ZERO, DONE, RETURN WITH Z SET
JR RWDSK ; OTHERWISE, LOOP
;
JPHL: JP (HL) ; INDIRECT JUMP
;
; VERIFY SYSTEM IMAGE HEADER IN BUF BY CHECKING THE EXPECTED SIGNATURE.
; COMPUTE AND RETURN IMAGE SIZE (BASED ON HEADER VALUES) IN HL.
; NZ SET IF SIGNATURE ERROR.
;
CHKHDR:
; CHECK SIGNATURE
LD HL,(LOADP+580H) ; GET SIGNATURE
LD DE,0A55AH ; SIGNATURE VALUE
OR A ; CLEAR CF
SBC HL,DE ; COMPARE
JP NZ,ERRSIG ; INVALID SIGNATURE
; COMPUTE THE IMAGE SIZE (DOES NOT INCLUDE SIZE OF HEADER)
LD HL,(LOADP+5FCH) ; GET CPM_END
LD DE,(LOADP+5FAH) ; GET CPM_LOC
OR A ; CLEAR CF
SBC HL,DE ; IMAGE SIZE := CPM_END - CPM_LOC
XOR A ; SIGNAL SUCCESS
RET ; DONE
;
; INVOKE CBIOS FUNCTION
; THE CBIOS FUNCTION OFFSET MUST BE STORED IN THE BYTE
; FOLLOWING THE CALL INSTRUCTION. EX:
; CALL CBIOS
; DB 0CH ; OFFSET OF CONOUT CBIOS FUNCTION
;
CBIOS:
EX (SP),HL
LD A,(HL) ; GET THE FUNCTION OFFSET
INC HL ; POINT PAST VALUE FOLLOWING CALL INSTRUCTION
EX (SP),HL ; PUT ADDRESS BACK AT TOP OF STACK AND RECOVER HL
LD HL,(CBFTBL) ; ADDRESS OF CBIOS FUNCTION TABLE TO HL
CALL ADDHL ; DETERMINE SPECIFIC FUNCTION ADDRESS
JP (HL) ; INVOKE CBIOS
;
; ADD THE VALUE IN A TO HL (HL := HL + A)
;
ADDHL:
ADD A,L ; A := A + L
LD L,A ; PUT RESULT BACK IN L
RET NC ; IF NO CARRY, WE ARE DONE
INC H ; IF CARRY, INCREMENT H
RET ; AND RETURN
;
; START OF PROGRAM
;
START:
LD SP,STACK ; SET LOCAL STACK POINTER
LD HL,SIGNON
CALL CRMSG
; LOCATE CBIOS FUNCTION TABLE ADDRESS
LD HL,(BOOT+1) ; LOAD ADDRESS OF CP/M RESTART VECTOR
LD DE,-3 ; ADJUSTMENT FOR START OF TABLE
ADD HL,DE ; HL NOW HAS START OF TABLE
LD (CBFTBL),HL ; SAVE IT
; CHECK FOR DEFAULT FILE LOAD INSTEAD OF GET
LD A,(FCB+1); BLANK IF NO FILE
CP ' '
JP Z,GETSYS ; SKIP TO GET SYSTEM MESSAGE IF BLANK
LD DE,FCB ; TRY TO OPEN IT
CALL OPEN ;
INC A ; 255 BECOMES 00
JP NZ,RDOK ; OK TO READ IF NOT 255
; FILE NOT PRESENT, ERROR AND REBOOT
LD HL,NOFILE
CALL CRMSG
JP REBOOT
;
; FILE PRESENT - READ TO LOAD POINT
;
RDOK:
XOR A
LD (FCBCR),A; CURRENT RECORD = 0
; PRE-READ AREA FROM TPA TO LOADP
LD C,(LOADP-TPA)/SECSIZ
PRERD: ; PRE-READ FILE
PUSH BC ; SAVE COUNT
LD DE,FCB ; INPUT FILE CONTROL COUNT
CALL DREAD ; ASSUME SET TO DEFAULT BUFFER
POP BC ; RESTORE COUNT
OR A
JP NZ,BADRD ; CANNOT ENCOUNTER END-OF FILE
DEC C ; COUNT DOWN
JP NZ,PRERD ; FOR ANOTHER SECTOR
;
; SECTORS SKIPPED AT BEGINNING OF FILE
;
LD HL,LOADP
RDINP:
PUSH HL
LD B,H
LD C,L ; READY FOR DMA
CALL CBIOS ; INVOKE CBIOS WITH...
DB 024H ; SETDMA ENTRY OFFSET
LD DE,FCB ; READY FOR READ
CALL DREAD ;
POP HL ; RECALL DMA ADDRESS
OR A ; 00 IF READ OK
JP NZ,PUTSYS ; ASSUME EOF IF NOT.
; MORE TO READ, CONTINUE
LD DE,SECSIZ
ADD HL,DE ; HL IS NEW LOAD ADDRESS
JP RDINP
;
BADRD: ; EOF ENCOUNTERED IN INPUT FILE
LD HL,BADFILE
CALL CRMSG
JP REBOOT
;
GETSYS:
CALL CRLF
LD HL,ASKGET ; GET SYSTEM?
CALL CRMSG
CALL GETCHAR
CP CR
JP Z,PUTSYS ; SKIP IF CR ONLY
;
SUB 'A' ; NORMALIZE DRIVE NUMBER
CP NDISKS ; VALID DRIVE?
JP C,GETC ; SKIP TO GETC IF SO
; INVALID DRIVE NUMBER
CALL BADDISK
JP GETSYS ; TO TRY AGAIN
;
GETC:
; SELECT DISK GIVEN BY REGISTER A
ADD A,'A'
LD (GDISK),A; TO SET MESSAGE
SUB 'A'
LD (ACTDSK),A ; SAVE ACTIVE DISK NO
; ; GETSYS, SET RW TO READ AND GET THE SYSTEM
CALL CRLF
LD HL,GETMSG
CALL OUTMSG
CALL GETCHAR
CP CR
JP NZ,REBOOT
CALL CRLF
CALL RDDSK
JP NZ,GETSYS
LD HL,DONE
CALL OUTMSG
;
; PUT SYSTEM
;
PUTSYS:
CALL CRLF
LD HL,ASKPUT
CALL CRMSG
CALL GETCHAR
CP CR
JP Z,REBOOT
SUB 'A'
CP NDISKS
JP C,PUTC
; INVALID DRIVE NAME
CALL BADDISK
JP PUTSYS ; TO TRY AGAIN
;
PUTC: ; SET DISK FROM REGISTER C
ADD A,'A'
LD (PDISK),A ; MESSAGE SET
SUB 'A'
LD (ACTDSK),A ; SAVE ACTIVE DISK NO
; PUT SYSTEM
LD HL,PUTMSG
CALL CRMSG
CALL GETCHAR
CP CR
JP NZ,REBOOT
CALL CRLF
CALL WRDSK
JP NZ,PUTSYS
LD HL,DONE
CALL OUTMSG
JP PUTSYS ; FOR ANOTHER PUT OPERATION
;
REBOOT:
CALL CRLF
JP BOOT
;
ERRSEL:
LD HL,SELMSG
JP ERR
;
ERRSYS:
LD HL,SYSMSG
JP ERR
;
ERRIO:
LD HL,IOMSG
JP ERR
;
ERRSIG:
LD HL,SIGMSG
JP ERR
;
ERR:
CALL OUTMSG
OR A,0FFH
RET
;
BADDISK:;BAD DISK NAME
LD HL,QDISK
CALL CRMSG
RET
;
; DATA AREAS
; MESSAGES
;
SIGNON: DB 'ROMWBW SYSGEN VER '
DB VERS/10+'0','.',VERS MOD 10+'0'
DB 0
ASKGET: DB 'SOURCE DRIVE NAME (OR RETURN TO SKIP): ',0
GETMSG: DB 'SOURCE ON '
GDISK: DS 1 ; FILLED IN AT GET FUNCTION
DB ':, THEN TYPE RETURN',0
ASKPUT: DB 'DESTINATION DRIVE NAME (OR RETURN TO REBOOT): ',0
PUTMSG: DB 'DESTINATION ON '
PDISK: DS 1 ; FILLED IN AT PUT FUNCTION
DB ':, THEN TYPE RETURN',0
ERRMSG: DB 'PERMANENT ERROR, TYPE RETURN TO IGNORE',0
DONE: DB 'FUNCTION COMPLETE',0
QDISK: DB 'INVALID DRIVE NAME (USE A-P)',0
NOFILE: DB 'NO SOURCE FILE ON DISK',0
BADFILE:
DB 'SOURCE FILE INCOMPLETE',0
SELMSG: DB 'DISK SELECTION ERROR',0
SYSMSG: DB 'NON-SYSTEM DISK ERROR',0
IOMSG: DB 'FATAL DISK I/O ERROR',0
SIGMSG: DB 'INVALID SYSTEM IMAGE (BAD SIGNATURE)',0
;
; VARIABLES
;
CBFTBL DW 0 ; ADDRESS OF CBIOS FUNCTION TABLE
IMGSIZ DB 0 ; IMAGE SIZE (COUNT OF 128 BYTE RECORDS)
;
RWFUN DB 0 ; ACTIVE READ/WRITE FUNCTION
RECCNT DB 0 ; ACTIVE REMAINING RECORDS TO READ/WRITE
BUFPTR DW 0 ; ACTIVE POINTER INTO BUFFER
;
ACTDSK DB 0 ; ACTIVE DISK NO
ACTTRK DW 0 ; ACTIVE TRACK
ACTSEC DW 0 ; ACTIVE SECTOR
ACTSPT DW 0 ; ACTIVE SECTORS PER TRACK
ACTFNC DW 0 ; ACTIVE FUNCTION (READ OR WRITE)
DS STKSIZE*2
STACK:
;
END

View File

@@ -1,406 +0,0 @@
;===============================================================================
; Talk - Bare minimum terminal interface
;
; Console talks to designated character device.
;
;===============================================================================
;
; Author: Wayne Warthen (wwarthen@gmail.com)
;_______________________________________________________________________________
;
; Usage:
; TALK TTY:|CRT:|BAT:|UC1:
;_______________________________________________________________________________
;
; Change Log:
;_______________________________________________________________________________
;
; ToDo:
; 1) Handle ZCPR devices somehow
;_______________________________________________________________________________
;
;===============================================================================
; Definitions
;===============================================================================
;
stksiz .equ $40 ; Working stack size
;
restart .equ $0000 ; CP/M restart vector
bdos .equ $0005 ; BDOS invocation vector
iobyte .equ $0003 ; IOBYTE address
;
const .equ $06 ; CBIOS CONST function dispatch table offset
conin .equ $09 ; CBIOS CONIN function dispatch table offset
conout .equ $0C ; CBIOS CONOUT function dispatch table offset
;
;===============================================================================
; Code Section
;===============================================================================
;
.org $100
;
; setup stack (save old value)
ld (stksav),sp ; save stack
ld sp,stack ; set new stack
;
; initialization
call init ; initialize
jr nz,exit ; abort if init fails
;
ld de,msghel ; hello message
call prtstr ; print it
;
; save active iobyte (console)
ld a,(iobyte) ; get active IOBYTE
ld (iobcon),a ; save it to iobcon
;
; parse command line
call parse ; parse command line
jr nz,exit ; abort if parse fails
;
; startup message
;
ld de,msgtlk1 ; message prefix
call prtstr ; print it
call prtstrz ; print dev name at HL
ld de,msgtlk2 ; message suffix
call prtstr ; print it
;
; do the real work
call talk ; do the real work
;
; restore original iobyte
ld a,(iobcon) ; load original iobyte
ld (iobyte),a
;
ld de,msgbye ; goodbye message
call prtstr ; print it
;
exit: ; clean up and return to command processor
;
call crlf ; formatting
;
ld sp,(stksav) ; restore stack
ret ; return to CP/M w/o reset
;
; Initialization
;
init:
; add check for RomWBW?
;
; locate cbios function table address
ld hl,(restart+1) ; load address of CP/M restart vector
ld de,-3 ; adjustment for start of table
add hl,de ; HL now has start of table
ld (cbftbl),hl ; save it
; return success
xor a
ret
;
; Parse command line
; If success, Z set and HL points to device name string (zero terminated)
; ... else NZ set.
;
parse:
;
ld hl,$81 ; point to start of command tail (after length byte)
call nonblank ; skip blanks
jp z,erruse ; no parms
;
ld c,0 ; current table entry
ex de,hl ; point to parm with de
ld hl,devtbl ; point to device table with hl
;
parse0: ; compare loop
push bc
push de
push hl
call strcmp ; compare strings
pop hl
pop de
pop bc
jr z,parse1 ; if Z, we have a match
inc c ; increment table entry
ld a,5 ; bump hl by
call addhl ; ... table entry size
ld a,c ; get the table entry num to A
cp 4 ; past end of table?
jr nz,parse0 ; loop till done
jp errprm ; handle parm error
;
parse1: ; handle match
ld a,c ; device num to A
ld (iobcom),a ; save as com device iobyte
; return success
xor a ; signal error
ret ; and return
;
; Main routine
;
talk: ; CON: --> UC1:
;
ld a,(iobcon) ; setup iobyte to read from CON:
ld (iobyte),a
;
call cbios ; check for char pending using cbios
.db const ; ... const function
or a ; set flags
jr z,next ; no char ready
call cbios ; read char using cbios
.db conin ; ... conin function
cp $1A ; check for exit request (ctrl+z)
ret z ; if so, bail out
;
push af ; save the char we read
ld a,(iobcom) ; setup iobyte to read from UC1:
ld (iobyte),a
pop af ; recover the character
;
ld c,a ; move it to C
call cbios ; write char using cbios
.db conout ; ... conout function
;
next: ; UC1: --> CON:
;
ld a,(iobcom) ; setup iobyte to read from com device
ld (iobyte),a
;
call cbios ; check for char pending using cbios
.db const ; ... const function
or a ; set flags
jr z,talk ; no char ready
call cbios ; read char using cbios
.db conin ; ... conin function
;
push af ; save the char we read
ld a,(iobcon) ; setup iobyte to read from CON:
ld (iobyte),a
pop af ; recover the character
;
ld c,a ; move it to C
call cbios ; write char using cbios
.db conout ; ... conout function
;
jr talk ; loop
;
;
; Print character in A without destroying any registers
;
prtchr:
push bc ; save registers
push de
push hl
ld e,a ; character to print in E
ld c,$02 ; BDOS function to output a character
call bdos ; do it
pop hl ; restore registers
pop de
pop bc
ret
;
; Print a '$' terminated string at (DE) without destroying any registers
;
prtstr:
push bc ; save registers
push de
push hl
ld c,$09 ; BDOS function to output a '$' terminated string
call bdos ; do it
pop hl ; restore registers
pop de
pop bc
ret
;
; Print a zero terminated string at (HL) without destroying any registers
;
prtstrz:
push hl
;
prtstrz1:
ld a,(hl) ; get next char
or a
jr z,prtstrz2
call prtchr
inc hl
jr prtstrz1
;
prtstrz2:
pop hl ; restore registers
ret
;
; Print the value in A in hex without destroying any registers
;
prthex:
push af ; save AF
push de ; save DE
call hexascii ; convert value in A to hex chars in DE
ld a,d ; get the high order hex char
call prtchr ; print it
ld a,e ; get the low order hex char
call prtchr ; print it
pop de ; restore DE
pop af ; restore AF
ret ; done
;
; Convert binary value in A to ascii hex characters in DE
;
hexascii:
ld d,a ; save A in D
call hexconv ; convert low nibble of A to hex
ld e,a ; save it in E
ld a,d ; get original value back
rlca ; rotate high order nibble to low bits
rlca
rlca
rlca
call hexconv ; convert nibble
ld d,a ; save it in D
ret ; done
;
; Convert low nibble of A to ascii hex
;
hexconv:
and $0F ; low nibble only
add a,$90
daa
adc a,$40
daa
ret
;
; Start a new line
;
crlf:
ld a,13 ; <CR>
call prtchr ; print it
ld a,10 ; <LF>
jr prtchr ; print it
;
; Get the next non-blank character from (HL).
;
nonblank:
ld a,(hl) ; load next character
or a ; string ends with a null
ret z ; if null, return pointing to null
cp ' ' ; check for blank
ret nz ; return if not blank
inc hl ; if blank, increment character pointer
jr nonblank ; and loop
;
; Check character at (DE) for delimiter.
;
delim: or a
ret z
cp ' ' ; blank
ret z
jr c,delim1 ; handle control characters
cp '=' ; equal
ret z
cp '_' ; underscore
ret z
cp '.' ; period
ret z
cp ':' ; colon
ret z
cp $3b ; semicolon
ret z
cp '<' ; less than
ret z
cp '>' ; greater than
ret
delim1:
; treat control chars as delimiters
xor a ; set Z
ret ; return
;
; Compare $ terminated strings at HL & DE
; If equal return with Z set, else NZ
;
strcmp:
;
ld a,(de) ; get current source char
cp (hl) ; compare to current dest char
ret nz ; compare failed, return with NZ
or a ; set flags
ret z ; end of string, match, return with Z set
inc de ; point to next char in source
inc hl ; point to next char in dest
jr strcmp ; loop till done
;
; Invoke CBIOS function
; The CBIOS function offset must be stored in the byte
; following the call instruction. ex:
; call cbios
; .db $0C ; offset of CONOUT CBIOS function
;
cbios:
ex (sp),hl
ld a,(hl) ; get the function offset
inc hl ; point past value following call instruction
ex (sp),hl ; put address back at top of stack and recover HL
ld hl,(cbftbl) ; address of CBIOS function table to HL
call addhl ; determine specific function address
jp (hl) ; invoke CBIOS
;
; Add the value in A to HL (HL := HL + A)
;
addhl:
add a,l ; A := A + L
ld l,a ; Put result back in L
ret nc ; if no carry, we are done
inc h ; if carry, increment H
ret ; and return
;
; Errors
;
erruse: ; command usage error (syntax)
ld de,msguse
jr err
errprm: ; command parameter error (syntax)
ld de,msgprm
jr err
err: ; print error string and return error signal
call crlf ; print newline
call prtstr ; print error string
or $FF ; signal error
ret ; done
errdos: ; handle BDOS errors
push af ; save return code
call crlf ; newline
ld de,msgdos ; load
call prtstr ; and print error string
pop af ; recover return code
call prthex ; print error code
or $FF ; signal error
ret ; done
;
;===============================================================================
; Storage Section
;===============================================================================
;
cbftbl .dw 0 ; address of CBIOS function table
;
iobcon .db 0 ; iobyte value for console
iobcom .db 0 ; iobyte value for com device
;
devtbl: ; device table
.db "TTY:",0
.db "CRT:",0
.db "BAT:",0
.db "UC1:",0
;
stksav .dw 0 ; stack pointer saved at start
.fill stksiz,0 ; stack
stack .equ $ ; stack top
;
; Messages
;
msghel .db 13,10,"Talk v1.0",13,10,"$"
msgbye .db 13,10,13,10,"*** Finished talking ***","$"
msgtlk1 .db 13,10,"Talking on device $"
msgtlk2 .db " (press <Ctrl+Z> to exit)...",13,10,13,10,"$"
msguse .db "Usage: TALK TTY:|CRT:|BAT:|UC1:$"
msgprm .db "Parameter error$"
msgdos .db "DOS error, return code=0x$"
;
.end

BIN
Apps/apps-bins/access.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/banker.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/chars.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/cls.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/cpmname.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/diskcopy.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/findfile.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/label.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/ls.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/map.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/meta.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/multifmt.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/noaccess.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/setlabel.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/stop.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/sysgen.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/termtype.com Normal file

Binary file not shown.

BIN
Apps/apps-bins/view.com Normal file

Binary file not shown.

BIN
Apps/apps-srcs/sources.lbr Normal file

Binary file not shown.

BIN
Apps/core/access.com Normal file

Binary file not shown.

BIN
Apps/core/cpmname.com Normal file

Binary file not shown.

BIN
Apps/core/findfile.com Normal file

Binary file not shown.

BIN
Apps/core/map.com Normal file

Binary file not shown.

BIN
Apps/core/meta.com Normal file

Binary file not shown.

BIN
Apps/core/multifmt.com Normal file

Binary file not shown.

BIN
Apps/core/noaccess.com Normal file

Binary file not shown.

BIN
Apps/core/rem.com Normal file

Binary file not shown.

BIN
Apps/core/setlabel.com Normal file

Binary file not shown.

BIN
Apps/core/sysgen.com Normal file

Binary file not shown.

BIN
Apps/core/termtype.com Normal file

Binary file not shown.

BIN
Apps/core/view.com Normal file

Binary file not shown.

20
Apps/crossdev/APPLVERS.H Normal file
View File

@@ -0,0 +1,20 @@
/****************************/
/* applvers.h dwg - 2.0.0.0 */
/****************************/
#define A_RMJ 2
#define A_RMN 0
#define A_RUP 0
#define A_RTP 0
#define A_MONTH 6
#define A_DAY 10
#define A_YEAR 2012
#define A_YR 12
/********************/
/* eof - applvers.h */
/********************/


View File

@@ -0,0 +1,67 @@
; asmiface.asm 6/4/2012 dwg -
extrn .begin,.chl,.swt
extrn csave,cret,.move
global xrega_,1
global xregbc_,2
global xregde_,2
global xreghl_,2
PUBLIC asmif_
asmif_: lxi d,.2
call csave
LXI H,8-.2 ; pick up 1st parm "function address"
DAD SP
MOV E,M
INX H
MOV D,M
xchg
shld callad+1
LXI H,10-.2
DAD SP
MOV E,M
INX H
MOV D,M ; DE = parm
xchg
shld xregbc_
LXI H,12-.2
DAD SP
MOV E,M
INX H
MOV D,M
xchg
shld xregde_
LXI H,14-.2
DAD SP
MOV E,M
INX H
MOV D,M
xchg
shld xreghl_
lhld xregbc_
mov b,h
mov c,l ; setup B&C
lhld xregde_
xchg ; setup D&E
lhld xreghl_ ; setup H&L
callad: call 0e639h ; setlu
sta xrega_
shld xreghl_
xchg
shld xregde_
mov l,c
mov h,b
shld xregbc_
RET ; HL has return value
.2 EQU 0
END


14
Apps/crossdev/ASMIFACE.H Normal file
View File

@@ -0,0 +1,14 @@
/*****************************/
/* asmiface.H 6/4/2012 dwg - */
/*****************************/
extern char xrega;
extern unsigned int xregbc;
extern unsigned int xregde;
extern unsigned int xreghl;
extern asmif(); /* asmif(0xe60,bc,de,hl); */
/********************/
/* eof - asmiface.h */
/********************/


4
Apps/crossdev/BANNER.H Normal file
View File

@@ -0,0 +1,4 @@
/* banner.h */
extern sbanner();
extern banner();


View File

@@ -0,0 +1,71 @@
; bdoscall.asm 3/10/2012 dwg - bdos binding for Aztec C
global drega_,1
global dregbc_,2
global dregde_,2
global dreghl_,2
PUBLIC lurst_
lurst_:
push b
push d
push h
push psw
mvi c,37
lxi d,127
lxi b,127
call 5
pop psw
pop h
pop d
pop b
RET
PUBLIC bdoscall_
bdoscall_:
push b
push d
push h
push psw
lhld dregbc_
mov b,h
mov c,l
lhld dregde_
mov d,h
mov e,l
lhld dreghl_
lda drega_
call 5
sta drega_
shld dreghl_
mov l,e
mov h,d
shld dregde_
mov l,c
mov h,b
shld dregbc_
pop psw
pop h
pop d
pop b
RET
END


8
Apps/crossdev/BDOSCALL.H Normal file
View File

@@ -0,0 +1,8 @@
/* bdoscall.h 3/10/2012 dwg - header file for bdoscall */
extern char drega;
extern unsigned int dregbc;
extern unsigned int dregde;
extern unsigned int dreghl;
extern bdoscall();


BIN
Apps/crossdev/BIN/AS80.EXE Normal file

Binary file not shown.

BIN
Apps/crossdev/BIN/CCZ.EXE Normal file

Binary file not shown.

BIN
Apps/crossdev/BIN/HEX80.EXE Normal file

Binary file not shown.

Binary file not shown.

BIN
Apps/crossdev/BIN/LN80.EXE Normal file

Binary file not shown.

BIN
Apps/crossdev/BIN/MAKE.EXE Normal file

Binary file not shown.

View File

@@ -0,0 +1,80 @@
; bioscall.asm 3/10/2012 dwg - bios binding for Aztec C
global irega_,1
global iregbc_,2
global iregde_,2
global ireghl_,2
public getmeta_
getmeta_:
push psw
push b
push d
push h
lxi b,4
lxi d,0
call 0e61bh
lxi d,0
call 0e61eh
lxi d,11
call 0e621h
lxi d,80h
call 0e624h
call 0e627h
pop h
pop d
pop b
pop psw
ret
PUBLIC bioscall_
bioscall_:
push b
push d
push h
push psw
lhld iregbc_
mov b,h
mov c,l
lhld iregde_
mov d,h
mov e,l
lhld ireghl_
shld mycall+1
lda irega_
mycall: call 5
sta irega_
shld ireghl_
mov l,e
mov h,d
shld iregde_
mov l,c
mov h,b
shld iregbc_
pop psw
pop h
pop d
pop b
RET
END


8
Apps/crossdev/BIOSCALL.H Normal file
View File

@@ -0,0 +1,8 @@
/* bioscall.h 3/10/2012 dwg - header file for bdoscall */
extern char irega;
extern unsigned int iregbc;
extern unsigned int iregde;
extern unsigned int ireghl;
extern bioscall();


41
Apps/crossdev/CBANNER.C Normal file
View File

@@ -0,0 +1,41 @@
/* cbanner.c 3/12/2012 dwg - */
#include "portab.h"
#include "globals.h"
#include "applvers.h"
char * lines = "----------------------------------------";
char * line1 = "12345678.123 mm/dd/yyyy Version x.x.x.x";
char * line2 = "S/N CPM80-DWG-654321 Licensed under GPL3";
char * line3 = "Copyright (C) 2011-12 Douglas W. Goodall";
sbanner(program)
char *program;
{
char szTemp[128];
printf("%s ",program);
printf("%2d/%2d/%4d ",A_MONTH,A_DAY,A_YEAR);
printf("Version %d.%d.%d.%d ",A_RMJ,A_RMN,A_RUP,A_RTP);
printf("COPR Douglas Goodall Licensed w/GPLv3\n");
}
banner(program)
char *program;
{
char szTemp[128];
printf("%s\n",lines);
strcpy(szTemp,program);
while(12 > strlen(szTemp)) {
strcat(szTemp," ");
}
printf("%s ",szTemp);
printf("%2d/%2d/%4d ",A_MONTH,A_DAY,A_YEAR);
printf("Version %d.%d.%d.%d\n",A_RMJ,A_RMN,A_RUP,A_RTP);
printf("%s\n",line2);
printf("%s\n",line3);
printf("%s\n",lines);
}


1
Apps/crossdev/CBANNER.H Normal file
View File

@@ -0,0 +1 @@

133
Apps/crossdev/CHARS.C Normal file
View File

@@ -0,0 +1,133 @@
/* chars.c 6/7/2012 dwg - test command line arguments */
#include "stdio.h"
#include "portab.h"
#include "globals.h"
#include "std.h"
#include "cpm80.h"
#include "cpmappl.h"
#include "applvers.h"
#define TOP 0
#define LEFT 4
char map[256] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0 */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 1 */
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 3 0 - 9 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 4 A - O */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 5 P - Z */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6 a - o */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 7 p - z */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 8 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B 0 - 9 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C A - O */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D P - Z */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E a - o */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F p - z */
};
char attroff[] = { 27, '[', 'm', 0 };
char attrbold[] = { 27, '[', '1', 'm', 0 };
char attrlow[] = { 27, '[', '2', 'm', 0 };
char attrundr[] = { 27, '[', '4', 'm', 0 };
char attrblnk[] = { 27, '[', '5', 'm', 0 };
char attrrevs[] = { 27, '[', '7', 'm', 0 };
char attrinvs[] = { 27, '[', '8', 'm', 0 };
char graphon[] = { 27, 'F', 0 };
char graphoff[] = { 27, 'G', 0 };
char atreset[] = "0";
char atbold[] = "1";
char atdim[] = "2";
char atundrscr[] = "4";
char atblink[] = "5";
char atrevs[] = "7";
char athidden[] = "8";
char fgblack[] = "30";
char fgred[] = "31";
char fggreen[] = "32";
char fgyellow[] = "33";
char fgblue[] = "34";
char fgmagenta[] = "35";
char fgcyan[] = "36";
char fgwhite[] = "37";
char bgblack[] = "40";
char bgred[] = "41";
char bggreen[] = "42";
char bgyellow[] = "43";
char bgblue[] = "44";
char bgmagenta[] = "45";
char bgcyan[] = "46";
char bgwhite[] = "47";
dispattr(attr,fg,bg)
char * attr;
char * fg;
char * bg;
{
printf("%c[%s;%s;%sm",27,attr,fg,bg);
}
int main(argc,argv)
int argc;
char *argv[];
{
int i,j,k;
int x,y;
if(1 < argc) {
for(i=1;i<argc;i++) {
printf("%c",atoi(argv[i]));
}
} else {
crtinit();
crtclr();
crtlc(0,0);
dispattr(atbold,fggreen,bgblack);
banner("CHARS");
printf("%s",attroff);
dispattr(atbold,fgcyan,bgblack);
for(x=0;x<16;x++) {
crtlc(TOP+6,LEFT+(x*4)+5);
printf("[%x]",x);
}
printf("%s",attroff);
for(y=0;y<16;y++) {
crtlc(TOP+y+7,LEFT+0);
dispattr(atbold,fgcyan,bgblack);
printf("[%x]",y);
printf("%s",attroff);
for(x=0;x<16;x++) {
crtlc(TOP+y+7,LEFT+(x*4)+6);
if(1 == map[(y*16)+x]) {
printf(".");
} else {
printf("%c",(y*16)+x);
}
}
dispattr(atbold,fgcyan,bgblack);
printf(" [%x]",y);
printf("%s",attroff);
}
}
return 0;
}


57
Apps/crossdev/CLOGICAL.C Normal file
View File

@@ -0,0 +1,57 @@
/* clogical.c 6/4/2012 dwg - */
#include "portab.h"
#include "cpmbios.h"
#include "asmiface.h"
lugcur(drive)
{
asmif(pGETLU,drive,0,0);
return xregde;
}
lugnum(drive)
{
asmif(pGETLU,drive,0,0);
return xreghl;
}
lugdu(drive)
{
asmif(pGETLU,drive,0,0);
return xregbc>>8;
}
luscur(drive,lunum)
{
asmif(pGETLU,drive,0,0);
/* A = Result 0=OK */
/* B = devunit */
/* DE = current */
/* HL = numlu */
/* BC = devunit*256+drive */
/* DE = current */
/* HL = numlu */
asmif(pSETLU,xregbc,lunum,xreghl);
}
lusnum(drive,numlu)
{
asmif(pGETLU,drive,0,0);
/* A = Result 0=OK */
/* B = devunit */
/* DE = current */
/* HL = numlu */
/* BC = devunit*256+drive */
/* DE = current */
/* HL = numlu */
asmif(pSETLU,xregbc,xregde,numlu);
}
/********************/
/* eof - clogical.c */
/********************/


18
Apps/crossdev/CLOGICAL.H Normal file
View File

@@ -0,0 +1,18 @@
/*****************************/
/* clogical.H 6/4/2012 dwg - */
/*****************************/
#define METATRK 0
#define METASEC 11
extern lugdu();
extern lugcur();
extern luscur();
extern lugnum();
extern lusnum();
/********************/
/* eof - clogical.h */
/********************/


53
Apps/crossdev/CMEMORY.C Normal file
View File

@@ -0,0 +1,53 @@
/* cmemory.c 3/13/2012 dwg - */
#include "portab.h"
/* #include "cpmbind.h" */
memcmp(xptr,yptr,count)
u8 * xptr;
u8 * yptr;
int count;
{
u8 * x;
u8 * y;
int i;
x = xptr;
y = yptr;
for(i=0;i<count;i++) {
if(*x++ != *y++) return FALSE;
}
return TRUE;
}
memcpy(dstptr,srcptr,count)
u8 * dstptr;
u8 * srcptr;
int count;
{
u8 * s;
u8 * d;
int i;
s = srcptr;
d = dstptr;
for(i=0;i<count;i++) {
*d++ = *s++;
}
}
memset(dstptr,data,count)
u8 * dstptr;
u8 data;
u16 count;
{
u8 * p;
int i;
p = dstptr;
for(i=0;i<count;i++) {
*p++ = data;
}
}


108
Apps/crossdev/CNAMEPT1.C Normal file
View File

@@ -0,0 +1,108 @@
/* cnamept1.c 5/24/2012 dwg - added bootlu */
#include "stdio.h"
#include "stdlib.h"
#include "portab.h"
#include "std.h"
#include "cnfgdata.h"
#include "syscfg.h"
extern pager();
char cache[17];
cnamept1(syscfg)
struct SYSCFG * syscfg;
{
strcpy(cache,"syscfg->cnfgdata");
printf("syscfg->jmp jp 0%04xh",syscfg->jmp.address);
pager();
printf("syscfg->cnfloc .dw 0%04xh",syscfg->cnfloc);
pager();
printf("syscfg->tstloc .dw 0%04xh",syscfg->tstloc);
pager();
printf("syscfg->varloc .dw 0%04xh",syscfg->varloc);
pager();
printf("%s.rmj = %d",cache,syscfg->cnfgdata.rmj);
pager();
printf("%s.rmn = %d",cache,syscfg->cnfgdata.rmn);
pager();
printf("%s.rup = %d",cache,syscfg->cnfgdata.rup);
pager();
printf("%s.rtp = %d",cache,syscfg->cnfgdata.rtp);
pager();
printf("%s.diskboot = ",cache);
switch(syscfg->cnfgdata.diskboot) {
case TRUE: printf("TRUE"); break;
case FALSE: printf("FALSE"); break;
}
pager();
printf("%s.devunit = 0x%02x",cache,
syscfg->cnfgdata.devunit);
pager();
printf("%s.bootlu = 0x%04x",cache,
syscfg->cnfgdata.bootlu);
pager();
printf("%s.freq = %dMHz",cache,syscfg->cnfgdata.freq);
pager();
printf("%s.platform = ",cache);
switch(syscfg->cnfgdata.platform) {
case PLT_N8VEM: printf("N8VEM"); break;
case PLT_ZETA: printf("ZETA"); break;
case PLT_N8: printf("N8"); break;
}
pager();
printf("%s.dioplat = ",cache);
switch(syscfg->cnfgdata.dioplat) {
case DPNONE: printf("DIOPLT_NONE"); break;
case DPDIO: printf("DIOPLT_DISKIO"); break;
case DPZETA: printf("DIOPLT_ZETA"); break;
case DPDIDE: printf("DIOPLT_DIDE"); break;
case DPN8: printf("DIOPLT_N8"); break;
case DPDIO3: printf("DIOPLT_DISKIO3"); break;
default: printf("Unknown"); break;
}
pager();
printf("%s.vdumode = ",cache);
switch(syscfg->cnfgdata.vdumode) {
case VPNONE: printf("VDUPLT_NONE"); break;
case VPVDU: printf("VDUPLT_VDU"); break;
case VPVDUC: printf("VDUPLT_VDUC"); break;
case VPPROPIO: printf("VDUPLT_PROPIO"); break;
case VPN8: printf("VDUPLT_VPN8"); break;
default: printf("Unknown!!"); break;
}
pager();
printf("%s.romsize = %d",cache,
syscfg->cnfgdata.romsize);
pager();
printf("%s.ramsize = %d",cache,
syscfg->cnfgdata.ramsize);
pager();
}
/********************/
/* eof - cnamecp1.c */
/********************/


113
Apps/crossdev/CNAMEPT2.C Normal file
View File

@@ -0,0 +1,113 @@
/* cnamept2.c 5/24/2012 dwg - */
#include "stdio.h"
#include "stdlib.h"
#include "portab.h"
#include "std.h"
#include "cnfgdata.h"
#include "syscfg.h"
extern pager();
char cache[17];
cnamept2(syscfg)
struct SYSCFG * syscfg;
{
strcpy(cache,"syscfg->cnfgdata");
printf("%s.clrramdk = ",cache);
switch(syscfg->cnfgdata.clrramdk) {
case CLRNEV: printf("CLR_NEVER"); break;
case CLRAUTO: printf("CLR_AUTO"); break;
case CLRALLW: printf("CLR_ALLWAYS"); break;
}
pager();
printf("%s.dskyenable = ",cache);
switch(syscfg->cnfgdata.dskyenable) {
case TRUE: printf("TRUE"); break;
case FALSE: printf("FALSE"); break;
}
pager();
printf("%s.uartenable = ",cache);
switch(syscfg->cnfgdata.uartenable) {
case TRUE: printf("TRUE"); break;
case FALSE: printf("FALSE"); break;
}
pager();
printf("%s.vduenable = ",cache);
switch(syscfg->cnfgdata.vduenable) {
case TRUE: printf("TRUE"); break;
case FALSE: printf("FALSE"); break;
}
pager();
printf("%s.fdenable = ",cache);
switch(syscfg->cnfgdata.fdenable) {
case TRUE: printf("TRUE"); break;
case FALSE: printf("FALSE"); break;
}
pager();
if(TRUE == syscfg->cnfgdata.fdenable) {
printf("%s.fdtrace = ",cache);
switch(syscfg->cnfgdata.fdtrace) {
case 0: printf("Silent"); break;
case 1: printf("Fatal Errors"); break;
case 2: printf("All Errors"); break;
case 3: printf("Everything"); break;
default: printf("Unknown!!"); break;
}
pager();
printf("%s.fdmedia = ",cache);
switch(syscfg->cnfgdata.fdmedia) {
case FDM720: printf("FDM720");
printf(" 3.5 720KB 2-sided 80 Trks 9 Sectors");
break;
case FDM144: printf("FDM144");
printf(" 3.5 1.44MB 2-sided 80 Trks 18 Sectors");
break;
case FDM360: printf("FDM360");
printf(" 5.25 360KB 2-sided 40 Trks 9 Sectors");
break;
case FDM120: printf("FDM120");
printf(" 3.5 1.2MB 2-sided 80 Trks 15 Sectors");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.fdmediaalt = ",cache);
switch(syscfg->cnfgdata.fdmediaalt) {
case FDM720: printf("FDM720");
printf(" 3.5 720KB 2-sided 80 Trks 9 Sectors");
break;
case FDM144: printf("FDM144");
printf(" 3.5 1.44MB 2-sided 80 Trks 18 Sectors");
break;
case FDM360: printf("FDM360");
printf(" 5.25 360KB 2-sided 40 Trks 9 Sectors");
break;
case FDM120: printf("FDM120");
printf(" 3.5 1.2MB 2-sided 80 Trks 15 Sectors");
break;
}
pager();
}
}
/********************/
/* eof - cnamept2.c */
/********************/


216
Apps/crossdev/CNAMEPT3.C Normal file
View File

@@ -0,0 +1,216 @@
/* cnamept2.c 5/24/2012 dwg - */
#include "stdio.h"
#include "stdlib.h"
#include "portab.h"
#include "std.h"
#include "cnfgdata.h"
#include "syscfg.h"
extern pager();
char cache[17];
cnamept3(syscfg)
struct SYSCFG * syscfg;
{
strcpy(cache,"syscfg->cnfgdata");
printf("%s.fdmauto = ",cache);
switch(syscfg->cnfgdata.fdmauto) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
}
pager();
printf("%s.ideenable = ",cache);
switch(syscfg->cnfgdata.ideenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
}
pager();
if(TRUE == syscfg->cnfgdata.ideenable) {
printf("%s.idetrace = ",cache);
switch(syscfg->cnfgdata.idetrace) {
case 0: printf("SILENT");
break;
case 1: printf("ERRORS");
break;
case 2: printf("EVERYTHING");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.de8bit = ",cache);
switch(syscfg->cnfgdata.ide8bit) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.idecapacity = %dMB",cache,
syscfg->cnfgdata.idecapacity);
pager();
}
printf("%s.ppideenable = ",cache);
switch(syscfg->cnfgdata.ppideenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
}
pager();
if(TRUE == syscfg->cnfgdata.ppideenable) {
printf("%s.ppidetrace = ",cache);
switch(syscfg->cnfgdata.ppidetrace) {
case 0: printf("SILENT");
break;
case 1: printf("ERRORS");
break;
case 2: printf("EVERYTHING");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.ppide8bit = ",cache);
switch(syscfg->cnfgdata.ppide8bit) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.ppidecapacity = %dKB",cache,
syscfg->cnfgdata.ppidecapacity);
pager();
printf("%s.ppideslow = ",cache);
switch(syscfg->cnfgdata.ppideslow) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
}
printf("%s.boottype = ",cache);
switch(syscfg->cnfgdata.boottype) {
case BTMENU: printf("BT_MENU");
break;
case BTAUTO: printf("BT_AUTO");
break;
}
pager();
printf("%s.boottimeout = %d seconds",cache,
syscfg->cnfgdata.boottimeout);
pager();
printf("%s.bootdefault = %c:",cache,
syscfg->cnfgdata.bootdefault);
pager();
printf("%s.baudrate = %u (0x%04x) Baud",cache,
syscfg->cnfgdata.baudrate,syscfg->cnfgdata.baudrate);
pager();
if(PLT_N8 == syscfg->cnfgdata.platform) {
printf("%s.ckdiv = %d",cache,
syscfg->cnfgdata.ckdiv);
pager();
printf("%s.memwait = 0x%02x",cache,
syscfg->cnfgdata.memwait);
pager();
printf("%s.iowait = 0x%02x",cache,syscfg->cnfgdata.iowait);
pager();
printf("%s.cntlb0 = 0x%02x",cache,syscfg->cnfgdata.cntlb0);
pager();
printf("%s.cntlb1 = 0x%02x",cache,syscfg->cnfgdata.cntlb1);
pager();
printf("%s.sdenable = ",cache);
switch(syscfg->cnfgdata.sdenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.sdtrace = ",cache);
switch(syscfg->cnfgdata.sdtrace) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
}
}
/********************/
/* eof - cnamept3.c */
/********************/
/*
unsigned char ckdiv;
unsigned char memwait;
unsigned char iowait;
unsigned char cntlb0;
unsigned char cntlb1;
unsigned char sdenable;
unsigned char sdtrace;
unsigned int sdcapacity;
unsigned char sdcsio;
unsigned char sdcsiofast;
unsigned char defiobyte;
unsigned char termtype;
unsigned int revision;
unsigned char prpsdenable;
unsigned char prpsdtrace;
unsigned int prpsdcapacity;
unsigned char prpconenable;
unsigned int biossize;
*/


198
Apps/crossdev/CNAMEPT4.C Normal file
View File

@@ -0,0 +1,198 @@
/* cnamept2.c 5/24/2012 dwg - */
#include "stdio.h"
#include "stdlib.h"
#include "portab.h"
#include "std.h"
#include "cnfgdata.h"
#include "syscfg.h"
extern pager();
char cache[17];
cnamept4(syscfg)
struct SYSCFG * syscfg;
{
strcpy(cache,"syscfg->cnfgdata");
if(PLT_N8 == syscfg->cnfgdata.platform) {
printf("%s.sdcapacity = %uKB",cache,
syscfg->cnfgdata.sdcapacity);
pager();
printf("%s.sdcsio = ",cache);
switch(syscfg->cnfgdata.sdcsio) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default:
printf("Unknown!!");
break;
}
pager();
printf("%s.sdcsiofast = ",cache);
switch(syscfg->cnfgdata.sdcsiofast) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
}
printf("%s.defiobyte = 0x%02x",cache,
syscfg->cnfgdata.defiobyte);
pager();
printf("%s.termtype = ",cache);
switch(syscfg->cnfgdata.termtype) {
case TERM_TTY: printf("TERM_TTY");
break;
case TERM_ANSI: printf("TERM_ANSI");
break;
case TERM_WYSE: printf("TERM_WYSE");
break;
case TERM_VT52: printf("TERM_VT52");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.revision = %d",cache,
syscfg->cnfgdata.revision);
pager();
printf("%s.prpenable = ",cache);
switch(syscfg->cnfgdata.prpenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
if(TRUE == syscfg->cnfgdata.prpenable) {
printf("%s.prpsdenable = ");
switch(syscfg->cnfgdata.prpsdenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
if(TRUE == syscfg->cnfgdata.prpsdenable) {
printf("%s.prpsdtrace = ",cache);
switch(syscfg->cnfgdata.prpsdtrace) {
case 0: printf("SILENT");
break;
case 1: printf("ERRORS");
break;
case 2: printf("EVERYTHING");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.prpsdcapacity = ",cache);
pager();
printf("%s.prpconenable = ",cache);
switch(syscfg->cnfgdata.prpconenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
}
}
printf("%s.biossize = %d",cache,
syscfg->cnfgdata.biossize);
pager();
printf("%s.pppenable = ",cache);
switch(syscfg->cnfgdata.pppenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
if(TRUE == syscfg->cnfgdata.pppenable) {
printf("%s.pppsdenable = ",cache);
switch(syscfg->cnfgdata.pppsdenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.pppsdtrace = ",cache);
switch(syscfg->cnfgdata.pppsdtrace) {
case 0: printf("SILENT");
break;
case 1: printf("ERRORS");
break;
case 2: printf("EVERYTHING");
break;
default: printf("Unknown!!");
break;
}
pager();
printf("%s.pppcapacity = %d",cache,
syscfg->cnfgdata.prpsdcapacity);
pager();
printf("%s.pppconenable = ",cache);
switch(syscfg->cnfgdata.pppconenable) {
case TRUE: printf("TRUE");
break;
case FALSE: printf("FALSE");
break;
default: printf("Unknown!!");
break;
}
pager();
}
}
/********************/
/* eof - cnamept4.c */
/********************/


73
Apps/crossdev/CNFGDATA.H Normal file
View File

@@ -0,0 +1,73 @@
/* cnfgdata.h 6/04/2012 dwg - */
struct CNFGDATA {
unsigned char rmj;
unsigned char rmn;
unsigned char rup;
unsigned char rtp;
unsigned char diskboot;
unsigned char devunit;
unsigned int bootlu;
unsigned char hour;
unsigned char minute;
unsigned char second;
unsigned char month;
unsigned char day;
unsigned char year;
unsigned char freq;
unsigned char platform;
unsigned char dioplat;
unsigned char vdumode;
unsigned int romsize;
unsigned int ramsize;
unsigned char clrramdk;
unsigned char dskyenable;
unsigned char uartenable;
unsigned char vduenable;
unsigned char fdenable;
unsigned char fdtrace;
unsigned char fdmedia;
unsigned char fdmediaalt;
unsigned char fdmauto;
unsigned char ideenable;
unsigned char idetrace;
unsigned char ide8bit;
unsigned int idecapacity;
unsigned char ppideenable;
unsigned char ppidetrace;
unsigned char ppide8bit;
unsigned int ppidecapacity;
unsigned char ppideslow;
unsigned char boottype;
unsigned char boottimeout;
unsigned char bootdefault;
unsigned int baudrate;
unsigned char ckdiv;
unsigned char memwait;
unsigned char iowait;
unsigned char cntlb0;
unsigned char cntlb1;
unsigned char sdenable;
unsigned char sdtrace;
unsigned int sdcapacity;
unsigned char sdcsio;
unsigned char sdcsiofast;
unsigned char defiobyte;
unsigned char termtype;
unsigned int revision;
unsigned char prpsdenable;
unsigned char prpsdtrace;
unsigned int prpsdcapacity;
unsigned char prpconenable;
unsigned int biossize;
unsigned char pppenable;
unsigned char pppsdenable;
unsigned char pppsdtrace;
unsigned int pppsdcapacity;
unsigned char pppconenable;
unsigned char prpenable;
};
/********************/
/* eof - cnfgdata.h */
/********************/

196
Apps/crossdev/CPM80.H Normal file
View File

@@ -0,0 +1,196 @@
/* cpmbios.h 3/11/2012 dwg - added CURDRV */
/*************************/
/* BIOS Memory Locations */
/*************************/
#define CURDRV 0x00004
#define BIOSAD 0x0e600
#define pBOOT 0x0E600
#define pWBOOT 0x0E603
#define pCONST 0x0E606
#define pCONIN 0x0E609
#define pCONOUT 0x0E60C
#define pLIST 0x0E60F
#define pPUNCH 0x0E612
#define pREADER 0x0E615
#define pHOME 0x0E618
#define pSELDSK 0x0E61B
#define pSETTRK 0x0E61E
#define pSETSEC 0x0E621
#define pSETDMA 0x0E624
#define pREAD 0x0E627
#define pWRITE 0x0E62A
#define pLISTST 0x0E62D
#define pSECTRN 0x0E630
#define pBNKSEL 0x0E633
#define pGETLU 0x0E636
#define pSETLU 0x0E639
#define pGETINFO 0x0E63C
struct JMP {
unsigned char opcode;
unsigned int address;
};
struct BIOS {
struct JMP boot;
struct JMP wboot;
struct JMP const;
struct JMP conin;
struct JMP conout;
struct JMP list;
struct JMP punch;
struct JMP reader;
struct JMP home;
struct JMP seldsk;
struct JMP settrk;
struct JMP setsec;
struct JMP setdma;
struct JMP read;
struct JMP write;
struct JMP listst;
struct JMP sectrn;
struct JMP bnksel;
struct JMP getlu;
struct JMP setlu;
struct JMP getinfo;
struct JMP rsvd1;
struct JMP rsvd2;
struct JMP rsvd3;
struct JMP rsvd4;
char diskboot;
char bootdrive;
char devunit;
char rmj;
char rmn;
char rup;
char rtp;
};
struct DPH {
unsigned int xlt;
unsigned int rv1;
unsigned int rv2;
unsigned int rv3;
unsigned int dbf;
unsigned int dpb;
unsigned int csv;
unsigned int alv;
unsigned char sigl;
unsigned char sigu;
unsigned int current;
unsigned int number;
};
struct DPB {
unsigned int spt;
unsigned char bsh;
unsigned char blm;
unsigned char exm;
unsigned int dsm;
unsigned int drm;
unsigned char al0;
unsigned char al1;
unsigned int cks;
unsigned int off;
};
/* bioscall.h 3/10/2012 dwg - header file for bdoscall */
extern char irega;
extern unsigned int iregbc;
extern unsigned int iregde;
extern unsigned int ireghl;
extern bioscall();
/* bdoscall.h 3/10/2012 dwg - header file for bdoscall */
extern char drega;
extern unsigned int dregbc;
extern unsigned int dregde;
extern unsigned int dreghl;
extern bdoscall();
/* diagnose.h 5/23/2012 dwg - */
extern char hrega;
extern unsigned int hregbc;
extern unsigned int hregde;
extern unsigned int hreghl;
extern diagnose();
/* ctermcap.h 3/11/2012 dwg - declarations for termal capability */
extern crtinit();
extern crtclr();
extern crtlc();
/* cpmbdos.h */
#define TERMCPM 0
#define CONIN 1
#define CWRITE 2
#define DIRCONIO 6
#define PRINTSTR 9
#define RDCONBUF 10
#define GETCONST 11
#define RETVERNUM 12
#define RESDISKSYS 13
#define SELECTDISK 14
#define FOPEN 15
#define FCLOSE 16
#define SEARCHFIRST 17
#define SEARCHNEXT 18
#define FDELETE 19
#define FREADSEQ 20
#define FWRITESEQ 21
#define FMAKEFILE 22
#define FRENAME 23
#define RETLOGINVEC 24
#define RETCURRDISK 25
#define SETDMAADDR 26
#define GETALLOCVEC 27
#define WRPROTDISK 28
#define GETROVECTOR 29
#define FSETATTRIB 30
#define GETDPBADDR 31
#define SETGETUSER 32
#define FREADRANDOM 33
#define FWRITERAND 34
#define FCOMPSIZE 35
#define SETRANDREC 36
#define RESETDRIVE 37
#define WRRANDFILL 38
#define DRIVEA 0
/* dphmap.h 5/29/2012 dwg - declaration of DPH MAP structure */
struct DPHMAP {
struct DPH * drivea;
struct DPH * driveb;
struct DPH * drivec;
struct DPH * drived;
struct DPH * drivee;
struct DPH * drivef;
struct DPH * driveg;
struct DPH * driveh;
} * pDPHMAP;
struct DPHMAP * pDPHVEC[MAXDRIVE];
/******************/
/* eof - dphmap.h */
/******************/
/*****************/
/* eof - cpm80.h */
/*****************/


Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Apps/crossdev/CPM86/AS.EXE Normal file

Binary file not shown.

View File

@@ -0,0 +1,8 @@
#ifndef NDEBUG
#ifndef stderr
#include <stdio.h>
#endif
#define assert(x) if (!(x)) {fprintf(stderr,"Assertion failed: x, file %s, line %d\n",__FILE__,__LINE__); exit(1);}
#else
#define assert(x)
#endif

BIN
Apps/crossdev/CPM86/C.LIB Normal file

Binary file not shown.

BIN
Apps/crossdev/CPM86/CC.EXE Normal file

Binary file not shown.

BIN
Apps/crossdev/CPM86/CCB.EXE Normal file

Binary file not shown.

BIN
Apps/crossdev/CPM86/CNM.EXE Normal file

Binary file not shown.

BIN
Apps/crossdev/CPM86/CPM.EXE Normal file

Binary file not shown.

BIN
Apps/crossdev/CPM86/CRC.EXE Normal file

Binary file not shown.

View File

@@ -18,4 +18,3 @@ extern char ctp_[];
#define toascii(x) ((x)&127)
#define _tolower(x) ((x)|0x20)
#define _toupper(x) ((x)&0x5f)


BIN
Apps/crossdev/CPM86/D11.LIB Normal file

Binary file not shown.

BIN
Apps/crossdev/CPM86/D20.LIB Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
/* Copyright (C) 1983 by Manx Software Systems */
#define TIOCGETP 0 /* read contents of tty control structure */
#define TIOCSETP 1 /* set contents of tty control structure */
#define TIOCSETN 1 /* ditto only don't wait for output to flush */
/* special codes for MSDOS 2.x only */
#define TIOCREAD 2 /* read control info from device */
#define TIOCWRITE 3 /* write control info to device */
#define TIOCDREAD 4 /* same as 2 but for drives */
#define TIOCDWRITE 5 /* same as 3 but for drives */
#define GETISTATUS 6 /* get input status */
#define GETOSTATUS 7 /* get output status */
struct sgttyb {
short sg_flags; /* control flags */
char sg_erase; /* ignored */
char sg_kill; /* ignored */
};
/* settings for flags */
#define RAW 0x20 /* no echo or mapping of input/output BDOS(6) */
/* Refer to the MSDOS technical reference for detailed information on
* the remaining flags.
*/

View File

@@ -0,0 +1,29 @@
extern int errno;
extern char *sys_errlist[];
extern int sys_nerr;
/* MsDos return codes */
#define EINVAL 1
#define ENOENT 2
#define ENOTDIR 3
#define EMFILE 4
#define EACCES 5
#define EBADF 6
#define EARENA 7
#define ENOMEM 8
#define EFAULT 9
#define EINVENV 10
#define EBADFMT 11
#define EINVACC 12
#define EINVDAT 13
#define ENODEV 15
#define ERMCD 16
#define EXDEV 17
#define ENOMORE 18
/* additional codes used by Aztec C */
#define EEXIST 19
#define ENOTTY 20
/* used by the math library */
#define ERANGE 21
#define EDOM 22

View File

@@ -5,4 +5,3 @@
#define O_TRUNC 0x0200
#define O_EXCL 0x0400
#define O_APPEND 0x0800


BIN
Apps/crossdev/CPM86/G.LIB Normal file

Binary file not shown.

View File

@@ -0,0 +1,16 @@
main()
{
char buffer[100];
/* set to 25 row x 80 column monochrome mode 6 (HIRES) */
mode('H');
printf("Please enter your name: ");
gets(buffer);
/* set to 25 row x 40 column 4-color mode 4 (MEDRES) */
mode('M');
printf("Hello %s!\nWelcome to the growing family of\nAZTEC C users...\n",
buffer);
getchar();
/* set to 25 row x 80 column color text mode 3 (LOWRES) */
mode('L');
}

Binary file not shown.

BIN
Apps/crossdev/CPM86/GRAPH.O Normal file

Binary file not shown.

View File

@@ -0,0 +1,4 @@
main()
{
printf("Hello Woprd!!");
}

Binary file not shown.

Binary file not shown.

BIN
Apps/crossdev/CPM86/HELLO.O Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -80,4 +80,3 @@ struct fcbtab {
#define SETREC 36
#define Wrkbuf ((char *)0x80)


View File

@@ -13,6 +13,7 @@ extern int (*Sysvec[])();
#define _DIRTY 0x04
#define _EOF 0x08
#define _IOERR 0x10
#define _TEMP 0x20 /* temporary file (delete on close) */
typedef struct {
char *_bp; /* current position in buffer */
@@ -22,6 +23,7 @@ typedef struct {
char _unit; /* token returned by open */
char _bytbuf; /* single byte buffer for unbuffer streams */
int _buflen; /* length of buffer */
char *_tmpname; /* name of file for temporaries */
} FILE;
extern FILE Cbuffs[];
@@ -37,4 +39,3 @@ long ftell();
#define ferror(fp) (((fp)->_flags&_IOERR)!=0)
#define clearerr(fp) ((fp)->_flags &= ~(_IOERR|_EOF))
#define fileno(fp) ((fp)->_unit)


View File

@@ -0,0 +1,210 @@
nlist
; Copyright (C) 1985 by Manx Software Systems, Inc.
; :ts=8
ifndef MODEL
MODEL equ 0
endif
if MODEL and 1
largecode
FARPROC equ 1
FPTRSIZE equ 4
else
FPTRSIZE equ 2
endif
if MODEL and 2
LONGPTR equ 1
endif
;this macro to be used on returning
;restores bp and registers
pret macro
if havbp
pop bp
endif
ret
endm
internal macro pname
public pname
pname proc
endm
intrdef macro pname
public pname
ifdef FARPROC
pname label far
else
pname label near
endif
endm
procdef macro pname, args
public pname&_
ifdef FARPROC
_arg = 6
pname&_ proc far
else
_arg = 4
pname&_ proc near
endif
ifnb <args>
push bp
mov bp,sp
havbp = 1
decll <args>
else
havbp = 0
endif
endm
entrdef macro pname, args
public pname&_
ifdef FARPROC
_arg = 6
pname&_:
else
_arg = 4
pname&_:
endif
ifnb <args>
if havbp
push bp
mov bp,sp
else
error must declare main proc with args, if entry has args
endif
decll <args>
endif
endm
;this macro equates 'aname' to arg on stack
decl macro aname, type
;;'byte' or anything else
havtyp = 0
ifidn <type>,<byte>
aname equ byte ptr _arg[bp]
_arg = _arg + 2
havtyp = 1
endif
ifidn <type>,<dword>
aname equ dword ptr _arg[bp]
_arg = _arg + 4
havtyp = 1
endif
ifidn <type>,<cdouble>
aname equ qword ptr _arg[bp]
_arg = _arg + 8
havtyp = 1
endif
ifidn <type>, <ptr>
ifdef LONGPTR
aname equ dword ptr _arg[bp]
_arg = _arg + 4
else
aname equ word ptr _arg[bp]
_arg = _arg + 2
endif
havtyp = 1
endif
ifidn <type>, <fptr>
ifdef FARPROC
aname equ dword ptr _arg[bp]
_arg = _arg + 4
else
aname equ word ptr _arg[bp]
_arg = _arg + 2
endif
havtyp = 1
endif
ifidn <type>, <word>
aname equ word ptr _arg[bp]
_arg = _arg + 2
havtyp = 1
endif
ife havtyp
error -- type is unknown.
endif
endm
;this macro loads an arg pointer into DEST, with optional SEGment
ldptr macro dest, argname, seg
ifdef LONGPTR
ifnb <seg> ;;get segment if specified
ifidn <seg>,<es>
les dest,argname
else
ifidn <seg>,<ds>
lds dest,argname
else
mov dest, word ptr argname
mov seg, word ptr argname[2]
endif
endif
else
ifidn <dest>,<si> ;;si gets seg in ds
lds si, argname
else
ifidn <dest>,<di> ;;or, es:di
les di, argname
else
garbage error: no seg for long pointer
endif
endif
endif
else
mov dest, word ptr argname ;;get the pointer
ENDIF
ENDM
decll macro list
IRP i,<list>
decl i
ENDM
ENDM
pend macro pname
pname&_ endp
endm
retptrm macro src,seg
mov ax, word ptr src
ifdef LONGPTR
mov dx, word ptr src+2
endif
endm
retptrr macro src,seg
mov ax,src
ifdef LONGPTR
ifnb <seg>
mov dx, seg
endif
endif
endm
retnull macro
ifdef LONGPTR
sub dx,dx
endif
sub ax,ax
endm
pushds macro
ifdef LONGPTR
push ds
endif
endm
popds macro
ifdef LONGPTR
pop ds
endif
endm
finish macro
codeseg ends
endm
list
codeseg segment byte public 'code'
assume cs:codeseg

BIN
Apps/crossdev/CPM86/LN.EXE Normal file

Binary file not shown.

BIN
Apps/crossdev/CPM86/M.LIB Normal file

Binary file not shown.

BIN
Apps/crossdev/CPM86/M87.LIB Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More