Slashdot Mirror


Turning the Arduino Uno Into an Apple ][

An anonymous reader writes: To demonstrate how powerful modern computers are compared to their forebears, engineer Damian Peckett decided to approximate an Apple ][ with an Arduino Uno. In this post, he explains how he did it, from emulating the 6502 processor to reinventing how characters were displayed on the screen. "The Apple II used a novel approach for video generation, at the time most microcomputers used an interlaced frame buffer where adjacent rows were not stored sequentially in memory. This made it easier to generate interlaced video. The Apple II took this approach one step further, using an 8:1 interlacing scheme. This had the first line followed by the ninth line. This approach allowed Steve Wozniak to avoid read/write collisions with the video memory without additional circuitry. A very smart hack!" Peckett includes code implementations and circuit diagrams.

113 comments

  1. Did this really need demonstration? by kamapuaa · · Score: 0

    Very cheap modern computer is capable to emulating a 28 year old cheap computer.

    --
    Slashdot: providing anti-social weirdos a soapbox, since 1997.
    1. Re:Did this really need demonstration? by marka63 · · Score: 3, Informative

      Apple II w/ 4K of memory would cost $5236.87 ($1298) in todays dollars. While this may be a lot less than a lot of computers at the time I wouldn't call it a cheap computer by any stretch of the imagination.

    2. Re:Did this really need demonstration? by kamapuaa · · Score: 2

      To be fair, he was mostly emulating a MOS 6502 that would cost about $125 in today's dollars.

      --
      Slashdot: providing anti-social weirdos a soapbox, since 1997.
    3. Re:Did this really need demonstration? by Anonymous Coward · · Score: 0

      Wow, there's not even an iWatch that cheap..

    4. Re:Did this really need demonstration? by kamapuaa · · Score: 2

      I hate to quote the fucking article because who reads that anyway? But When the 6502 was first released it was priced at $25 USD. At the time this was unheard of, being up to six times cheaper than the nearest competitors. Some people even thought that the low price had to be some form of scam. does in fact establish that the processor was considered a cheap processor.

      --
      Slashdot: providing anti-social weirdos a soapbox, since 1997.
    5. Re:Did this really need demonstration? by gl4ss · · Score: 2

      well, kind of.

      I mean it's neat, because it's on such a crapp microcontroller.

      the atmel avr used is pretty much an ancient microcontroller today. I mean, it's pretty much slower than the first pc our family had(8mhz x86 vs atmel 8mhz, or maybe 16, depends). our first pc also had a video card to take care about the graphics display and so forth...

      sure, if you loaded an emulator on raspberry pi, I wouldn't give a shit or any props. but for this yes.

      --
      world was created 5 seconds before this post as it is.
    6. Re:Did this really need demonstration? by Bing+Tsher+E · · Score: 2

      Well, the 6502 was the shittiest processor of it's generation (which is why the Apple dudes could afford it) so it makes sense to emulate low end with low end.

      Your first PC had a CRT controller (likely a 6845 or derivative.) That's a relatively simple LSI chip. People were doing 'cheap video' with software even back in the day (i.e. Lancaster's cookbook)

    7. Re:Did this really need demonstration? by Bing+Tsher+E · · Score: 1

      The 6502 was cheap for a reason. It was the low end alternative. It's no coincidence that the thing eventually was bought out by a video game manufacturer. And that so many warts and 'undocumented' features existed in it.

      Fun to hack on. But professionals were specifying 6802s and a little later Z-80s.

      The whole 'merit' of the 6502 and Apple at the time was an exclusive 'killer app' (Visicalc) that moved units. Marketing hustle, not technical superiority or even equivalence. That scent of ripe apple, back then and today, much the same.

      It's surprising any of it survived the launch of Visicalc on the IBM hardware. And then Lotus 123 just shut the toy 8 bitters right down. They became, well, toys, for kids to learn on because dad had a new better machine in his den.

    8. Re:Did this really need demonstration? by Anonymous Coward · · Score: 0

      The first PC did not use a 6845 as they did not exist yet, google 'Sol 20' or 'Processor Technology VDM-1' if you want to see the first decent memory mapped video.

    9. Re:Did this really need demonstration? by sjames · · Score: 1

      The AVR is a fine microcontroller. It isn't meant to be a CPU for a PC.

    10. Re:Did this really need demonstration? by Anne+Thwacks · · Score: 4, Informative
      The 6502 was years before the 6802 or Z80. The 6800 was designed by the same people. After they designed the 6800, they realised that processing strings on a 6800 was hell's own job cos it only had one pointer (although it was 16 bit). The 6502 had two 8 bit pointers and could therefore do a string move or compare quite painlessly and any fool could write a Basic interpreter for it in a couple of weeks.

      There was a 6500 before the 6502 (I had one) but it used a weird technology that meant it drew almost all its power from the clock lines (two phase non-overlapping clock) and the interface voltages were also non-standard, so the 6502 was magnificently better. It was cheaper because of volume - the die size was almost exactly the same - the chip was almost exactly the same. (I think they got some major order before it was even available for general release), and there was a second source (Rockwell).

      The 6800 was a superior processor if you did not have much string processing to do. The 68000 was an entirely different beast.

      --
      Sent from my ASR33 using ASCII
    11. Re:Did this really need demonstration? by gl4ss · · Score: 1

      I said that it was ancient, not that it was shitty as such. well, that kind of makes it shitty if you compare what is on the market in 2015 - for any application. it's not particularly cheap either and in official arduino uno board it's ridiculously expensive for what it is.

      sure, my 3d printer runs on atmel avr. that's what makes the firmware rather shitty from what it could be and impossible to improve upon, there's no space left on the rom and the ram is exhausted and there's no empty cycles(96% of home 3d printers run on 8 bit avr, it's the reprap standard and makerbot used one too until in their latest line switching to a faster bot - though amazingly their new bot has worse firmware and stepper control).

      but comparing it to a cheap modern pc is stupid. that was my point. our first 8mhz/640kb/20mbyte/ega home computer from 1988 or so was leagues ahead of the 8 bit avr. so comparing this project to running an emulator on a cheap modern pc is stupid.

      --
      world was created 5 seconds before this post as it is.
    12. Re:Did this really need demonstration? by jbolden · · Score: 4, Informative

      The Apple 2 came out in 1977. Visicalc was 1979 and didn't start development until 1978. No Apple was not building the machine around Visicalc.

    13. Re:Did this really need demonstration? by Anonymous Coward · · Score: 2, Interesting

      > Very cheap modern computer is capable to emulating a 28 year old cheap computer.

      Actually, it may contradict common sense, but you're missing part of the "history".

      As technologies evolve and brands consolidate, some old ideas are lost. Things like the mentioned 8:1 interleave, floppy drive skewing schemes or they way images are generated in vector display are harder to simulate (though feasible). And even if simulated, not everyone would know how to use them. I'm particularly reminded of ATARI 2600 image generation, a nightmare if I ever saw one. It makes me value the ZX80 even more.

    14. Re:Did this really need demonstration? by wed128 · · Score: 1

      Dunno about that...i think the AVR instruction set is probably faster at 8Mhz then an 8086 at the same speed; it's at the very least equivalent. The x86 instruction set really is a mess...

    15. Re:Did this really need demonstration? by marcomarrero · · Score: 1

      The IBM PC 5150 used CGA and MDA videocards, both used the 6845 text chip. I wonder if you were talking about the IBM 5100...

    16. Re:Did this really need demonstration? by Anonymous Coward · · Score: 1

      After they designed the 6800, they realised that processing strings on a 6800 was hell's own job cos it only had one pointer (although it was 16 bit).

      Reminds me of my own adventures with assembly language on a Z80 CPU. In writing my first non-trivial (yet not that complex) program, I decided I wanted to establish a calling convention for subroutines as well as use the stack for temporary variables. On an 8086 this is pretty simple, at the beginning of a function you just "MOV BP, SP" followed by "SUB SP, x" to make room for your temporary variables, then reference everything via "[BP+y]" with positive values pointing to the function arguments and negative values pointing to local variables. On the Z80 however, you're in for hell if you want to do something so trivial. Transferring the stack pointer to and from other registers is a pain in the ass. You also can't do math with it, so you have to add room for your local variables while it is in other registers, then move the result back to the stack pointer. The result is that the overhead of function entry and exit is insane. After confirming that there is indeed no good solution by looking at the output of a couple of Z80 C compilers, I gave up and continued to just pass arguments in registers and use global variables for everything.

      In the present day, no one would care about such things, as the inefficiency would be hidden by the compiler, but back when these CPUs were new, it's easy to imagine such differences between CPUs being more of a factor in their popularity than their speed or their price. In particular, ease of programmability is going to affect the quality and cost of software available. Thus I'm not too surprised that the 8086 came out on top. I've done a lot of assembly coding for it and never found myself in a "there's no easy way to do this" situation like I keep finding myself in when writing in Z80 or 8052 assembly. Honestly, it's almost like they chose the available instructions for these CPUs completely at random with no concern for how easy it was going to be to do any particular task. Even Atmel's AVR instruction set leaves a lot to be desired once you reach the point where you can't fit all of your variables in the 32 registers and start having to touch the device's RAM, as instruction sequences become so long that you feel like your 20 MHz CPU is about to turn into 2 MHz.

    17. Re:Did this really need demonstration? by CastrTroy · · Score: 1

      Yeah. Most of the emulators out there use hacks to get them to run smoothly on today's hardware. There's a lot of emulators out there that don't run exactly as the old hardware did. Some emulators like BSNES actually try to run the machine code exactly the same way the old consoles did, while others take short cuts and there fore might only work with the most popular games.

      There's even a fair number of N64 emulators that can't play Ocarina of Time properly. There's a part very early in the game where you have to pick a path based on the direction path the song is coming from. Most of the emulators fail at this and just play the song the same no matter which path you go down.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    18. Re:Did this really need demonstration? by Anonymous Coward · · Score: 0

      The 6502 had one thing that made Visicalc plausible - BCD support in hardware.
      Doing fixed point math on the other CPUs of the time was a slow process, maybe by
      a factor of 10 or better.

    19. Re:Did this really need demonstration? by squiggleslash · · Score: 1

      Unlikely. Virtually all mainstream 8 bit CPUs of the time had BCD support in some shape or form, including the 8080 and its compatible rival the Z80 series. The vast majority of microcomputers in the late 1970s were 6502, 6800, 8080, or Z80 based.

      Visicalc probably started on the Apple II because that's the computer the authors had at the time.

      --
      You are not alone. This is not normal. None of this is normal.
    20. Re: Did this really need demonstration? by Anonymous Coward · · Score: 0

      The Apple 2 was an also-ran until Visicalc.

      Visicalc was the first spreadsheet. It initially only ran on the Apple. During that first year was when the Apple gained it's credibility as a useful business machine.

      Yes, nerds had them too. I would have, except I has another brand.

    21. Re:Did this really need demonstration? by sjames · · Score: 1

      You must have a very different definition of crap than most of us use. It's not ancient either, it is current.

      Perhaps you don't know what a microcontroller is for? Hint, for the purposes a microcontroller is intended, the home computer would be a miserable choice, then or now.

    22. Re: Did this really need demonstration? by Anonymous Coward · · Score: 0

      GP is one of those people who refuses to allow us to use the term 'the first PC' to refer to the 5150 because there were personal computers before IBM entered the market.

      Kings had personal computers in the 14th century. They employed them in computing sums. The term computer used to refer to a human calculating with numbers.

    23. Re:Did this really need demonstration? by operagost · · Score: 1

      You know the Atari 400/800 and Commodore VIC20/64 used the 6502 as well, right? Not exactly a limited or niche processor.

      --

      Gamingmuseum.com: Give your 3D accelerator a rest.
    24. Re:Did this really need demonstration? by Eunuchswear · · Score: 1

      The 6502 was years before the 6802 or Z80

      6800 - November 1974
      6502 - 1975
      z80 - July 1976
      6802 - March 1977

      Things went faster in the past.

      --
      Watch this Heartland Institute video
    25. Re:Did this really need demonstration? by tlhIngan · · Score: 1

      The 6502 was years before the 6802 or Z80. The 6800 was designed by the same people. After they designed the 6800, they realised that processing strings on a 6800 was hell's own job cos it only had one pointer (although it was 16 bit). The 6502 had two 8 bit pointers and could therefore do a string move or compare quite painlessly and any fool could write a Basic interpreter for it in a couple of weeks.

      You have it reversed - the 6800 predated the 6500.

      The 6800 was done by Motorola, but those designers were unhappy with the way Motorola was marketing it (expensive processor), so they split off from Motorola and created MOS. They designed (cleanly) the 6500, which was designed to be super cheap ($25), and not only binary compatible, but pin compatible with the 6800. You could literally drop the 6500 into a 6800 socket and it would work just fine (being designed by the same guys helped).

      Motorola got pissed at this, and threatened MOS, so they simply created a new processor which was similar to the 6500, but not pin compatible, but close enough. They called it the 6502.

      Its low price helped significantly, but also that at every trade show, MOS would have them for sale. Bring $20-25, and they'll sell you a 6502 and all the databooks and manuals you needed to hook it up. Motorola and everyone else required you to go through distributors to obtain that material, and it was also over $100 (I think the 6800 was $200 or so) to boot.

      Basically MOS realized there was a home hobbyist market, and they sold processors at every trade show they attended to interested folks.

    26. Re: Did this really need demonstration? by jbolden · · Score: 1

      Well I don't know about "also ran". There were lots of CP/M machines. Visicalc was after basic word processing one of the first major applications for CP/M machines moving them from hobbyist to usable for home businesses ...

      Regardless the Apple 2 was not designed around the specs for Visicalc per GP. That's just not true.

    27. Re:Did this really need demonstration? by Anonymous Coward · · Score: 0

      I bought an Apple ][ for graphics not visicalc. The alternative were TRS 80 and commodore Pet with lower res and no graphics. Visicalc was for enterprises only.

    28. Re:Did this really need demonstration? by Tipa · · Score: 1

      Both the Atari and Commondore computers you mention had a couple additional processors to handle video, sound, etc. They didn't go with just the 6502 alone. http://en.wikipedia.org/wiki/J...

    29. Re:Did this really need demonstration? by Anonymous Coward · · Score: 0

      Bricklin programmed his prototype in BASIC on Dan Fylstra's Apple II, and then got Frankston to write the 6502 assembly version. Frankston used a macro assembler on a 6502 machine from ECD, and downloaded the executables to the Apple II for testing and debugging.

      VisiCalc did use BCD, but Frankston later said that it was a poor choice because it was slower and users didn't care about the base-10 precision, that they should have just used binary math.

    30. Re:Did this really need demonstration? by itzly · · Score: 1

      Actually, the 6502 only cost $6.95 in today's dollars.

      http://www.mouser.com/ProductD...

    31. Re:Did this really need demonstration? by itzly · · Score: 1

      It's for sale right now, but it's still ancient. You can get an ARM CPU for roughly the same price, with 10 times the clock, more peripherals, more choice of packages, more memory, and 32 bits instead of 8.

    32. Re:Did this really need demonstration? by itzly · · Score: 1

      The x86 instruction set really is a mess...

      Clock for clock, a modern intel CPU is much faster than an AVR. Who cares if it doesn't look pretty, when it gets the job done ?

    33. Re:Did this really need demonstration? by Anonymous Coward · · Score: 0

      I don't agree with what you're implying about the chips design that lead to it having 'warts' and undocumented features. If you listen to Chuck Peddle's interviews on Youtube the 6502 was actually extremely optimised and hand-tuned so that it could fit within the silicon and process budget for the chip. The weird things about it like the illegal opcodes were just a consequence of this optimisation, not some magic that the designers put in on purpose but never documented.

    34. Re:Did this really need demonstration? by sjames · · Score: 1

      ARM is more expensive. You can get an AVR for $3 quantity 1. ARM also requires more of the board it's connected to and still consumes more power.

      I like ARM and when the capability is needed, I wouldn't hesitate to recommend it but it's not a one size fits all world.

    35. Re:Did this really need demonstration? by Megane · · Score: 1

      A while back I found a Heathkit ET-3400 at a thrift store. I tried writing a simple program for it when I realized that holy shit, the original 6800 doesn't even have the ABX instruction, that was in the 6801/6803 core. I mean, I knew all those other instructions like ADDD and MUL wouldn't be there, but I didn't know ABX would be missing too. And I was doubly annoyed because I had done a lot of 6809 programming so I already knew I was going to miss a lot of things.

      And the 6809 was the most superior 8-bit CPU when it came to string processing.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    36. Re:Did this really need demonstration? by Megane · · Score: 1

      Back in the mid '90s, I think everyone was surprised to find that you needed at least a 486DX-25 to emulate the Atari 2600. It was because the 2600 required cycle-accurate timing to emulate it properly. You could, and everyone did, do stuff with the Stella chip (which I call a "1-D" graphics chip) in the middle of a scan line, sometimes abusing its counter registers in interesting ways.

      The N64 was a different beast with emulation. I think the biggest problem was needing a lot of RAM to emulate it properly on the Xbox, and I think RAM was also the problem on PSP. But at some level it abstracted the 3-D hardware such that you could usually emulate it with better looking graphics than the original hardware.

      And yeah, then there's the sound hardware. That was a big problem for SNES emulators, because there was so much that the sound CPU could do. You either make it work for most cases, or you eat up a lot more CPU time emulating it properly.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    37. Re:Did this really need demonstration? by Megane · · Score: 1

      The 8085 actually had an undocumented instruction to add a constant value to SP and put the result in DE. But apparently all this was happening roughly at the time the 8088 was coming out, and one of their advertised "advantages" was being able to cross-assemble 8080 code to the 8086, so they memory-holed those instructions. Most 8085 clone cores had them though. And yes, I have also seen the result of trying to compile C for the Z-80, and it isn't pretty.

      You should look into the 6809 to see what you get when the instruction set isn't chosen "completely at random". It was really nice, and I even got paid to do it for a few years. The only real trouble I had was feeling like I needed just one more register, but you could always cheat by putting stuff on the stack at the cost of cycles.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    38. Re:Did this really need demonstration? by gl4ss · · Score: 1

      in the purposes it serves in many arduino projects, it's crap. it's used for all kinds of things it's crap for. realtime motor controls, motion planning, audio analyzing, you name it. all kinds of stuff it's pretty crappy for but it's the "standard", so it gets thrown in there.

      the arduino atmels are a) not low power use b) not powerful.

      from what I can look at volume pricing, the volume pricing of the atmels isn't that great either.

      it's not intended at any specific application either. it's intended to do anything it possibly can. if you can make a plugin tv console with it that emulates space invaders then good for you. it was intended for purposes like that just as much as it was intended for running a washing machine..

      --
      world was created 5 seconds before this post as it is.
    39. Re:Did this really need demonstration? by Shirley+Marquez · · Score: 1

      Mostly the 6502 was cheap because they made a marketing decision to make it cheap. The convention wisdom of the time was to charge through the nose for small quantities of chips and soak developers. In theory this helped companies keep down the large volume prices of their chips and make them more attractive to companies that were going to buy millions of them. MOS Technology, a startup chip maker, decided to try something radical to put itself on the map: sell single chips at prices low enough that hobbyists and garage startups could afford them. It paid off; Apple's decision to use the 6502 was largely motivated by the low price of the chip.

      After MOS Technology went away, the industry returned to business as normal for many years, again charging high prices for small quantity orders and especially for evaluation boards. But that has changed in recent years. We now have a flood of inexpensive evaluation boards for all sorts of microcontrollers - not just open hardware projects like Arduino, but also boards from manufacturers such as the TI Launchpad series and the mbed. The maker movement has been a big beneficiary of the change. The software situation has also improved: we now have open-source tools based on GCC as an alternative to expensive embedded system compilers and debuggers.

    40. Re:Did this really need demonstration? by Shirley+Marquez · · Score: 1

      The 6500 was MOS Technology's first chip, and sold for $20 in quantity one. It was designed to be pin-compatible with the 6800, though the instruction set was different so it was not a drop-in replacement. The requirement for the quadrature clock was shared with that chip, so it really wasn't any harder to use. MOS Technology withdrew the 6500 from the market under legal pressure from Motorola; MOS Technology probably would have won the legal battle but did not have the resources to fight it.

      Meanwhile they had been working on their second product, the 6502. The new chip incorporated the quadrature clock generator in the CPU, so there was no longer a need to generate it externally. (Generating quadrature clocks is not all that difficult - the circuit involves two flip-flops - the main wrinkle is that they have to be non-overlapping, requiring some attention to circuit layout and stray capacitance.) The 6502 also rearranged the pins so it was no longer pin-compatible with the 6800, satisfying Motorola's lawyers. The new chip was easier to use so they raised the price a bit to $25 in quantity one.

      Many modern microprocessor designs use quadrature clocks, but they are generated on-chip now just like the 6502. Any microcontroller that takes a clock input that is four times the actual clock speed of the processor uses a quadrature clock. In current designs it's harder to tell because they also often incorporate on-chip PLL clock multipliers, so the actual clock rate of the chip is many times the speed of the external clock. x86 processors are one extreme example; they use a 100 MHz external clock and may multiply it by 40x or more.

    41. Re:Did this really need demonstration? by Shirley+Marquez · · Score: 1

      VisiCalc was actually developed on a MicroMind? I didn't know that!

      The ECD MicroMind was a tragic example of the perfect being the enemy of the good. It was an ambitious design for the time, notably including memory mapping hardware so the system could have more than 64K RAM, and a powerful graphics board that had both bitmap graphics capability and a programmable character generator. It used stackable boards rather than the usual card slots. But they spent so much time perfecting the design and adding more bells and whistles that they never got the system to the point of being able to be mass produced at a reasonable price.

      I knew the guys at the time and hung around at the fringes of the project, though I was never really involved. I think they did use the bitmap chess font I designed for it in the chess program.

    42. Re:Did this really need demonstration? by Shirley+Marquez · · Score: 1

      No, ARM isn't more expensive. Try, for example, the ST Microelectronics STM32F030R8T6. That's a Cortex-M0 ARM, 48MHz, 64K flash, 8K RAM, 55 I/O pins. $2.22 in quantity one. Reference: http://www.digikey.com/product... That's just one part I happen to be familiar with; there may be even cheaper ARM alternatives out there.

      Quantity one price of an ATMega328? $3.25. That's the surface mount version; the DIP is $3.38. Reference: http://www.digikey.com/product...

      It's true that if you stay with Atmel, ARM will be more expensive. The ATSAMD21G18 that is used in the upcoming Arduino Zero Pro is $6.17 in quantity one. Reference: http://www.digikey.com/product... To be fair, that is a newer design using the somewhat more powerful Cortex-M0+ core.

    43. Re: Did this really need demonstration? by cthulhu11 · · Score: 1

      Times cheaper? Makes no sense. I think you mean one sixth the cost.

    44. Re:Did this really need demonstration? by sjames · · Score: 1

      ATTINY2313-20PU $1.62.

      Not as fast and not as powerful, but if that's all you need, why overbuy? If you slow it way down, it comes in at 20 micro amps @ 1.8v

      There's nothing wrong with the ARM, it's just not always what is needed.

      One reason AVR looks more expensive is that it is currently the cool maker choice so you see a lot of them at vastly inflated prices. One reason it's 'cool' is it's ease of use and minimal demands for support circuitry.

    45. Re:Did this really need demonstration? by Shirley+Marquez · · Score: 1

      Another factor is that the AVR chips are mostly still 5 volt parts. That means that they have to be made with a very out-of-date process and are much larger than current designs. (The processors used in AVR Arduinos can be run all the way down to 2V at reduced performance, but the fact that they allow 5V operation dictates the process used.) All the microcontroller ARM chips that I am familiar with are 3.3 volt chips (that's the maximum, most can also be run at lower voltages, typically down to 1.8V); higher end ARMs used in phones and the like run at even lower voltages, often less than one volt.

      But... being 5 volt chips, they are easier to use in maker designs. Makers tend to still be using older 5 volt CMOS chips for glue rather than low voltage parts. Other things that they want to hook up are likely to run at 5V. 5V means that you can drive every color of LED directly with an output pin rather than needing a level shifter. Low voltage CPUs usually have less current drive capability as well, so even interfacing to other low voltage devices may require the use of buffers. 5V parts have better noise immunity and are less static sensitive.

      The Arduino Due, the first ARM-based Arduino, has failed to catch on. One reason is that it is a 3.3V board with inputs that are not 5V tolerant, which means that a large percentage of existing shields and other modules that are designed to be used with Arduino won't work with it. No real fix for that other than releasing new 3.3V shields.

    46. Re:Did this really need demonstration? by sjames · · Score: 1

      That is a very good point. I'm in a project now that needs low power. It is nice to be able to power sensors off of one of the DIO pins so I can power them down at will without adding to component count. And as you say, the 5V design will be more robust for little effort.

      I tend to think of < 5V as something you do if you have to, never as a first choice.

  2. Neat by Anonymous Coward · · Score: 0

    Kinda cool I guess, though I was playing around with Apple II emulators about 10 years ago.

    Arduino for the blog cred though!

    1. Re:Neat by RLiegh · · Score: 1

      I was playing with apple emulators 18 years ago and I had the same reaction.

  3. Cool hack, but not very useful by Misagon · · Score: 2

    The cool things are that he used a 8-bit AVR microcontroller to emulate the 6502, and that he used a USB chip on the prototyping board to create video...
    Unfortunately, it runs much slower than a 1MHz 6502.

    It appears that he did his own reverse-engineering of the 6502. One peculiarity that he may have missed is that it has undocumented op-codes, and those do show up in some programs.
    Other people have done much more reverse engineering of the chip, down to the gate level even.

    --
    "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
    1. Re:Cool hack, but not very useful by Anonymous Coward · · Score: 2, Interesting

      > Other people have done much more reverse engineering of the chip, down to the gate level even.

      See: http://www.visual6502.org/JSSim/index.html

    2. Re:Cool hack, but not very useful by sjames · · Score: 1

      I thought the best part was reprogramming the 16u2 to bit bang VGA.

  4. Interlacing? WTF? by Megane · · Score: 3, Interesting

    most microcomputers used an interlaced frame buffer where adjacent rows were not stored sequentially in memory

    First of all, I know a lot about micros from the late '70s and early '80s (I was there, maaaan!), and I can't remember a single one other than the Apple II series that didn't display rows sequentially.

    This approach allowed Steve Wozniak to avoid read/write collisions with the video memory without additional circuitry.

    I'm pretty sure the story I heard was that it saved one TTL chip in the counter chain to do it that way, which was just the kind of thing Woz would do.

    Collisions? Exactly what kind of collisions are you talking about? IIRC, the Apple II used interleaved access, where the 6502 would access RAM on every other clock, and the video would access it in between. (This method was also used on the original Macintosh, though the 68000 sometimes needed a wait state.) But that has nothing to do with the funky row counters.

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    1. Re:Interlacing? WTF? by dohzer · · Score: 1

      I don't understand the article's explanation. Anyone care to elaborate?

    2. Re:Interlacing? WTF? by Anonymous Coward · · Score: 0

      I don't understand your questioning of the answer to your question. Was it a joke about out of order read / writes? Or, Recursion? Perhaps just another damn time traveler trolling the chono-impaired?

    3. Re:Interlacing? WTF? by Anonymous Coward · · Score: 0

      most microcomputers used an interlaced frame buffer where adjacent rows were not stored sequentially in memory

      First of all, I know a lot about micros from the late '70s and early '80s (I was there, maaaan!), and I can't remember a single one other than the Apple II series that didn't display rows sequentially.

      The Swedish 8bit Z80 based computer ABC80 did this, with the same 8:1 interleave IIRC. I remember that I was surprised by this.

    4. Re:Interlacing? WTF? by ljw1004 · · Score: 2

      I'm pretty sure ZX Spectrum did interleaving with 8:1 ratio.

      When a game loaded off cassette tape and displayed its loading screen (took about 10-20 seconds I think), you'd see pixel row 0, 8, 16, ... Then pixel row 1, 9, 17, ...

    5. Re:Interlacing? WTF? by ljw1004 · · Score: 2

      Ah, here's an article and great video that demonstrates the ZX spectrum's interlacing:

      http://whatnotandgobbleaduke.b...

    6. Re:Interlacing? WTF? by msauve · · Score: 4, Informative

      Woz designed a video system which very gracefully solved a few problems. For memory, one could choose from static or dynamic RAM. Static was easy to use, but costly. Dynamic RAM was required to be refreshed (accessed every couple of ms), or stored bits would simply be forgotten. But you could get higher capacity chips at lower cost.

      Woz designed the Apple ][ video system so the order it read data from RAM automatically fulfilled the DRAM refresh requirements. And, the video system reads were interleaved with CPU access, so the CPU never had to wait while video or DRAM refresh was happening, as was common with other designs.

      The claim of an 8:1 interlace isn't really correct. The bitmapped memory layout used an 8:8:1 interleave. The first 8 rows were addressed 0x400 apart, that pattern was then repeated 8 times with an offset of 0x80. Details can be Googled. Part of the reason for that is so DRAM refresh hit every required location often enough.

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    7. Re:Interlacing? WTF? by serviscope_minor · · Score: 2

      First of all, I know a lot about micros from the late '70s and early '80s (I was there, maaaan!), and I can't remember a single one other than the Apple II series that didn't display rows sequentially.

      The BBC micro outside of Teletext mode didn't. It had a quite whacky scheme which (in Mode 0) went something like this:

      The first byte corresponds to the first 8 pixels of row 1, one bit per pixel. I can't remember which endianness. The second byte corresponds to the first 8 pixels of row 2. And so on up to and including the 8th row.

      Then byte 9 corresonds to the second 8 pixels of rown 1. They 10th byte corresponds to the second eight pixels of row 2.

      And so on. This was an odd scheme, but since characters were 8x8 pixels, it meant that a character cell's worth could be updated using a sequential 8 byte copy, which made the text in the graphics mode very quickly. It also allowed a reverse lookup, where the OS could examine a character cell bitmap and work out which if any character was present. This manifested itself in the excellent copy key.

      --
      SJW n. One who posts facts.
    8. Re:Interlacing? WTF? by Megane · · Score: 2, Interesting
      So... we have two or three minor examples, hardly the "most microcomputers" as stated in the summary. TRS-80 didn't, Atari (with its complex display line modes) let you do whatever you wanted, Commodore didn't, and no big-iron S-100/SS-50 had non-sequential row mapping. Those were the "most microcomputers" up until the time of the IBM PC in 1982, which also had sequential video row mapping. Also, TMS-9918-based systems and MSX used a video chip with separate RAM, very much sequentially mapped. And ditto for all game consoles of the day.

      BBC Micro (not even available outside of one country) with some modes that did, and couple of Sinclairs (all toy computers from the end of the 8-bit era) hardly a make majority.

      Not having seen the details of what it did in the Apple II, I would not be surprised to find that it was designed to somehow optimize DRAM refresh. No Z-80 computer needed help with DRAM refresh for 16K DRAMs, but it looks like ZX Spectrum being from the late 8-bit era had a 128K option, but not until after it had been 16K/32K for a while.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    9. Re:Interlacing? WTF? by serviscope_minor · · Score: 2

      Mate, WTF?

      You said you couldn't think of any computers other than the Apple II which had non-contiguous rows. I provided an example, which I assumed you wanted since you couldn't think of any others. No need to go on the attack about something I'm not disputing (whether it was the majority).

      Anyway the BBC wasn't exactly unique, as it used the 6845 http://en.wikipedia.org/wiki/M... which also used on other machines. Maybe not the majority, though I've no idea.

      --
      SJW n. One who posts facts.
    10. Re:Interlacing? WTF? by squiggleslash · · Score: 2

      The Spectrum did though for a different reason (despite numerous explanations, I'm not actually convinced the Apple II did it for any reason other than saving TTL chips.)

      The Apple II's original video system was essentially a grid of characters. The Spectrum's was a grid of two-colour pixels followed by a lower resolution grid of palette selection information. The intention for the Spectrum implementation was to make it easier for programmers to draw characters (setting the associated colours at the same time) in a 256x192 grid by allowing the same operation to be performed 9 times (8 pixel lines, plus one palette) with a different offset each time.

      So while Woz was trying to save TTL chips, or something about memory refreshes that might be correct but as explained to me thus far I don't quite get it, the designers at Sinclair were trying to help programmers be a little more efficient. Slightly similar solutions, but for completely different reasons, and with very different consequences.

      --
      You are not alone. This is not normal. None of this is normal.
    11. Re:Interlacing? WTF? by Mr+Z · · Score: 1

      I came here to say pretty much exactly what you did. The funky addressing saved a chip. It's pretty widely documented / known.

      Yes, the video used opposite bus phases from the CPU (and doubled as refresh counter for the DRAMs), so there were no wait states due to video fetch. But as you point out, that has nothing to do with the Apple ]['s weird video memory map.

    12. Re:Interlacing? WTF? by PotatoHead · · Score: 1

      C64 used a non-sequential scheme that mirrored it's character display.

      8 bytes sequential on most machines means a linear series of pixels on the same scan line.

      On the C64, those bytes got stacked up to form a character, each byte on a sequential scan line, assuming one starts at a character boundary.

    13. Re:Interlacing? WTF? by xiox · · Score: 1

      The Amstrad PCW also had a complex memory layout for the screen. It had a "Roller RAM" lookup table for each row which could be modified in order to achieve fast scrolling of the screen. The memory for a single character was also stored sequentially in the memory.

    14. Re:Interlacing? WTF? by Megane · · Score: 1

      The summary said "most microcomputers". Two or three out of a one or two dozen isn't "most". And I wasn't "attacking" you, I was summarizing you and the other two or three people who responded as showing TFS being way off the mark.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    15. Re:Interlacing? WTF? by Megane · · Score: 1

      I can see how that could be true and even sensible for a graphics mode on character-oriented display hardware, but the Apple II had that as part of its text mode row counters. IIRC from having seen the screen cleared many times long ago, hi-res did it with the same number of scan lines as text.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    16. Re:Interlacing? WTF? by Megane · · Score: 1

      Checking wikipedia, that was needed because the display was 100% bit-mapped. You just can't push that much data around on an 8-bit processor for vertical scrolling. On a TRS-80 Color Computer, if you used every register possible with PSHS/PULS, scrolling 6K of bitmapped video data 8 pixels at a time was almost tolerable. The Amstrad had 23K.

      And I'm still mad at myself for not buying up the two or three PCWs I saw at thrift stores back in the '90s, because I later found out that it used the same 3" floppy drive as the Famicom Disk System.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    17. Re:Interlacing? WTF? by Anonymous Coward · · Score: 0

      This is why Woz is my god. The bizarre machinations of the video system and the RWTS disk I/O code are indicative of a truly awesome intellect.

    18. Re:Interlacing? WTF? by hawk · · Score: 1

      for hires, rather than reading the same 40 bytes eight times in a row, and feeding to a character generator,eight different sets of 40 bytes were read (of which six set bits, and two danced around the colorburst signal. the pixel rate was just at the colorburst signal, so shifting half a bit tickled it and gave a different set of colors. Not just clever,but fiendeshly clever)

      hawk

    19. Re:Interlacing? WTF? by hawk · · Score: 1

      And I'm kicking myself for not buying the used Apple ][ in a wooden case at the surplus store around the corner, which I've come to realize wasn't a ][ at all . . . :(

      hawk, who still has his 128k mac and 1802 wirewrap systems

  5. wut? by Anonymous Coward · · Score: 0

    The 6502 in the Apple II only used the memory for 1/2 of each clock cycle and so the Woz synced the video to the cpu clock allowing the video to access the memory on the other half of the clock.

    The 8-1 address reordering was done so that the video properly refreshed the dynamic ram without any additional circuitry.

    Also, the clock frequency of 14.31818 mhz was a multiple of the 3.58 mhz color burst used in a NTSC color tv. This allowed 4 possible colors by setting adjacent pixels on or off at the cost of 1/2 the horizontal resolution.

    I want some of whatever this guy is smoking!

  6. 6502 orgasms by anorlunda · · Score: 1

    Memories of programming with the 6502 instruction set are so delicious that the only comparable thing to compare it to was my first orgasm.

    I actually first did it on a General Electric GEPAC computer in 1966. It had an almost identical instruction set to the 6502, but with 24 bit words. Hip programmers expressed themselves in octal in those days.

    1. Re:6502 orgasms by Anonymous Coward · · Score: 1

      Memories of programming with the 6502 instruction set are so delicious that the only comparable thing to compare it to was my first orgasm. I actually first did it on a General Electric GEPAC computer in 1966.

      I assume you were polite and cleaned off the top of the machine when you were done?

    2. Re:6502 orgasms by Anonymous Coward · · Score: 0

      > I actually first did it on a General Electric GEPAC computer in 1966

      And I hope you washed up afterwards with distilled water. Salty body fluids were really bad for the contacts on those things.

    3. Re:6502 orgasms by Anonymous Coward · · Score: 0

      Forget the troll. I understand exactly how you felt: just like getting inside a flying saucer.

      IMHO it's arguable that the 8080 was better than 6502, though. Each had their advantages.

      The Z80 OTOH was clearly better than all the others. To this day I find it had an elegant design.

    4. Re:6502 orgasms by hcs_$reboot · · Score: 1

      Memories of programming with the 6502 instruction set are so delicious that the only comparable thing to compare it to was my first orgasm.

      Especially true when comparing to the 4 years later coming 8088 and its painfully segmented memory access.

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    5. Re: 6502 orgasms by Anonymous Coward · · Score: 0

      Uh.. The 8086 has segmented memory addresses, basically a movable window of 64k addressable at a time over a total address range of a full megabyte. Readdressable by simply changing an offset register of which there are four. You consider that painful compared to a fixed address space that can ONLY address 64k?

      Granted, most programmers didn't take advantage of all four segment registers on the 8086, because the system their programs ran kludged all over the design.

      But unless you're comparing the 8086 to the 68000 you're talking about processors in completely separate leagues. The 8 bit parts with 16 bit address busses are cute little things in comparison to the 8086.

    6. Re:6502 orgasms by Eunuchswear · · Score: 1

      The Z80 OTOH was clearly better than all the others. To this day I find it had an elegant design.

      Ugh no, The assembly language looks ok-ish, but look at the instruction lengths and timing for anything using IX or IY, and tons of undocumented instructions that may or may not work on different versions of the chip.

      --
      Watch this Heartland Institute video
    7. Re:6502 orgasms by macs4all · · Score: 2

      Forget the troll. I understand exactly how you felt: just like getting inside a flying saucer.

      IMHO it's arguable that the 8080 was better than 6502, though. Each had their advantages.

      The Z80 OTOH was clearly better than all the others. To this day I find it had an elegant design.

      I disagree.

      Although I absolutely love coding Assembly language on the 6502, and have written tens of thousands of lines of same; I would rather the 6809 had taken off. The design of that processor was truly forward-thinking. It was a shame that only the Radio Shack (RIP) Color Computer (CoCo) employed that CPU; because it was closer to an 8/16 bit "miniature 68k" than it was to the 6800/6801/6501/6502 designs.

      Among other things, It had an A and B Accumulator, which you could concatenate into one 16 bit accumulator, a hardware 8 x 8 MUL instruction, a 16-bit X Index Register, and a USER Stack Pointer, which was PERFECT for implementing things like FORTH, or for using as an Interrupt Stack. Along with this, it had a nearly-orthagonal Instruction Set, and almost as many Addressing Modes as the 6502. And, IIRC, unlike the 8080 and especially the Z80, it was nearly as miserly with cycles-per-instruction as the 6502 (which was nearly an early RISC chip in its efficiency). In fact, it was so far advanced from anything else Motorola was making at the time, that I wondered why the 6801 core was the one that got pulled-forward into all the Mot. Microcontrollers of the 80s and 90s, instead of the 6809. It was almost like someone from outer space dropped in to Motorola, threw the 6809 designs on the table, and then beamed-out again!

    8. Re:6502 orgasms by zaft · · Score: 1

      YES. 6809 was a truly elegant design that deserved to have far more success than it did.

    9. Re:6502 orgasms by macs4all · · Score: 2

      YES. 6809 was a truly elegant design that deserved to have far more success than it did.

      Yeah, I always wondered about that. It never got transmogrified into an "HC" version, never-ever became a Microcontroller (oh, how much more fun the HC11 would have been, if it was based on a 6809 instead of a 6801?), etc. This article states incorrectly that a modified version of the 6809 forms the CPU in the HC11; but I remember from the datasheet that it was called a modified 6800 (the 6801); so?

      The other possibility is that Motorola was already investing heavily into the 68k R&D, and didn't want to lose potential "sockets" to the less-expensive 6809. In fact, IIRC, the Mac was originally slated to have a 6809; but no one wanted to port QuickDraw (which was written in 68k for the Lisa) back to 6809; so they went ahead and put a 68k into the first Macs (overall, IMHO, a VERY wise decision!)...

      By the way, that Wikipedia article does contain a fairly long list of products (some very successful!) that employed the 6809 or Hitachi's improved 6309 version. I remember Williams used it in their video games and electronic-ified Pinball machines, and also that the Fairlight CMI used dual out-of-phase 6809s as its main CPU(s); but I never knew that Yamaha put the 6309 into the DX-7 synth.

      So, are there any Slashdotters out there that might know the inside story on why the 6809 never went further? Was it because Motorola lost its way so bad in the mid-late 90s? Was it the 68k? Or what?

    10. Re:6502 orgasms by Megane · · Score: 1

      But the 6809 was the best. (inb4 6309 which no computer ever shipped with)

      It is unfortunate that Motorola didn't use it as the basis of the 6811 and 6812, but it was probably harder to express the 6809 in microcode.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    11. Re:6502 orgasms by Megane · · Score: 2

      The Vectrex video game system also used the 6809.

      And my guess as to why Moto didn't use the 6809 as the basis of the 6811/6812 is because they wanted to use microcode, and it would have been harder because of the post-byte index modes.

      And then there was the 68000... apparently the marketing guys back in the day were dead set on only selling thousands of 68000s for full-blown Unix-type systems, and against selling millions of 68000s as an embedded processor. By the time of the Macintosh/Amiga/Atari ST when they finally wised up, it was too late, the IBM PC had already happened.

      My piecing together of various legends about IBM choosing the 8088 was that they were interested in the 68008, Motorola didn't want to commit to IBM's deadline, IBM said never mind, then Motorola ended up releasing it by that date after all. And that is how you lose a war that you didn't even know had started. In my opinion, the lack of a large flat address space in the leading architecture set the industry back by ten years.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    12. Re:6502 orgasms by macs4all · · Score: 1

      The Vectrex video game system also used the 6809.

      Yeah, I saw that in the Wikipedia article.

      And my guess as to why Moto didn't use the 6809 as the basis of the 6811/6812 is because they wanted to use microcode, and it would have been harder because of the post-byte index modes.

      Interesting. I am not familiar enough with the internal circuit topology of the '09 to comment. Did the PLA approach take more, less, or about the same silicon as if the '09 would have used a microcoded approach? Because that was around the time when Mot. (And other) electronics salespeople started taking about "nanoacres of silicon", LOL! So, if the microcode-based designs were done in less silicon, and with the microcontroller price-wars heating-up, I could see Mot. Mgmt. Axing the 6809 for MCUs.

      And then there was the 68000... apparently the marketing guys back in the day were dead set on only selling thousands of 68000s for full-blown Unix-type systems, and against selling millions of 68000s as an embedded processor.

      Well, if you are really talking about "embedded" applications, one cannot forget the MC68HC33x series, with that mega-cool TPU. And slightly OT, Frickin' Fords ended up with PowerPCs in them, FFS!!!

      By the time of the Macintosh/Amiga/Atari ST when they finally wised up, it was too late, the IBM PC had already happened.

      Yes, but that is an ENTIRELY different story...

      My piecing together of various legends about IBM choosing the 8088 was that they were interested in the 68008, Motorola didn't want to commit to IBM's deadline, IBM said never mind, then Motorola ended up releasing it by that date after all. And that is how you lose a war that you didn't even know had started.

      But the 68008 was dog-slow, so IBM probably would have jumped-ship anyway.

      In my opinion, the lack of a large flat address space in the leading architecture set the industry back by ten years.

      Not for the Mac, Amiga nor Atari...

    13. Re:6502 orgasms by Anonymous Coward · · Score: 0

      If you're seeing massive similarities between coding and orgasm, you've got to at least consider the possibility that you're doing one of them wrong somehow :-)

    14. Re:6502 orgasms by Agripa · · Score: 2

      So, are there any Slashdotters out there that might know the inside story on why the 6809 never went further? Was it because Motorola lost its way so bad in the mid-late 90s? Was it the 68k? Or what?

      It may be the same reason we switched from 68HC11 to PIC and IBM used the 8088 instead of the 68000; Motorola was never customer friendly except with their literature. Availability and second sources were common problems.

      Another possibility is that with the release of the 68008, there was no reason to further market the 6809.

  7. CoCo by AndyKron · · Score: 1

    Tandy Color Computer used the opposite side of the clock signal to generate video.

  8. Steve Wozniak... by Anonymous Coward · · Score: 0

    One of the gentile geniuses of our time

    1. Re:Steve Wozniak... by macs4all · · Score: 1

      One of the gentile geniuses of our time

      ...and one of the Gentle Geniuses, too!

  9. No Interlacing by pcjunky · · Score: 2

    The video produced by the Apple II is not interlaced at all. Many video devices used to mix and overlay video in studios had trouble with this fact. True the video memory is not sequential but that's not the same thing as interlacing. Way back in 1983 I had lunch with Woz and a half dozen or so mostly game developers at the Independent Developrs conference. I asked him if he would want to change anything about the design of the II. He said he might add the two chips needed to make the video memory map sequential. Several of us including myself said that most of us would still use a lookup tables for updating video memory anyway (it was faster) and that didn't really matter much. In the end he agreed.

    As far as the 6502 being the shittiest processor of it's generation I would have to disagree. True it has fewer registers and instructions (RISC?) than most even older designs like the 8080, but it did have some unique adressing modes that made it the perfect processor for the graphics the Apple did. This coupled with the fact you can use the 256 bytes of zero page much faster and much like processor registers (indexed memory referencing) made it one neat machine.

    1. Re:No Interlacing by mark-t · · Score: 1

      This coupled with the fact you can use the 256 bytes of zero page ...

      Except for the anoying detail that if you wanted to be interoperable with anything that was written in Applesoft Basic and ProDOS, weren't very many of them to really play around with.. One would usually have to resort to saving most of the entries they wanted to use, and then restoring them upon exit. This works, but I recall it wasn't very amenable to being interrupted with reset. While writing a custom reset handler mitigated some of that, in practice one would always need to reserve at least a couple of zero page memory locations that weren't being used by anyone else to actually have a genuinely robust system that wouldn't ever crash. When I was writing my Applesoft multitasker operating system as a replacement for ProDOS's basic.system back in the mid 1980's (I find it personally amusing when recalling the endeavor that I wrote it before I ever even knew what the word "multitasking" was, actually), I found that I needed to still have a few zero page memory locations that I would have to completely rely on to not get stomped on anything else even when my code was not actually running in order to have a usable system.

    2. Re:No Interlacing by macs4all · · Score: 1

      ProDOS

      ProDOS was a Disk Operating System, not a Language.

      Oh, and I wrote a preemptive RTOS in 6502 for my Apple ][-based Stage Lighting Controller back in 1982, using a hardware "time-slicer" (interrupt-generator) running at 2 KHz, long before I knew what an RTOS was.

      And I also wrote a "virtual-memory" system for Applesoft BASIC programs, that used the On-Error GoTo and "Ampersand Hook" to allow a programmer (we didn't call them "Developers" in those days!) to either write a program in "modular" form, or, in the case of the program I actually wrote it for, slice up an already-existing program into "modules", which would then be loaded directly from Disk (including startup, I could load an 8 KB module in about a second, and MUCH faster with a Corvus Hard Drive!), and silently continue without disturbing the Variables or anything else. As long as you didn't do something utterly stupid like try to break execution up across a Loop, it worked an absolute TREAT! Took an Applesoft program that was SO out-of-memory that it spent nearly all of its time doing Garbage Collection, and turned it into a completely-usable system.

    3. Re:No Interlacing by mark-t · · Score: 1

      You did preemptive multitasking on the Apple //? Way cool.... mine was strictly a cooperative multitasker, although it considered waiting for input (either from a remote connection or the keyboard) to be indicative that it was safe for the task requesting input to yield control. I had no hardware clock in my apple, so I could not do full-preemptive multitasking. As I said, when I was writing it I didn't even know the word 'multitasking' would describe what I was doing... I always described the mechanism as having "swappable stacks and I/O" so that it was easy to write in basic, for example, a multi-user bulletin board where the main program didn't have to concern itself with coordinating input and output for all other users (this was actually the specific purpose for which it was designed). With my OS extension taking care of which thread was talking to which I/O system (which modem, or the keyboard/screen) it actually was pretty cool.

      And I know full well that prodos's basic.system is not a language, it was the part of the OS that was loaded into regular ram and interfaced with applesoft basic, understanding such things as ctrl-d on output being a DOS request. the mechanism I used replaced the basic.system file entirely. At the time, it was the largest assembly project I had ever tackled, clocking in at about 6.5K after it was assembled and linked, and sat at the top of ram, where basic.system ordinarily resided.

    4. Re:No Interlacing by macs4all · · Score: 1

      You did preemptive multitasking on the Apple //? Way cool.... mine was strictly a cooperative multitasker, although it considered waiting for input (either from a remote connection or the keyboard) to be indicative that it was safe for the task requesting input to yield control. I had no hardware clock in my apple, so I could not do full-preemptive multitasking.

      Thanks for the props, LOL!

      Looking back on it, It was actually pretty close to a true, modern RTOS, with semaphores and "mailboxes", "task-suspending", and the whole bit. I had 16 "slots" (threads) that could be managed at a time. I called the functions "TaskMaster", IIRC. It was born out of the need to have multiple asynchronous functions, such as crossfades, sequences (which I could even "nest" up to 8 levels deep!), and to manage the CHARACTER-BASED, OVERLAPPING "Windowing" system I created for it as well. The hardware timer was part of the 16-channel self-refreshing "Channel" cards that were part of the system. Each card had two 7489 16x4 dual-ported "RAMs", and the 2k oscillator ran a 4-bit counter that kept the on-board 16-channel sample/hold (this was before DMX!) refreshed without processor intervention. in this fashion, you could use up to 4 cards in an Apple ][ to have a total of 64 channels of analog-dimming C.V. output, all without CPU intervention for the refresh. Each card had its own 2k "clock"; but also had a switch, so you could enable just one of them to be the "time-slice" clock. Worked a treat! In fact, I look back at that project (which eventually went exactly nowhere), and wonder how I did all that in 6502 Assembler, not knowing a damned thing about RTOS design, and very little about interrupt-driven systems, let alone windowed UIs (heck, hardly ANYONE knew much about that in 1982!!!) ...

      As I said, when I was writing it I didn't even know the word 'multitasking' would describe what I was doing... I always described the mechanism as having "swappable stacks and I/O" so that it was easy to write in basic, for example, a multi-user bulletin board where the main program didn't have to concern itself with coordinating input and output for all other users (this was actually the specific purpose for which it was designed). With my OS extension taking care of which thread was talking to which I/O system (which modem, or the keyboard/screen) it actually was pretty cool.

      Sounds like it!

      And I know full well that prodos's basic.system is not a language, it was the part of the OS that was loaded into regular ram and interfaced with applesoft basic, understanding such things as ctrl-d on output being a DOS request. the mechanism I used replaced the basic.system file entirely. At the time, it was the largest assembly project I had ever tackled, clocking in at about 6.5K after it was assembled and linked, and sat at the top of ram, where basic.system ordinarily resided.

      Yeah, what finally killed my enthusiasm for my lighting controller was the fact that, no matter how hard I tried, and no matter how much I modified the RWTS (Read/Write Track & Sector) floppy code, there was STILL a small sliver of time where Interrupts had to be DISABLED during the read of the "Next Song" in the "Set List", causing a momentary (around 1/2 second) glitch in any crossfade and/or sequence that was in progress.

      I investigated switching from an Apple ][ to a standalone product using an embedded Amiga 500 (because their OS was INCREDIBLE at multitasking!), and then to a dedicated design using 3 microcontrollers (a 65816, a 6809, and a 6502) each running at 2 MHz, with a common memory-pool running at 6 MHz (so the CPUs would each "act" as if they had exclusive access to the memory; but could still do "message-passing" through agreed-upon "mailboxes"); but neither of those ever got past the drawing-board stage...

      Good times, good times...

    5. Re:No Interlacing by Megane · · Score: 1

      I started on the Z-80 and later had 6809, so I never could find much love for the 6502. But it started a revolution by being designed for high yield, and initially sold for $20 each quantity one when the 6800/8080/Z-80 processors were more like $200 each Q1.

      I once got to use an Ohio Scientific Challenger III. It had 3 processors, 6502, 6800, and Z-80, but the people who owned it only ever used the 6502 with a version of Microsoft BASIC. It supported multi-user by having a 48K RAM card for each user at 0000-BFFF. That's one way to get an extra zero page.

      The 6809 had a direct page register to select which page was the "zero" page, and the 65816 did as well. Then each independent task could have its own zero page, though you would have to use up entire 256 byte chunks for each task's data area to do that.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    6. Re:No Interlacing by Dadoo · · Score: 1

      Wow, you don't come across people who've even heard of Ohio Scientific that often, much less actually used one. The first computer I ever used was a C2-OEM, with 8" floppies, and I have a (still working) C4P in my garage.

      --
      Sit, Ubuntu, sit. Good dog.
    7. Re:No Interlacing by hawk · · Score: 1

      Prodos?

      PRODOS????

      damned newbies . . .

      hawk

    8. Re:No Interlacing by hawk · · Score: 1

      >Wow, you don't come across people who've even heard of
      >Ohio Scientific that often, much less actually used one.

      *sigh*

      get off my lawn, I suppose. (I just reseeded it anyway)

      hawk, suddenly feeling old

  10. I wonder by guruevi · · Score: 1

    I wonder how Woz feels about this kind of development. He has a /. account so if you read this: did you ever think there would be computers powerful enough and people interested enough to implement your brainchild on a credit card sized machine with different architecture within your lifetime. What do you think of the arduino movement in comparison with the DIY computer movement from our time?

    --
    Custom electronics and digital signage for your business: www.evcircuits.com
    1. Re:I wonder by macs4all · · Score: 1

      I wonder how Woz feels about this kind of development. He has a /. account so if you read this: did you ever think there would be computers powerful enough and people interested enough to implement your brainchild on a credit card sized machine with different architecture within your lifetime. What do you think of the arduino movement in comparison with the DIY computer movement from our time?

      Well, considering that Apple pretty-much did an Apple-//e-on-a-chip back in 1991, I'd say he'd be rather bemused.

      But supportive, nonetheless...

    2. Re:I wonder by hawk · · Score: 1

      Earlier than that.

      The Mac IIfx had a pair of chips each of which effectively had such a creature. One ran the serial/network ports, and I forget the other.

      Had apple sold that chip, combined with the network that ran on the second (unused) pair of standard home wiring, they could have *owned* home automation years ahead . . .

      hawk

  11. Re: Is /. that hipster? by Anonymous Coward · · Score: 0

    Calling it the Apple ][ is more of a mullet than a hipster thing.

  12. Re:Is /. that hipster? by Anonymous Coward · · Score: 0

    What the fuck is a Apple ][?, What the fuck does ][ stand for?, Are you so fucking chic that typing 2, or II is a problem?. Fucking hipsters.

    Boot one. The image on the screen was the string "][", unless you're booting a //e or //c.

  13. Re:Is /. that hipster? by Kozar_The_Malignant · · Score: 1

    That's the way Apple Computer typed the name and trademarked logo, Apple ][. Possibly the first known use of 133t-speak, and definitely pre-hipster. You are showing your lack of geek cred.

    --
    Some mornings it's hardly worth chewing through the restraints to get out of bed.
  14. Woz Sez He Regrets the Video Addressing Shortcut by macs4all · · Score: 1

    I probably can't find the quote; but I distinctly remember reading an interview with Woz, stating (among other things), paraphrasing, "If I had known how popular the Apple ][ was going to be, I would have gone ahead and included the two extra chips it would have taken to make the video memory addressed sequentially."

    Instead, we had BASCALC and HBASCALC calls in the Apple Monitor ROM.

    And we liked it!

  15. Re:Is /. that hipster? by macs4all · · Score: 1

    What the fuck is a Apple ][?, What the fuck does ][ stand for?, Are you so fucking chic that typing 2, or II is a problem?. Fucking hipsters.

    OMFG! You're kidding, right?

    You must IMMEDIATELY turn in every single computing device you own.

  16. Absolutely fabulous article! by blind+biker · · Score: 2

    This was easily the best, by far, technical article ever linked in a Slashdot submission.

    I just had to express my amazement. Holy shit, such deliciously nerdy article...

    --
    "The agriculture ministry is not in charge of Gundam" - Japanese ministry official.
    1. Re:Absolutely fabulous article! by Anonymous Coward · · Score: 0

      If you enjoyed that you should take a look a the one from the guy who booted Linux on an ATmega, http://dmitry.gr/index.php?r=05.Projects&proj=07.%20Linux%20on%208bit

  17. Re:Is /. that hipster? by Megane · · Score: 1

    It's a 1980's hipsterism. So clearly it's someone getting too senile to use II or 2.

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }