home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / articles / archives / limanews.exe / PASCAL1.TXT < prev    next >
Text File  |  2006-10-19  |  22KB  |  417 lines

  1. ORIGINALLY PUBLISHED IN LIMA NEWSLETTER JANUARY 1994
  2.  
  3.  THAT "OTHER" OFFICIAL TI CARD FOR THE PE BOX  
  4. reviewed by Charles Good 
  5. Lima Ohio User Group 
  6.  
  7.      HISTORICAL BACKGROUND:  
  8.     Here's a trivia question.  In addition to the disk
  9. controller, RS232, and 32K memory expansion cards which
  10. almost all of us have, what other TI PE box card could be
  11. purchased in 1983 directly from TI or from most TI dealers
  12. of that time?  Answer..The P-CODE card, first shown to the
  13. public in January 1982 and listing for "only" $249.95 in
  14. TI's last 1983 catalog.  With this card you can run canned
  15. disk or tape software written by others in UCSD PASCAL (also
  16. known as "p-Code" or the "P-System").  For a list price of
  17. $499.95 you could purchase the P-Code card AND development
  18. software that allows you to write your own USCD Pascal
  19. software as well as write TMS9900 assembly language
  20. programs.  That's right, assembly code can be written
  21. without TI's editor assembler package using the P-Code card
  22. and associated software.  In 1982 the P-Code card's
  23. potential seemed enormous.  Yet now very few 99/4A users
  24. have or will ever need this piece of hardware.  What
  25. happened to all that potential? 
  26.  
  27.     The following quote from the April 1983 issue or POPULAR
  28. COMPUTING states what many at that time believed to be the
  29. future potential of UCSD PASCAL.  "Immagine how much easier
  30. choosing your microcomputer would be if any computer program
  31. on the market would run on any machine.... Your old programs
  32. would run on any new computer you might buy.  That's what
  33. software engineers call portability, and it's the goal of an
  34. increasingly popular computer operating system called the
  35. UCSD p-System.... a universal language, a kind of computer
  36. Esperanto that would allow a program written for one
  37. computer to run on all the others."  Or how about this ad
  38. quoted from the July 12, 1982 issue of INFOWORLD: "Whether
  39. it's a Z80, 8086/8088, M6800, 6502, or you name it, the
  40. p-System is portable across any popular microprocessor made
  41. anywhere today.  And we don't mean just at the source code
  42. level either.  We mean you can develop your program on any
  43. machine, then compile to object code (p-code),  and its
  44. totally transportable.....the only OS that runs the same
  45. object code programs on all popular 8 and 16 bit
  46. microprocessors.  No matter who makes them.  No matter who
  47. uses them." 
  48.      
  49.      Sounds neat, doesn't it! There should be tons of
  50. software written on other machines will run on the 99/4A
  51. with a p-Code card.  That was the promise.  But there is
  52. almost no software.  What happened? Where is the p-Code
  53. software? An interesting article by Stan Veit published in
  54. the Dec 1992 issue of Computer Shopper tells most of the
  55. story.  In 1980 the University of California gave Softech
  56. Microsystems an exclusive licence to market and develop the
  57. UCSD p-System language.  Softech got greedy, and what was
  58. once almost public domain technology suddenly became too
  59. expensive for almost everyone.  For example, on page 10 of
  60. the January 1984 issue of BYTE it is noted that, "Softech
  61. Microsystems has announced a family of newtork software
  62. products based on its p-System operating system.  Initially
  63. ... software for up to eight users costs $750." And you had
  64. to already own the latest 1983 version of this operating
  65. system ($450 for EACH machine) in order to run this new
  66. software! Suddenly nobody was purchasing the p-System or
  67. writing any software for it.  
  68.      
  69.     There is another reason for the lack of 99/4A software
  70. that uses the p-Code peripheral.  Software written in the
  71. UCSD PASCAL language is compiled into an intermediate code
  72. called P-code, and this P-code is exactly the same no matter
  73. what machine is used to develope the software.  The same
  74. PASCAL source code typed into a variety of different
  75. computer types equipped with a P-System interpreter will
  76. compile into exactly the same P-code.  Each different kind
  77. of machine has its own unique P-code interpreter which
  78. translates the P-code into the machine's native language for
  79. execution.  The P-code card for the TI contains the
  80. necessary software in ROM to translate P-code into TMS9900
  81. assembly directives.  All of this suggests that you should
  82. be able to put disks containing UCSD PACAL software written
  83. on an APPLE IIe, a Mac, an MS DOS machine, a Commodore 64,
  84. an Atari 800 or ST, etc. into our 99/4A's disk drive and
  85. have the P-code card actually run the software! There should
  86. be hundreds or thousands of PASCAL programs out there for us
  87. P-code card owners to play with.  Unfortunately this is not
  88. the case.  YOU CANNOT PUT A DISK WRITTEN ON ANOTHER KIND OF
  89. COMPUTER INTO A 99/4A'S DRIVE AND EXPECT TO RUN pascal
  90. software. This is true even if the disk from the other
  91. computer contains the exact same sequence of P-code 1's and
  92. 0's that would be generated by our TI's if the PASCAL source
  93. code had been typed into the TI instead of the other
  94. computer.  Why? The 99/4A disk controller only recognizes
  95. disks formatted by a 99/4A or Geneve.  Our /4A's can't read
  96. "their" disks. This is true for most computer types.  Even
  97. though there is only one kind of p-code, there is no
  98. universal disk format readable by all computers. 
  99.  
  100.     So.....what is "portable" about UCSD PASCAL?  Well, with
  101. some exceptions you can type in the exact same printed
  102. program listing as source code into the PASCAL editor of ANY
  103. computer that supports the USCD PASCAL system.  These
  104. program listings can then be compiled into P-code and run on
  105. different machines.  Thus, if you start with a printed
  106. source code listing, the same software SHOULD run
  107. identically on different kinds of computers.  Unlike BASIC,
  108. which is only sligltly similar from one machine to another,
  109. text oriented software written in UCSD PASCAL is supposed to
  110. be identical from one machine to another.  I said "text
  111. oriented" because UCSD PASCAL for the 99/4A includes
  112. commands for graphics, speech, and sound that would not work
  113. on other computers. 
  114.      
  115.     Finally, an important reason for the lack of modern
  116. p-Code software is the development of versions of TURBO
  117. PASCAL for different computers.  Both TURBO and UCSD PASCAL
  118. start with the same printed source code listings typed into
  119. an editor and then compiled.  However, TURBO PASCAL compiles
  120. directly into the native assembly code of the host computer,
  121. bypassing the intermediate p-Code stage.  Software written
  122. and then compiled from TURBO PASCAL runs much faster than
  123. software that compiles into p-Code.  Good bye p-Code.  L.L.
  124. Conner (317-742-8146) sells a version of TURBO PASCAL for
  125. the 99/4A that does not require TI's p-Code card.  I have
  126. see software listings in TURBO PASCAL for IBM clones
  127. published in recent (1993) computer magazines.  It has been
  128. years since I have seen any new listings in UCSD PASCAL.  
  129. ------------ 
  130.       TI'S OFFICIAL IMPLEMENTATION OF UCSD PASCAL   
  131.      
  132.      A complete UCSD PASCAL system for most computers
  133. includes an editor for entering program code or text
  134. documents, some file/disk/printer manipulation software, a
  135. compiler to convert source code into P-code, and a P-code
  136. interpreter.  Only the P-code interpreter differs from one
  137. computer to another.  TI chose to unbundle these parts and
  138. sell them separately.  A minimum system consists of only the
  139. P-code card itself, which contains the interpreter in ROM.
  140. The TI version of the P-system editor and file manipulator,
  141. and the P-code compiler are extra cost items in TI 99/4A
  142. catalogs.  With only the card 99/4A users could purchase and
  143. RUN commercial PASCAL software on disk or tape.  Back when
  144. TI hardware cost BIG BUCKS there were some folks who
  145. purchased a PE box but couldn't immediately afford a disk
  146. system.   In 1982/83 the $249.95 list price for TI's p-Code
  147. card (without development software) looked like a real
  148. bargain.  Softech was at that time charging $450 PER MACHINE
  149. (with development software) for a P-system on every other
  150. type of computer.  
  151. ------------------ 
  152.     AVAILABLE APPLICATION SOFTWARE FOR THE P-CODE CARD:  
  153.      
  154.     What's available that can be run with just the P-code
  155. card without the other "sold separately"  P-system
  156. development software?  TI actually sold PERSONAL TAX PLAN,
  157. an income tax preparation software package written by a
  158. group of CPA's who called themselves Ardvark Software.
  159. Personal Tax Plan was also available for the Apple II and
  160. probably some other personal computers of the day.  I have
  161. an original copy of the TI version, ($99.95 in TI's last
  162. 1983 catalog) complete with documentation, all contained in
  163. a large three ring padded TI binder.  This was based on 1983
  164. tax laws and probably isn't usable for computing federal
  165. income taxes in the 1990's.  Items covered include the joint
  166. filing credit if both spouses work and income averaging,
  167. neither of which are part of the 1992 tax code.  For an
  168. extra $45 you could obtain a toll free phone number that
  169. give you up to one hour of over the phone help in using the
  170. software from a CPA.  Additional hours are only $40.  My
  171. docs state that this $45/hour service does NOT provide tax
  172. advice, just aid in running the software. 
  173.  
  174.      TI's last 1983 catalog also lists TI PILOT ($79.95), a
  175. language written in UCSD Pascal designed for use in computer
  176. aided instruction in schools.  TI PILOT was never released,
  177. but I have a copy of the software and its user
  178. documentation. 
  179.      
  180.     Also in the works from TI for the P-code card was a word
  181. processor that came as a text editor and a separate
  182. formatter.  The editor of this "never released" software was
  183. similar to TI's regular UCSD Pascal editor, and the
  184. formatter had capabilities similar to those of the TI Writer
  185. formatter.  I have a copy of this UCSP Pascal word
  186. processor, and it has one BIG problem.  You create text with
  187. its editor and then save the text to a disk file.  You then
  188. switch to the formatter to print the formatted text.  You
  189. can't print directly from the word processor's editor.  The
  190. problem is that the formatter doesn't work with modern
  191. printers! One version of the formatter is for "Diable 1650s
  192. and 630s (or any variable pitch printer)" and the other
  193. version is for "TI810 printers (or any fixed pitch
  194. printer)".  I have no idea what "fixed" and "variable" pitch
  195. printers are.  Setting Pascal to look for a PIO printer
  196. (instead of the default RS232) doesn't help with this
  197. formatter.  A word processor isn't much good if you can't
  198. print its text! The regular pascal editor, the one that is
  199. used to enter source code, makes a very usable 80 column
  200. word processor.  Printing text from the regular editor is
  201. not difficult. 
  202.      
  203.     TI also had for the p-code card a "three dimensional"
  204. spread sheet called FREEFORM that allowed the user to create
  205. templates in rows, columns, and pages.  "Pages" is the
  206. third dimension.  Mathematical calculations can only be done
  207. in two dimensions (rows and columns), so the actual use of a
  208. three dimensionsl matrix is somewhat limited.  The P-code
  209. word processor and spread sheet never made it into published
  210. TI catalogs, and were never released.  This material is now
  211. in the public domain.  The Lima group has this never
  212. released software in its library as well as a hard copy of
  213. the 1982 documentation.  We also have the source code of
  214. FREEFORM as p-System text files.   
  215. --------------- 
  216.     OPERATING UNDER THE P-SYSTEM:  
  217.      
  218.     The P-code card turns the 99/4A into a completely
  219. different and mostly unfamiliar computer.  Execution is
  220. SLOW, in part because much of the p-System must be loaded in
  221. sections into memory from disk.  There is lots of disk
  222. activity. If you want your computer to behave like a normal
  223. TI there is a switch on the back of the P-code card that
  224. makes the card transparent to the rest of the computer
  225. system.  If the P-code card is switched to the ON position,
  226. then when you turn on the console the P-code card captures
  227. the system.  You don't see the usual TI title screen and if
  228. you have a CorComp disk controller you don't see the CorComp
  229. title screen either (CorComp controllers are notorious for
  230. usually capturing control of the 99/4A before other sofware
  231. can be run).  Instead of a title screen the disk drives
  232. grind away and the computer beeps several times as the
  233. P-code card checks the first three drives to see if a
  234. P-system formatted disk is in the drive.  After about 45
  235. seconds of this either the disk in the first drive
  236. automatically begins to execute if it contains a Pascal file
  237. called SYSTEM.STARTUP.  If not, a list of available Pascal
  238. commands appears at the top of the screen.  From this list
  239. of commands the user can press "X" to Xecute a runable
  240. pascal file.  This is how TI PILOT is started, for example.
  241. The user can also press "I" to reInitialize the pascal
  242. system if different pascal disks are placed in the active
  243. drives, or press "H" to leave pascal and return to the TI
  244. title screen for normal computer operations.  Prompts for
  245. other parts of the total P-system are displayed, but most
  246. require extra cost software. 
  247.  
  248.     The only way to do any disk or file management is with
  249. the extra cost pascal "filer" software, booted from the
  250. first drive by pressing "F" from the startup menu.  Ordinary
  251. TI disk managers such as DM1000, DSKU, and Funnelweb's DISK
  252. REVIEW do not recognize Pascal files and cannot be used to
  253. print such files or move them from one disk to another.
  254. Pascal files are stored on disk as "blocks" each
  255. corresponding to two regular disk sectors.  To an ordinary
  256. TI disk manager a pascal disk says it contains only one file
  257. (usually named PASCAL) that occupies the whole disk.  An
  258. ordinary TI disk manager must be used to initialize a new
  259. disk for use with UCSD Pascal, but the newly initialized
  260. disk has to be "zero"ed by the pascal filer before pascal
  261. can use the disk.  The pascal filer, once loaded, displays
  262. its own set of prompts at the top of the screen, one of
  263. which is Z(ero). 
  264.  
  265.     The filer's V(olume) command lists all the parts of the
  266. P-system on screen as names and accompanying numbers. 1=
  267. CONSOLE. 2= SYSTEM (the system software in the p-code card's
  268. ROM). 4= name of disk in the first drive (known to most of
  269. us as DSK1). 5= disk name in second drive (aka DSK2). 6=
  270. PRINTER.  7= REMIN (I don't know what this means).  8=
  271. REMOUT (ditto). 9= disk name in third drive (DSK3). 14= OS
  272. (operating system, presumably part of the P-code card). 31=
  273. TAPE.  You use these numbers a lot in file loading, saving,
  274. and management.  To copy a file from the disk in the first
  275. drive to the disk in the third drive press T(ransfer) from
  276. the list of filer prompts.  You are prompted for the file
  277. name and then asked "where".  Typing "#4:,#9:" copies the
  278. file from the first drive to the third drive, which is
  279. device #9.  If you don't know a file name you can display a
  280. disk directory from the filer by pressing either L(ook) or
  281. E(xtended directory).  
  282.      
  283.     The T(ransfer) filer command is also used to print a
  284. file to the printer (#4:,#6:), but there is a potential
  285. problem.  The p-code card expects a printer to be attached
  286. to the RS232/2 port.  (I think it expects a modem at
  287. RS232/1).  Just in case you don't have a serial printer and
  288. the necessary Y cable needed to attach it to the "/2" of the
  289. RS232 port you have to change device #6 to "PIO".  A utility
  290. program that comes with the editor/filer software package
  291. will accomplish this, but you have to run this utility
  292. program every time you boot the p-system.  The RS232/2
  293. designation for printer device #6 is in the p-code card's
  294. ROM and there is apparently no way to permanently change
  295. this.  There is, however, a convenient solution: 
  296.     ---------- 
  297.      THE MARVELOUS LIMA UCSD PASCAL BOOT DISK:   
  298.  
  299.    {This DSSD disk is #705 in the Lima group's software
  300. library.  ANYONE (not just members of the Lima UG) can get
  301. a copy by sending a disk and paid return mailer to the Lima
  302. UG at P.O. Box 647, Venedocia OH 45894} 
  303.      
  304.     Put the disk in drive 1 and turn on the computer.  First
  305. this disk sets the printer device name (device #6) to PIO.
  306. The user is then asked for the current date.  The disk then
  307. boots the filer.  All of this except entering the current
  308. date is done automatically upon system powerup.  The actions
  309. taken by the Lima boot disk make using the TI p-System much
  310. easier and more convenient.   
  311.     ---------- 
  312.      CREATING YOUR OWN PASCAL SOFTWARE:  
  313.  
  314.      You use the pascal editor to do this, which is called
  315. by pressing "E" from the main system menu.  When booted the
  316. editor presents you with a new set of possible prompts.  You
  317. press I(nsert) to begin entering your pascal program.  You
  318. can also use the editor as a text editor to create documents
  319. (similar to using the EA module's editor as a word
  320. processor).  Like TI Writer, the pascal editor gives you
  321. access to an 80 column work area by windowing left/right.
  322. The keypresses that control the pascal editor are, however,
  323. oftwn quite different from those of TI Writer, perhaps
  324. because the pascal editor was originally developed for use
  325. with the 99/4 which has no function key.  On a 99/4A
  326. left/right windowing is controled with FCTN/7 and FCTN/8.
  327. Line delete is FCTN/9.  Once the source code of a program
  328. has been typed into the editor it is saved to disk as a
  329. ".TEXT" file.  You then exit the editor and press C(ompile)
  330. from the main Pascal menu to boot the compiler software and
  331. turn the text file into p-code.  The resulting ".CODE" file
  332. can be run at any time from the main pascal menu by pressing
  333. X(ecute) and then specifying the drive number and file name. 
  334.  
  335.     UCSD Pascal is not a common programming language today.
  336. However, type in pascal programs can be found in computer
  337. books and magazines from the 1982-84 time period.  For
  338. example, a rather long type in income tax record keeping
  339. program written in pascal appears in one of the early 1983
  340. issues of BYTE. 
  341.  
  342.      Pascal is a "structured language" whose syntax follows
  343. very precise rules.  Code written by one person is usually
  344. easy to understand by another person who is familiar with
  345. pascal.  This often is not true for BASIC program listings.
  346. Large software applications to be written in UCSD Pascal can
  347. be divided into a number of small segments each assigned to
  348. a different programmer for development.  These separate
  349. pieces of programming code can be individually tested and
  350. then because of the logical syntax of pascal it is
  351. relatively easy to combine the separate pieces into large
  352. blocks of program code.  A pascal source code listing
  353. appears to be written in outline form, with various degrees
  354. of "indentation".  Short independent pieces of code
  355. (indentented the most from the left margin of the listing)
  356. can be combined to form larger units of code (indented less)
  357. which in turn can be combined into larger code units.  The
  358. effect is similar to using Extended Basic subprograms
  359. developed by others in your own programs.  Because of its
  360. "logic" and "structure" pascal is sometimes taught in
  361. introductory university level computer programming classes
  362. as an example of the concept that software written in any
  363. computer language should be logical and understandable by
  364. others (I hope you understood that!). 
  365. --------------- 
  366.      TECHNICAL INFORMATION ABOUT THE P-CODE CARD:  
  367.  
  368.     I have had no problem with text oriented operations of
  369. P-code card software, even using a system with a Horizon
  370. Ramdisk set for CRU address 1000.  Since the p-code card
  371. takes control of the computer BEFORE the CorComp disk
  372. controller, one might think that that the P-code card has a
  373. CRU address of 1000, but I don't know this for sure.  I have
  374. run into a strange problem which I think has to do with my
  375. AVPC card.  With the AVPC card in my system I have no access
  376. to the console's sound chip.  This means no beeps, no music,
  377. and no speech synthesis when running TI PILOT.  The computer
  378. locks up every time sound is expected.  Music and speech
  379. work OK in pascal on my non-AVPC system even though there is
  380. a CRU 1000 ramdisk in this system.  Strange! 
  381.      
  382.     The following information is part of a 1987 article by
  383. Anders Persson of Lund, Sweden.  The complete text is
  384. published in the Feb-March 88 issue of the MANNERS
  385. NEWSLETTER, which is available on loan to members of the
  386. Lima UG. 
  387.      
  388.    "The P-Code card has a total memory capacity of 60
  389. kilobytes.  This memory consists of 12K ROM and 48K Grom. 
  390.     "ROM: The ROM memory is located at 4000-5FFF.  5000-5FFF
  391. is paged in two pages, but the lower four kilobytes are
  392. always the same.  The paging is done with CRU bit 1F80.
  393. Resetting the bit to zero gives access to the normal page.
  394. Setting the bit to one switches in the extra page. 
  395.     "GROM: The GROM chips contain the files that are located
  396. in unit #14: (OS:).  they also contain various data and
  397. assembly code, which is loaded into RAM when the card is
  398. initialized.  The p-code GROM is accessed just like the
  399. console and module GROM chips, but at different addresses." 
  400.     The article then goes on to describe in great detain
  401. workspace addresses and a map of 8K RAM under the p-system. 
  402.     --------------- 
  403.      CONCLUSION:  
  404.                     
  405.     I traded my Thermal Printer (device TP) for my p-Code
  406. card.  I find the p-Code card every bit as useful as my TP
  407. was.  There is very little p-System software.  I don't think
  408. any commercial software for any computer is written in
  409. p-Code any more. As of December 1993 the TI P-Code card was
  410. available for $39.95 from TM Direct Marketing (phone
  411. 800-336-9966) and for $25.00 from Cecure Electronics (phone
  412. 800-959-9640).  Both prices are plus shipping and both these
  413. dealers accept phone credit card orders.  The Cecure price
  414. is for a "limited time". 
  415.  .PL 1 
  416.  
  417.