<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 30 May 1981108:52:00-MDT
From   : Ronald G. Fowler <RGF@MIT-MC>
Subject: DMA ADDRESSES

  If your program is resident while other programs are running
(such as is the case with DESPOOL, which prints a file in "back-
ground" while other programs are running), you can intercept the
BDOS calls by transplanting the address field of the jump inst-
ruction at address 5 with a jump to your intercept routine; the
intercept routine examines the parameter number in the C register,
and, if it is a SETDMA function request, stores the DMA address
in the DE register.  The code sequence could look like this:
        MOV  A,C   ;CHECK THE PARAMETER
        CPI  SDMAF ;SETTING DMA?
        JNZ  NOPE
        XCHG       ;YEP, SAVE A COPY FOR US
        SHLD OURDMA
        XCHG
NOPE:   JMP  $-$

  Note that the $-$ address (which is the real address of the BDOS)
must be filled in by the same routine that overlays the jump at 5.
  Also note that this changes the "top of memory" for programs
that read this address field, such as PIP, to determine the amount
of usable memory.  If your program resides above CPM, this would
cause the BDOS and BIOS to be clobbered.  In this case, you
must overlay the address field of the jump instruction pointed
to by the instruction field of the jump at 5 (which is within
the BDOS), and not the jump at 5 itself.  This allows the BDOS
calls to be intercepted without changing "top of memory".
  Hope this answers your question.
      Ron Fowler
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>