home *** CD-ROM | disk | FTP | other *** search
/ Commodore 64 Scene Diskmags Assortment / Commodore_CEE_Vol._1_Issue_05_1995_Jack_Vander_White_Disk_2_of_3_Side_A.d64 / comal < prev    next >
Text File  |  2023-02-26  |  12KB  |  118 lines

  1. From: Alan Jones <alan.jones@qcs.org> 
  2.  
  3. Subject: bank switched cartridges and COMAL
  4.  
  5. Bank switching cartridges are a great thing for the C64/128.  They work like software overlays, except you don't have to load the sotware, the cartridge just switches a new bank of ROM or EPROM into the C64/128 address space.  I use the COMAL 2.0 programing language.  This is a 64K+ cartridge based language.  The cartridge data is banked into the C64 in 16K pages starting at $8000.  This message is to describe the cartridge and some related notes.
  6.  
  7. COMAL 80 is a freely available standardized language.  COMAL 2.0 is an impelentation of COMAL 80 by Unicomal that was available in cartidge form for the C64.  The Comal User's Group, USA marketed the cartidges in the US for about $100.  Len Lindsay ran the group and published/edited Comal Today.  Anyone is free to write thier own implementation of COMAL 80, but Unicomal COMAL 2.0 is copywrited.  Of course, you could clone it for research purposes.
  8.  
  9. The standard core of COMAL 2.0 is 64K, including some usefull packages. COMAL is also extendable by packages.  Packages are collections of subroutines that have been assembled to ML code and can be called from Comal programs much like regular Comal subroutines.  Packages can be loaded into RAM, or burned into EPROM and used directly from the cartridge.  A 16K "Superchip" ROM was also marketed and was so popular that it was a common standard.  The early version of the cartidge had four sockets containing four 27128 EPROMS, or just 64K bytes. The later cartidge had three sockets for 27256 ROMS, wich allowed for the Superchip and other user expansion.  I might also add that the early, gray, cartridge drew more power than the later, black, cartridge and led to early failure of stock C64 power supplies.  Terry Ricketts eventualy devised a way to rewire the gray cartridge to use up to four 27256 EPROMs (128K bytes!).  I bought the early cartridge and later modified it.  Note that ROMs and EPROMs are interchangeable and CMOS 27CXXX EPROMS will draw less power than 27XXX EPROMS, and a 32K chip draws less power than two 16K chips...
  10.  
  11. But enough about Comal.  Here is the anatomy of the 128K cartridge. I'm not into ASCII art, so this is an IC pin connection table.  You can draw your own schematic.  U1 is a 74LS04, U2 is a 74LS08, U3 is a 75LS161 (or 163), U4 is a 74LS139, E is all 74C256 EPROMs or equivalent and En is a particular EPROM (0-3).  ",n" is the IC pin number.  Caps are not shown.  Starting at the card edge:
  12.  
  13. 1  - Ground               A - Ground 
  14. 2  - +5V                  B - U2,2 
  15. 3  - +5V                  C - U2,12 
  16. 5  - U1,11                E - U1,3 
  17. 7  - U1,13                F - U4,6 
  18. 8  - U3,11                H - U4,5 
  19. 9  - U3,12 - U3,11        J - E,26 
  20. 11 - U2,1                 K - E,2 
  21. 14 - E,19                 L - E,23 
  22. 15 - E,18 - U3,6          M - E,21 
  23. 16 - U3,5                 N - E,24 
  24. 17 - E,16                 P - E,25 
  25. 18 - E,15                 R - E,3 
  26. 19 - E,13                 S - E,4 
  27. 20 - E,12 - U3,4          T - E,5 
  28. 21 - E,11 - U3,3          U - E,6
  29.                           V - E,7
  30. -------------------       W - E,8
  31.                    {SHIFT--}      X - E,9
  32. U1,4  - U3,2       {SHIFT--}      Y - E,10
  33. U1,10 - U2,9       ---------------------
  34. U1,12 - U2,10 
  35. U1,5  - U2,8              U2,11 - U3,1 
  36. U1,6  - U3,9              U2,3  - E,22 
  37. U1,7  - Ground            U2,17 - Ground 
  38. U1,14 - +5V               U2,14 - +5V
  39. -----------------------   U2,13 - +5V
  40.                        ----------------------
  41.  
  42. U3,16 - +5V 
  43. U3,7  - Ground            U4,3  - Ground 
  44. U3,10 - Ground            U4,16 - +5V 
  45. U3,8  - Ground            U4,8  - Ground 
  46. U3,13 - U4,1              U4,15 - E0,20 
  47. U3,14 - E,27              U4,14 - E1,20 
  48. U3,15 - U4,4              U4,13 - E2,20 
  49. U3,12 - U4,2              U4,12 - E3,20
  50.  
  51. --------------------------------------------
  52.  
  53. Data from the 16K EPROMS was simply copied into the top and bottom halves of the 32K EPROMS using the J-R Promenade C1 programmer.  This cartridge can be further modified to use more EPROMS or larger EPROMs. The Jameco catalog lists the following 27CXXX-200 EPROMS:
  54.    16K - $4.59
  55.    32K - $3.95
  56.    64K - $4.25
  57.   128K - $4.95
  58.   256K - $6.95 The last two are 32 pin ICs rather than 28 pin, but all could be used in a bank switched C64/128 catridge, and the larger (and fewer) the better.  I often find 27256 (32K) EPROMS at swap meets for $1 each, and speed is not critcal.  You can now build your own bank switched cartridge.
  59.  
  60. I am not entirely sure how the bank switching is done, since the COMAL 2.0 system handles this itself with a combination of software and hadware.  U1 is a signal inverter, U2 is an AND, U3 latches the bank number and sets the line for the top or bottom half of the 27256.  U4 decodes the bank number to enable one of the EPROMs.  There are no doubt other designs for 16K bank switched cartridges.  Indeed, the black cartridge is slightly different with slightly different code. There is also a 128K C128 COMAL cartridge, but at $200 I don't think that more than a few evaluation units ever shipped to the US.  J-R sells some bank switching cartridges, but as far as I know they only bank 8K overlays.  "The Ins and Outs of the C-64/128 Expansion Port, Part II", in AHOY! (I would like to get a copy of part one.) describes how to build a "typical" cartridge.  However, it only covers 8K banked cartridges with manual switching and refers you to the J-R cartridges for software bank switching.
  61.  
  62. I note also that the Comal 2.0 catridge is compatable with the CBM REU. THe CBM REU itself has provisions for a 16K EPROM socket and will map it in at the right location, $8000.  It might be possible to design a bankswitching plug in board for the 17xx REUs.  More prommising would be to adapt Pessi's RAM expansion or the upcomming I-RAM project to emulate the COMAL 2.0 cartridge in RAM, perhaps with some hacking to the code as well.
  63.  
  64. Sadly, CMD's new superCPU will only use the cartridge port at slow speed and they have made no provision for executing bankswitched cartidge code at high speed using thier RAM shadowing techniques.
  65.  
  66. OK, so you don't like COMAL 2.0, what else can a bank switched cartridge do?  It gives you access to external read only memory very fast.  A disk drive, even a hard drive, is very slow.  An REU, CBM or RAMLINK, can serve up data quite fast,but it still takes a while to get the first byte.  It only takes a few cycles to select a bank, and then it can be read as fast as normal RAM.  If you are doing table look ups, you can put the table data in a cartridge.  The 6502 does not do math very fast, so table lookups are prefered for speed.  Indeed, you could even put the entire 8 bit by 8 bit multiplication table on a cartridge. Carefully chosen tables of other math functions might prove more productive overall.
  67.  
  68. If you build it, they will come.  (Or at least smile appreciatively.)
  69.  
  70. ------------------------
  71. From: Alan Jones <alan.jones@qcs.org> 
  72.  
  73. Subject: Comal trivia
  74.  
  75. Jim Brain wrote in trivia $198: 
  76.  
  77. Q -  COMAL, a programming language available for Commodore computers,
  78.      was created by whom? 
  79.  
  80. A -  Borge Christensen and Benedict Lofstedt, although Borge is
  81.      given the most credit.
  82.  
  83. This is correct as written but of course there is more to the story.
  84.  
  85. Here are some excerpts form "The Story of COMAL told by Borge Christensen", Comal Today issue 25, 1989.  First some quotes about BASIC:
  86.  
  87. "It is in fact, not a computer language.  It is an offense to the human mind."  - Benedict Lofstendt
  88.  
  89. "It might very well be that the good God has invented the computer. But there is no doubt that his black majesty then came up with BASIC shortly thereafter  in order to confuse peoples minds because that's the way he preferes to operate."  - Borge Christensen
  90.  
  91. "As a programming language, BASIC is a cruel hoax."  - Alan Jones  (If may allow my $.02 worth to stand with these esteemed fellows.)
  92.  
  93. Borge first defined the language in 1974.  The first version, COMAL 75 was written for the 16 bit Data General NOVA, by two bright young boys that Borge taught to program.  Borge said:
  94.  
  95. "I had a problem with one of them.  He was a heavy drinker.  Now and then he would go away, and we knew where he was.  But only at a
  96.  could ertain time when he had had enough could we pick him up.  We could not persuade him to come back again until he had taken so much. He would then be very drunk.  And we needed him, as he was our expert in debugging.  Danish beer can be quite heavy, quite strong.  We poured coffee in him, and put him into a cold showwer.  Then he would work for 24 hours.  It was just great."
  97.  
  98. For extra credit, who were Borge's two students?
  99.  
  100. In 1978 Borge defined a new improved version.  It was called COMAL 80 because it was not completed until 1980 and it ran on Z80 computer. Morgens Kjar wrote Borge a critical letter about his definition of COMAL 80.  Borge was impressed, "It was very good.  I adjusted my COMAL according to what he advised me to do.  And then I asked him if he might do ... He had intended to do an implementation for a computer that wuldn't have a any chance of going anywhere.  I advised him not to do that, but instead to go for the Commodore PET.  It was abviously a very good computer."
  101.  
  102. "Morgens Kjaer made his version for Commodore, and this is the version now known as 0.14.  After he did that, The UniComal group was set up and then went on.  From then on I have not had much to do with it."
  103.  
  104. I started with 0.14 on the C64.  It only gave abot 10K free, and took a long time to load with a stock 1541.  I instantly prefered it to BASIC 2.0.  I bought the COMAL 2.0 cartridge as soon as it was available. Over the years there were small improvements in the disk loaded 0.14 to give it more 2.0 like commands, more free memory, a software fast loader, etc.  The last version was the Power Driver with about 15K free and all this the commands and features except LOOP, packages, external procedures, and the error handler.  A "compiler" is also available that will free up even more RAM.  There is also a C128 cartridge, a CP/M COMAL 2.10, and versions for IBM, Amega, Unix and many other platforms. It is an international standardized language.  However IMHO, it is only on the C64/128 where COMAL is the best language.  If only Commodore had embraced COMAL the way they embraced GEOS...
  105.  
  106. It seems seems to me that Morgens Kjaer should be in the trivia answer somehow.  Also, Len Lindsay deserves credit for promoting COMAL in the USA and publishing Comal Today.  One of the best "features" of COMAL was Comal Today and the quality and diversity of the people who supported it.
  107.  
  108. -----------------------
  109. From: jpnan@prairienet.org (Jean P Nance) Subject: 
  110.  
  111. Re: Comal trivia
  112.  
  113. Thanks for the information on Comal. I read the story in Comal Today but had forgotten a lot of it. I agree with everthing said about Comal as a programming language. I have pretty much given up up programming. I'm not quite up to Assembly, and certainly can't face up to programming with either Commodore Basic. Just to  frustrating and painful. I join in weeping for Comal. I have piles and piles of Comal material, but nobody much is even  willing to look at Commodore Comal. The Comal area on QLink was just a tiny handful of people talking about Amiga Comal and IBM Comal. If Comal had become better known in the Commodore world, there would be a lot more people with the courage to program. With just Len Lindsay plugging it with his limited resources there was little hope. --
  114.  
  115. ---------------------------
  116.  
  117.  
  118.