3 ms·
Bookmarked this to read about optimizers, because it looks great. That said, I clicked on the link because it had "6502" in the title. And... this isn't very
by ajross 4y ago
Bookmarked this to read about optimizers, because it looks great.
That said, I clicked on the link because it had "6502" in the title. And... this isn't very interesting as a retrocomputing activity. To be blunt: there's absolutely no way in hell a compiler architecture like that is ever going to be self-hosting in 64k of memory space.
- geon 4y agoWho in their right mind would self host 6502 development?
- spc476 4y agoPlenty of teenagers in the 80s writing games for the various home computers at the time (Apple ][, Atari 400 & 800, Commodore 64).
- jlokier 4y agoThat waa me. My 6502 "IDE" was a BBC Micro, with it's excellent BBC BASIC ROM that had inline 6502 assembler built-in to the BASIC language. It was so good and accessible, and documented in the Advanced User Guide, that after learning BASIC starting age 10, I learned 6502 a few months later and was able to reverse engineer and modify other people's games not long after that. I had the luxury of floppy drives which my contemporaries did not have The floppies helped immensely with self-hosted development of larger programs. Imagine losing all your assembler work due to a crash running it because it was tempting to skip rhe time of several minutes saving to tape. Floppies were reasonably fast for saving before running things, but few people I knew had them. It also gained a Z80 second processor (an add-on; and later a 68000), so rhe Z80 helped with development of 6502 code, as a RAM disk and editing scratchpad that survived 6502 crashes. And for running Wordstar, which was a decent editor. Eventually I had someone else's ZX Spectrum hooked up to the BBC with a kind of home-made bit-banging serial port. That's when things started getting fancy, as my BBC's Z80 second processor's flavour of BBC BASIC could assemble Z80 code for the Spectrum, and run some Z80 binaries from other people's Spectrum software, with the BBC's 6502 providing display and sound emulation.
- deepspace 4y agoYup, that was me too. The BBC Micro was a great 6502 dev environment (for the time). Several years after I moved on from the Beep to a PC, I again had the opportunity to use my knowledge of 6502 assembly. A rally-driving friend asked me to look into changing the fuel curves in their Toyota's ECU. Turns out that many early 90s ECUs used 6502s. I whipped up a 6502 disassembler (in Turbo Pascal) and was able to reverse engineer the ROM dump and make the required adjustments. Fun times.
- iainmerrick 4y agoNot interesting to you, but other people may differ! A cross-compiler targeting the 6502 is still interesting to some. As the article notes, these compiler techniques weren’t invented in the 70s because computers weren’t powerful enough to make good use of them. What’s wrong with exploring what the original hardware is capable of when freed from those restrictions?
- ajross 4y agoThere's nothing "wrong" with it. I'm just saying that if I'm going to read an article about fun 6502 activities, I want to see it hosted on an Apple II. If I want to read about compiler techniques, I'd prefer to see it targetting a more orthogonal (or less weird, anyway) architecture.
- spc476 4y agoOkay, here's an article about calculating e to 116,000 digits on an Apple ][: <https://archive.org/download/Apple_2_Woz_e_Calc_1981/Apple_2_Woz_e_Calc_1981.pdf https://archive.org/download/Apple_2_Woz_e_Calc_1981/Apple_2...> (warning, PDF!). I found it interesting to read, even though I never owned an Apple ][, nor did I ever own a 6502-based computer (well, except for the Atari 2600). I was, however, able to apply the techniques to computers I did own (6809 and 8088 based).
- ecpottinger 4y agoIt is my understanding the the GEOS system was developed on a more powerful machine than the C64/Atari computers it was used on. This let then have the entire code in memory and then processed for common functions. They could not do this on the the 64K-8 bit computers at the time.
- troad 4y agoI don't think of retro-computing as an activity limited solely to the hardware and software that existed at a given time, that's far too restrictive for me. 6502 is an architecture, not a specific machine, nor even the set of machines that supported that architecture in the past. The architecture is and remains interesting on its own! (6502 assembly remains a really good intro to assembly, for instance, even for people that have never even seen a C64.) There is absolutely scope for people to do fun things with 6502 that could never run on a C64 or an Apple II. The vast majority of 6502 code today runs in emulation, so there's really no reason to artificially gimp it to ape the limitations of any given machine. (Unless emulating that specific machine of course!)
- ajross 4y ago> 6502 assembly remains a really good intro to assembly It... really is not, though. It doesn't teach you macro assemblers as they exist in the modern world. It doesn't teach you interaction with the linker except in the simplest ways. And while the instruction set is "simple" in the sense that it can be understood on a page of paper, lots of critically important ideas don't exist in a meaningful way. Modern techniques like register assignment aren't possible given the limitations and non-orthogonality of the CPU state. There's no "ABI" equivalent you can use to call a standard function, and even something as foundational as "passing arguments" to a function isn't directly expressible, because the "stack pointer" isn't actually a pointer. In point (heh) of fact, no pointers are pointers because the 6502 doesn't actually have an abstraction for a memory address! Everyone should learn to hack on an Apple II (and good grief, not a Commodore unless you are trying to learn VIC-II or SID hardware), but not to teach themselves "assembly" as a skill they might apply elsewhere. In fact it's almost the same argument used for why we teach new kids Python and not BASIC. The latter just isn't a useful tool for expressing the concepts you need to learn.
- Luc 4y agoWow you really are into telling people what they should do.
- 4y ago