######## ################## ###### ###### ##### ##### #### #### ## ##### #### #### #### #### #### ##### ##### ## ## #### ## ## ## ### ## #### ## ## ## ##### ######## ## ## ## ##### ## ## ## ## ## ##### ## ## ######## ## ## ## ### ## ## #### ## ## ##### #### #### #### #### ##### #### #### #### #### #### ###### ##### ## ###### ###### Issue #9 ################## Jan. 24, 1995 ######## ------------------------------------------------------------------------------ Editor's Notes by Craig Taylor And *drum beat please* here's another issue of Commodore Hacking!! We've lasted longer and had more issues put out than some other magazines I won't discuss (*wondering where issue 39 of that mag is*). Not many Commodore notes this time - things have gotten a little bit more montatenous(sp - it's late) on the Commodore front. I was unable to get an article by Craig Bruce in time but I got the next best thing: An interview with him!! Users of his software may find this interview interesting in how he looks at programming. Right now I'm entertaining the thought of dropping C= Hacking after I graduate which will be sometime around July 1st of this year. I'm interested in somebody who would "carry the reign" so to speak, and take over my job of nagging, bugging people etc :-) to write articles. I've got my system fairly automated in handling requests here - if that person has a VAX account then I could set them up with a mailserver, if a UNIX account then there's oodles of them floating on the net that could be used. _PLEASE_ write to me and lemme know if you're interested. I'm going to try to get one more issue of Commodore Hacking out before July 1st. =========================================================================== Please note that this issue and prior ones are available via anonymous FTP from ccosun.caltech.edu (amongunders) under /pub/cbm/hacking.mag and via a mailserver which documentation can be obtained by sending mail to "[email protected]" with a subject line of "mailserver" and the lines of "help" and "catalog" in the body of the message. =========================================================================== Legal Mumbo-Jumbo Permission is granted to re-distribut3e this "net-magazine", in whole, freely for non-profit use. However, please contact individual authors for permission to publish or re-distribute articles seperately. A charge of no greater than 5 US dollars or equivlent may be charged for library service / diskettte costs for this "net-magazine". =========================================================================== In This Issue: Commodore Trivia Corner This edition of Commodore Trivia Corner contains the answers to the July edition of trivia ($070 - $07F), the questions and answers for August ($080 - $08F), September ($090 - $09F), October ($0A0 - $0AF), November ($0B0 - $0BF), and the questions for the December edition ($0C0 - $0CF). Enjoy them! A Different Perspective, part II This month George and Steve continue their series on 3D graphics on the C-64 with a look at hidden faces and filled faces. In addition to adding these features into last month's program some other improvements to the old program will be discussed, such as fast multiplication (around 24 cycles) and various bug fixes -- for instance, the program now works on older C-64's which initialize color RAM to the background color when the screen is cleared (sorry about that ;-). A very primitive form of texture mapping is also included. As usual, full source and executables are included. The native C64 files are in a Lynx archive, so you will obviously need Lynx to get at them -- check your favorite BBS or FTP site. 2D Graphics Toolbox: Circles To augment three-dimensional algorithms this series will focus on two-dimensional drawing algortihms. Circles are the subject this time around (heh -- get it?), and a very fast algorithm for drawing them on your C64 is presented, with examples in assembly and BASIC7.0. How fast is fast? How does 11 cycles per pixel without the use of tables grab ya? AFLI=specs v1.0 In AFLI we can get 120 colors in theory (counted like this 16!/(2!*14!)=120). When we put red and blue hires pixels close to each other we get a vision of purple - thanks the television. This article details what AFLI is, how it's used and done. Coding Tricks Included are a series of postings to comp.sys.cbm about neat coding tricks (in machine language) that are interesting and useful. C.S.Bruce Interview An interview with the author of Zed, the ACE os and many other numerous utilities for the Commodore 64/128. Aligning 1541 Drives A discussion regarding Commodore 1541 disk drive alignment procedures, with suggestions. =========================================================================== Commodore Trivia Corner by Jim Brain ([email protected]) Well, it is a new year, and I am sending up a new collection of the Commodore rivia for all to enjoy. If you haven't seen this already, the following is a collection of trivia questions that I post to various networks every month. I have collected Trivia Edition #8-13 in this article. As you may know, these questions form part of a contest in which the monthly winner gets a prize (Thanks to my various prize donators). The whole thing is mainly just for fun, so please enjoy. As the new year rolls in, I am happy to report the following: 1) As I have gained access to FIDONet, the trivia is now posted to both the USENET newsgroup COMP.SYS.CBM on the Internet AND the FIDONet echo CBM every month. 2) A number of publications have started publishing the trivia, including Commodore World, and a variety of club newsletters. 3) I have moved into my new house (See new address at bottom). While this may not seem important, the extra room I now have means I can now bring all of my old CBM machine to the new house and work with them. Working with them gives me fodder for more trivia. As always, I welcome any questions (with answers), and encourage people to enter their responses to the trivia, now at #13. Be sure you get the responses to me by January 12th at noon. Jim. The following article contains the answers to the July edition of trivia ($070 - $07F), the questions and answers for August ($080 - $08F), September ($090 - $09F), October ($0A0 - $0AF), November ($0B0 - $0BF), and the questions for the December edition ($0C0 - $0CF). Enjoy them! Here are the answers to Commodore Trivia Edition #8 for July, 1994 Q $070) On a PET series computer, what visual power-on indication will tell the user whether the computer has Revision 2 or Revision 3 ROMs? A $070) Revision Level 2 ROMS (the ones with more bugs) power up with: *** COMMODORE BASIC ***, with '*' in place of the more familiar '#' character. Q $071) The IEEE-488 interface is sometimes called the GPIB interface. What does GPIB stand for? A $071) General Purpose Interface Bus. Another name is Hewlett Packard Interface Bus (HPIB), since HP developed this standard for its istrumentation device networking. Q $072) Commodore manufactured at least two hard drives with IEEE-488 interfaces. Can you name them? A $072) The Commodore D9060 and D9090. From the cbmmodel.txt file: * CBM D9060 5 MB Hard Drive, DOS3.0, Off-White, IEEE-488. GP * CBM D9090 7.5 MB Hard Drive, DOS3.0, Off-White, IEEE-488. GP The following model has been said to be in existence, though no one has one on hand to prove it: * CBM D9065 7.5 MB Hard Drive And this model may never have made it past the prototype stage: CBM D9062 Dual D9065. Q $073) Why didn't buyers like the original PET-64? A $073) It looked just like a old-style C-64. It had a "home" computer look that the schools didn't care for. They liked the "business" look of the PET series, so Commodore put refurbished and new 64 motherboards in PET cases and sold them as PET 64s. The repackaging suited the schools. Q $074) On a PET Revision 2 ROM, what was the largest single array size that BASIC could handle? A $074) An array can have a cumulative total of 256 elements. For single dimension arrays, that means D(0) to D(255), but a 2D array can only go from DD(0,0) to DD(1,127) etc. All types of arrays had this limitation. Q $075) On the stock 1541, data is transmitted one bit at a time. How many bits are transferred at a time on the Commodore 1551 disk drive? A $075) 3 bits were transmitted at a time. I assume that each byte had a parity bit tacked on for error detection, so it would have taken 3 transfers to transmit a byte of information from the drives. Q $076) On all Commodore floppy disk drives, how fast does the disk spin? A $076) 300 RPM. Q $077) Upon first reading the Commodore 1541 Error channel after turning on the disk drive, what error number and text is returned? A $077) 73, CBM DOS V2.6 1541, 0, 0 Q $078) What error number and text is returned on a 1551? A $078) 73, CBM DOS V2.6TDISK, 0, 0 Notice that the new text JUST fits! Q $079) Commodore printers are normally assigned to device #4, but they can be also used as device #? A $079) #5. The Commodore 1525 has a switch to do this, but not all printers have such a switch. Q $07A) What microprocessor is used in the Commodore 1551 disk drive? A $07A) the 6510T. It is a slight variant on the 6510 microprocessor used on the C64. Some say it runs at 2 MHz, but the specs drives spec sheet doesn't say. Q $07B) When the VIC-20 was designed, the serial port throughput was roughly equivalent to the throughput of the IEEE-488 bus? Why isn't it very fast in production VICs? A $07B) Let's go back to question $04F: <begin insert> Q $04F) What was the primary reason Commodore went to a serial bus with the introduction of the VIC-20? A $04F) Jim Butterfield supplied me with this one: As you know, the first Commodore computers used the IEEE bus to connect to peripherals such as disk and printer. I understand that these were available only from one source: Belden cables. A couple of years into Commodore's computer career, Belden went out of stock on such cables (military contract? who knows?). In any case, Commodore were in quite a fix: they made computers and disk drives, but couldn't hook 'em together! So Tramiel issued the order: "On our next computer, get off that bus. Make it a cable anyone can manufacture". And so, starting with the VIC-20 the serial bus was born. It was intended to be just as fast as the IEEE-488 it replaced. <end insert> And here is what Jim Butterfield followed up with: "Technically, the idea was sound: the 6522 VIA chip has a "shift register" circuit that, if tickled with the right signals (data and clock) will cheerfully collect 8 bits of data without any help from the CPU. At that time, it would signal that it had a byte to be collected, and the processor would do so, using an automatic handshake built into the 6522 to trigger the next incoming byte. Things worked in a similar way outgoing from the computer, too. We early PET/CBM freaks knew, from playing music, that there was something wrong with the 6522's shift register: it interfered with other functions. The rule was: turn off the music before you start the tape! (The shift register was a popular sound generator). But the Commodore engineers, who only made the chip, didn't know this. Until they got into final checkout of the VIC-20. By this time, the VIC-20 board was in manufacture. A new chip could be designed in a few months (yes, the silicon guys had application notes about the problem, long since), but it was TOO LATE! A major software rewrite had to take place that changed the VIC-20 into a "bit-catcher" rather than a "character-catcher". It called for eight times as much work on the part of the CPU; and unlike the shift register plan, there was no timing/handshake slack time. The whole thing slowed down by a factor of approximately 5 to 6. When the 64 came out, the problem VIA 6522 chip had been replaced by the CIA 6526. This did not have the shift register problem which had caused trouble on the VIC-20, and at that time it would have been possible to restore plan 1, a fast serial bus. Note that this would have called for a redesign of the 1540 disk drive, which also used a VIA. As best I can estimate - and an article in the IEEE Spectrum magazine supports this - the matter was discussed within Commodore, and it was decided that VIC-20 compatibility was more important than disk speed. Perhaps the prospect of a 1541 redesign was an important part of the decision, since current inventories needed to be taken into account. But to keep the Commodore 64 as a "bit-banger", a new problem arose. The higher-resolution screen of the 64 (as compared to the VIC-20) could not be supported without stopping the CPU every once in a while. To be exact: Every 8 screen raster lines (each line of text), the CPU had to be put into a WAIT condition for 42 microseconds, so as to allow the next line of screen text and color nybbles to be swept into the chip.(More time would be needed if sprites were being used). But the bits were coming in on the serial bus faster than that: a bit would come in about every 20 microseconds! So the poor CPU, frozen for longer than that, would miss some serial bits completely! Commodore's solution was to slow down the serial bus even more. That's why the VIC-20 has a faster serial bus than the 64, even though the 64 was capable, technically, of running many times faster. Fast disk finally came into its own with the Commodore 128." --Jim Q $07C) On Commodore computers, how much RAM is set aside as a tape buffer? A $07C) 192 bytes is used as a tape buffer. Blocks of data on tape are 192 bytes long. Q $07D) On Commodore computers, most every peripheral has a device number. What is the device number of the screen? A $07D) #3 Q $07E) What is the device number of the keyboard? A $07E) #0 Q $07F) Commodore computers use 2's-complement notation to represent integers. What is the 2's-complement hex representation of the signle byte -1? A $07F) (This was not a Commodore specific question) Commodore computers use this notation to represent integer quantities. In 2's complement notation, a -1 looks like 11111111(binary) or $FF(hex). Here are the answers to Commodore Trivia Edition #9 for August, 1994 Q $080) During the days of the Commodore 64 and the VIC-20, Commodore produced at least two Commodore magazines. What were their names? A $080) The magazines were originally called "Commodore Microcomputers" and "Power/Play: Commodore Home Computing". They never did seem to nail down the name of the latter as I see "Power/Play" and "Commodore: Power/Play" used as the original names as well. Anyway, Commodore Microcomputers started its life in 1979, whereas "Power/Play" started in 1981. Both magazines were published until around 1987, when they were merged to form "Commodore Magazine". Then, around 1990, the magazine was sold to IDG Communications and was merged into RUN. RUN was continued for a while, but was finally pulled out of circulation. Creative Micro Designs purchased the rights to the magazine, and now Commodore World is being produced by CMD. I am not sure how strong (if any) a link there is between RUN and CW, but some of the same authors write for the new publication. Just for added info, here are the ISSN numbers: Commodore Microcomputers (Commodore Magazine) 0744-8724 Power/Play:Commodore Home Computing 0739-8018 RUN (Commodore/RUN) 0741-4285 "The Transactor" is also a correct answer, and info on it is below. Q $081) Back in the PET heyday, another magazine was produced by Commodore Canada. This magazine was later sold and showed up as a hardware journal. Name the magazine. A $081) The infamous "Tarnsactor". One of the noted C64 hardware-hacking magazines, it was originally published by Commodore Canada, before being sold to an individual named Mr. Hilden. Its ISSN number is 0838-0163. As far as I can tell, this magazine, died many deaths, but ceased to exist in 1989-90. Its first issue is dated April 30, 1978. Q $082) The Commodore 128 has a VIC-II compatible chip inside it. Can this chips be switched for a VIC-II from a Commodore 64? A $082) No! The newer 128 compatible chip (VIC-IIe) has 8 extra pins to perform timing functions specific for the 128. In addition, some of the registers have extra functions. However, a suitable card to make it compatible can be made. Q $083) What does the video encoding standard PAL expand to? A $083) Phase Alternating Line is the answer I was looking for, which describes the video encoding used in Europe, but Programmable Array Logic is also correct, which describes the family of chips used as "glue" logic for the C64 I/O and processing chips. Q $084) How many buttons were present on the earliest of Commodore tape decks? A $084) 5: Play, Rewind, Fast-Forward, Record, and Stop/Eject. Later models separated the stop and eject functions into two buttons. Q $085) Earlier SID chips had a distinctive "clicking" sound that some demo coders used to an advantage. Commodore subsequently removed the click, and then later reintroduced it. When does the telltale click occur? A $085) When you change the volume of a voice. The voice need not be outputting anything. Q $086) What does CP/M stand for? A $086) Take your pick: Control Program/Monitor Control Program for Microprocessors Control Program for Microcomputers. The last one is considered by many to be most correct. Q $087) What is the highest line number allowed for a program line in Commodore BASIC V2? A $087) Normally, the user cannot enter a line number higher than 63999. If you want to be tricky, however, the numbers can be made to go up to 65535. Q $088) What symbol, clearly printed on the front of a key on the Commodore VIC, 64, and 128 keyboard, is not available when the lower case character set is switched in? A $088) The PI symbol. It is [SHFT-UPARROW] in uppercase mode, but becomes a checkerboard-like character when in lower-case mode. Unlike the graphics characters printed on the fronts of the keys, this one is positioned in the middle of the keycap, and should probably be accessible in both character sets. Q $089) How do you get the "checkmark" character ? A $089) In lowercase mode, type a shift-@ Q $08A) On the PET computers, what memory location holds the Kernal ROM version? A $08A) It is different from the 64/128. It is 50003. 0 here indicates old ROMs, while 1 indicates new ROMs. Q $08B) The Commodore computers have 2 interrupts, called IRQ and NMI. What does IRQ stand for? A $08B) Interrupt ReQuest. This interrupt is used for things that should usually be allowed to interrupt the processor. This interrupt can be masked off by the SEI instruction. Q $08C) What does NMI stand for? A $08C) Non-Maskable Interrupt. Unlike the IRQ, this interrupt cannot be masked by an instruction. However, some tricks can be used to mask it. Q $08D) The 6502 line of microprocessors has a number of flags that can be used to test for certain conditions. One of then is the N flag. What does it stand for? A $08D) 'N' stands for Negative. On instructions that change this flag, it is set to be equal to bit 7 of the result of the instruction. Q $08E) How about the D flag? A $08E) It stands for decimal mode. This mode causes certain instructions to treat a byte as 2 4 bit BCD-coded nybbles. Q $08F) The shorthand for the BASIC keyword PRINT is '?'. What is the shorthand equivalent for PRINT#? A $08F) pR is the way to abbreviate PRINT#. Note that ?# will fail. Here are the answers to Commodore Trivia Edition #10 for September, 1994 Q $090) The 6502 has a rich history. It is modeled after another 8-bit microprocessor. Name the processor. A $090) The 65XX series of processors was modeled after the Motorola 6800. Motorola hampered the design groups' efforts to pursue product developments using the 6800. A core group of 8 designers left Motorola and went to MOS Technologies, which was the largest producer of calculator chips at the time. MOS decided it was time to go into the CPU business. Q $091) The 6502 has a older brother that was never produced. Name its number designation and why it was not produced. A $091) The older brother to the 6502 was the 6501. The 6501 was pin-compatible with the 6800, which prompted a suit by Motorola. Eventually, MOS reached an agreement where they scrapped the 6501 marketing, but were free to market the 6502. Q $092) How many different opcodes are considered valid and "legal" on the MOS NMOS 6502 line? A $092) 151 opcodes are documented in the NMOS 6502 data book. The remaining 105 opcodes were not implemented, and exist as "don't care" states in the opcode matrix. That means that some seemingly invalid opcodes will actually perform pieces of two or more valid opcodes. Newer CPU systems trap all non-implemented opcode usages, but not the 6502. Q $093) Every instruction takes at least __ cycles to complete. Fill in the missing number. A $093) 2. The architecture assumes that each opcode has two bytes in it and one byte can be fetched per cycle. For instructions that use only 1 byte, the extra fetched byte (actually the next opcode), is thrown away. Q $094) Which instructions take more time than necessary as a result of the answer to Q $093? A $094) Although this is a subjective answer, One could nominate NOP on the basis that NOP is generally believed to waste one execution cycle on a particular processor, namely one cycle on the 65XX line. However, one can argue that NOP simply means no operation, and has no ties to length of execution. You be the judge. All other instructions must take at least two cycles: one for opcode fetch, one for operation. Q $095) What did MOS Technologies manufacture befor introducing the 650X line of microprocessors? A $095) As stated above, it was calculator chips. Q $096) Three companies manufactured the 6502 under a cross-licensing agreement. Name them. A $096) Rockwell, MOS Technologies, and Synertek. Q $097) In NTSC-land, how fast does the 1MHz 6510 in the C64 actually run? A $097) 1.022727143 MHz. It is derived by taking the main clock frequency (14.31818MHz) and diving it by 14. Q $098) What about in PAL-land? A $098) 985.248449 kHz. It is derived by taking the main clock frequency (17.734472MHz) and dividing it by 18. Thus the PAL 64 actually runs slower than the NTSC one. Q $099) Data is latched into the 650X microprocessor on the (rising/falling) edge? A $099) Data is latched in to the 65XX on the falling edge of Phi0 (Phi1). The timing diagram in some books (64 PRG is one) is incorrect. Q $09A) Through the years, the 650X line has changed family numbers, yet the part has not been changed. (A family number is the upper 2 digits in this case) Name the other family numbers used by MOS to denote the 650X line. A $09A) the 75XX line used in the 264 series (Plus/4 and C16), and the 85XX series used in the C64C and C128 series. Q $09B) Consider the following code: ldx #10 lda $ff,x what location does the accumulator get loaded with? A $09B) The answer is location $ff+10 mod 256 = $09. The answer involves explaining a (mis)features of the NMOS 65XX CPU line. The above code instructs the 65XX CPU to use zero-page addressing mode to load the accumulator. In zero-page addressing, the address need only be one byte wide ($ff in this case), because the high byte is considered to be $00. Now, as humans, we would expect the CPU would add 10 to 255 ($ff), giving 265 ($109) as the address to load the accumulator from. However, the CPU designers decided that zero-page addressing means that the high byte will be $00 all the time, no exceptions. If a situation like the above occurs, the low byte of the addition will be used as the low byte of the address (9 in this case), but the high-byte will be ZERO. All zero page addressing modes work this way. Note that the CMOS versions of the 6502 do perform the high byte "fix-up", so this behavior is only seen on the NMOS parts. Q $09C) What about the following? ldx #10 lda ($ff),x A $09C) This was a trick. The code is trying to use INDIRECT INDEXED indexing mode using the x register, but that addressing mode can only be used with the y register. If the code is changed to the following, legal code: ldx #10 lda ($ff),y Then, the above discussion for zero-page addressing holds true here as well. The effective address would have been (hi:lo) $100:$0ff, but is instead (hi:lo) $000:$0ff. The simple rule is: zero page means exactly that. There is no way to address outside of zero-page with zero-page addressing. Q $09D) How many CPU clock signal lines does the 650X require to run? A $09D) 1. The 6501 used two, as the 6800 used two, but the 6502 and successors only required Phi0 (Phi1). Phi2 was generated on the CPU. Q $09E) Where does the 650X line fetch its first byte from after reset? A $09E) $fffc. The address formed by reading $fffd and $fffc is stuffed into the IP, and the code is read starting there. $fffc is read first, since the 65XX line stores addresses in low byte, high byte format. Q $09F) One of the original designers on the NMOS 6502 CPU now heads up Western Design Center in Arizona, and makes the 65C02 and 65C816 CPU chips. Name him. Hint: it is not Chuck Peddle! A $09F) Bill Mensch. He hand-designed these newer parts in the 65XX line in the same manner he and Chuck Peddle and others hand-designed the 6501 and 6502. Here are the answers to Commodore Trivia Edition #11 for October, 1994 Q $0A0) In the mid 1980's, Commodore introduced RAM Expansion Units for the Commodore 64, 64C, 128, and 128D. There were three of them. Give their model numbers, and what was different among them. A $0A0) The 1700 (128kB), the 1764 (256kB), and the 1750 (512kB). The 1700 and the 1750 were marketed for the 128, while the 1764 was marketed from the 64 line. Q $0A1) Some of the CIA integrated circuits used on the C64 and C128 computers have a hardware defect. What is the result of this defect, and when does it occur? (May be more than one, but I need only one) A $0A1) The only one I have documented in front of me is the timer B interrupt bug, which is explained in the "Toward 2400" article by George Hug in Transactor 9.3. (1) However, I had many people relate other bugs (2 and 3), which I haven't been able to test, so I add them as possibilities. (I encourage readers to confirm/deny the latter 2.) 1) If timer B of the 6526 CIA times out at about the same time as a read of the interrupt register, the timer B flag may not be set at all, and no interrupt will occur if timer B interrupts were turned on. 2) When the hour on the TOD clock is 12, the AM/PM must be reversed from its normal setting to set/reset the AM/PM flag. 3) The TOD clock sometimes generates double interrupts for alarm trigger. Q $0A2) Name the Commodore machine(s) on which a Intel 8088 was an OPTIONAL coprocessor. (Hint, not the IBM clones) A $0A2) I was looking for the B series computers, which contains the B computers (B128, B256), as well as the 600 series and the 700 series. These computers could be fitted with an optional 8088 processor on a separate card. However, another correct answer is the Amiga, which can have a 8088 attached via an expansion card or a SideCar(tm) unit. Q $0A3) On Commodore computers beside the Plus/4 series, there are three frequencies used to record the data on the tape. Name the frequencies used. A $0A3) 1953.125Hz, 2840.909Hz, and 1488.095Hz. These correspond to waveforms with periods: 512us, 352us, and 672us, respectively. Q $0A4) Commodore Plus/4 series computers can not read any cassettes recorded on other Commodore computers. Why? (Hint: It has nothing to do with the nonstandard connecotr on the Plus/4) A $0A4) The tones recorded on the Plus/4-C16 are exactly one-half the frequencies shown above. This suggests to many that the Plus/4 and C16 were supposed to run at twice its present frequency, but were downgraded at the last-minute, and the code to generate the tones was not updated to reflect the change. This is just heresay, so you decide for yourself. Q $0A5) During power-up, the Commodore 64 checks to see if it running in PAL-land or NTSC-land. How does it determine its location? A $0A5) It sets the raster compare interrupt to go off at scan line 311. If the interrupt occurs, we are on a PAL system, since NTSC will never get to line 311 (NTSC only has 262.5 lines per frame, every other frame shifted down a bit to create 525 lines). Q $0A6) What is the 65XX ML opcode for BRK? A $0A6) $00, or 00 Q $0A7) On the 65XX CPU, what gets pushed onto the stack when an interrupt occurs? A $0A7) The program counter gets saved high byte first, then the processor status flags get saved. Q $0A8) Speaking of the stack, where is the stack located in the 65XX address map? A $0A8) $0100 to $01FF Q $0A9) On the 65XX CPU line, it is possible to set and clear a number of processor status flags. Examples include SEC and CLC to set and clear the carry flag. What flag has a clear opcode, but no set opcode? A $0A9) The overflow flag: V. However, the V flag can be set via an external pin on some members of the 65XX line. The 1541 uses this as an ingenious synchronization tool. Q $0AA) When saving a text file to tape, the computer records 192 bytes of data, an inter-record gap, and then the same 192 bytes of data again. How wide is this inter-record gap, and why is it there? A $0AA) Some terminology: "inter" means "between". Most everyone knows that a tape block is recorded twice on the tape, but Commodore considers the two copies and the gap between them a single "record". Thus, this question is referring to the gap in between two dissimilar records. With that in mind, the interrecord gap is nominally 2 seconds long, (or 223.2 byte lengths, although the gap contains no data). It is there to allow the tape motors to get up to speed before the next data comes under the read/write head. The tape motors may need to stop between records if the program is not requesting any more data from the tape data file at this time. If the program subsequently asks for data from the tape, the drive must get up to speed before the read can occur. Note: on the first version of PET BASIC, the gap was too small, so programmers had problems retrieving data files. For completeness, the "intra-record" gap (The one between the two copies of the data) consists of 50+ short pulses, each of which is 352us in length, giving a timing of .0176s+. This time was used to copy important data to safe locations, reset pointers, and do error logging. The entire "record" is recorded in 5.7 seconds. Q $0AB) On an unexpanded VIC-20, where does the screen memory start? A $0AB) $1e00, or 7680 Q $0AC) In Commodore BASIC, what is the abbreviated form of the "Load" command? A $0AC) lO (L SHIFT-O) Q $0AD) In Commodore BASIC, what is the abbreviated form of the "List" command? A $0AD) lI (L SHIFT-I) Q $0AE) On the Commodore 64, there is section of 4 kilobytes of RAM that cannot be used for BASIC programs. It is the favorite hiding places for many ML programs, however. What is its address in memory? A $0AE) $c000, or 49152 Q $0AF) What is stored at locations $A004-$A00B, and why is it strange? A $0AF) The text "CBMBASIC" is stored there. It is strange because this text is not referenced by any routine. It can also be called strange because the code is Microsoft's. Doesn't it make you wonder? Here are the answers to Commodore Trivia Edition #12 for November, 1994 Q $0B0) What will happen if you type ?""+-0 into the CBM BASIC interpreter on the PET series, the 64 series, or the 128 series? A $0B0) The BASIC interpreter has a bug in it that shows up while interpreting the above statement. The interpreter leaves two bytes on the CPU stack prior to returning from a subroutines call. At least on the C64, the two bytes are both zeros. Since subroutines put the return address on the stack, the return retrieves the two bytes left on the stack and attempts to se that as the return address. So, depending on what code it executes after the return, it can do a number of things. Most of the time after the bug occurs, the interpreter limps along for a while until it hits a BRK instruction, $00. Then, that instruction causes the system to execute an interrupt. On the C64, the system vectors through $316-$317 (BRK vector) and does a warm start. On the C128 and PETs with Monitors, the system dumps into the internal machine language monitor. If the machine under use did not do something with the BRK vector, the machine will hang. Now, note that the above is not the only result. Since the interpreter is executing code from the wrong location, any result from no effect to hung machine is possible. Note that this is NOT normal behavior. The system should report an error while interpreting the above statement. Q $0B1) In the first CBM 64 units, what color was the screen color RAM changed to when you cleared the screen? A $0B1) The screen color RAM was changed to value 1 when the screen was cleared. Thus, when a byte was poked into screen RAM, the resulting character was white on the screen. The white contrasted nicely with the normal blue background. Q $0B2) Why was it changed in later versions of the 64? A $0B2) Commodore found that this practice sometimes caused "light flashes" during screen scrolls. I was going to leave this for another time, but ... The change was to make the color RAM equal to background color register #0. Well, this got rid of the "light flashes", but then poking values to screen RAM caused invisible characters, since the foreground color of the character was the same as the background color of the screen. Well, this broke a number of older programs that did not