Difference between revisions of "Sweet16"
Line 1: | Line 1: | ||
This is a masterpiece of 6502 programming as far as I'm concerned [[User:Lucky|Lucky]] 19:06, 17 May 2007 (PDT) | This is a masterpiece of 6502 programming as far as I'm concerned [[User:Lucky|Lucky]] 19:06, 17 May 2007 (PDT) | ||
− | |||
− | |||
{{wp-orig}} | {{wp-orig}} | ||
− | + | '''SWEET16''' is an interpreted byte-code language invented by Steve Wozniak and implemented as part of the [[Integer BASIC]] ROM in the Apple II computer. It was created because Wozniak needed to manipulate 16-bit pointer data in his implementation of [[BASIC]], and the [[Apple II]] was an 8-bit computer. | |
− | '''SWEET16''' is an interpreted byte-code language invented by Steve Wozniak and implemented as part of the [[Integer BASIC]] ROM in the Apple II computer. It was created because Wozniak needed to manipulate 16-bit pointer data in his implementation of [[BASIC]], and the Apple II was an 8-bit computer. | ||
SWEET16 code is executed as if it were running on a (non-existent) 16-bit processor with sixteen, internal 16-bit little-endian registers, R0 through R15. Some registers have well-defined functions: | SWEET16 code is executed as if it were running on a (non-existent) 16-bit processor with sixteen, internal 16-bit little-endian registers, R0 through R15. Some registers have well-defined functions: | ||
Line 15: | Line 12: | ||
The 16 virtual registers, 32 bytes in total, are located in the [[zero page]] of the Apple II's real, physical memory map (at $00-$1F). The actual SWEET16 interpreter is located from $F689 to $F7FC. | The 16 virtual registers, 32 bytes in total, are located in the [[zero page]] of the Apple II's real, physical memory map (at $00-$1F). The actual SWEET16 interpreter is located from $F689 to $F7FC. | ||
− | According to Wozniak, the SWEET16 implementation is a model of frugal coding, taking up only about 300 bytes in memory. SWEET16 runs about 10 times slower than the equivalent native [[MOS Technology 6502|6502]] | + | According to Wozniak, the SWEET16 implementation is a model of frugal coding, taking up only about 300 bytes in memory. SWEET16 runs about 10 times slower than the equivalent native [[MOS Technology 6502|6502]]. |
== External Links == | == External Links == | ||
* [http://www.6502.org/source/interpreters/sweet16.htm An extensive discussion of the interpreter and source code] | * [http://www.6502.org/source/interpreters/sweet16.htm An extensive discussion of the interpreter and source code] |
Revision as of 03:16, 18 May 2007
This is a masterpiece of 6502 programming as far as I'm concerned Lucky 19:06, 17 May 2007 (PDT)
SWEET16 is an interpreted byte-code language invented by Steve Wozniak and implemented as part of the Integer BASIC ROM in the Apple II computer. It was created because Wozniak needed to manipulate 16-bit pointer data in his implementation of BASIC, and the Apple II was an 8-bit computer.
SWEET16 code is executed as if it were running on a (non-existent) 16-bit processor with sixteen, internal 16-bit little-endian registers, R0 through R15. Some registers have well-defined functions:
- R0 is the accumulator.
- R14 is the status register.
- R13 stores the result of all comparison operations for branch testing.
- R15 is the program counter.
The 16 virtual registers, 32 bytes in total, are located in the zero page of the Apple II's real, physical memory map (at $00-$1F). The actual SWEET16 interpreter is located from $F689 to $F7FC.
According to Wozniak, the SWEET16 implementation is a model of frugal coding, taking up only about 300 bytes in memory. SWEET16 runs about 10 times slower than the equivalent native 6502.