home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PERFORM
/
CURSOR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-01-13
|
1KB
|
74 lines
{$IFDEF VER70}
{$A+,B-,D-,E-,F-,G+,I-,L-,N-,O-,P-,Q-,R-,S+,T-,V-,X+}
{$ELSE}
{$A+,B-,D-,E-,F-,G+,I-,L-,N-,O-,R-,S+,V-,X+}
{$ENDIF}
{$M 16384,0,655360}
uses Crt,Dos;
var TimerTick: Word absolute $0040:$006C;
StartTick: Word;
Reps: LongInt;
Const BiosInt = $10;
procedure SetCursor(X,Y: Byte);
var Regs: Registers;
begin
with Regs do
begin
AH := $02;
BH := 0;
DL := X;
DH := Y
end;
Intr(BiosInt,Regs)
end {SetCursor};
procedure SetCursorBASM(X,Y: Byte); Assembler;
ASM
mov AH,$02
xor BH,BH
mov DL,X
mov DH,Y
int BIOSINT
end {SetCursorBASM};
var X,Y: Array[1..10240] of Byte;
begin
ClrScr;
RandSeed := 0;
for Reps:=1 to 10240 do
begin
X[Reps] := Random(80);
Y[Reps] := Random(25)
end;
Reps := 0;
StartTick := TimerTick;
while StartTick = TimerTick do {wait for end of TimerTick};
StartTick := TimerTick;
repeat
SetCursor(X[Reps],Y[Reps]);
Inc(Reps)
until StartTick <> TimerTick;
GotoXY(1,1);
writeln(' SetCursor: ',Reps);
Reps := 0;
StartTick := TimerTick;
while StartTick = TimerTick do {wait for end of TimerTick};
StartTick := TimerTick;
repeat
SetCursorBASM(X[Reps],Y[Reps]);
Inc(Reps)
until StartTick <> TimerTick;
GotoXY(1,2);
writeln(' SetCursorBASM: ',Reps);
end.