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 tkchia Homepage, 18.01.2022, 15:30

Hello rosegondon,

> > function GetFreeDosVer : pchar; assembler;
> > asm
> > > > mov ax,$33ff ; get FreeDOS version string pointer
> > > > xor dx, dx
> > > > int $21 ; returns DX AX
> > > > test dx, dx
> > > > jnz @gotname
> > xor ax, ax
> > mov dx, ax
> > @gotname:
> > end;
>
> Uses Strings;
> Begin
> Writeln(StrPas(GetFreeDosVer));
> End.
>
> Under MS-DOS this function returns a string of random characters. Shouldn't
> it return empty result under DOS other than FreeDOS?

The above implementation under MS-DOS will return a null pointer (0:0) — which in general may not point to an empty string. You probably want to check that the returned pointer is not a null pointer.

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

 

Complete thread:

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