Jump to content

EvilSnack

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by EvilSnack

  1. I started learning Commodore BASIC in 1980 (on the PET), and got 6502 programming docs the moment I could lay my hands on them. Remembering back to those days, I now have the idea of developing a transpiler (or whatever you want to call it) which: * Looks and runs like CBASIC, or, should I say, how CBASIC would have run had it originally been made for the X-16; * Minimizing its inefficiencies (by tokenizing the code for faster execution, better string support, more efficient program flow, supporting integer arithmetic where desired, etc.); * Maybe have extra commands for the graphics and sound, support for text labels in addition to line numbers, and accessing the X-16's banked memory; * Generates assembler listings (which can be optimized and assembled). I'm a bit rusty on 6502 (I last used it to write a C64 word processor back in 1987-88), and I'd have to give up some of my other hobbies...
  2. My algorithm was more general-purpose, not assuming any particular length of the dividend. The reason it works is because the series (1/16) + (1/16)^2 + (1/16)^3 + ... approaches 1/15, and then it's only a matter of dividing by 4 to get the final result.
  3. If the most significant byte is 0x38 or lower, this will deliver more accurate results, and might be faster: 1. Shift left by two bits. Save off this value. 2. Shift right by four bits. Add this to the variable holding the saved-off value. 3. If you still have anything left in the shift variable, return to step 2. 4. Add 0x80 (this will round the final result to the nearest 1/60th). 5. Drop the least significant byte.
  4. One way to divide any integer by 60, using only integer math: 1. Shift right by six bits. Save off this value. 2. Shift right by another four bits. Add this to the variable holding the saved-off value. 3. If you still have anything left in the shift variable, return to step 2. 4. The variable with the saved-off value will contain the quotient.
  5. I understand the reasons why few would attempt this. The 6809 seems to have been a victim of bad timing. I've coded for both the 6502 (including a word processor for my C64) and the 6809 (several attempted games for Dad's CoCo), and the latter simply had that much more potential.
  6. Aside from having to rewrite the entire ROM, and perhaps having to add an adapter to accommodate any pin-out/power requirement variation between the two CPUs, what's stopping an ambitious experimenter from replacing the 6502 with a 6809?
  7. I wrote my very first computer program on a Commodore Pet in January of 1980. I was in ninth grade on my lunch break, and went over, making me late for civics class. Briefly migrated into TRS-80 Color Computer land during high school, but got my Commodore 64 from a Sears in San Antonio in 1984. Migrated to an Amiga 500 later on (1986), then an Amiga 1200 in 1994, and then when Commodore went bust wandered off into Wintel Wonderland. Glad to see that someone is keeping the old ways alive.
×
×
  • Create New...

Important Information

Please review our Terms of Use