add hl,hl ; shift out next bit\r
jr nc,not$out$device\r
push hl ; save the vector\r
-; push bc ; save the count and character\r
-;not$out$ready:\r
-; call coster\r
-; or a\r
-; jr z,not$out$ready\r
-; pop bc\r
- push bc ; restore and resave the character and device\r
+ push bc ; save device num and the character\r
call ?co ; if device selected, print it\r
pop bc ; recover count and character\r
pop hl ; recover the rest of the vector\r
push hl ; save the vector\r
push bc ; save the count\r
ld a,0FFh ; assume device ready\r
- call c,coster ; check status for this device\r
+ call c,?cost ; check status for this device\r
pop bc ; recover count\r
pop hl ; recover bit vector\r
or a ; see if device ready\r
or 0FFh ; all selected were ready, return true\r
ret\r
\r
- ; check for output device ready, including optional\r
- ; xon/xoff support\r
-coster:\r
- ld l,b\r
- ld h,0 ; make device code 16 bits\r
- push hl ; save it in stack\r
- add hl,hl\r
- add hl,hl\r
- add hl,hl ; create offset into device characteristics tbl\r
- ld de,@ctbl+6\r
- add hl,de ; make address of mode byte\r
- ld a,(hl)\r
- and mb$xon$xoff\r
- pop hl ; recover console number in <HL>\r
- jp z,?cost ; not a xon device, go get output status direct\r
- ld de,xofflist\r
- add hl,de ; make pointer to proper xon/xoff flag\r
- call cist1 ; see if this keyboard has character\r
- ld a,(hl)\r
- call nz,ci1 ; get flag or read key if any\r
- cp ctlq\r
- jr nz,not$q ; if its a ctl-Q,\r
- ld a,0FFh ; set the flag ready\r
-not$q:\r
- cp ctls\r
- jr nz,not$s ; if its a ctl-S,\r
- ld a,00h ; clear the flag\r
-not$s:\r
- ld (hl),a ; save the flag\r
- call cost1 ; get the actual output status,\r
- and (hl) ; and mask with ctl-Q/ctl-S flag\r
- ret ; return this as the status\r
\r
cist1: ; get input status with <BC> and <HL> saved\r
push bc\r
or a\r
ret\r
\r
-cost1: ; get output status, saving <BC> & <HL>\r
- push bc\r
- push hl\r
- call ?cost\r
- pop hl\r
- pop bc\r
- or a\r
- ret\r
-\r
-ci1: ; get input, saving <BC> & <HL>\r
- push bc\r
- push hl\r
- call ?ci\r
- pop hl\r
- pop bc\r
- ret\r
-\r
\r
; AUXIST\r
; Auxiliary Input Status. Return true if\r
ist$scan:\r
ld b,0 ; start with device 0\r
cis$next:\r
- add hl,hl ; check next bit\r
- ld a,0 ; assume device not ready\r
- call c,cist1 ; check status for this device\r
- or a\r
+ xor a ; assume next device not ready\r
+ add hl,hl ; check next bit (lets z flag unaffected)\r
+ call c,cist1 ; check status for this device\r
ret nz ; if any ready, return true\r
inc b ; next device number\r
ld a,h\r
or l ; see if any more selected devices\r
- jr nz,cis$next\r
- xor a ; all selected were not ready, return false\r
- ret\r
+ ret z ; all selected were not ready, return false\r
+ jr cis$next\r
\r
\r
; AUXIN\r
push hl ; save bit vector\r
ld b,0\r
ci$next:\r
+ xor a ; assume next device not ready\r
add hl,hl ; shift out next bit\r
- ld a,0 ; insure zero a (nonexistant device not ready).\r
call c,cist1 ; see if the device has a character\r
- or a\r
jr nz,ci$rdy ; this device has a character\r
inc b ; else, next device\r
ld a,h\r
jp ?bank ; and go exit through users\r
; physical bank select routine\r
\r
-\r
-xofflist:\r
- db -1,-1,-1,-1,-1,-1,-1,-1 ; ctl-s clears to zero\r
- db -1,-1,-1,-1,-1,-1,-1,-1\r
-\r
dseg ; following resides in banked memory\r
\r
; Disk I/O interface routines\r
b2m RE, 6 ;Receiver Enable\r
b2m TE, 5 ;Transmitter Enable\r
b2m RTS0, 4 ;Request to Send Channel 0\r
- b2m CKA1D, 4 ;\r
+ b2m CKA1D, 4 ;CKA1 disable (Enable DREQ0)\r
b2m MPBR, 3 ;Multiprocessor Bit Receive (Read)\r
b2m EFR, 3 ;Error Flag Reset (Write)\r
b2m MOD2, 2 ;Data Format Mode 1 = 8-Bit data\r
b2m FE,4 ;Framing Error\r
b2m RIE,3 ;Receive Interrupt Enable\r
b2m DCD0,2 ;Data Carrier Detect (Ch 0)\r
- b2m CTS1E,2 ;Clear To Send (Ch 1)\r
+ b2m CTS1E,2 ;Clear To Send Enable (Ch 1)\r
b2m TDRE,1 ;Transmit Data Register Empty\r
b2m TIE,0 ;Transmit Interrupt Enable\r
\r