Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

21.33FF kernel version string interface (Developers)

posted by Laaca Homepage, Czech republic, 18.01.2022, 14:25

Or this dualistic implementation (Turbopascal / Freepascal)
(compatible with both FPC calling modes: oldfpccall and fastcall)

Procedure Get_FreeDOS_version_string_asm(var s,o:word);assembler;
asm
{$IFDEF FPC}
   push esi
   push edi
   mov esi,s
   mov edi,o
   mov ax,33ffh
   mov dx,0
   int 21h
   mov [esi],dx
   mov [edi],ax
   pop edi
   pop esi
{$ELSE}
push si
push ds
mov ax,33ffh
mov dx,0
int 21h
lds si,s
mov [si],dx
lds si,o
mov [si],ax
pop ds
pop si
{$ENDIF}
end;


Function Get_FreeDOS_version_string:string;
var t:string;
    s,o:word;
    a,b:byte;
begin
Get_FreeDOS_version_string_asm(s,o);
t:='';
if s<>0 then
   for a:=0 to 254 do
       begin
       b:=Mem[s:o+a];
       if b=0 then break else
       if b>=32 then t:=t+char(b);
       end;
Get_FreeDOS_version_string:=t;
end;


begin
writeln(Get_freedos_version_string);
end.

---
DOS-u-akbar!

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 240 users online (0 registered, 240 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum