flags.pp 393 B

123456789101112131415161718
  1. Program flags;
  2. uses go32;
  3. var r : trealregs;
  4. begin
  5. r.ax := $5300;
  6. r.bx := 0;
  7. realintr($15, r);
  8. { check if carry clear and write a suited message }
  9. if ((r.flags and carryflag)=0) then begin
  10. Writeln('APM v',(r.ah and $f),
  11. '.', (r.al shr 4), (r.al and $f),
  12. ' detected');
  13. end else
  14. Writeln('APM not present');
  15. end.