home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / 22rsx / rxmd.ark.2 / RXMD01.MAC < prev    next >
Text File  |  1985-12-07  |  3KB  |  172 lines

  1. ;
  2. ; -------------------------------------------------------------------
  3. ;        I/O drivers using BYERSX's extended BDOS calls
  4. ;
  5. ; local console input status
  6. ; a,f
  7. constat:
  8.     mvi    a,66;        Console status call
  9.     jmp    dos
  10. ;
  11. ; input (a) from local keyboard
  12. ; a,f
  13. conin:    mvi    a,67;        Console input call
  14.     jmp    dos
  15. ;
  16. ; char (e) to local console
  17. ; a,f
  18. conout:    mvi    a,68;        Console output call (char is in 'E')
  19.     jmp    dos
  20. ;
  21. ; check carrier presence (or checks disabled)
  22. ; a,f
  23. mdcarck:
  24.     call    getstatus
  25.     xri    carcks;        Carrier checks enabled
  26.     ani    carcks
  27.     rnz;            Disabled, signal carrier on
  28.     mvi    a,65;        Carrier check
  29.     jmp    dos
  30. ;
  31. ; input from modem, no ready checks
  32. ; a,f
  33. mdinp:    mvi    a,64;        Modem input
  34.     jmp    dos
  35. ;
  36. ; output char (a) to modem, no ready checks
  37. ; f
  38. mdoutp:    push    d
  39.     mov    e,a;        Put character in 'E'
  40.     mvi    a,63;        Modem output
  41.     call    dos
  42.     mov    a,e;        ensure (a) unchanged
  43.     pop    d
  44.     ret
  45. ;
  46. ; modem output status
  47. ; a,f
  48. mdoutst:
  49.     mvi    a,62;        Modem output status
  50.     jmp    dos
  51. ;
  52. ; Get modem input status
  53. ; a,f
  54. mdinst:    mvi    a,61;        Modem input status
  55. ;    "    "
  56. ; BDOS call (a), preserving registers.  Can't return word value
  57. ; a,f
  58. dos:    push    h
  59.     push    d
  60.     push    b
  61.     mov    c,a
  62.     call    bdos
  63.     pop    b
  64.     pop    d
  65.     pop    h
  66.     ret
  67. ;
  68. ; Get current modem speed
  69. ; a,f
  70. mspeed:    push    d
  71.     mvi    e,0;        query subcommand
  72.     mvi    a,sgbaud
  73.     call    dos;        returns 1..10
  74.     pop    d
  75.     ani    0fh;        ignore stops/parity
  76.     rz;            default 110 baud if unknown
  77.     dcr    a;        Put in range 0..9
  78.     ret
  79. ;
  80. ; This end is the cpu, not a terminal.  Using CCP stack.
  81. ; Delay for remote end to close files and return to terminal mode
  82. ; a,f,d,e,h,l
  83. waitxit:
  84.     lhld    waitm;        l is delay in 0.1 secs
  85. waitx1:    call    delay
  86.     dcr    l
  87.     jnz    waitx1
  88.     ret    
  89. ;
  90. ; delay (de) millisecs
  91. ; a,f
  92. dodelay:
  93.     mvi    a,delayms
  94.     jmp    dos;        delay and exit
  95. ;
  96. ; 100 millisec delay
  97. ; a,f
  98. delay:    push    d
  99.     lxi    d,100
  100.     call    dodelay;    delay 0.1 sec
  101.     pop    d
  102.     ret
  103. ;
  104. ; Get CPU clock rate in 100 khz units
  105. ; a,f
  106. clkspd:    mvi    a,2;        subcommand
  107.     jmp    dorsx
  108. ;
  109. ; check RSX presence.  Allows for changes under CPM 3
  110. ; a,f
  111. chkrsx:    mvi    a,0;        presence query
  112. ;    "    "
  113. ; rsx sub-command (a)
  114. ; a,f
  115. dorsx:    push    d
  116.     mov    e,a
  117.     mvi    d,0;        so enquiry works, cant kill
  118.     mvi    a,rsxmast
  119.     call    dos
  120.     pop    d
  121.     ora    a;        set flags on returned value
  122.     ret
  123. ;
  124. ; get system status byte
  125. ; a,f
  126. getstatus:
  127.     mvi    a,systate
  128. ;    "    "
  129. ; query a system variable for dos call (a)
  130. ; *** USE ONLY for calls that use 0ffh as enquiry ***
  131. ; a,f
  132. sysquery:
  133.     push    d
  134.     mvi    e,0ffh
  135.     call    dos
  136.     pop    d
  137.     ret
  138. ;
  139. ; set/get wheel/system status. a=0ffh to get, else set
  140. ; a,f
  141. setstatus:
  142.     push    d
  143.     mov    e,a
  144.     mvi    a,systate
  145.     call    dos
  146.     pop    d
  147.     ret
  148. ;
  149. ; turn disk motors off
  150. ; a,f
  151. dskstp:    mvi    a,047h
  152.     jmp    dorsx
  153. ;
  154. ; advance local timers by 1 min
  155. ; a,f
  156. advmin:    mvi    a,04ah
  157.     jmp    dorsx
  158. ;
  159. ; delay "pause" milliseconds for line turn-around to allow some
  160. ; main-frames to become live on receive.  Disturb no registers
  161. turn:    push    psw
  162.     push    d
  163.     lda    pause
  164.     mov    e,a
  165.     mvi    d,0
  166.     ora    a;        Speed up if configured to zero
  167.     cnz    dodelay;    delay pause millisecs
  168.     pop    d
  169.     pop    psw
  170.     ret
  171. ;
  172.     9