Browse Source

Fixed MODE Command Bug

Credit to Phil Summers
patch
Wayne Warthen 8 years ago
parent
commit
ae2c3b113c
  1. 1
      Doc/ChangeLog.txt
  2. 17
      Source/Apps/Mode.asm
  3. 8
      Source/CPM22/BDOS.ASM
  4. 4
      Source/CPM22/OS3BDOS.ASM
  5. 87
      Source/CPM22/ReadMe.txt

1
Doc/ChangeLog.txt

@ -12,6 +12,7 @@ Version 2.9.1
- WBW: Fixed XModem HBIOS console driver for file send operations
- WBW: Preliminary support for RC180 platform (Z180 module in RC2014)
- WBW: Added NZCOM distribution files to third slice of hard disk image
- WBW: Fixed getnum32 bug in MODE command (found by Phil Summers)
Version 2.9.0
-------------

17
Source/Apps/Mode.asm

@ -30,6 +30,7 @@
; Change Log:
; 2017-08-16 [WBW] Initial release
; 2017-08-28 [WBW] Handle UNACPM
; 2018-07-24 [WBW] Fixed bug in getnum23 routine (credit Phil Summers)
;_______________________________________________________________________________
;
; ToDo:
@ -215,7 +216,7 @@ comset1:
jr nc,comset1a ; ... to handle empty
;
call getnum32 ; get baud rate into DE:HL
jp c,errcfg ; Handle error
jp c,errcfg ; Handle overflow error
ld c,75 ; Constant for baud rate encode
call encode ; encode into C:4-0
jp nz,errcfg ; Error if encode fails
@ -817,7 +818,7 @@ getnum32a:
cp '9' + 1 ; compare to ascii '9'
jr nc,getnum32c ; abort if above
;
; valid digit, multiply DE:BC by 10
; valid digit, multiply DE:HL by 10
; X * 10 = (((x * 2 * 2) + x)) * 2
push de
push hl
@ -846,11 +847,13 @@ getnum32a:
ld l,a ; back to L
jr nc,getnum32b ; if no carry, done
inc h ; otherwise, bump H
jr nc,getnum32b ; if no carry, done
jr nz,getnum32b ; if no overflow, done
inc e ; otherwise, bump E
jr nc,getnum32b ; if no carry, done
jr nz,getnum32b ; if no overflow, done
inc d ; otherwise, bump D
ret c ; if overflow, ret w/ CF
jr nz,getnum32b ; if no overflow, done
scf ; set carry flag to indicate overflow
ret ; and return
;
getnum32b:
inc ix ; bump to next char
@ -967,7 +970,7 @@ errcfg: ; Invalid device configuration specified
jr err
;
err: ; print error string and return error signal
call crlf ; print newline
call crlf2 ; print newline
;
err1: ; without the leading crlf
call prtstr ; print error string
@ -1016,7 +1019,7 @@ stack .equ $ ; stack top
; Messages
;
indent .db " ",0
msgban1 .db "MODE v1.1, 28-Aug-2017",0
msgban1 .db "MODE v1.2, 24-Jul-2018",0
msghb .db " [HBIOS]",0
msgub .db " [UBIOS]",0
msgban2 .db "Copyright (C) 2017, Wayne Warthen, GNU GPL v3",0

8
Source/CPM22/BDOS.ASM

@ -2300,9 +2300,11 @@ diskwr11:
;
diskwr2: ;a has vrecord, c=2 if new block or
; new record #
dcr c
dcr c
jnz noupdate
; WW: DRI Patch 01 Start
nop ; dcr c
nop ; dcr c
lxi h,0 ; jnz noupdate
; WW: DRI Patch 01 End
push psw ;save vrecord value
call getmodnum ;hl=.fcb(modnum),a=fcb(modnum)
;reset the file write flag to mark

4
Source/CPM22/OS3BDOS.ASM

@ -1700,8 +1700,10 @@ diskwrite: ;(may enter here from seqdiskwrite above)
mvi c,2 ;mark as record count incremented
diskwr2:
;A has vrecord, C=2 if new block or new record#
; WW: DRI BDOS Patch start
;dcr c! ;dcr c! ;jnz noupdate
nop! nop! lxi h,0 ; WW: DRI BDOS Patch
nop! nop! lxi h,0
; WW: DRI BDOS Patch end
push psw ;save vrecord value
call getmodnum ;HL=.fcb(modnum), A=fcb(modnum)
;reset the file write flag to mark as written fcb

87
Source/CPM22/ReadMe.txt

@ -0,0 +1,87 @@
OS2CCP & OS3BDOS
----------------
Sourced from DRIPAK archive.
It appears to have come from DRI and seems to be the closest
version of pure original source. The source is commented, but
utilizes multiple statements per line.
OS2CCP.BAK - Original file from DRIPAK
OS2CCP.ASM - Modified ORG
OS3BDOS.BAK - Original file from DRIPAK
OS3BDOS.ASM - Modified ORG & DRI CPM22PAT01 applied
CCP & BDOS
----------
Sourced from DRIPAK archive.
It is a nicer formatted version of above. Lines
expanded to one statement per line. The case of message string
literals has been modified, but
otherwise byte identical to OS2CCP & OS3BDOS.
CCP.BAK - Original file from DRIPAK
CCP.ASM - Modified ORG
BDOS.BAK - Original file from DRIPAK
BDOS.ASM - Modified ORG & DRI CPM22PAT01 applied
CCP22 & BDOS22
--------------
Sourced from DRIPAK archive.
It is an independent disassembly and reconstruction of CCP/BDOS.
DRI CPM22PAT01 was already applied. Unclear why, but the BDOS
source was checking for a blank instead of a ctrl-s in the
KBSTAT routine. Ctrl-s seems to be correct based on all other
BDOS images I have encountered. Also, these files imbed the
CP/M version number into the serial number fields. Other than
this, they are byte identical to the OS2CCP/OS3BDOS images above.
CCP22.BAK - Original file from DRIPAK
CCP22.ASM - Modified ORG
BDOS22.BAK - Original file from DRIPAK
BDOS22.ASM - Modified ORG & fix for ctrl-S
CCPB03 & BDOSB01
----------------
Sourced from N8VEM effort to create an enhanced
variant of CP/M 2.2.
It appears to be a disassembly and reconstruction of CCP/BDOS,
but there are no comments attributing the work. DRI CPM22PAT01
was already applied. The message string literals are all
in CAPS in BDOS. Additionally, there is explicit filler of 0x55
value bytes at the end of the CCP/BDOS files padding their
length out to full page. Other than this, the BDOS
is byte identical to the others above. CCP contains multiple
enhancements and is, therefore, not identical to others.
CCPB03.ASM - Enhanced reassembly of CCP
BDOSB01.ASM - Reassembly of BDOS w/ DRI Patch 01
---
The first 6 bytes of BDOS are the serial number. In general,
the BDOS sources just leave all six bytes as 0x00. The
one exception is BDOS22 which defines the 6 bytes to be a
hybrid of CP/M version information and serial number. This is
basically irrelevant unless MOVCPM is used, in which case
the 6 byte serial number field must match with MOVCPM.
---
The DRI CP/M Patch #01 (DRI CPM22PAT01) is defined to be
nop; nop; lxi h,0 and that is how I have patched OS3BDOS & BDOS.
However, BDOS22 uses nop; nop; lxi h,fbase for the patch.
In practice, this difference does not matter because the value
placed in HL at this point is unused (immediately overwritten).
---
Loading…
Cancel
Save