Aucbvax.1456
fa.info-cpm
utzoo!duke!mhtsa!ucbvax!RGF@MIT-MC
Sat May 30 18:06:23 1981
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


-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <[email protected]>
of http://communication.ucsd.edu/A-News/


This Usenet Oldnews Archive
article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.