Hardware Reference
In-Depth Information
Table 6.4 Summary of PowerBASIC 3.5 for DOS data types
Data type
Size
Range
Integer
16 bits (2 bytes) signed
32 768 to 32 767
Long integer
32 bits (4 bytes) signed
2 147 483 648 to 2 147 483 647
9 . 22 10 18
Quad integer
64 bits (8 bytes) signed
Byte
8 bits (1 byte) unsigned
0 to 255
Word
16 bits (2 bytes) unsigned
0 to 65 535
Double Word
32 bits (4 bytes) unsigned
0 to 4 294 967
8 . 43 10 37
to 3.37 10 38
Single precision
32 bits (4 bytes)
4 . 19 10 307
to 1.67 10 308
Double precision
64 bits (8 bytes)
3 . 4 10 4932
to 1.2 10 4932
Extended precision
80 bits (10 bytes)
9 . 99 10 63
to 9.99 10 63
BCD fixed point
64 bits (8 bytes)
9 . 99 10 63
to 9.99 10 63
BCD floating point
80 bits (10 bytes)
that Microsoft's BASIC Professional Development Systems Version 7.1 was
released. However, unlike the latter product, Power BASIC continued to be
developed and supported and the current version (Version 3.5 of Power BASIC
for DOS) represents the ultimate 'state of the art' in tools for the development
of BASIC programs in a DOS environment.
PowerBASIC supports direct generation of 80286 and 80386 processor code
and 80287/80387 math coprocessor code. A fast procedure-based math package
performs IEEE standard floating point operations and there is support for a full
complement of variables and data types (see Tables 6.3 and 6.4).
Accessing assembly
language from within
BASIC programs
The ability to include assembly language routines within a BASIC program
can be invaluable when developing code for instrumentation, data acquisition
and control applications. This can be done in two basic ways: the use of inline
assembly language statements or the ability to link to an external assembly
language module. For those who are already developing assembly language
code the latter might be an attractive option but for most of us the ability to
introduce assembly language code within a set of BASIC program statements
will satisfy most, if not all, requirements.
Here is a simple example of using assembly language within PowerBASIC
3.5 to access the PC's internal speaker:
' Title: assfunc.bas
Version: 0.2
Modified: 24/08/04
' Language: PowerBASIC 3.5
' Function: Demonstrates function calls to inline assembly
' language routines. Generates sounds using the speaker
'
' Main loop to obtain input from user
'
division$ = String$(40, Chr$(205))
blank$ = String$(48, Chr$(32))
color 15, 1
cls
print division$
print "Assembly language function call demo."
print division$
Search WWH ::




Custom Search