Microsoft Office Tutorials and References
In Depth Information
Appendix F. High-Level and Low-Level Languages
Appendix F. High-Level and Low-Level Languages
In this appendix, we'll examine the position of Visual Basic as a programming language by taking
a somewhat closer look at high-level and low-level languages, with some examples for
comparison.
A low-level language is characterized by its ability to manipulate the computer's operating system
and hardware more or less directly. For instance, a programmer who is using a low-level language
may be able to easily turn on the motor of a floppy drive, check the status bits of the printer
interface, or look at individual sectors on a disk, whereas these tasks may be difficult, if not
impossible, with a high-level language. Another benefit of low-level languages is that they tend to
perform tasks more quickly than high-level languages.
On the other hand, the power to manipulate the computer at a low level comes at a price. L
owlevel languages are generally more cryptic—they tend to be farther removed from ordinary spoken
languages and are therefore harder to learn, remember, and use. High-level languages (and
application-level languages, which many people would refer to simply as high-level languages)
tend to be more user-friendly, but the price we pay for that friendliness is less control over the
computer and slower running programs.
To illustrate, consider the task of printing some text. A low-level language may only be able to
send individual characters to a printer. The process of printing with a low-level language might go
something like the following:
1.
Check the status of the printer.
2.
If the printer is free, initialize the printer.
3.
Send a character to the printer.
4.
Check to see if this character arrived safely.
5.
If not, send the character again.
6.
If so, start over with the next character.
The "lowest" level language that programmers use is called assembly language . Indeed, assembly
language has essentially complete control over the computer's hardware. To illustrate assembly
language code, the following program prints the message "Happy printing." Don't worry if these
instructions seem meaningless—you can just skim over them to get the feel. In fact, the very point
we want to make is that low-level languages are much more cryptic than high-level languages.
(Lines that begin with a semicolon are comments. We have left out error checking to save a little
space.)
; --------------------
; Data for the program
; --------------------
; message to print
Message DB 'Happy printing', 0Dh, 0Ah
; length of message
Msg_Len EQU $-Message
; --------------------
; Initialize printer 0
; --------------------
mov ah,1
mov dx,0
int 17h
 
Search JabSto ::




Custom Search