|
<--- Turn the page
   
(contents page)
   
Turn the page ---> Pascal |
|
|
Listing 1 program Is386demo;
uses dos;
function is386: boolean; assembler;
asm
push bx { save reg's used (except ax) }
xor ax,ax { assume false }
mov bx,7000h { if bits 12,13,14 are still set }
push bx { after pushing/poping to/from }
popf { the flags register then we have }
pushf { a 386+ }
pop bx
and bx,7000h
cmp bx,7000h
jne @Not386
mov ax,-1
@Not386:
pop bx { restore register }
end;
begin
if not is386 then
writeln('You have a 286 or before')
else
writeln('You have a 386 or higher (32-bits)');
end.
|
<--- Turn the page
   
(contents page)
   
Turn the page ---> Page 12