www.delorie.com/gnu/docs/gcc/gnat_ug_260.html   search  
Buy the book!

Untitled Document

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24.7 A Complete Example

This section contains a complete program illustrating a realistic usage of GNAT's Inline Assembler capabilities. It comprises a main procedure Check_CPU and a package Intel_CPU. The package declares a collection of functions that detect the properties of the 32-bit x86 processor that is running the program. The main procedure invokes these functions and displays the information.

The Intel_CPU package could be enhanced by adding functions to detect the type of x386 co-processor, the processor caching options and special operations such as the SIMD extensions.

Although the Intel_CPU package has been written for 32-bit Intel compatible CPUs, it is OS neutral. It has been tested on DOS, Windows/NT and Linux.

24.7.1 Check_CPU Procedure  
24.7.2 Intel_CPU Package Specification  
24.7.3 Intel_CPU Package Body  

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003