mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 17:09:10 +02:00
Save and restore ES register in InitDelay and Delay
git-svn-id: trunk@37013 -
This commit is contained in:
parent
5d96ca4baf
commit
cc9d506512
@ -460,6 +460,8 @@ begin
|
|||||||
{ and interrupts are always disabled at this point when }
|
{ and interrupts are always disabled at this point when }
|
||||||
{ running a program inside gdb(pas). Web bug 1345 (JM) }
|
{ running a program inside gdb(pas). Web bug 1345 (JM) }
|
||||||
sti
|
sti
|
||||||
|
mov es,ax
|
||||||
|
push ax
|
||||||
mov ax, $40
|
mov ax, $40
|
||||||
mov es, ax
|
mov es, ax
|
||||||
mov di, $6c
|
mov di, $6c
|
||||||
@ -474,6 +476,8 @@ LInitDel1:
|
|||||||
|
|
||||||
mov word ptr [DelayCnt], ax
|
mov word ptr [DelayCnt], ax
|
||||||
mov word ptr [DelayCnt + 2], dx
|
mov word ptr [DelayCnt + 2], dx
|
||||||
|
pop ax
|
||||||
|
mov ax,es
|
||||||
end ['AX','BX','DX', 'DI'];
|
end ['AX','BX','DX', 'DI'];
|
||||||
DelayCnt := -DelayCnt div $55;
|
DelayCnt := -DelayCnt div $55;
|
||||||
end;
|
end;
|
||||||
@ -483,6 +487,8 @@ procedure Delay(MS: Word);assembler;
|
|||||||
label
|
label
|
||||||
LDelay1, LDelay2;
|
LDelay1, LDelay2;
|
||||||
asm
|
asm
|
||||||
|
mov es,ax
|
||||||
|
push ax
|
||||||
mov ax, $40
|
mov ax, $40
|
||||||
mov es, ax
|
mov es, ax
|
||||||
xor di, di
|
xor di, di
|
||||||
@ -498,6 +504,8 @@ LDelay1:
|
|||||||
call DelayLoop
|
call DelayLoop
|
||||||
loop LDelay1
|
loop LDelay1
|
||||||
LDelay2:
|
LDelay2:
|
||||||
|
pop ax
|
||||||
|
mov ax,es
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user