[fpc-pascal]sound blaster

Szilasi RĂ³bert rszilasi at pirin.hu
Sat Dec 14 14:05:05 CET 2002


Ahoi!

I would like to compile BP code into FREE P 
but I can't translate the following rows:
  mov  ax, Seg @DATA
  port[DMA_mask] := SB_DMA or 4;

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;






More information about the fpc-pascal mailing list