[fpc-pascal]sound blaster

John Coppens john at johncoppens.com
Sat Dec 14 16:07:23 CET 2002


On Sat, 14 Dec 2002 14:05:05 +0100
Szilasi RĂ³bert <rszilasi at pirin.hu> wrote:

> Ahoi!
> 
> I would like to compile BP code into FREE P 
> but I can't translate the following rows:
>   mov  ax, Seg @DATA

	The 'Seg' sentence isn't available, see manual:

Description
    Seg returns the segment of the address of a variable. This function is only supported for compatibility. In Free Pascal, it returns always 0, since Free Pascal is a 32 bit compiler, segments have no meaning.

Depending on what you need this line for, you'll have to change the code.

>   port[DMA_mask] := SB_DMA or 4;

The port function is implemented in the ports unit (see manual). You'll have
to put that in your 'uses' statement, and take into account the portability
problems that can arrise.

John

> 
> If somebody can help me to translate Seg @DATA and 
> port[DMA_mask] into free pascal source, please send me
> an example to rszilasi at pirin.hu.
> 
> thanks
> 
> Robert
> 
> 
> 
> procedure InitDMAcontroller(Transfermode : byte);
> var p, s, l : word;
> begin
>   DMApage := DMApages[SB_DMA];
>   DMAoffset := DMAoffsets[SB_DMA];
>   DMAsize := DMAsizes[SB_DMA];
>   port[DMA_mask] := SB_DMA or 4;
>   port[DMA_bpt] := $00;
>   port[DMA_mode] := Transfermode or SB_DMA;
>   DMA_addr(DMAbuffer, p, s, l);
>   port[DMApage] := p;
>   port[DMAoffset] := LO(s);
>   port[DMAoffset] := HI(s);
>   port[DMAsize] := LO(BufferSize - 1);
>   port[DMAsize] := HI(BufferSize - 1);
>   port[DMA_mask] := SB_DMA and 3;
> end;
> 
> procedure SB_AutoInitDMA_IRQ;    interrupt;
> begin
>  asm
>   push DS
>   push ax
>   push dx
>   mov  ax, Seg @DATA
>   mov  DS, ax
>   mov  dx, SBbase
>   add  dx, $0e
>   in   al, dx
>   mov  RfshRequest, TRUE
>   mov  al, 020h
>   out  020h, al
>   pop  dx
>   pop  ax
>   pop  DS
>  end {asm};
> end;
> 
> 
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list