[fpc-pascal]DOS memory access via "absolute"

Sebastian Schuberth s.schuberth at gmx.net
Sun Oct 1 21:29:05 CEST 2000


Hi there!

Is anyone able to tell me why the following code plots the red pixel but
not the blue one, and why the locking function does not work?

----8<----
Program Test;

Uses
  CRT,GO32;

Var
  Screen:Array[0..199,0..319] Of Byte Absolute $A0000;

Begin
  WriteLn(lock_linear_region($A0000,320*200));

  ReadKey;
  Asm
    mov eax,13h
    int 10h
  End;

  Screen[0,0]:=1; { blue pixel }
  Mem[$A0001]:=12; { red pixel }

  ReadKey;
  Asm
    mov eax,03h
    int 10h
  End;

  WriteLn(unlock_linear_region($A0000,320*200));
End.
----8<----

Thanks in advance!

-- 

Sebastian Schuberth




More information about the fpc-pascal mailing list