home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 237 / 237.d81 / t.programming1 < prev    next >
Text File  |  2022-08-26  |  18KB  |  697 lines

  1. u
  2.         P R O G R A M M I N G
  3.  
  4.         The Great Adventure of
  5.          Creativity and Logic
  6.            by Dave Moorman
  7.  
  8.  
  9.     We are entering into a strange
  10. world of symbolic logic. Process
  11. Logic, to be exact. If you do those
  12. logic problems found in puzzle
  13. magazines, you know Classic Logic. If
  14. you found Geometry enjoyable in hight
  15. school, you know Proof Logic. And if
  16. you studied philosophic logic in
  17. college, you are aquainted with
  18. Symbolic Logic.
  19.  
  20.     Process Logic is a combination of
  21. Proof Logic and Symbolic Logic --
  22. plus three wonderful additional
  23. features. Like Proof Logic, you will
  24. be arranging statements and commands
  25. in a particular order -- not to prove
  26. some truth, but to affect some action
  27. in the computer. In the process, you
  28. will use Symbolic Logic to manipulate
  29. values.
  30.  
  31.     The three additional features are
  32. symbolic value holders (called
  33. variables and arrays), loops, and
  34. conditional commands. It is the
  35. ability to make conditional changes
  36. in the flow of logic that gives a
  37. computer its ability to "think."
  38.  
  39.     The C-64 includes a built in
  40. BASIC interpreter. Computers are
  41. controlled with three types of
  42. language. At its very heart, the
  43. computer processor recognizes certain
  44. values as "instructions." This is
  45. built into the machine itself, and is
  46. called Machine Language. EVERYTHING
  47. the computer does is done by means of
  48. ML.
  49.  
  50.     ML is nothing but numbers, that
  51. is, numeric values. Remembering such
  52. values and the tasks they perform is
  53. difficult for humans. We need at
  54. least some easily recognizable code
  55. words to remind us about what is
  56. going on. The ML programmer writes
  57. this code and the computer uses a
  58. program to ASSEMBLE that code into ML
  59. -- which is what the computer
  60. actually understands. The code the
  61. programmer writes is called ML, or
  62. more correctly, Assembly Source Code.
  63.  
  64.     But a computer can be smarter
  65. than that. Assembly ML source code
  66. has a one-to-one relationship with
  67. the code the computer understands.
  68. However, the computer can be
  69. programmed to read words, numbers,
  70. and other characters and translate
  71. them into complex groups of ML
  72. instructions. Such a language is
  73. called Compiled. The program that
  74. translates Compiler Code into ML Code
  75. is called a Compiler.
  76.  
  77.     A compiler compiles an entire
  78. program or routine at a time. If the
  79. programmer has made a mistake the
  80. compiler cannot understand, it
  81. reports errors -- but only after
  82. chugging through the whole source
  83. code. So the programmer writes,
  84. compiles, debugs, recompiles,
  85. executes, rewrites, recompiles, etc,
  86. etc. This is an arduous task, to say
  87. the least. It was even mor frustrating
  88. back in the 1960's when the programmer
  89. had to punch cards with each line of
  90. the program and take the "batch" to
  91. the computer room. The operator would
  92. run the batch and return a paper
  93. print-out to the programmer in a few
  94. hours. Or days!
  95.  
  96.     At that time, computers were
  97. finally becoming fairly fast and
  98. powerful. A terminal could be
  99. directly connected to the computer so
  100. the programmer did not have to wait.
  101. But the computer then did a lot of
  102. waiting -- for the programmer's
  103. input. The concept of time-sharing
  104. was developed, where the computer
  105. could switch between many different
  106. terminals, running different programs
  107. at apparently the same time.
  108.  
  109.     To take advantage of time sharing
  110. and to provide a language that was
  111. easy for students to learn and use,
  112. BASIC (standing for Beginner's All
  113. Purpose Symbolic Instruction Code)
  114. was written (invented) in 1963, at
  115. Dartmouth College, by mathematicians
  116. John George Kemeny and Tom Kurtzas.
  117. The commands and math the programmer
  118. typed looked enough like English to
  119. make reading the code relatively
  120. easy.
  121.  
  122.     But the big advantage of BASIC was
  123. that it was  -- and is -- an
  124. Interpreted Language. During the
  125. user's tiny slice of processor time, a
  126. single BASIC statement would be read,
  127. turned into the ML Code necessary to
  128. execute the command, and processed.
  129. Then the processor turned to another
  130. terminal and program to process. On
  131. the BASIC program's next turn, the
  132. next BASIC statement would be
  133. interpreted and executed.
  134.  
  135.     The great thing about an
  136. interpreted language like BASIC is
  137. that the program runs until an error
  138. occurs. Then it stops and delivers
  139. an error message. The programmer can
  140. fix the error and rerun the program.
  141. This made BASIC very interactive. The
  142. programmer did not have to get
  143. everything right before seeing how at
  144. least SOME of the program performed.
  145.  
  146.     In December of 1974, the January
  147. issue of Popular Electronics
  148. published news about the first home
  149. computer -- the Altair 8800. Two
  150. Harvard students, Paul Allen and Bill
  151. Gates saw the magazine -- and their
  152. future. They dropped out of college
  153. and rushed to Albuquerque, NM, where
  154. the Altair was being built.
  155.  
  156.     They realized that these home
  157. computers needed an "operating
  158. system" -- a simple way for users to
  159. interact with the machine. Bill Gates
  160. wrote Altair BASIC using a mainframe
  161. computer with an emulator that made
  162. it act like the Intel 8008
  163. microprocessor used by the Altair.
  164. His BASIC included ML code to read
  165. the keystrokes and put the BASIC
  166. program into memory. Other code would
  167. read BASIC commands and jump to ML
  168. routines that performed them. The
  169. whole thing fit in just 4 kilobytes
  170. of memory (which was rather expensive
  171. at the time).
  172.  
  173.     Gates and his newly founded
  174. company -- MicroSoft -- went on to
  175. write BASIC for nearly every home
  176. computer. BASIC 2 used about 16K of
  177. memory, but was remarkably powerful.
  178. Most anything a programmer wanted to
  179. do could be done in BASIC. True -- it
  180. was slower than straight ML. But it
  181. was easy to learn, faster to write,
  182. and more-or-less portable between
  183. different makes of computers.
  184.  
  185.     When Commodore produced the
  186. Personal Electronic Transactor -- the
  187. PET -- they turned to MicroSoft for
  188. BASIC. Legend has it that Commodore
  189. CEO Jack Tramiel bought BASIC 2.0
  190. outright for $7,000 from cash-
  191. strapped MicroSoft.
  192.  
  193.     So, in the fall of 1981 when
  194. Commodore designed the C-64, they
  195. already owned the BASIC 2.0 operating
  196. system. The C-64 has color video and
  197. other features for which BASIC 2.0
  198. had no commands. But that was OK.
  199. Game designers would certainly use
  200. fast ML for their code. And BASIC 2.0
  201. has commands which can directly read
  202. or write information to places in
  203. memory that can control these
  204. features.
  205.  
  206.     On the up side, the C-64 was
  207. designed to be modified with ML code.
  208. Though BASIC 2.0 was in Read Only
  209. Memory (ROM) and could not be
  210. changed, certain critical jump
  211. locations were in Random Access
  212. Memory (RAM). By changing the jump
  213. addresses, a programmer could add new
  214. commands to BASIC and perform all
  215. sorts of miracles the designers never
  216. dreamed of. The designers did include
  217. "paddle controls" for then popular
  218. games like Break Out. These controls
  219. proved perfect for adding a mouse.
  220.  
  221.     All in all, a C-64 was a
  222. fantastic machine in 1982 when it was
  223. unveiled at the January Consumer
  224. Electronics Show in Las Vegas. Its
  225. capabilities -- especially as a "game
  226. machine" -- and its incredible price
  227. (that dropped below $200 in 1984) kept
  228. it in production through 1992. Over
  229. its decade of manufacture, some 27
  230. million units were sold, making the
  231. C-64 the "Best Selling Computer of the
  232. 20th Century," according to the
  233. revered Guinness Book of World Records
  234. (2000-2001).
  235.  
  236.     And to top of a remarkable (if
  237. often ignored) history, a C-64
  238. Direct-to-TV game joystick was
  239. marketed in 2004 through QVC shopping
  240. channel. Some 200,000 units were sold
  241. between Thanksgiving and Christmas.
  242.  
  243.     Thanks to the designer -- Jeri
  244. Ellsworth -- the computer inside the
  245. joystick is a real, honest-to-
  246. goodness C-64. With nine wires
  247. soldered to the credit-card-sized
  248. board, a user can connect a PS2
  249. keyboard, Commodore disk drive, and an
  250. external power supply.
  251.  
  252.     The Commodore 64 -- more than any
  253. other first-generation, 8-bit
  254. computer -- has proved itself as THE
  255. computer for gamesters and hobbyist
  256. programmers all over the world.
  257.  
  258.  
  259. INSIDE the C-64
  260.  
  261.     Every computer has three
  262. essential parts --
  263.  
  264.  1. A processor which executes ML
  265.     instructions and does math and
  266.     logic operations.
  267.  
  268.  2. Input/Output capabilities -- for
  269.     keyboard, mouse, joystick,
  270.     printers, and disk drives.
  271.  
  272.  3. Memory -- "itty-bitty boxes"
  273.     called bytes which