mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 09:39:09 +02:00
+ obtain the msdos version on startup
git-svn-id: trunk@24574 -
This commit is contained in:
parent
52328554e4
commit
7628c87e44
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
extern PASCALMAIN
|
extern PASCALMAIN
|
||||||
extern dos_psp
|
extern dos_psp
|
||||||
|
extern dos_version
|
||||||
|
|
||||||
extern _edata ; defined by WLINK, indicates start of BSS
|
extern _edata ; defined by WLINK, indicates start of BSS
|
||||||
extern _end ; defined by WLINK, indicates end of BSS
|
extern _end ; defined by WLINK, indicates end of BSS
|
||||||
@ -42,6 +43,12 @@ no_bss:
|
|||||||
pop ax
|
pop ax
|
||||||
mov word [dos_psp], ax
|
mov word [dos_psp], ax
|
||||||
|
|
||||||
|
; get DOS version and save it in the pascal variable dos_version
|
||||||
|
mov ax, 3000h
|
||||||
|
int 21h
|
||||||
|
xchg al, ah
|
||||||
|
mov word [dos_version], ax
|
||||||
|
|
||||||
; allocate max heap
|
; allocate max heap
|
||||||
; TODO: also support user specified heap size
|
; TODO: also support user specified heap size
|
||||||
; try to resize our main DOS memory block until the end of the data segment
|
; try to resize our main DOS memory block until the end of the data segment
|
||||||
|
@ -81,6 +81,9 @@ implementation
|
|||||||
const
|
const
|
||||||
fCarry = 1;
|
fCarry = 1;
|
||||||
|
|
||||||
|
var
|
||||||
|
dos_version:Word;public name 'dos_version';
|
||||||
|
|
||||||
{$I registers.inc}
|
{$I registers.inc}
|
||||||
|
|
||||||
procedure Intr(IntNo: Byte; var Regs: Registers); external name 'FPC_INTR';
|
procedure Intr(IntNo: Byte; var Regs: Registers); external name 'FPC_INTR';
|
||||||
@ -287,4 +290,5 @@ begin
|
|||||||
{ Reset IO Error }
|
{ Reset IO Error }
|
||||||
InOutRes:=0;
|
InOutRes:=0;
|
||||||
initvariantmanager;
|
initvariantmanager;
|
||||||
|
Writeln(dos_version);
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user