15.04.2018 Views

programming-for-dummies

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Teaching Languages 53<br />

Principles<br />

Because <strong>programming</strong> was so difficult, both John Kemeny and Thomas Kurtz<br />

decided to create a new <strong>programming</strong> language specifically designed to teach<br />

novices how to program. The goals of their new <strong>programming</strong> language,<br />

dubbed BASIC (Beginner’s All-purpose Symbolic Instruction Code), consists<br />

of several principles:<br />

✦ Be easy <strong>for</strong> beginners to understand and use.<br />

✦ Be a general-purpose <strong>programming</strong> language.<br />

✦ Be interactive.<br />

✦ Shield the user from understanding the computer hardware and operating<br />

system.<br />

Book I<br />

Chapter 3<br />

Types of<br />

Programming<br />

Languages<br />

Descriptive commands<br />

To make the language easy to understand, BASIC uses descriptive commands,<br />

which is something most <strong>programming</strong> languages don’t use. For example, this<br />

assembly language program prints the words Hello, world! on-screen:<br />

title Hello World Program<br />

dosseg<br />

.model small<br />

.stack 100h<br />

.data<br />

hello_message db ‘Hello, world!’,0dh,0ah,’$’<br />

.code<br />

main proc<br />

mov<br />

mov<br />

mov<br />

mov<br />

int<br />

mov<br />

int<br />

main endp<br />

end main<br />

ax,@data<br />

ds,ax<br />

ah,9<br />

dx,offset hello_message<br />

21h<br />

ax,4C00h<br />

21h<br />

Looking at the preceding assembly language program, isn’t what the preceding<br />

commands are telling the computer simple and intuitive? (If you answered,<br />

“Yes,” you’re either a computer genius or completely delusional.)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!