The reason the PC register is stored in si is that this makes it possible to load the next opcode or 8-bit operand using lodsb, and of course 16-bit operands can be loaded via lodsw.Īll of the CPU emulation code occupies 64KB of contiguous memory, with the emulation routine for each opcode located at the beginning of each 256-byte segment. The Z and N flags are stored directly in the 8086 ZF and SF, while dh stores the C and the O flags.
Most of the state of the emulated 6502 CPU is stored in 8086 registers: The Hollywood blockbuster The Terminator featured some 6502 code for Apple ][ in several scenes, seen on the Terminator's HUD: Wozniak himself set an example of what's possible, managing to fit in 12 KB of memory a Basic interpreter, a program editor, and a debugger. The result was a cheap, powerful and interesting machine.īesides, programmers love solving complex problems and take pride in exceptionally clever masterpieces.
This minimalist approach seems counter-intuitive, but only if difficult to write software is seen as a downside yet software - unlike hardware - is free to distribute. This improved Electric Duet sounded like this). And yet, Paul Lutus gave us The Electric Duet, which plays two voice music (though it produced an audible 14,080 Hz noise as a side effect of duty cycle modulation Alex wrote his own player from scratch to fix this, and hacked into the binary code to replace the original player. In contrast, the Wozniak design does about 10% of what most reasonable people would consider sufficient for it to be called Disk ][, each access of address $C030 inverts the polarity of the speaker, and that's all of the support you get from the hardware. The IBM controller has its own CPU, supports DMA, and does a lot of heavy lifting that makes it easy to write the software. If you wonder how can these two cards do the same thing, they really don't. The Wozniak design is below (not to scale): :) The above is the floppy disk controller for the IBM PC/XT. If one studied the overall system design, it became clear that Wozniak was driven by a simple principle: if there was a way to save 5c in production cost, at the expense of making the life of the programmer 100x more difficult, he'd totally go for it.Īs an example, consider the floppy disk controller for Apple ][: He alone designed the hardware as well as the system software. The company rejected it, the entire team quit and joined MOS Technology, which produced what became known as the 6502 (the Bulgarians copied that too, making the 100% compatible CM630).īut as great as the 6502 was, at the heart of Apple ][ is Wozniak's brilliant design. The team worked for Motorola and proposed an idea for a new, cheaper, faster CPU. The Apple ][ uses the 6502 CPU, which was designed by a team lead by Chuck Peddle. Naturally, the actual Apple ][ looked a lot nicer:
Instead, they were available for free use at schools and at public computing centers.īut enough about this Commie business. I don't know how much one of these cost, because in Communist Bulgaria such things were considered "means of production" and nobody could own one. The entire bottom of the case, on which everything else is bolted on, is a solid 2mm steel plate which doubles as a giant heat sink for 100% silent operation:
It is perhaps unfair to introduce the illegal clone before the original American masterpiece, but let me assure you, behind the commie skin the brilliance of Wozniak's design was intact, and it was built like a tank. I'm kidding of course, the above is the Bulgarian-made clone of the Apple ][. Next was the Apple ][, which had a yellowish skin:Ĭuriously, it supported the Cyrillic alphabet right out of the box. You either write the code every time you turn the power on, or else read it from a cassette tape. Back in those days, when you booted up the computer, there was no software loaded on it. This is a nice surviving example, mounted in a briefcase: He designed and put together the Apple I, which was sold as a kit, meaning the computer was sold barebones, and had to be assembled by the buyer. The humble beginningsĪpple Computer started in Steve Wozniak's garage. Run DOSBOX, and on its command prompt enter the following commands (replacing with the location where you unzipped Appler):įeel free to create GitHub issues, hopefully I can help.Īppler's startup disk boots the classic Apple ][. Double-click the downloaded file to unzip it.
To download Appler, click the green Code button in GitHub, and in the drop-down menu select Download ZIP. This distribution contains the executable binaries as well as the complete source code.Īt the time of this writing, Apple ][ games running on Appler running on DOSBOX running on MacOS. Alexander Patalenski | Emil Dotchevski IntroductionĪppler is an Apple ][ emulator ever made it is probably the fastest also, although this distinction is no longer important.