Browse Source

Minor App Updates

Improve handling of UNA in XModem and MODE commands.
pull/3/head
Wayne Warthen 9 years ago
parent
commit
d5936b7fb5
  1. 56
      Source/Apps/Mode.asm
  2. 2
      Source/Apps/XM125/xmdm125.asm
  3. 86
      Source/Apps/XM125/xmhb.180

56
Source/Apps/Mode.asm

@ -29,6 +29,7 @@
; ;
; Change Log: ; Change Log:
; 2017-08-16 [WBW] Initial release ; 2017-08-16 [WBW] Initial release
; 2017-08-28 [WBW] Handle UNACPM
;_______________________________________________________________________________ ;_______________________________________________________________________________
; ;
; ToDo: ; ToDo:
@ -44,7 +45,7 @@ stksiz .equ $40 ; Working stack size
restart .equ $0000 ; CP/M restart vector restart .equ $0000 ; CP/M restart vector
bdos .equ $0005 ; BDOS invocation vector bdos .equ $0005 ; BDOS invocation vector
; ;
stamp .equ $40 ; loc of RomWBW CBIOS zero page stamp
ident .equ $FFFE ; loc of RomWBW HBIOS ident ptr
; ;
rmj .equ 2 ; intended CBIOS version - major rmj .equ 2 ; intended CBIOS version - major
rmn .equ 8 ; intended CBIOS version - minor rmn .equ 8 ; intended CBIOS version - minor
@ -85,28 +86,11 @@ exit: ; clean up and return to command processor
; Initialization ; Initialization
; ;
init: init:
;
; locate start of cbios (function jump table) ; locate start of cbios (function jump table)
ld hl,(restart+1) ; load address of CP/M restart vector ld hl,(restart+1) ; load address of CP/M restart vector
ld de,-3 ; adjustment for start of table ld de,-3 ; adjustment for start of table
add hl,de ; HL now has start of table add hl,de ; HL now has start of table
ld (bioloc),hl ; save it ld (bioloc),hl ; save it
;
; get location of config data and verify integrity
ld hl,stamp ; HL := adr or RomWBW zero page stamp
ld a,(hl) ; get first byte of RomWBW marker
cp 'W' ; match?
jp nz,errinv ; abort with invalid config block
inc hl ; next byte (marker byte 2)
ld a,(hl) ; load it
cp ~'W' ; match?
jp nz,errinv ; abort with invalid config block
inc hl ; next byte (major/minor version)
ld a,(hl) ; load it
cp rmj << 4 | rmn ; match?
jp nz,errver ; abort with invalid os version
inc hl ; bump past
inc hl ; ... version info
; ;
; check for UNA (UBIOS) ; check for UNA (UBIOS)
ld a,($FFFD) ; fixed location of UNA API vector ld a,($FFFD) ; fixed location of UNA API vector
@ -120,22 +104,38 @@ init:
ld a,(hl) ; get next byte ld a,(hl) ; get next byte
cp $E5 ; second byte of UNA push ix instruction cp $E5 ; second byte of UNA push ix instruction
jr nz,initwbw ; if not, not UNA jr nz,initwbw ; if not, not UNA
;
; UNA initialization
ld hl,unamod ; point to UNA mode flag ld hl,unamod ; point to UNA mode flag
ld (hl),$FF ; set UNA mode flag ld (hl),$FF ; set UNA mode flag
ld a,$FF ; assume max units for UNA ld a,$FF ; assume max units for UNA
ld a,2 ; *debug*
ld (comcnt),a ; ... and save it ld (comcnt),a ; ... and save it
jr initx ; UNA init done jr initx ; UNA init done
; ;
initwbw: initwbw:
; get count of serial units
; get location of config data and verify integrity
ld hl,(ident) ; HL := adr or RomWBW HBIOS ident
ld a,(hl) ; get first byte of RomWBW marker
cp 'W' ; match?
jp nz,errinv ; abort with invalid config block
inc hl ; next byte (marker byte 2)
ld a,(hl) ; load it
cp ~'W' ; match?
jp nz,errinv ; abort with invalid config block
inc hl ; next byte (major/minor version)
ld a,(hl) ; load it
cp rmj << 4 | rmn ; match?
jp nz,errver ; abort with invalid os version
;
; RomWBW initialization
ld b,bf_sysget ; BIOS SYSGET function ld b,bf_sysget ; BIOS SYSGET function
ld c,$00 ; CIOCNT subfunction ld c,$00 ; CIOCNT subfunction
rst 08 ; E := serial device unit count rst 08 ; E := serial device unit count
ld a,e ; count to A ld a,e ; count to A
ld (comcnt),a ; save it ld (comcnt),a ; save it
; ;
initx: ; initialization complete
initx
; initialization complete
xor a ; signal success xor a ; signal success
ret ; return ret ; return
; ;
@ -215,8 +215,6 @@ comset1:
jr nc,comset1a ; ... to handle empty jr nc,comset1a ; ... to handle empty
; ;
call getnum32 ; get baud rate into DE:HL call getnum32 ; get baud rate into DE:HL
;call crlf ; *debug*
;call prthex32 ; *debug*
jp c,errcfg ; Handle error jp c,errcfg ; Handle error
ld c,75 ; Constant for baud rate encode ld c,75 ; Constant for baud rate encode
call encode ; encode into C:4-0 call encode ; encode into C:4-0
@ -944,11 +942,11 @@ errprm: ; command parameter error (syntax)
ld de,msgprm ld de,msgprm
jr err jr err
; ;
errinv: ; invalid CBIOS, zp signature not found
errinv: ; invalid HBIOS, signature not found
ld de,msginv ld de,msginv
jr err jr err
; ;
errver: ; CBIOS version is not as expected
errver: ; unsupported HBIOS version
ld de,msgver ld de,msgver
jr err jr err
; ;
@ -1018,18 +1016,18 @@ stack .equ $ ; stack top
; Messages ; Messages
; ;
indent .db " ",0 indent .db " ",0
msgban1 .db "MODE v1.0 for RomWBW CP/M 2.2, 22-Aug-2017",0
msgban1 .db "MODE v1.1, 28-Aug-2017",0
msghb .db " [HBIOS]",0 msghb .db " [HBIOS]",0
msgub .db " [UBIOS]",0 msgub .db " [UBIOS]",0
msgban2 .db "Copyright 2017, Wayne Warthen, GNU GPL v3",0
msgban2 .db "Copyright (C) 2017, Wayne Warthen, GNU GPL v3",0
msguse .db "Usage: MODE COM<n>: [<baud>[,<parity>[,<databits>[,<stopbits>]]]] [/P]",13,10 msguse .db "Usage: MODE COM<n>: [<baud>[,<parity>[,<databits>[,<stopbits>]]]] [/P]",13,10
.db " ex. MODE /? (display version and usage)",13,10 .db " ex. MODE /? (display version and usage)",13,10
.db " MODE (display config of all serial ports)",13,10 .db " MODE (display config of all serial ports)",13,10
.db " MODE COM0: (display serial unit 0 config)",13,10 .db " MODE COM0: (display serial unit 0 config)",13,10
.db " MODE COM1: 9600,N,8,1 (set serial unit 1 config)",0 .db " MODE COM1: 9600,N,8,1 (set serial unit 1 config)",0
msgprm .db "Parameter error (MODE /? for usage)",0 msgprm .db "Parameter error (MODE /? for usage)",0
msginv .db "Unexpected CBIOS (signature missing)",0
msgver .db "Unexpected CBIOS version",0
msginv .db "Invalid BIOS (signature missing)",0
msgver .db "Unexpected HBIOS version",0
msgdev .db "Invalid device name",0 msgdev .db "Invalid device name",0
msgnum .db "Unit or slice number invalid",0 msgnum .db "Unit or slice number invalid",0
msgunt .db "Invalid device unit number specified",0 msgunt .db "Invalid device unit number specified",0

2
Source/Apps/XM125/xmdm125.asm

@ -328,7 +328,7 @@ MAXMIN EQU 60 ; Minutes for maximum file transfer time.
; Length of external patch program. If over 128 bytes, get/set size ; Length of external patch program. If over 128 bytes, get/set size
; ;
LARGEIO EQU YES ; Yes, if modem patch area over 128 bytes LARGEIO EQU YES ; Yes, if modem patch area over 128 bytes
LARSIZE EQU 100H ; If 'LARGEIO' set patch area size (bytes) here
LARSIZE EQU 180H ; If 'LARGEIO' set patch area size (bytes) here
; ;
;======================================================================= ;=======================================================================
; ;

86
Source/Apps/XM125/xmhb.180

@ -21,6 +21,8 @@ ERRDET EQU NO ; detect parity/framing/overrun errs
; ;
BASE EQU 100H ; start of cp/m normal program area BASE EQU 100H ; start of cp/m normal program area
; ;
BDOS EQU 00005H ; BDOS function dispatch vector
;
;======================================================================= ;=======================================================================
; ;
; Jump table: The jump table must be in exactly the same sequence as the ; Jump table: The jump table must be in exactly the same sequence as the
@ -59,22 +61,33 @@ CONOUT EQU 0 ; not used
; entries as appropriate. ; entries as appropriate.
; ;
MINIT: MINIT:
;
; Announce
LD DE,RBC ; RetroBrew Computers
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
;
; Get system type ; 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
LD DE,00202H ; D := 2, E := 2
MLT DE ; DE := D * E == 4
BIT 2,E ; Bit 2 wil be set if mlt happend
LD HL,U_JPTBL ; Assume Z80 (UART)
LD DE,UART ; UART port notification string
JR Z,MINIT2 ; Yes, Z80, do vector copy
LD HL,A_JPTBL ; Otherwise Z180 (ASCI)
LD DE,ASCI ; ASCI port notification string
; ;
MINIT2: MINIT2:
; Display port notification string
PUSH HL ; Save HL
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
POP HL ; Recover HL
;
; Copy real vectors into active jump table ; Copy real vectors into active jump table
LD DE,JPTBL
LD BC,7 * 3 ; copy 7 3-byte entries
LDIR
LD DE,JPTBL ; Real jump table is destination
LD BC,7 * 3 ; Copy 7 3-byte entries
LDIR ; Do the copy
; ;
; Check for UNA (UBIOS) ; Check for UNA (UBIOS)
LD A,(0FFFDH) ; fixed location of UNA API vector LD A,(0FFFDH) ; fixed location of UNA API vector
@ -89,7 +102,12 @@ MINIT2:
CP 0E5H ; second byte of UNA push ix instruction CP 0E5H ; second byte of UNA push ix instruction
JR NZ,MINIT3 ; if not, not UNA JR NZ,MINIT3 ; if not, not UNA
; ;
; Get CPU speed from UNA
; Display UNA notification string
LD DE,UBIOS ; BIOS notification string
LD C,9 ; BDOS string display function
CALL BDOS
;
; Get CPU speed from UNA and return
LD C,0F8H ; UNA BIOS Get PHI function LD C,0F8H ; UNA BIOS Get PHI function
RST 08 ; Returns speed in Hz in DE:HL RST 08 ; Returns speed in Hz in DE:HL
LD A,E ; Hack to get approx speed in MHz LD A,E ; Hack to get approx speed in MHz
@ -98,15 +116,47 @@ MINIT2:
SRL A ; ... SRL A ; ...
SRL A ; ... SRL A ; ...
INC A ; Fix up for value truncation INC A ; Fix up for value truncation
RET ; done
RET ; Done
; ;
MINIT3: MINIT3:
; Not UNA, use HBIOS for CPU speed lookup
; Not UNA, try RomwBW HBIOS for CPU speed lookup
LD HL,(0FFFEH) ; HL := HBIOS ident location
LD A,'W' ; First byte of ident
CP (HL) ; Compare
JR NZ,MINIT4 ; Not HBIOS
INC HL ; Next byte of ident
LD A,~'W' ; Second byte of ident
CP (HL) ; Compare
JR NZ,MINIT4 ; Not HBIOS
;
; Display RomWBW notification string
LD DE,HBIOS ; BIOS notification string
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
;
; Get CPU speed from RomWBW HBIOS and return
LD B,0F8H ; HBIOS SYSGET function 0xF8 LD B,0F8H ; HBIOS SYSGET function 0xF8
LD C,0F0H ; CPUINFO subfunction 0xF0 LD C,0F0H ; CPUINFO subfunction 0xF0
RST 08 ; do it, L := CPU speed in MHz
LD A,L ; move it to A
RET ; done
RST 08 ; Do it, L := CPU speed in MHz
LD A,L ; Move it to A
RET ; Done
;
MINIT4:
; Neither UNA nor RomWBW
LD DE,BIOERR ; BIOS error message
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
JP 0 ; Bail out!
;
RBC DB "RBC, 28-Aug-2017, $"
;
UART DB "UART0$"
ASCI DB "ASCI0$"
;
UBIOS DB " [UNA]", 13, 10, "$"
HBIOS DB " [WBW]", 13, 10, "$"
;
BIOERR DB 13, 10, 13, 10, "*** Unknown BIOS ***", 13, 10, "$"
; ;
;----------------------------------------------------------------------- ;-----------------------------------------------------------------------
; ;

Loading…
Cancel
Save