mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-06 22:43:15 -06:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fdb89d651 | ||
|
|
c4e9a47048 | ||
|
|
2fd22922d5 | ||
|
|
1060cfd441 | ||
|
|
7db00165dd |
@@ -1,3 +1,11 @@
|
||||
Version 2.8.3
|
||||
-------------
|
||||
- WBW: Added MODE command
|
||||
- WBW: Removed obsolete 1200.COM, 9600.COM, and 38400.COM
|
||||
- WBW: New XM.COM that automatically adapts to primary port of platform
|
||||
- WBW: XM.COM now handles 38400 baud at 4MHz
|
||||
- WBW: Removed obsolete XM versions: XM5.COM, XM-A0.COM, XM-A1.COM
|
||||
|
||||
Version 2.8.2
|
||||
-------------
|
||||
- WBW: Adjusted VGA3 register setup per John's recommendations
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
***********************************************************************
|
||||
|
||||
Wayne Warthen (wwarthen@gmail.com)
|
||||
Version 2.8.2, 2017-07-18
|
||||
Version 2.8.3, 2017-08-23
|
||||
https://www.retrobrewcomputers.org/
|
||||
|
||||
RomWBW is a ROM-based implementation of CP/M-80 2.2 and Z-System for
|
||||
|
||||
@@ -16,14 +16,16 @@ call :asm Assign || goto :eof
|
||||
call :asm Format || goto :eof
|
||||
call :asm Talk || goto :eof
|
||||
call :asm OSLdr || goto :eof
|
||||
call :asm Mode || goto :eof
|
||||
|
||||
zx Z80ASM -SYSGEN/F
|
||||
|
||||
setlocal & cd XM125 && call Build || exit /b 1 & endlocal
|
||||
|
||||
goto :eof
|
||||
|
||||
:asm
|
||||
echo.
|
||||
echo Building %1...
|
||||
rem tasm -t80 -b -g3 -fFF %1.asm %1.com %1.lst
|
||||
tasm -t80 -g3 -fFF %1.asm %1.com %1.lst
|
||||
goto :eof
|
||||
@@ -3,4 +3,6 @@ setlocal
|
||||
|
||||
if exist *.bin del *.bin
|
||||
if exist *.com del *.com
|
||||
if exist *.lst del *.lst
|
||||
if exist *.lst del *.lst
|
||||
|
||||
setlocal & cd XM125 && call Clean || exit /b 1 & endlocal
|
||||
|
||||
79
Source/Apps/Decode.asm
Normal file
79
Source/Apps/Decode.asm
Normal file
@@ -0,0 +1,79 @@
|
||||
;
|
||||
;==================================================================================================
|
||||
; DECODE 32-BIT VALUES FROM A 5-BIT SHIFT-ENCODED VALUE
|
||||
;==================================================================================================
|
||||
;
|
||||
; Copyright (C) 2014 John R. Coffman. All rights reserved.
|
||||
; Provided for hobbyist use on the Z180 SBC Mark IV board.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; THE FUNCTION(S) IN THIS FILE ARE BASED ON LIKE FUNCTIONS CREATED BY JOHN COFFMAN
|
||||
; IN HIS UNA BIOS PROJECT. THEY ARE INCLUDED HERE BASED ON GPLV3 PERMISSIBLE USE.
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; An encoded value (V) is defined as V = C * 2^X * 3^Y
|
||||
; where C is a prearranged constant, X is 0 or 1 and Y is 0-15
|
||||
; The encoded value is stored as 5 bits: YXXXX
|
||||
; At present, C=75 for baud rate encoding and C=3 for CPU OSC encoding
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; DECODE
|
||||
;
|
||||
; Enter with:
|
||||
; HL = word to be decoded (5-bits) FXXXX
|
||||
; F=extra 3 factor, XXXX=shift factor, reg H must be zero
|
||||
; DE = encode divisor OSC_DIV = 3, or BAUD_DIV = 75
|
||||
;
|
||||
; Exit with:
|
||||
; DE:HL = decoded value
|
||||
; A = non-zero on error
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
decode:
|
||||
ld a,h ; set to test
|
||||
ld c,$ff ; presume error condition
|
||||
or a ; test for zero
|
||||
jr nz,decode9 ; not an encoded value
|
||||
ld a,l ; get low order 5 bits
|
||||
cp 32 ; test for error
|
||||
jr nc,decode9 ; error return if not below
|
||||
; argument hl is validated
|
||||
ld h,d
|
||||
ld l,e ; copy to hl
|
||||
cp 16
|
||||
jr c,decode2 ; if < 16, no 3 factor
|
||||
add hl,de ; introduce factor of 3
|
||||
add hl,de ; **
|
||||
decode2:
|
||||
ld de,0 ; zero the high order
|
||||
and 15 ; mask to 4 bits
|
||||
jr z,decode8 ; good exit
|
||||
ld c,b ; save b-reg
|
||||
ld b,a ;
|
||||
decode3:
|
||||
add hl,hl ; shift left by 1, set carry
|
||||
rl e
|
||||
rl d ; **
|
||||
djnz decode3
|
||||
ld b,c ; restore b-reg
|
||||
decode8:
|
||||
ld c,0 ; signal good return
|
||||
decode9:
|
||||
ld a,c ; error code test
|
||||
or a ; error code in reg-c and z-flag
|
||||
ret
|
||||
75
Source/Apps/Encode.asm
Normal file
75
Source/Apps/Encode.asm
Normal file
@@ -0,0 +1,75 @@
|
||||
;
|
||||
;==================================================================================================
|
||||
; ENCODE 32-BIT VALUES TO A 5-BIT SHIFT-ENCODED VALUE
|
||||
;==================================================================================================
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; An encoded value (V) is defined as V = C * 2^X * 3^Y
|
||||
; where C is a prearranged constant, Y is 0 or 1 and X is 0-15
|
||||
; The encoded value is stored as 5 bits: YXXXX
|
||||
; At present, C=75 for baud rate encoding and C=3 for CPU OSC encoding
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ENCODE
|
||||
;
|
||||
; Enter with:
|
||||
; DE:HL = dword value to be encoded
|
||||
; C = divisor (0 < C < 256)
|
||||
; encode divisor OSC_DIV = 3, or BAUD_DIV = 75
|
||||
;
|
||||
; Exit with:
|
||||
; C = encoded value
|
||||
; A = non-zero on error
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
encode:
|
||||
; incoming value of zero is a failure
|
||||
call encode5 ; test DE:HL for zero
|
||||
jr z,encode4 ; if zero, failure return
|
||||
;
|
||||
; apply encoding divisor
|
||||
call div32x8 ; DE:HL / C (remainder in A)
|
||||
or a ; set flags to test for zero
|
||||
ret nz ; error if not evenly divisible
|
||||
;
|
||||
; test divide by 3 to see if it is possible
|
||||
push de ; save working
|
||||
push hl ; ... value
|
||||
ld c,3 ; divide by 3
|
||||
call div32x8 ; ... test
|
||||
pop hl ; restore working
|
||||
pop de ; ... value
|
||||
;
|
||||
; implmement divide by 3 if possible
|
||||
ld c,$00 ; init result in c w/ div 3 flag clear
|
||||
or a ; set flags to test for remainder
|
||||
jr nz,encode2 ; jump if it failed
|
||||
;
|
||||
; if divide by 3 worked, do it again for real
|
||||
ld c,3 ; setup to divide by 3 again
|
||||
call div32x8 ; do it
|
||||
ld c,$10 ; init result in c w/ div 3 flag set
|
||||
;
|
||||
encode2:
|
||||
; loop to determine power of 2
|
||||
ld b,16 ; can only represent up to 2^15
|
||||
encode3:
|
||||
srl d ; right shift de:hl into carry
|
||||
rr e ; ...
|
||||
rr h ; ...
|
||||
rr l ; ...
|
||||
jr c,encode5 ; if carry, then done, c has result
|
||||
inc c ; bump the result value
|
||||
djnz encode3 ; keep shifting if possible
|
||||
encode4:
|
||||
or $ff ; signal error
|
||||
ret ; and done
|
||||
;
|
||||
encode5:
|
||||
; test de:hl for zero (sets zf, clobbers a)
|
||||
ld a,h
|
||||
or l
|
||||
or d
|
||||
or e
|
||||
ret ; ret w/ Z set if DE:HL == 0
|
||||
1039
Source/Apps/Mode.asm
Normal file
1039
Source/Apps/Mode.asm
Normal file
File diff suppressed because it is too large
Load Diff
19
Source/Apps/XM125/Build.cmd
Normal file
19
Source/Apps/XM125/Build.cmd
Normal file
@@ -0,0 +1,19 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set TOOLS=..\..\..\Tools
|
||||
|
||||
set PATH=%TOOLS%\zx;%PATH%
|
||||
|
||||
set ZXBINDIR=%TOOLS%\cpm\bin\
|
||||
set ZXLIBDIR=%TOOLS%\cpm\lib\
|
||||
set ZXINCDIR=%TOOLS%\cpm\include\
|
||||
|
||||
zx mac xmdm125
|
||||
zx slr180 -xmhb/HF
|
||||
zx mload25 XM=xmdm125,xmhb
|
||||
|
||||
rem set PROMPT=[Build] %PROMPT%
|
||||
rem %comspec%
|
||||
|
||||
move /Y XM.com ..
|
||||
7
Source/Apps/XM125/Clean.cmd
Normal file
7
Source/Apps/XM125/Clean.cmd
Normal file
@@ -0,0 +1,7 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
if exist *.hex del *.hex
|
||||
if exist *.prn del *.prn
|
||||
if exist *.lst del *.lst
|
||||
if exist xm.com del xm.com
|
||||
5740
Source/Apps/XM125/xmdm125.asm
Normal file
5740
Source/Apps/XM125/xmdm125.asm
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Source/Apps/XM125/xmdm125.zip
Normal file
BIN
Source/Apps/XM125/xmdm125.zip
Normal file
Binary file not shown.
361
Source/Apps/XM125/xmhb.180
Normal file
361
Source/Apps/XM125/xmhb.180
Normal file
@@ -0,0 +1,361 @@
|
||||
;=======================================================================
|
||||
;
|
||||
; XMHB.Z80 - XMODEMXX PATCH FILE FOR ROMWBW HBIOS
|
||||
;
|
||||
; Wayne Warthen - wwarthen@gmail.com
|
||||
; Updated: 2017-08-09
|
||||
;
|
||||
;=======================================================================
|
||||
;
|
||||
; Overlay file is Z80, build with M80:
|
||||
; M80 =XMHB
|
||||
; L80 XMHB,XMHB/N/X/E
|
||||
;
|
||||
.Z80
|
||||
ASEG
|
||||
;
|
||||
NO EQU 0
|
||||
YES EQU NOT NO
|
||||
;
|
||||
ERRDET EQU NO ; detect parity/framing/overrun errs
|
||||
;
|
||||
BASE EQU 100H ; start of cp/m normal program area
|
||||
;
|
||||
;=======================================================================
|
||||
;
|
||||
; Jump table: The jump table must be in exactly the same sequence as the
|
||||
; one in XMODEM. Note the ORG of 103H - This jump table has no jump to
|
||||
; 'BEGIN'.
|
||||
;
|
||||
ORG BASE + 3 ;start after 'JMP BEGIN'
|
||||
;
|
||||
JP CONOUT ;must be 00000h if not used, see below
|
||||
JP MINIT ;initialization routine (if needed)
|
||||
JP UNINIT ;undo whatever 'MINIT' did (or return)
|
||||
JPTBL:
|
||||
JP SENDR ;send character (via pop psw)
|
||||
JP CAROK ;test for carrier
|
||||
JP MDIN ;receive data byte
|
||||
JP GETCHR ;get character from modem
|
||||
JP RCVRDY ;check receive ready
|
||||
JP SNDRDY ;check send ready
|
||||
JP SPEED ;get speed value for file transfer time
|
||||
JP EXTRA1 ;extra for custom routine
|
||||
JP EXTRA2 ;extra for custom routine
|
||||
JP EXTRA3 ;extra for custom routine
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Output character to console
|
||||
;
|
||||
CONOUT EQU 0 ; not used
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Initialize modem
|
||||
;
|
||||
; This procedure has been usurped to dynamically detect the type
|
||||
; of system we are running on and install the *real* jump table
|
||||
; entries as appropriate.
|
||||
;
|
||||
MINIT:
|
||||
; Get system type
|
||||
LD D,2
|
||||
LD E,2
|
||||
MLT DE
|
||||
BIT 2,E ; bit 2 wil be set if mlt happend
|
||||
LD HL,U_JPTBL ; assume Z80 (UART)
|
||||
LD A,10 ; assume 10MHz CPU in case of Z80
|
||||
JR Z,MINIT2 ; yes, Z80, do vector copy
|
||||
LD HL,A_JPTBL ; otherwise Z180 (ASCI)
|
||||
LD A,20 ; assume 20MHz CPU in case of Z180
|
||||
;
|
||||
MINIT2:
|
||||
; Copy real vectors into active jump table
|
||||
LD DE,JPTBL
|
||||
LD BC,7 * 3 ; copy 7 3-byte entries
|
||||
LDIR
|
||||
;
|
||||
; Check for UNA (UBIOS)
|
||||
LD A,(0FFFDH) ; fixed location of UNA API vector
|
||||
CP 0C3H ; jp instruction?
|
||||
JR NZ,MINIT3 ; if not, not UNA
|
||||
LD HL,(0FFFEH) ; get jp address
|
||||
LD A,(HL) ; get byte at target address
|
||||
CP 0FDH ; first byte of UNA push ix instruction
|
||||
JR NZ,MINIT3 ; if not, not UNA
|
||||
INC HL ; point to next byte
|
||||
LD A,(HL) ; get next byte
|
||||
CP 0E5H ; second byte of UNA push ix instruction
|
||||
JR NZ,MINIT3 ; if not, not UNA
|
||||
;
|
||||
; Get CPU speed from UNA
|
||||
LD C,0F8H ; UNA BIOS Get PHI function
|
||||
RST 08 ; Returns speed in Hz in DE:HL
|
||||
LD A,E ; Hack to get approx speed in MHz
|
||||
SRL A ; ... by dividing by 1,048,576
|
||||
SRL A ; ...
|
||||
SRL A ; ...
|
||||
SRL A ; ...
|
||||
INC A ; Fix up for value truncation
|
||||
RET ; done
|
||||
;
|
||||
MINIT3:
|
||||
; Not UNA, use HBIOS for CPU speed lookup
|
||||
LD B,0F8H ; HBIOS SYSGET function 0xF8
|
||||
LD C,0F0H ; CPUINFO subfunction 0xF0
|
||||
RST 08 ; do it, L := CPU speed in MHz
|
||||
LD A,L ; move it to A
|
||||
RET ; done
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Uninitialize modem
|
||||
;
|
||||
UNINIT:
|
||||
RET ; not initialized, so no 'UN-INITIALIZE'
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; The following are all dummy routines that are unused because MINIT
|
||||
; dynamically installs the real jump table.
|
||||
;
|
||||
SENDR:
|
||||
CAROK:
|
||||
MDIN:
|
||||
GETCHR:
|
||||
RCVRDY:
|
||||
SNDRDY:
|
||||
SPEED:
|
||||
EXTRA1:
|
||||
EXTRA2:
|
||||
EXTRA3:
|
||||
RET
|
||||
;
|
||||
;=======================================================================
|
||||
;=======================================================================
|
||||
;
|
||||
; Standard RBC Projects 8250-like UART port @ 68H
|
||||
;
|
||||
; Will be used for all RBC Z80 systems.
|
||||
;
|
||||
;=======================================================================
|
||||
;=======================================================================
|
||||
;
|
||||
; UART port constants
|
||||
;
|
||||
U_BASE EQU 68H ; UART base port
|
||||
U_DATP EQU U_BASE + 0 ; data in port
|
||||
U_DATO EQU U_BASE + 0 ; data out port
|
||||
U_CTLP EQU U_BASE + 5 ; control/status port
|
||||
U_SNDB EQU 20H ; bit to test for send ready
|
||||
U_SNDR EQU 20H ; value when ready to send
|
||||
U_RCVB EQU 01H ; bit to test for receive ready
|
||||
U_RCVR EQU 01H ; value when ready to receive
|
||||
U_PARE EQU 04H ; bit for parity error
|
||||
U_OVRE EQU 02H ; bit for overrun error
|
||||
U_FRME EQU 08H ; bit for framing error
|
||||
;
|
||||
; Following jump table is dynamically patched into real jump
|
||||
; table at program startup. See MINIT above. Note that only a
|
||||
; subset of the jump table is overlaid (SENDR to SPEED).
|
||||
;
|
||||
U_JPTBL:
|
||||
JP U_SENDR ; send character (via pop psw)
|
||||
JP U_CAROK ; test for carrier
|
||||
JP U_MDIN ; receive data byte
|
||||
JP U_GETCHR ; get character from modem
|
||||
JP U_RCVRDY ; check receive ready
|
||||
JP U_SNDRDY ; check send ready
|
||||
JP U_SPEED ; get speed value for file transfer time
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Send character on top of stack
|
||||
;
|
||||
U_SENDR:
|
||||
POP AF ; get character to send from stack
|
||||
OUT (U_DATO),A ; send to port
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Test and rep;ort carrier status, Z set if carrier present
|
||||
;
|
||||
U_CAROK:
|
||||
XOR A ; not used, always indicate present
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Get a character (assume character ready has already been tested)
|
||||
;
|
||||
U_MDIN:
|
||||
U_GETCHR:
|
||||
IN A,(U_DATP) ; read character from port
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Test for character ready to receive, Z = ready
|
||||
; Error code returned in A register
|
||||
; *** Error code does not seem to be used ***
|
||||
;
|
||||
U_RCVRDY:
|
||||
IN A,(U_CTLP) ; get modem status
|
||||
;
|
||||
IF ERRDET
|
||||
;
|
||||
; With error detection (slower)
|
||||
PUSH BC ; save scratch register
|
||||
PUSH AF ; save full status on stack
|
||||
AND U_FRME | U_OVRE | U_PARE ; isolate line err bits
|
||||
LD B,A ; save err status in B
|
||||
POP AF ; get full status back
|
||||
AND U_RCVB ; isolate ready bit
|
||||
CP U_RCVR ; test it (set flags)
|
||||
LD A,B ; get the error code back
|
||||
POP BC ; restore scratch register
|
||||
;
|
||||
ELSE
|
||||
;
|
||||
; No error detection (faster)
|
||||
AND U_RCVB ; isolate ready bit
|
||||
CP U_RCVR ; test it (set flags)
|
||||
LD A,0 ; report no line errors
|
||||
;
|
||||
ENDIF
|
||||
;
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Test for ready to send a character, Z = ready
|
||||
;
|
||||
U_SNDRDY:
|
||||
IN A,(U_CTLP) ; get status
|
||||
AND U_SNDB ; isolate transmit ready bit
|
||||
CP U_SNDR ; test for ready value
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Report baud rate (index into SPTBL returned in regsiter A)
|
||||
;
|
||||
U_SPEED:
|
||||
LD A,8 ; arbitrarily return 9600 baud
|
||||
RET
|
||||
;
|
||||
;=======================================================================
|
||||
;=======================================================================
|
||||
;
|
||||
; Standard RBC Projects Z180 primary ASCI port
|
||||
;
|
||||
; Will be used for all RBC Z180 systems.
|
||||
;
|
||||
;=======================================================================
|
||||
;=======================================================================
|
||||
;
|
||||
; ASCI port constants
|
||||
;
|
||||
A_DATP EQU 48H ;Z180 TSR - ASCI receive data port
|
||||
A_DATO EQU 46H ;Z180 TDR - ASCI transmit data port
|
||||
A_CTLP EQU 44H ;Z180 STAT - ASCI status port
|
||||
A_CTL2 EQU 40H ;Z180 CNTLA - ASCI control port
|
||||
A_SNDB EQU 02H ;Z180 STAT:TDRE - xmit data reg empty bit
|
||||
A_SNDR EQU 02H ;Z180 STAT:TDRE - xmit data reg empty value
|
||||
A_RCVB EQU 80H ;Z180 STAT:RDRF - rcv data reg full bit
|
||||
A_RCVR EQU 80H ;Z180 STAT:RDRF - rcv data reg full value
|
||||
A_PARE EQU 20H ;Z180 STAT:PE - parity error bit
|
||||
A_OVRE EQU 40H ;Z180 STAT:OVRN - overrun error bit
|
||||
A_FRME EQU 10H ;Z180 STAT:FE - framing error bit
|
||||
;
|
||||
; Following jump table is dynamically patched over initial jump
|
||||
; table at program startup. See MINIT above. Note that only a
|
||||
; subset of the jump table is overlaid (SENDR to SPEED).
|
||||
;
|
||||
A_JPTBL:
|
||||
JP A_SENDR ;send character (via pop psw)
|
||||
JP A_CAROK ;test for carrier
|
||||
JP A_MDIN ;receive data byte
|
||||
JP A_GETCHR ;get character from modem
|
||||
JP A_RCVRDY ;check receive ready
|
||||
JP A_SNDRDY ;check send ready
|
||||
JP A_SPEED ;get speed value for file transfer time
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Send character on top of stack
|
||||
;
|
||||
A_SENDR:
|
||||
POP AF ; get character to send from stack
|
||||
OUT0 (A_DATO),A ; send to port
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Test and rep;ort carrier status, Z set if carrier present
|
||||
;
|
||||
A_CAROK:
|
||||
XOR A ; not used, always indicate present
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Get a character (assume character ready has already been tested)
|
||||
;
|
||||
A_MDIN:
|
||||
A_GETCHR:
|
||||
IN0 A,(A_DATP) ; read character from port
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Test for character ready to receive, Z = ready
|
||||
; Error code returned in A register
|
||||
; *** Error code does not seem to be used ***
|
||||
;
|
||||
A_RCVRDY:
|
||||
IN0 A,(A_CTLP) ; get modem status
|
||||
PUSH BC ; save scratch register
|
||||
PUSH AF ; save full status on stack
|
||||
AND A_FRME | A_OVRE | A_PARE ; isolate line err bits
|
||||
LD B,A ; save err status in B
|
||||
|
||||
; Z180 ASCI ports will stall if there are errors.
|
||||
; Error bits are NOT cleared by merely reading
|
||||
; the status register. Below, bit 3 of ASCI
|
||||
; control register is written with a zero to
|
||||
; clear error(s) if needed.
|
||||
JP Z,A_RCVRDY2 ; if no errs, continue
|
||||
IN0 A,(A_CTL2) ; get current control register
|
||||
AND 0F7H ; force err reset bit to zero
|
||||
OUT0 (A_CTL2),A ; write control register
|
||||
|
||||
A_RCVRDY2:
|
||||
POP AF ; get full status back
|
||||
AND A_RCVB ; isolate ready bit
|
||||
CP A_RCVR ; test it (set flags)
|
||||
LD A,B ; get the error code back
|
||||
POP BC ; restore scratch register
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Test for ready to send a character, Z = ready
|
||||
;
|
||||
A_SNDRDY:
|
||||
IN A,(A_CTLP) ; get status
|
||||
AND A_SNDB ; isolate transmit ready bit
|
||||
CP A_SNDR ; test for ready value
|
||||
RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Report baud rate (index into SPTBL returned in regsiter A)
|
||||
;
|
||||
A_SPEED:
|
||||
LD A,8 ; arbitrarily return 9600 baud
|
||||
RET
|
||||
;
|
||||
END
|
||||
104
Source/Apps/bcd.asm
Normal file
104
Source/Apps/bcd.asm
Normal file
@@ -0,0 +1,104 @@
|
||||
;;
|
||||
;; make a bcd number from a binary number
|
||||
;; 32 bit binary number in hl:bc, result stored at (de)
|
||||
;; de is preserved, all other regs destroyed
|
||||
;;
|
||||
;bin2bcd:
|
||||
; push ix ; save ix
|
||||
; push bc ; move bc
|
||||
; pop ix ; ... to ix
|
||||
; ld c,32 ; loop for 32 bits of binary dword
|
||||
;;
|
||||
;bin2bcd0:
|
||||
; ; outer loop (once for each bit in binary number)
|
||||
; ld b,5 ; loop for 5 bytes of result
|
||||
; push de ; save de
|
||||
; add ix,ix ; left shift next bit from hl:ix
|
||||
; adc hl,hl ; ... into carry
|
||||
;;
|
||||
;bin2bcd1:
|
||||
; ; inner loop (once for each byte of bcd number)
|
||||
; ld a,(de) ; get it
|
||||
; adc a,a ; double it w/ carry
|
||||
; daa ; decimal adjust
|
||||
; ld (de),a ; save it
|
||||
; inc de ; point to next bcd byte
|
||||
; djnz bin2bcd1 ; loop thru all bcd bytes
|
||||
;;
|
||||
; ; remainder of outer loop
|
||||
; pop de ; recover de
|
||||
; dec c ; dec bit counter
|
||||
; jr nz,bin2bcd0 ; loop till done with all bits
|
||||
; pop ix ; restore ix
|
||||
;
|
||||
; make a bcd number from a binary number
|
||||
; 32 bit binary number in de:hl, result stored at (bc)
|
||||
; on output hl = bcd buf adr
|
||||
;
|
||||
bin2bcd:
|
||||
push ix ; save ix
|
||||
; convert from de:hl -> (bc) to hl:ix -> (de)
|
||||
; hl -> ix, de -> hl, bc -> de
|
||||
ex de,hl
|
||||
push de
|
||||
pop ix
|
||||
push bc
|
||||
pop de
|
||||
;
|
||||
ld c,32 ; loop for 32 bits of binary dword
|
||||
;
|
||||
bin2bcd0:
|
||||
; outer loop (once for each bit in binary number)
|
||||
ld b,5 ; loop for 5 bytes of result
|
||||
push de ; save de
|
||||
add ix,ix ; left shift next bit from hl:ix
|
||||
adc hl,hl ; ... into carry
|
||||
;
|
||||
bin2bcd1:
|
||||
; inner loop (once for each byte of bcd number)
|
||||
ld a,(de) ; get it
|
||||
adc a,a ; double it w/ carry
|
||||
daa ; decimal adjust
|
||||
ld (de),a ; save it
|
||||
inc de ; point to next bcd byte
|
||||
djnz bin2bcd1 ; loop thru all bcd bytes
|
||||
;
|
||||
; remainder of outer loop
|
||||
pop de ; recover de
|
||||
dec c ; dec bit counter
|
||||
jr nz,bin2bcd0 ; loop till done with all bits
|
||||
ex de,hl ; hl -> bcd buf
|
||||
pop ix ; restore ix
|
||||
ret
|
||||
;
|
||||
; print contents of 5 byte bcd number at (hl)
|
||||
; with leading zero suppression
|
||||
; all regs destroyed
|
||||
;
|
||||
prtbcd:
|
||||
inc hl ; bump hl to point to
|
||||
inc hl ; ...
|
||||
inc hl ; ...
|
||||
inc hl ; ... last byte of bcd
|
||||
ld b,5 ; loop for 5 bytes
|
||||
ld c,0 ; start by suppressing leading zeroes
|
||||
;
|
||||
prtbcd1:
|
||||
; loop to print one bcd byte (two digits)
|
||||
xor a ; clear accum
|
||||
rld ; rotate first nibble into a
|
||||
call prtbcd2 ; print it
|
||||
xor a ; clear accum
|
||||
rld ; rotate second nibble into a
|
||||
call prtbcd2 ; print it
|
||||
dec hl ; point to prior byte
|
||||
djnz prtbcd1 ; loop till done
|
||||
ret ; return
|
||||
;
|
||||
prtbcd2:
|
||||
; subroutine to print a digit in a
|
||||
cp c ; compare incoming to c
|
||||
ret z ; if equal, suppressing, abort
|
||||
dec c ; make c negative to stop suppression
|
||||
add a,'0' ; offset to printable value
|
||||
jp prtchr ; exit via character out
|
||||
@@ -1,5 +1,5 @@
|
||||
#DEFINE RMJ 2
|
||||
#DEFINE RMN 8
|
||||
#DEFINE RUP 1
|
||||
#DEFINE RUP 3
|
||||
#DEFINE RTP 0
|
||||
#DEFINE BIOSVER "2.8.2"
|
||||
#DEFINE BIOSVER "2.8.3"
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
setlocal
|
||||
|
||||
setlocal & cd "ZCPR Manual" && call Build.cmd || exit /b 1 & endlocal
|
||||
setlocal & cd "RomWBW User Guide" && call Build.cmd || exit /b 1 & endlocal
|
||||
setlocal & cd "RomWBW System Guide" && call Build.cmd || exit /b 1 & endlocal
|
||||
rem setlocal & cd "RomWBW User Guide" && call Build.cmd || exit /b 1 & endlocal
|
||||
rem setlocal & cd "RomWBW System Guide" && call Build.cmd || exit /b 1 & endlocal
|
||||
@@ -2665,9 +2665,9 @@ PS_PRTSC0:
|
||||
PUSH DE ; PRESERVE DE
|
||||
CALL PC_COMMA ; FORMATTING
|
||||
LD A,E ; GET CONFIG BYTE
|
||||
RLCA ; SHIFT RELEVANT BITS
|
||||
RLCA ; ...
|
||||
RLCA ; ...
|
||||
RRCA ; SHIFT RELEVANT BITS
|
||||
RRCA ; ...
|
||||
RRCA ; ...
|
||||
AND $07 ; AND ISOLATE DATA BITS VALUE
|
||||
LD HL,PS_STPARMAP ; CHARACTER LOOKUP TABLE
|
||||
CALL ADDHLA ; APPLY OFFSET
|
||||
@@ -2678,8 +2678,8 @@ PS_PRTSC0:
|
||||
; PRINT STOP BITS
|
||||
CALL PC_COMMA ; FORMATTING
|
||||
LD A,E ; GET CONFIG BYTE
|
||||
RLCA ; SHIFT RELEVANT BITS
|
||||
RLCA ; ...
|
||||
RRCA ; SHIFT RELEVANT BITS
|
||||
RRCA ; ...
|
||||
AND $01 ; AND ISOLATE DATA BITS VALUE
|
||||
ADD A,'1' ; MAKE IT A CHARACTER
|
||||
CALL COUT ; AND PRINT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#DEFINE RMJ 2
|
||||
#DEFINE RMN 8
|
||||
#DEFINE RUP 2
|
||||
#DEFINE RUP 3
|
||||
#DEFINE RTP 0
|
||||
#DEFINE BIOSVER "2.8.2"
|
||||
#DEFINE BIOSVER "2.8.3"
|
||||
|
||||
BIN
Source/Images/hd0/s0/u0/FD_DIO.COM
Normal file
BIN
Source/Images/hd0/s0/u0/FD_DIO.COM
Normal file
Binary file not shown.
BIN
Source/Images/hd0/s0/u0/HDIR.COM
Normal file
BIN
Source/Images/hd0/s0/u0/HDIR.COM
Normal file
Binary file not shown.
BIN
Source/Images/hd0/s0/u0/R.COM
Normal file
BIN
Source/Images/hd0/s0/u0/R.COM
Normal file
Binary file not shown.
BIN
Source/Images/hd0/s0/u0/RSETSIMH.COM
Normal file
BIN
Source/Images/hd0/s0/u0/RSETSIMH.COM
Normal file
Binary file not shown.
BIN
Source/Images/hd0/s0/u0/TIMER.COM
Normal file
BIN
Source/Images/hd0/s0/u0/TIMER.COM
Normal file
Binary file not shown.
BIN
Source/Images/hd0/s0/u0/URL.COM
Normal file
BIN
Source/Images/hd0/s0/u0/URL.COM
Normal file
Binary file not shown.
BIN
Source/Images/hd0/s0/u0/W.COM
Normal file
BIN
Source/Images/hd0/s0/u0/W.COM
Normal file
Binary file not shown.
BIN
Source/RomDsk/MK4/FD_DIDE.COM
Normal file
BIN
Source/RomDsk/MK4/FD_DIDE.COM
Normal file
Binary file not shown.
BIN
Source/RomDsk/MK4/FD_DIO3.COM
Normal file
BIN
Source/RomDsk/MK4/FD_DIO3.COM
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Source/RomDsk/N8/FD_N8.COM
Normal file
BIN
Source/RomDsk/N8/FD_N8.COM
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Source/RomDsk/SBC/FD_DIDE.COM
Normal file
BIN
Source/RomDsk/SBC/FD_DIDE.COM
Normal file
Binary file not shown.
BIN
Source/RomDsk/SBC/FD_DIO3.COM
Normal file
BIN
Source/RomDsk/SBC/FD_DIO3.COM
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Source/RomDsk/ZETA/FD_ZETA.COM
Normal file
BIN
Source/RomDsk/ZETA/FD_ZETA.COM
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Source/RomDsk/ZETA2/FD_ZETA2.COM
Normal file
BIN
Source/RomDsk/ZETA2/FD_ZETA2.COM
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user