flags.tex 469 B

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