SWEET16

SWEET16 is an interpreted byte-code language invented by Steve Wozniak and implemented as part of the Integer BASIC ROM in the Apple II series of computers. It was created because Wozniak needed to manipulate 16-bit pointer data, and the Apple II was an 8-bit computer.
SWEET16 was not used by the core BASIC code, but was later used to implement several utilities. Notable among these was the line renumbering routine, which was included in the Programmer's Aid #1 ROM, added to later Apple II models and available for user installation on earlier examples.
SWEET16 code is executed as if it were running on a 16-bit processor with sixteen internal 16-bit little-endian registers, named through . Some registers have well-defined functions:
The 16 virtual registers, 32 bytes in total, are located in the zero page of the Apple II's real, physical memory map (at –), with values stored as low byte followed by high byte. The SWEET16 interpreter itself is located from to in the Integer BASIC ROM.
According to Wozniak, the SWEET16 implementation is a model of frugal coding, taking up only about 300 bytes in memory. SWEET16 runs at about one-tenth the speed of the equivalent native 6502 code.