mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 06:49:16 +02:00
* only save BP and DS when calling int 10h; mark the other registers as volatile in the asm blocks
- removed the 'ifdef FPC' around the register saving code around the int 10h calls git-svn-id: trunk@40890 -
This commit is contained in:
parent
ecfbf8f3cb
commit
6066eb07b4
@ -164,9 +164,11 @@ const
|
|||||||
Procedure CallInt10(val_ax : word); assembler;
|
Procedure CallInt10(val_ax : word); assembler;
|
||||||
asm
|
asm
|
||||||
mov ax,val_ax
|
mov ax,val_ax
|
||||||
|
push ds
|
||||||
push bp
|
push bp
|
||||||
int 10h
|
int 10h
|
||||||
pop bp
|
pop bp
|
||||||
|
pop ds
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{************************************************************************}
|
{************************************************************************}
|
||||||
@ -2282,19 +2284,11 @@ End;
|
|||||||
asm
|
asm
|
||||||
mov ax,[page] { only lower byte is supPorted. }
|
mov ax,[page] { only lower byte is supPorted. }
|
||||||
mov ah,05h
|
mov ah,05h
|
||||||
{$ifdef fpc}
|
push ds
|
||||||
push bp
|
push bp
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push bx
|
|
||||||
{$endif fpc}
|
|
||||||
int 10h
|
int 10h
|
||||||
{$ifdef fpc}
|
|
||||||
pop bx
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bp
|
pop bp
|
||||||
{$endif fpc}
|
pop ds
|
||||||
|
|
||||||
{ read start address }
|
{ read start address }
|
||||||
mov dx,3d4h
|
mov dx,3d4h
|
||||||
@ -2307,7 +2301,7 @@ End;
|
|||||||
mov al,0dh
|
mov al,0dh
|
||||||
out dx,al
|
out dx,al
|
||||||
in al,dx
|
in al,dx
|
||||||
end ['DX','AX'];
|
end ['DX','CX','BX','AX','SI','DI'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetActive200(page: word); {$ifndef fpc}far;{$endif fpc}
|
procedure SetActive200(page: word); {$ifndef fpc}far;{$endif fpc}
|
||||||
@ -2330,20 +2324,12 @@ End;
|
|||||||
asm
|
asm
|
||||||
mov ax,[page] { only lower byte is supPorted. }
|
mov ax,[page] { only lower byte is supPorted. }
|
||||||
mov ah,05h
|
mov ah,05h
|
||||||
{$ifdef fpc}
|
push ds
|
||||||
push bp
|
push bp
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push bx
|
|
||||||
{$endif fpc}
|
|
||||||
int 10h
|
int 10h
|
||||||
{$ifdef fpc}
|
|
||||||
pop bx
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bp
|
pop bp
|
||||||
{$endif fpc}
|
pop ds
|
||||||
end ['AX'];
|
end ['DX','CX','BX','AX','SI','DI'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetActive350(page: word); {$ifndef fpc}far;{$endif fpc}
|
procedure SetActive350(page: word); {$ifndef fpc}far;{$endif fpc}
|
||||||
@ -2526,19 +2512,11 @@ const CrtAddress: word = 0;
|
|||||||
JZ @L2
|
JZ @L2
|
||||||
OR AX, 080h
|
OR AX, 080h
|
||||||
@L2:
|
@L2:
|
||||||
{$ifdef fpc}
|
push ds
|
||||||
push bp
|
push bp
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push bx
|
|
||||||
{$EndIf fpc}
|
|
||||||
INT 10h
|
INT 10h
|
||||||
{$ifdef fpc}
|
|
||||||
pop bx
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bp
|
pop bp
|
||||||
{$EndIf fpc}
|
pop ds
|
||||||
MOV DX,03C4h {select memory-mode-register at sequencer Port }
|
MOV DX,03C4h {select memory-mode-register at sequencer Port }
|
||||||
MOV AL,04
|
MOV AL,04
|
||||||
OUT DX,AL
|
OUT DX,AL
|
||||||
@ -2574,7 +2552,7 @@ const CrtAddress: word = 0;
|
|||||||
IN AL,DX
|
IN AL,DX
|
||||||
OR AL,40h {bit 6 := 1: memory access scheme=linear bit array }
|
OR AL,40h {bit 6 := 1: memory access scheme=linear bit array }
|
||||||
OUT DX,AL
|
OUT DX,AL
|
||||||
end ['DX','BX','CX','AX','DI'];
|
end ['DX','BX','CX','AX','SI','DI'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1933,24 +1933,16 @@ end;
|
|||||||
asm
|
asm
|
||||||
mov ax,4F02h
|
mov ax,4F02h
|
||||||
mov bx,mode
|
mov bx,mode
|
||||||
{$ifdef fpc}
|
push ds
|
||||||
push bp
|
push bp
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push bx
|
|
||||||
{$endif fpc}
|
|
||||||
int 10h
|
int 10h
|
||||||
{$ifdef fpc}
|
|
||||||
pop bx
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bp
|
pop bp
|
||||||
{$endif fpc}
|
pop ds
|
||||||
sub ax,004Fh
|
sub ax,004Fh
|
||||||
cmp ax,1
|
cmp ax,1
|
||||||
sbb al,al
|
sbb al,al
|
||||||
mov res,al
|
mov res,al
|
||||||
end ['BX','AX'];
|
end ['DX','CX','BX','AX','SI','DI'];
|
||||||
if not res then
|
if not res then
|
||||||
_GraphResult := GrNotDetected
|
_GraphResult := GrNotDetected
|
||||||
else _GraphResult := grOk;
|
else _GraphResult := grOk;
|
||||||
@ -2222,20 +2214,12 @@ end;
|
|||||||
mov bx, 0000h { set display start }
|
mov bx, 0000h { set display start }
|
||||||
mov cx, 0000h { pixel zero ! }
|
mov cx, 0000h { pixel zero ! }
|
||||||
mov dx, [NewStartVisible] { new scanline }
|
mov dx, [NewStartVisible] { new scanline }
|
||||||
{$ifdef fpc}
|
push ds
|
||||||
push bp
|
push bp
|
||||||
push si
|
|
||||||
push di
|
|
||||||
push bx
|
|
||||||
{$endif}
|
|
||||||
int 10h
|
int 10h
|
||||||
{$ifdef fpc}
|
|
||||||
pop bx
|
|
||||||
pop di
|
|
||||||
pop si
|
|
||||||
pop bp
|
pop bp
|
||||||
{$endif}
|
pop ds
|
||||||
end ['DX','CX','BX','AX'];
|
end ['DX','CX','BX','AX','SI','DI'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetActiveVESA(page: word); {$ifndef fpc}far;{$endif fpc}
|
procedure SetActiveVESA(page: word); {$ifndef fpc}far;{$endif fpc}
|
||||||
|
Loading…
Reference in New Issue
Block a user