Browse this growing collection of Apple-1 programs.
A tribute to history and their hackers.

Run them in the emulator right away, or just on the real machine.

version

Stringout, original version

by Chris Espinosa in 1976

A handy string output subroutine for do-it-yourselfers.

assemblywithin 4k

History

Dr. Dobb's Journal published this program by Chris Espinosa in September 1976. More or less two months after the introduction of the Apple-1, he writes:

... I believe you should also concentrate on HANDY (Helpful Algorithms for Novice Do-It-Yourselfers) programs to save bytes in space-limited systems. I enclose my example: a string immediate-output subroutine for 6502-based systems.

It was actually an early example of a software component that could be reused by other microcomputer hobbyists. He continues his letter:

It has been implimented on an Apple Computer and copies of the program are being delivered to the Homebrew library and the CCC repository.

Chris was only 14 years old at the time he wrote this program and was Apple's employee number 8. It could be that he created this program in Steve Jobs's parents' garage, where the company was housed at the time.

Improvements

A couple of months later, an improved version of the routine was published in Dr. Dobb's. It was Marcel Meier who used some byte saving tricks to make the program smaller, without changing the function of the program. This was done regularly in those days because memory was expensive.

In February 1977 this program was revisited again by H. Gordon from the University of California, Berkeley. His revision was even more compact and easier to relocate in RAM. Note that this version is not compatible with the Apple-1 as it starts at memory location 200, it overlaps the memory used as input buffer storage for the Apple-1 keyboard.

Mistake?

Interestingly, the original published code is not working on the Apple-1. The actual output of a character is handled at location 0413. On this row, a JSR instruction with absolute memory address EFFF is being executed:

0413  20  FF  EF         JSR OUT    OUTPUT IT

However, the correct jump subroutine instruction here should be 20 EF FF, pointing to the ECHO-routine at FFEF of the Apple-1's ROM. Chris mentioned "has been implimented on an Apple Computer...", meaning the Apple-1. This seems to be a mistake, the high and low byte of the address should be swapped.

Note that all running versions published on this site are corrected and work on the Apple-1, however the assembly sources are untouched.

Instructions

The workings of the original version was explained by Chris in his letter:

This routine saves pointers, loops, etc. normally used for string output by sequentially outputting the ASCII characters represented in hex in the bytes immediately following the Jump to Subroutine. After reading a terminating character (null), it returns to the instruction following the end of the string. No string addresses or lengths are needed.

After loading the routine, it can be used in another program like this:

... 20 00 04 48 45 4C 4C 4F 20 57 4F 52 4C 44 21 00 ...
    ^        <---------------------------------> ^   ^
    JSR 0400           ASCII characters        null  program continues 

It first does a jump subroutine to location 0400, the location where this routine is loaded. Then, the string of ASCII characters follow. These can be of any length, but should be terminated with a null character. After the routine outputs the ASCII characters, it returns to the memory location after the null, resuming the calling program. See more details on 6502 instructions here.

The Hellorld! program can be recreated using this routine, another example:

300: 20 00 04 48 45 4C 4C 4F 52 4C 44 21 00 RETURN

300R RETURN

Note that the program 'hangs' after outputting to the screen, because the computer tries to execute the arbitrary code that is in memory after the 00. Also, the Meier's version can be used in the same way, but Gordon's version differs, it is explained in Dr. Dobb's.

Pfff, all this to put something on the screen? Yeah, later programmers were spoiled with the simple print-statements.

References

Screenshot of Stringout, original version
RAM: 4KB
CPU PC=0000

                

Use your keyboard to interact with this Apple-1 program.

Emulated with HoneyCrisp v1.2.7,
check here for more details.


Historical reference

In 1976, the Apple-1 Computer was advertised for $666.66 and came with 4K of on-board memory. For a $120 extra, this doubled to 8K of RAM. The provided Operation Manual included the circuit diagram and assembly source code of Wozmon, the operating system.

The Apple-1 Computer main board
The Apple-1 Computer main board.

The Apple Cassette Interface (or ACI) was used to load and save programs from cassette tape. The ACI Manual showed how to install it (the main board had to be jumpered correctly) and explained how it had to be used. Priced at $75, it included a cassette of Apple BASIC.

The Apple-1 Cassette Interface or ACI
The Apple-1 Cassette Interface or ACI.
Cassette with Apple BASIC
Cassette with Apple BASIC.

Software

Woz wrote a BASIC interpreter by himself. It was tiny enough to fit in 4K of memory, but did not support floating point arithmetic. The software itself was free. The Preliminary Apple BASIC Users Manual explained how to write your own games and programs with it.

Cassette tapes could be bought as an original accessory to your new Apple-1. A total of nine programs were available and listed $5 each. Pick one below and go back in time.

At the time, people were also inspired by publications like 101 BASIC Computer Games. They spent their evenings and nights to key-in the games, but soon were disappointed to discover that some of these did not work at all because of the missing floating points... Arghh.

Dive deeper? Read more here and here.

Memory

The Apple-1 has a 16-bit address bus and 64kB of addressable space. Within this space the 6502-processor can use the different parts of the computer:

  • read from ROM, where Wozmon is stored,
  • manipulate RAM, where user programs and BASIC are loaded,
  • and communicate with peripherals, like the attached keyboard and the cassette interface (ACI).

Woz designed a jumper area on the Apple-1 mainboard where the hobbyist-user could configure how memory should be organized. This was very flexible and made extension of the Apple-1 possible.

The full 64kB is split into 16 equal banks of 4kB each by this jumper area. The banks range from 0 to F, hexadecimal. A bank can be tied to one part of the computer: e.g. the ROM, upper RAM chips or a board in the expansion slot.

Jumper area on the Apple-1 mainboard
Jumper area on the mainboard of the Apple-1.

The default configuration is shown above. For example bank E (address space $E000-$EFFF) was usually tied to the eight lower RAM chips on the Apple-1 mainboard, indicated by W and the black wire in the figure. Usually BASIC was loaded here.

Wozmon

No windows yet. It was called a monitor program back then, the predecessor of an operating system. It allowed reading and modifying the computer's memory and starting programs. Woz his monitor was stored in only 256 bytes of ROM.

Part of the Wozmon source.
Part of the Wozmon source code, stored in ROM.

To load it, the user had to press RESET after powering on the computer. A back slash \ appeared on the screen with a flashing @ below, the cursor. Indicating the Apple-1 was ready for commands.

Try Wozmon yourself by pressing the Run button and after that Reset in the above emulator (any program). Then type 280 RETURN to read a memory location. Values are hexadecimal, so range from 0 to F. Change memory with 280: AB RETURN. Read it again and wow you changed memory!

Follow this excellent course to learn more. The original manual explains Wozmon as well (in Section II) and lists the assembly source code.

Transfer software to a real Apple-1 Order now

Use the 8BitFlux.com Keyboard Serial Terminal to connect to an Apple-1 with this website. It uses the Web Serial API locally and is supported by Chrome and Edge browsers. The Wozmon code of any program can be transferred right away.

The Keyboard Serial Terminal connected to an Apple-1
The Keyboard Serial Terminal connected to an Apple-1.

Use the Serial button to transfer the current program to an Apple-1. For example, BASIC takes around 20 seconds to transfer, at a speed of 57.6 kbps. The board is compatible with the high-speed TurboType™ format. It also performs a CRC check and has an error LED indicator.

Done transferring the game or program? Switch the input to the attached Apple-1 keyboard by pressing a button and enjoy it. This makes a great kit for hobbyists, museums or public events. More info »

Emulation

It is easy to run the software with one of these emulators as well:

This website uses the HoneyCrisp emulator. More information can be found here. It has its own software library with even more programs to explore.

View a comparison of emulators here.

Further exploration

  • Talk on Applefritter, the home ground of the Apple-1 Owners Club.
  • For an anarchistic collection of Apple docs and software see the Asimov FTP.
  • Antoine's collection of Apple cassettes, with scans and audio extracts of the tapes.
  • The Apple-1 Registry keeps track of all real Apple-1 machines that ever existed.
  • The story of a homebrew Apple-1 computer by Bryan.
  • Vince Briel's GitHub repository has all the information on his Replica 1.
  • P-Lab lists interesting Apple-1 projects on his website.
  • San Bergman's website has a lot of well-documented information on the Apple-1, from its internal workings to programming it in assembly.
  • Take the online course in 6502 assembly language programming.

Credits

An initiative of 8BitFlux.com. This website can be put to full use with a Keyboard Serial Terminal adapter board, which enables you run software on a (real) Apple-1 right away.

The textual descriptions and screenshots of the programs listed on this website are licensed under CC BY 4.0

A lot of recognition goes out to Landon J. Smith for being so kind to share his HoneyCrisp Emulator (also available on GitHub) for use on this website. Many Thanks to Uncle Bernie for his support and provision of his TurboType™ algorithm, which is part of his Apple-1 Toolchain. Last but not least, all this was not possible by all the authors of Apple-1 software and other emulators. The hobby computer enthusiasts of the past, but also people of the present, who keep this hobby so alive. Thank you all.

Disclaimer

This website is not associated with Apple Inc. in any way.

It tries to be a tribute to (their) history. It wants to list only software that is already considered to be in the public domain, or its license permits further publication. The (online) sources of the program and other references are listed when known.

No AI is used to describe the software packages here. Human mistakes happen, so please report any nonconformities.

Like it?

Buy me a ☕ coffee.

Check out my products, or just spread the word! Incorrect or missing content can be reported here. Thanks!

No trackers and zero cookies 🍪

Made behind an 🍎 in The Netherlands.