Mail Archives: djgpp/1996/07/23/01:28:57
On Mon, 22 Jul 1996, Luke Steele wrote:
> I'm planning to write some code that will require inline assembly.
> However, I have been unable to work out how to do this - specifically,
> how do I indicate to the compiler that the code is assembly, in the
> way that the 'asm' statement does in Borland C? I've read the FAQ in
> some detail, and the online documentation as well, but these only
> illustrate the syntax of the assembly, and not how to place it inline
> with the C code.
This is all explained in the GCC on-line docs. Download and install the
Texinfo package (v2gnu/txi360b.zip from the same place you get DJGPP) and
then type the following words of wisdom from the DOS prompt:
info gcc "C Extensions" "Extended Asm"
(note the quotes and the letter-case: they are important). You should
now be able to read the chapter on the GCC inline assembly facilities.
> Also, I'm planning to do a DMA transfer. I've performed DMA transfers
> in real mode before with no problem, but are there any special
> considerations when making a transfer in protected mode?
The main consideration is that in protected mode memory is mapped, so the
address of a buffer is usually NOT its physical address. Since DMA
controller needs to know the physical address, you will have to use DPMI
calls that return physical address given a logical one.
Another possibility is to use the VDS (Virtual DMA Services) API, but not
every memory manager/DPMI host supports them (CWSDPMI doesn't, so VDS
won't work when CWSDPMI is running without a memory manager).
- Raw text -