~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to docs/go32ex/flags.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2001-08-29 23:15:17 UTC
  • Revision ID: james.westby@ubuntu.com-20010829231517-thxsp7ctuab584ia
Tags: upstream-1.0.4
ImportĀ upstreamĀ versionĀ 1.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{ This example demonstrates the use of the flag constants in
 
2
conjunction with an interrupt call
 
3
 
 
4
In detail it checks if APM (advanced power management) is
 
5
available.
 
6
 
 
7
Int 15h 5300h - APM specification : Installation check
 
8
Input : AX = 5300h
 
9
        BX = device id of system BIOS (= 0000h)
 
10
Return : Carry clear if successful
 
11
        AH = major version (BCD)
 
12
        AL = minor version (BCD)
 
13
}
 
14
 
 
15
uses
 
16
        go32;
 
17
 
 
18
var
 
19
        r : trealregs;
 
20
 
 
21
begin
 
22
        { set register values and issue real mode interrupt call }
 
23
        r.ax := $5300;
 
24
        r.bx := 0;
 
25
        realintr($15, r);
 
26
        { check if carry clear and write a suited message }
 
27
        if ((r.flags and carryflag)=0) then begin
 
28
                Writeln('APM v', (r.ah and $f), '.',
 
29
                        (r.al shr 4), (r.al and $f), ' detected');
 
30
        end else
 
31
                Writeln('APM not present');
 
32
end.
 
 
b'\\ No newline at end of file'