+------------------------------------------------------------------------

TOPIC -- Apple II -- WOZPAK Sweet-16 article by Steve Wozniak

+------------------------------------------------------------------------

SWEET 16: A Pseudo 16 Bit Microprocessor by Steve Wozniak

Description:

------------

While writing APPLE BASIC for a 6502 microprocessor, I repeatedly encountered a variant of MURPHY'S LAW. Briefly stated, any routine operating on 16-bit data will require at least twice the code that it should. Programs making extensive use of 16-bit pointers (such as compilers, editors, and assemblers) are included in this category. In my case, even the addition of a few double-byte instructions to the 6502 would have only slightly alleviated the problem. What I really needed was a 6502/RCA 1800 hybrid - an abundance of 16-bit registers and excellent pointer capability.

My solution was to implement a non-existant (meta) 16-bit processor in software, interpreter style, which I call SWEET 16.

SWEET 16 is based on sixteen 16-bit registers (R0-15), which are actually 32 memory locations. R0 doubles as the SWEET 16 accumulator (ACC), R15 as the program counter (PC), and R14 as the status register. R13 holds compare instruction results and R12 is the subroutine return stack pointer if SWEET 16 subroutines are used. All other SWEET 16 registers are at the user's unrestricted disposal.

SWEET 16 instructions fall into register and non-register categories. The register ops specify one of the sixteen registers to be used as either a data element or a pointer to data in memory, depending

on the specific instruction. For example INR R5 uses R5 as data and ST @R7 uses R7 as a pointer to data in memory. Except for the SET instruction, register ops take one byte of code each. The non-register ops are primarily 6502 style branches with the second byte specifying a +/-127 byte displacement relative to the address of the following instruction. Providing that the prior register op result meets a specified branch condition, the displacement is added to the SWEET 16 PC, effecting a branch.

SWEET 16 is intended as a 6502 enhancement package, not a stand alone processor. A 6502 program switches to SWEET 16 mode with a subroutine call and subsequent code is interpreted as SWEET 16 instructions. The nonregister op RTN returns the user program to 6502 mode after restoring the internal register contents

(A, X, Y, P, and S). The following example illustrates how to use SWEET 16.

300

B9

00

02

LDA

IN,Y

;get a char

303

C9

CD

 

CMP

#"M"

;"M" for move

305

D0

09

 

BNE

NOMOVE

;No. Skip move

307

20

89

F6

JSR

SW16

;Yes, call SWEET 16

 

 

 

 

 

 

 

Page 43
Image 43
Apple II manual Lda In,Y, Cmp, BNE Nomove, Jsr

II specifications

The Apple II, launched in April 1977, was one of the first highly successful mass-produced microcomputer products. It marked a significant leap in personal computing, setting standards for future developments in the industry. Created by Steve Wozniak and Steve Jobs, the Apple II differentiated itself with its user-friendly design, appealing aesthetics, and robust capabilities.

One of the standout features of the Apple II was its open architecture, which allowed users to expand and enhance the computer's functionality. This design enabled hundreds of third-party hardware and software developers to contribute to its ecosystem, resulting in an array of peripherals, including printers, modems, and storage devices. The Apple II utilized a MOS Technology 6502 microprocessor running at a clock speed of 1 MHz. Initially equipped with 4 KB of RAM, the machine could be expanded to 48 KB, accommodating more complex applications and programs.

The Apple II was also notable for its colorful graphics. It was one of the first computers to support color display, offering a 6-color palette with a resolution of 280x192 pixels in 16 colors when using its Color Graphics Card. This feature significantly enhanced the visual appeal of games and educational software developed for the platform, making computing more accessible and entertaining for various audiences.

Apple's commitment to user experience was evident in the design of the machine. It featured an integrated keyboard and a plastic case, which was both durable and visually appealing. The self-contained design included drive bays for floppy disk drives, allowing for quicker data access than traditional tape drives. It also supported audio output, enabling sound effects and music, a novelty at the time.

The introduction of the Apple DOS operating system further underscored the machine's capabilities. DOS streamlined file management and made it easier for users to navigate and manage their data. The combination of hardware and software positioned the Apple II as an educational tool and a gaming platform, fostering a vibrant software ecosystem.

The Apple II family continued to evolve, with variations like the Apple II+, IIe, and IIgs being introduced over the years. These iterations brought enhancements in memory, processing power, and graphics capabilities. The legacy of the Apple II endures, not only as a foundational product in personal computing but also as a symbol of innovation that paved the way for future advancements in technology. Its impact is still felt today, as it inspired countless developers and shaped the trajectory of the computer industry.