.xlist
        page    64,132
        title   Mid-level FOSSIL Communications routines
        subttl  by Wynn Wagner III
        name    Com_Asm
        .sall
.list
        if1
        %out    FOSSIL routines for OPUS-Cbcs
        %out    Copyright 1987. Wynn Wagner III. All Rights Reserved
        endif
        include version.inc
        include msdos.inc
        include cmacros.inc
        if2
        if memS ne 1
        error   <You have to use SMALL memory for this module.>
        endif
        endif




sBegin   code

         assumes  cs,code
         assumes  ds,data


          page
         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
         ;;                                          ;;
         ;; ROUTINE: _readkb                         ;;
         ;;                                          ;;
         ;; PURPOSE: Get keyboard stuff from DOS     ;;
         ;;                                          ;;
         ;; USAGE:   int readkb(void);               ;;
         ;;                                          ;;
         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

cProc    readkb,<PUBLIC>

cBegin

         callos   coninput
         xor      ah, ah

cEnd


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

         page
         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
         ;;                                          ;;
         ;; ROUTINE: _kpress                         ;;
         ;;                                          ;;
         ;; PURPOSE: Returns non-zero if a character ;;
         ;;          is available in the keyboard    ;;
         ;;          buffer.                         ;;
         ;;                                          ;;
         ;; USAGE:   int kpress(void);               ;;
         ;;                                          ;;
         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

cProc    kpress,<PUBLIC>

cBegin

         callos   kbdstatus
         xor      ah, ah

cEnd


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

         page
         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
         ;;                                          ;;
         ;; ROUTINE: _rdscan                         ;;
         ;;                                          ;;
         ;; PURPOSE: Returns non-zero if a character ;;
         ;;          is available in the keyboard    ;;
         ;;          buffer.                         ;;
         ;;                                          ;;
         ;; USAGE:   int kpress(void);               ;;
         ;;                                          ;;
         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

cProc    rdscan,<PUBLIC>,<si,di>

cBegin
         callos   coninput
         xor      ah, ah

         or       al, al            ; is it 0? (extended scan code?)
         jne      Done              ; no, just return the value

         callos   coninput          ; get second character of extended code
         xor      ah, ah

         mov      cl, 8             ; make it look like an extended code
         shl      ax, cl
Done:

cEnd



sEnd
         end
