Hardware Reference
In-Depth Information
Figure 6.9 The PowerBASIC for Windows IDE
A complete example of a PowerBASIC for Windows program appears on
page 218.
Using dynamic link
library (DLL) files
A dynamic link library (DLL) is a Windows executable library module contain-
ing one or more Subs or Functions that can be called by executables (or by other
DLLs). DLLs allow you to re-use a common set of procedures without having to
include them in each application that needs them. This can significantly reduce
the size of executables.
DLLs make efficient use of resources because only one copy of the DLL
needs to be present in memory at any particular time in order to offer its services
(i.e. access to its Subs and Functions) to any program (or any other DLL) that
may need them. DLLs have multiple entry points, one for each exported Sub
or Function. The next section shows how DLLs can be used to overcome the
problem of accessing ports within the Windows Protected Mode environment.
Accessing the I/O ports
from the Windows
Protected Mode
environment
Modern versions of Windows (Windows NT, Windows 2000, and Windows XP)
allow programs to be executed in Protected Mode using a 32-bit flat memory
model. The rationale for this was to make Windows more robust by preventing
poorly constructed or faulty software from attempting to directly access the
system hardware. Unfortunately, this is precisely what we are attempting to do
with BASIC code such as:
out &H378,&HAA
and assembly language code such as:
mov al, &HAA
mov dx, &H378
out dx, al
Search WWH ::




Custom Search