Hardware Reference
In-Depth Information
Figure 4.1 It is possible to obtain the same results using different
programming languages. This Visual Basic code produces the simple warning
message shown in Figure 4.2
instrumentation and control applications are as follows:
What control flow structures are provided to facilitate the development of
structured code?
Such control structures may take several forms but should ideally include
the ability to handle user-defined functions and procedures (with or without
local variables) and such control structures as IF ... THEN ... ELSE ...
ENDIF , DO WHILE ... LOOP , SELECT ... CASE ... END SELECT ,
and
WHILE ... WEND .
What provision is there for handling I/O?
Most languages provide functions and statements (e.g. BASIC's PEEK and
POKE ) which facilitate direct access to memory. A language for PC-based
instrumentation and control applications should have statements that allow
reading from and writing to I/O port addresses. Taking BASIC as an example,
functions such as:
Figure 4.2 The warning
message produced by the
Visual Basic program shown
in Figure 4.1
INP(port)
and statements such as:
OUT port, data
make writing I/O routines extremely easy.
How easy is it to combine/interface modules written in the same or a different
language?
A facility for combining/interfacing modules written in the same or a differ-
ent language will be essential in any other than the simplest of applications
(Figures 4.1 and 4.2). As an example, it may be convenient to develop
an assembly language routine to handle some critical I/O process and then
interface this to a high-level language program which deals with more mun-
dane processes, such as keyboard input, display output, and disk filing. In
such a case, it will generally be necessary to have some mechanism for
Search WWH ::




Custom Search