MOS Technology 6502

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured CPU on the market by a considerable margin, costing less than one-sixth the price of competing designs from larger companies such as Motorola and Intel. It was nevertheless faster than most of them, and, along with the Zilog Z80, sparked a series of computer projects that would eventually result in the home computer revolution of the 1980s. The 6502 design was originally second-sourced by Rockwell and Synertek and later licensed to a number of companies; it is still made for embedded systems.
A MOS 6502 processor in a DIP-40 plastic package.
A MOS 6502 processor in a DIP-40 plastic package.
Contents
[hide]

    * 1 History and use
    * 2 Technical description
    * 3 Detailed behavior
    * 4 Dubious features
    * 5 16-bit derivatives
    * 6 32-bit derivatives
    * 7 Acceleration
    * 8 6502 in popular culture
    * 9 See also
    * 10 References
    * 11 External links

[edit] History and use

The 6502 was designed primarily by the same engineering team that had designed the Motorola 6800. After quitting Motorola en masse, they quickly designed the 6501, a completely new processor that was pin-compatible with the 6800 (that is, it could be plugged into motherboards designed for the Motorola processor, although its instruction set was different). Motorola sued immediately, and MOS agreed to stop producing the 6501 and went back to the drawing board.

The result was the "lawsuit-compatible" 6502, which was by design unusable in a 6800 motherboard. Motorola had no objection. However, this left MOS with the problem of getting developers to try their processor, so engineer Chuck Peddle designed the KIM-1 single-board computer. Much to their surprise, the KIM-1 sold well to hobbyists and tinkerers as well as to the engineers it was intended for. The related Rockwell AIM 65 control/training/development system also did well. Another roughly similar product was the Synertek SYM-1.

The 6502 was introduced at $25 in September 1975, when the 6800 and Intel 8080 were selling for $179.[1] At first many people thought the new chip's price was a hoax or a mistake, but shortly both Motorola and Intel had dropped their chips to $79.[2] These price reductions actually legitimized the 6502, which started selling by the hundreds.

One of the first "public" uses for the design was the Apple I computer, introduced in 1976. The 6502 was next used in the Apple II, and the Commodore PET. It was later used in the Atari home computers, the BBC Micro family, and a huge number of other designs now lost to history, such as Ohio Scientific. The 6510, a direct successor of the 6502 with a digital I/O port and a three-state bus, was the CPU utilized in the Commodore 64 home computer. (Commodore's disk drive, the 1541, had a processor of its own-it too was a 6502.)

Another important use of the 6500 family was in video games. The first to make use was the Atari 2600 videogame console. The 2600 used an offshoot of the 6502 called the 6507, which had fewer pins and, as a result, could address only 8 KB of memory. Millions of the Atari consoles would be sold, each with a MOS processor. Another significant use was by the Nintendo Famicom, a Japanese video game console. Its international equivalent, the Nintendo Entertainment System, also used the processor. The 6502 used in the NES was a second source version by Ricoh, a partial system-on-a-chip, that lacked a binary-coded decimal mode but added 22 memory-mapped registers for sound generation, joypad reading, and sprite list DMA. Called 2A03 in NTSC consoles and 2A07 in PAL consoles (the difference being the clock divider ratio and a lookup table for audio sample rates), this processor was produced exclusively for Nintendo.

Even today, 31 years after its introduction, some universities, including the Eindhoven University of Technology, the Netherlands, University of Tasmania, the University of Applied Sciences in Cologne, Germany, University of Exeter in Devon, United Kingdom, Carleton College, Hull University, University of Brescia in Italy and Universidad APEC in Santo Domingo, Dominican Republic still use the processor to teach assembly language, computer architecture and digital integrated systems.

[edit] Technical description

The 6502 is an 8-bit processor with a 16-bit address bus. The internal logic runs at the same speed as the external clock rate, but despite the slow clock speeds (typically in the neighborhood of 1 or 2 MHz), the 6502's performance was actually competitive with other CPUs using significantly faster clocks. This is partly due to a simplistic state machine implemented by combinatorial (clockless) logic to a greater extent than in many other designs; the two phase clock (supplying two synchronizations per cycle) can thereby control the whole machine-cycle directly. Like most simple CPUs of the era, the dynamic NMOS 6502 chip was not sequenced by a microcode ROM but used a PLA (which occupied about 15% of the chip area) for instruction decoding and sequencing. Like most typical eight-bit microprocessors, the chip does some limited overlapping of fetching and execution.

The low clock frequency moderated the speed requirement of memory and peripherals attached to the CPU, as only about 50% of the clock cycle was available for memory access (due to the asynchronous design, this percentage varied strongly among chip versions). This was critical at a time when affordable memory had access times in the range 450-250ns. The original NMOS 6502 was minimalistically engineered and efficiently manufactured and therefore cheap-an important factor in getting design wins in the very price-sensitive game console and home computer markets.
6502 Pin configuration (40-Pin DIP)
6502 Pin configuration (40-Pin DIP)

Like its precursor, the Motorola 6800 (but unlike Intel 8080 and similar microprocessors) the 6502 has very few registers. At the time the processor was designed, small bipolar memories were relatively fast, so it made sense to rely on RAM instead of wasting expensive NMOS chip area on CPU-registers.

The 6502's registers included one 8-bit accumulator register (A), two 8-bit index registers (X and Y), an 8-bit processor status register (P), an 8-bit stack pointer (S), and a 16-bit program counter (PC). The subroutine call/scratchpad stack's address space was hardwired to memory page $01, i.e. the address range $0100-$01FF (256-511). Software access to the stack was done via four implied addressing mode instructions whose functions were to push or pop (pull) the accumulator or the processor status register. The same stack was also used for subroutine calls via the JSR (Jump to Subroutine) and RTS (Return from Subroutine) instructions, and for interrupt handling.

The chip used the index and stack registers effectively with several addressing modes, including a fast "direct page" or "zero page" mode, similar to that found on the PDP-8, that accessed memory locations from address 0 to 255 with a single 8-bit address (saving the cycle normally required to fetch the high-order byte of the address)-code for the 6502 used the zero page much as code for other processors would have used registers. On some 6502-based microcomputers with an operating system, the OS would use most of zero page, leaving only a handful of locations for the user.

Addressing modes also included implied (1 byte instructions); absolute (3 bytes); indexed absolute (3 bytes); indexed zero-page (2 bytes); relative (2 bytes); accumulator (1); indirect,x and indirect,y (2); and immediate (2). Absolute mode was a general-purpose mode. Branch instructions used a signed 8-bit offset relative to the instruction after the branch; the numerical range -128..127 therefore translates to 128 bytes backward and 127 bytes forward from the instruction following the branch (which is 126 bytes backward and 129 bytes forward from the start of the branch instruction). Accumulator mode used the accumulator as an effective address, and did not need any operand data. Immediate mode used an 8-bit literal operand.

The indirect modes were useful for array processing and other looping. With the 5/6 cycle "(indirect),y" mode, the 8-bit Y register was added to a 16-bit base address in zero page, located by a single byte following the opcode. As the resulting address could be anywhere in the 16-bit memory range, the Y register was a true index register, as opposed to the 6800, which had one 16-bit address register. Incrementing the index register to walk the array byte-wise took only two additional cycles. With the less frequently used "(indirect,x)" mode the effective address for the operation was found at the zero page address formed by adding the second byte of the instruction to the contents of the X register. Using the indexed modes, the zero page effectively acted as a set of 128 additional (though very slow) address registers.

A Byte magazine article once referred to the 6502 as "the original RISC processor," due to its efficient, simplistic, and nearly orthogonal instruction set (most instructions work with most addressing modes), as well as its 256 zero-page "registers". The 6502 is technically not a RISC design however, as arithmetic operations can read any memory cell (not only zero-page), and some instructions (inc, rol etc.) even modify memory contrary to the basic load/store philosophy of RISC. Furthermore, orthogonality is equally often associated with "CISC". However the 6502 performed reasonably well compared to other contemporaneous processors such as the Z80, which used a much faster clock rate, and the 6502 has been credited as being inspirational to RISC processors such as the ARM.[3]

See the Hello world! article for a simple but characteristic example of 6502 assembly language.

[edit] Detailed behavior

The processor's non-maskable interrupt input is edge sensitive, which means that if the source of an NMI holds the line low NMI's are effectively disabled.

The simultaneous assertion of the NMI (non-maskable) and IRQ (maskable) hardware interrupt lines causes IRQ to be ignored. However, if the IRQ line remains asserted after the servicing of the NMI, the processor will immediately respond to IRQ, as IRQ is level-sensitive. Thus a sort of built-in interrupt priority was inadvertently established in the 6502 design.

[edit] Dubious features

The original 6502 and its NMOS derivatives are noted for having a variety of undocumented instructions, which vary from one chip manufacturer to the next. The 6502's instruction decoding is implemented in a hardwired logic array (similar to a programmable logic array) which is only defined for 151 of the 256 available opcodes. The remaining 105 trigger strange and hard-to-predict actions (e.g., immediately crashing the processor, performing several valid instructions at once, or simply doing nothing at all). Eastern House Software developed the "Trap65", a device that plugged between the processor and its socket to convert (trap) unimplemented opcodes into BRK (software interrupt) instructions. Some programmers utilized this feature to extend the 6502's instruction set by providing functionality for the unimplemented opcodes with specially written software intercepted at the BRK instruction's 0xFFFE vector. All of the undefined opcodes have been replaced by NOP instructions in the 65C02 CMOS version (although with varying byte sizes and execution times).

The 6502's memory indirect jump instruction, JMP (<address low-word>), is partially broken. If <address low-word> was hex xxFF (i.e. any word ending in FF), the processor would not jump to the address stored in xxFF and xxFF+1, but rather the one in xxFF and xx00. This defect continued through the entire NMOS line, but was fixed in the CMOS derivatives.

The N (result negative) ,V (sign overflow) and Z (zero) status flags are not valid when performing arithmetic operations while the processor is in BCD mode, as these flags reflect the binary, not BCD, result. This limitation was removed in the CMOS derivatives. Therefore, this feature may be used to cleanly distinguish CMOS from NMOS CPU versions without using any illegal opcodes ([2]).

If the processor happens to be in BCD mode when a hardware interrupt occurs it will not revert to binary mode. This quirk could result in hard-to-solve bugs in the interrupt service routine if it failed to clear BCD mode before performing any arithmetic operations. For example, the Commodore 64's kernel did not correctly handle this type of situation, requiring that IRQs be disabled or revectored during BCD math operations. This issue was addressed in the CMOS derivatives as well.

The 6502 instruction set includes BRK (opcode $00), which is technically a software interrupt (similar in spirit to the SWI mnemonic of the 6800). BRK is most often used to interrupt program execution and start a machine language monitor for testing and debugging during software development. It could also be used to route program execution using a simple jump table (analogous to the manner in which the 8088 and derivatives handle software interrupts by number). Unfortunately, if a hardware interrupt occurs at the same time the processor is fetching a BRK instruction, the NMOS version of the processor will fail to execute BRK and instead proceed as if only a hardware interrupt had occurred. This fault was corrected in the CMOS implementation of the processor.

The JSR (call subroutine) instruction pushes the address of the last byte of the call instruction on to the stack, not the expected address of the next instruction. The RTS (return) instruction pulls the return address off the stack and adds one to it before placing it into the program counter, resulting in automatic compensation for this design quirk. This characteristic would go unnoticed unless you pulled the return address to pick up parameters in the code stream (a common 6502 programming idiom). It remains a characteristic of 6502 derivatives to this day.

[edit] 16-bit derivatives

The Western Design Center designed and produced the 65C816 processor, a 16-bit successor to the 65C02, as well as a hybrid offshoot called the 65C802 which was a 65C816 core with a 64 KB address space in a 65(C)02 pin-compatible package-it could be plugged into a 6502 board and would function as a 65C02, or it could be configured via software to expose its 16 bit accumulator and index registers. Few 65C802 parts were sold, and the chip is no longer produced. The 65C816 is still widely used, both as a discrete processor and as the core of a microcontroller.

Mitsubishi (now Renesas Technology) made a line of 16-bit microcontrollers with an architecture very similar to the 65816, though it was not 100% compatible.

Synertek published a data sheet and application notes on the SY6516, a 16-bit derivative of the 6502, but the part was never introduced.

[edit] 32-bit derivatives

The Western Design Center is developing the W65T32 Terbium, a compatible 32-bit follow-up to the W65C816. The Terbium is named after the 65th element as 65 is the prefix to all of WDC's microprocessor number identifiers. The chip has a 32-bit address bus, a 16-bit data bus, and a variable length instruction set.

[edit] Acceleration

Many users of 1 MHz 6502-based systems soon wished their computers could go faster. A number of companies sold replacement hardware to speed up those systems. Generally, 6502 system accelerators were based on:

    * 6502 or 65C02 chips running at a faster clock rate
    * 65C816 chips in 6502 emulation mode, running at a much faster clock rate (up to 20 MHz)
    * 4 MHz and 8 MHz Zip Chip processors, made by Zip Technology, and 10 MHz Rocket Chips, made by Bits and Pieces, all using onboard cache RAM and proprietary glue logic to speed up processing while remaining compatible with a 1 MHz motherboard. Zip Technology's patent #4,794,523 eventually forced Bits and Pieces to cease manufacturing of the Rocket Chip.

[edit] 6502 in popular culture

In the science fiction movie The Terminator (1984), starring Arnold Schwarzenegger, the audience at one point is treated to a view through the T-800 Model-101 robot character's eye/camera display with some 6502 assembly/machine code program fragments scrolling down the screen. Also shown is the output from a run of an Apple II checksum program called KEY PERFECT 4.0, published in Nibble magazine.

Bender, a fictional android "industrial robot" manufactured in 2998 AD, and a main character in the animated TV series Futurama, was revealed to have a 6502 as his "brain", in the episode "Fry and the Slurm Factory."

[edit] See also
Wikibooks
Wikibooks has a book on the topic of
6502 Assembly

    * Lisa assembler
    * MOS Technology 6502-based

[edit] References

   1. ^ James (September 1975). "James Advertisement". Popular Electronics 8 (3): pg 107.  James is now Jameco Electronics. The 8080 CPU was $149.95, the 8008 CPU was 29.95. A 2102 1K bit static RAM was $4.95. Their price for a 8080A CPU was 37.95 in the June 1976 issue.
   2. ^ Digi-Key (December 1975). "Digi-Key Advertisement". Popular Electronics 8 (6): pg 124.  The 8080A CPU was $69.50. A 2102 1K bit static RAM was $3.50. Digi-Key's price for a 8080A was $34.95 in the June 1976 issue.
   3. ^ [1]

    * Leventhal, Lance A. (1986). 6502 Assembly Language Programming 2nd Edition. Osborne/McGraw-Hill. ISBN 0-07-881216-X.
    * Leventhal, Lance A. (1982). 6502 Assembly Language Subroutines. Osborne/McGraw-Hill. ISBN 0-931988-59-4.
    * Mansfield, Richard (1983). Machine Language For Beginners. Personal Computer Machine Language Programming For The Atari, VIC, Apple, Commodore 64, And PET/CBM Computers (or, Machine Language Programming For BASIC Language Programmers). Greensboro, North Carolina: Compute! Publications, Inc. Copyright  1983, Small System Services, Inc. ISBN 0-942386-11-6.
    * Zaks, Rodnay (1983). Programming the 6502 (Fourth Edition). Sybex, Inc. ISBN 0-89588-135-7.
    * Zaks, Rodnay (1982). Advanced 6502 Programming. Sybex, Inc. ISBN 0-89588-089-X.

[edit] External links

General information:

    * 6502.org - the 6502 microprocessor resource - Repository and portal (Mike Naberezny)
    * 650x information - Concise description, photos of MOS and second source chips; at cpu-collection.de (Dirk Oppelt)
    * a2DMAMagic - The secret, transparent, high-throughput 6502 DMA channel (by Jorge Chamorro Bieling)

Instruction set features:

    * 6502 - the first RISC P - With link to concise 6502 programming chart in PDF (Eric Clever)
    * "The 6502 Gets Microprogrammable Instructions" - By Dennette A. Harrod, in BYTE, Volume 5, Number 10 (October 1980), pp.282-5

Emulators and simulators:

    * List of 6502 software emulators - At Zophar's Domain (Sam Michaels)
    * 6502 simulator for Windows - At Dan Boris' homepage hosted by The Atari Gaming Headquarters
    * Web-based 6502 compatible compiler and emulator written in JavaScript - by Stian Sreng

Early 6502 computers:

    * Apple I Owners Club - Hosted by the Applefritter site (Tom Owad)
    * KIM-1 schematics - At The Obsolete Technology Website (anonymous collector)

Hardware accelerators:

    * 6502 accelerator information - At the Apple II History website (Steven Weyhrich)
    * "Underneath the Hood of the SuperCPU" - By Jim Brain, in C=Hacking, Issue #12, Version 1.3, March 1996 (search for "@(#)cmdcpu")


This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.


65xx-series CPUs from MOS Technology, second source/clone vendors, and the Western Design Center

MOS 4510 ? MOS 6501 ? MOS 6502 ? WDC 65C02 ? Hudson HuC6280 ? Ricoh 2A03 ? MOS 6507 ? MOS 6508 ? MOS 6509
MOS 6510 (and 7501, 8500, 8501) ? MOS 8502 ? MOS 65CE02 ? WDC 65802 ? WDC 65816 ? Ricoh 5A22 ? Nintendo SA-1
Retrieved from "http://en.wikipedia.org/wiki/MOS_Technology_6502"

Categories: MOS Integrated Circuits | 65xx microprocessors | 1975 introductions | Microprocessors

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

MOS Technology 6502

aus Wikipedia, der freien Enzyklopdie
Wechseln zu: Navigation, Suche
Teil einer C64-Platine mit einigen Chips von MOS Technology, u. a. einer 6510-CPU.
Teil einer C64-Platine mit einigen Chips von MOS Technology, u. a. einer 6510-CPU.
MOS 6502-Prozessor
MOS 6502-Prozessor
Mitsubishi M50747 und M50734 Mikrocontroller, basierend auf 6502
Mitsubishi M50747 und M50734 Mikrocontroller, basierend auf 6502

Der MOS Technology 6502 ist ein 8-Bit-Mikroprozessor von MOS Technology, Inc., der 1975 auf den Markt kam. Aufgrund seiner Unkompliziertheit und vor allem des im Vergleich zu den etablierten Intel- und Motorola-Prozessoren sehr niedrigen Preises bei groer Leistungsfhigkeit wurde er in vielen Heimcomputern (z. B. dem Commodore VC-20 und seinem Vorgnger PET 2001, dem Atari 800 XL, Apple II und BBC Micro), zahlreichen Schachcomputern (z. B. dem Mephisto Polgar mit 5 oder 10 MHz) und Peripherie-Gerten verbaut. Auch andere Mitglieder dieser Prozessorfamilie waren sehr erfolgreich, so der 6510, ein Bestandteil des Commodore 64, und der 6507 in den Atari-Spielkonsolen. Hauptkonkurrent war damals der Zilog Z80, der z. B. in den Sinclair- und Schneider-Computern sowie in CP/M-Rechnern zu finden war. Der Prozessor wurde unter der Leitung von Chuck Peddle entwickelt.

Das Design des 6502 wurde an den Motorola 6800 angelehnt. Der Befehlssatz ist hnlich, aber statt eines 16-Bit Index-Registers werden zwei 8-Bit Index-Register verwendet, deren Wert auf eine im Speicher (auch im Programmcode) vorgegebene 16-Bit-Adresse addiert wird. Deswegen haben 6502-Programme einen anderen Stil: Fr Arrays, die grer als 256 Bytes sind, muss ein zustzlicher Programmieraufwand betrieben werden. Andererseits geht die Manipulation von 8-Bit-Werten auf einem 8-Bit-Mikroprozessor erheblich schneller vonstatten. Anders als 16-Bit-Register des 6800 oder etwa Z80, welche eine absolute Adresse darstellen, stellen die 8-Bit-Register des 6502 lediglich einen Array-Index dar, und in manchen Fllen kann ein einziger 8-Bit-Increment- oder Decrement-Befehl sowohl das Zhlen der Adressen als auch das Setzen der Bedingung fr den Schleifenabbruch bei index=0 leisten, was zu kompakten und schnellen Schleifen fhrt.

Technisch war der 6502 durchaus innovativ:

    * Er war der erste Mikroprozessor mit rudimentter (zweistufiger) Pipeline-Architektur, d. h. wenn nur noch interne Schaltschritte fr einen Befehl notwendig waren, konnte der nchste Befehl bereits gleichzeitig aus dem Speicher geholt werden. Eine echte Pipeline mit berlappung der Lese- und Schreibzugriffe mehrerer Befehle gab es aber noch nicht.
    * Sein Befehlssatz kann - zumindest im Vergleich zur direkten Konkurrenz Intel 8080 - als "fast orthogonal" angesehen werden.

Die 6502 lebt heute als Prozessorkern der Mikrocontroller Mitsubishi/Renesas (38000/740 Series) und VMC Scal von Micronas Intermetall (eingesetzt in Automotive- und Fernseh-Technik) weiter und wird zudem in vielen PC-Tastaturen als Controller verwendet.

Als Cross-Compiler wurde hufig der cc65 eingesetzt.
Inhaltsverzeichnis
[Verbergen]

    * 1 Technische Daten
          o 1.1 Befehlssatz
    * 2 Varianten des 6502
    * 3 Trivia
    * 4 Literatur
    * 5 Weblinks

Technische Daten [Bearbeiten]

    * Technologie: NMOS, HMOS, CMOS
    * Anzahl Transistoren: ca. 5000
    * Taktfrequenz: traditionell 20 kHz bis 4 MHz; CMOS-Version: 0 bis 14 MHz
    * Taktzyklen je Befehl: 2 bis 7
    * Adressraum: 64 KiB, dabei kein separater I/O-Adressraum (wie z. B. beim Intel 8080), d. h. alles I/O wird per Memory Mapped I/O realisiert
    * Adressbusbreite: 16 Bit
    * Datenbusbreite: 8 Bit
    * Interrupts: ein NMI, ein IRQ, sowie Software-Interrupt ber BRK-Befehl
    * Befehle: traditionell 56, CMOS-Version: 70
    * Adressierungsarten: traditionell 13, CMOS-Version: 16
    * Byte-Reihenfolge: Little Endian
    * Register:
          o Akkumulator, 8 Bit
          o 2 Index-Register (X und Y), 8 Bit, eigentlich ein Offset-Register: es wird zu einer 16-Bit-Adresse addiert, die je nach Adressierungsart im Opcode oder in der Zeropage steht.
          o Stapelzeiger, 16 Bit, allerdings ist das High-Byte konstant auf $01 festgelegt, so dass der Stapel nur 256 Bytes umfasst.
          o Prozessorstatus-Register, 7 Bit (Flags: Carry, Zero, Decimal, Interrupt Disable, Break*, unbenutzt, Overflow, Negative)
          o Befehlszhler, 16 Bit
          o Die Zeropage (Adressbereich $00xx) kann aufgrund ihrer speziellen, schnelleren Adressierungsarten auch als Register-File angesehen werden

*Hinweis: Das Break-Flag existiert nur auf dem Stack nach einem BRK-Befehl, nicht im Prozessor selbst (es hat keine eigenen Setz- und Testbefehle und wird auch durch die Befehle PLP und PHP nicht verarbeitet).

Befehlssatz [Bearbeiten]

Hier ein paar Beispiele von Maschinenbefehlen, bzw. deren Mnemonics:

LDA #$FF     - ldt ("LoaD") das Register "Akkumulator" mit dem Hex-Zahleninhalt FF (also 255 dez.)

LDA $C000    - ldt den Akkumulator mit dem Inhalt der absoluten Speicheradresse
               HEX C000 (also 49152 dez.)

LDA ($24),Y  - ldt den Akkumulator mit dem Inhalt jener Speicheradresse,
               welche sich ergibt, indem zu der 16-Bit-Zahl in den Adressen HEX 24
               und HEX 25 der Inhalt des Y-Registers addiert wurde.
               Siehe Zeropage, indirekte Adressierung

STA $C000    - speichert ("STore") den Inhalt des Akkumulators (1 Byte) in der Speicheradresse HEX C000

CMP #$7F     - vergleicht ("CoMPare") den Inhalt des Akkumulators mit dem Zahlenwert HEX 7F (127 dez.)
               und setzt die Flags entsprechend

CPX $C0      - vergleicht den Inhalt des Registers X mit dem Inhalt der Speicherzelle HEX C0

CPY #$C0     - vergleicht den Inhalt des Registers Y mit dem Zahlenwert HEX C0

BEQ $FC00    - "Branch if result is EQual" = verzweigt, wenn der vorausgegangene Vergleich
               eine Gleichheit ergab (wird anhand der Flags erinnert). In diesem Fall wrde das
               Maschinenprogramm an Adresse FC00 weiterlaufen, andernfalls einfach beim nchsten Befehl.

BNE $FC00    - "Branch if result is Not Equal" = verzweigt, wenn der Vergleich
               eine Ungleichheit ergab.

INX          - "INcrement X" = erhht den Inhalt des Registers X um 1.

DEX          - "DEcrement X" = verringert den Inhalt des Registers X um 1.

JSR $FC00    - "Jump to SubRoutine": springt zur Subroutine (Unterprogramm) nach HEX FC00.
               Die Rcksprungadresse besteht aus 2 Byte und wird auf dem Stack (Stapel) abgelegt.

RTS          - "ReTurn from Subroutine": kehrt aus der Subroutine zurck und fhrt bei dem Befehl direkt
               hinter dem zuletzt ausgefhrten JSR fort. Dabei wird die Rcksprungadresse
               aus dem Stack ausgelesen.

In Assembler-Programmtexten des 6502 haben das Dollar- und Nummern-Zeichen sowie die Klammern folgende Bedeutung:

 $ - Der auf das $-Zeichen folgende Wert ist eine in HEX angegebene Zahl. Ohne $ ist bei Ziffern eine Dezimalzahl, bei Buchstaben eine symbolische Konstante gemeint.

 # - Der auf das #-Zeichen folgende Wert ist eine direkt zu verwendende ("immediate") Zahl und nicht eine Speicheradresse, deren Inhalt zu verwenden ist.

 ( ) - Die in den Klammern genannte Speicheradresse ist nicht direkt zu verwenden, sondern enthlt selbst wiederum die gemeinte Speicheradresse (indirekte Adressierung).

Varianten des 6502 [Bearbeiten]

    * 2002
          o von Yamaha
    * 38000
          o Microcontrollerfamilie von Renesas Technology mit 740er Kern. Siehe 740
    * 6501
          o Gehuse- und signalkompatibel (nicht softwarekompatibel) zum Motorola 6800 (nicht Motorola 68000). Musste nach einer Patentverletzungsklage Motorolas eingestellt werden.
    * 6502
          o eingesetzt in den Commodore-PET- und -CBM-Modellen PET 2001 bis CBM 8296 sowie im VC20 und den Floppy-Laufwerken 1540 und 1541.
          o eingesetzt im Apple II, im Apple II+, und im nicht erweiterten Apple IIe
          o eingesetzt im Ohio Scientific Superboard II
    * 6502A
          o 2 MHz Taktung
          o eingesetzt im Apple III
          o eingesetzt in 8-Bit Atari Homecomputern wie Atari 400, Atari 800 mit 1,79 MHz
    * 6502B
          o 3 MHz Taktung
    * 6502C
          o extra Pin namens HALT
          o eingesetzt in 8-Bit Atari Homecomputern wie Atari 800XL, Atari 130 XE usw. mit 1,79 MHz Taktung
    * 65C02
          o CMOS-Technologie
          o Zustzliche Befehle und Adressierungsmodi
          o Einige Befehle bentigen unter bestimmten Voraussetzungen weniger Taktzyklen als im 6502
          o Eingesetzt im erweiterten Apple IIe und im Apple IIc
          o Eingesetzt im Atari Lynx mit 4 MHz-Taktung
          o Hergestellt von Western Design Center
    * 65SC02
          o Leicht eingeschrnkter Befehlssatz (keine Bitbefehle, echte Teilmenge des 65816) gegenber dem 65C02
          o Eingesetzt im Watara Supervision
          o Hergestellt von GTE und CMD
    * 65CE02
          o Zustzliche 16-Bit-RMW-Befehle
          o Relative Sprnge und Unterprogrammaufrufe mit 16-Bit-Offset
          o Eingesetzt im Commodore C65 (4510) und A2232
          o 3,54 MHz Taktung
    * 65C102, 65C112
          o Fr Multiprozessorbetrieb ausgelegt, wobei der 65C112 als Slave dient
          o Eingesetzt im BBC Micro
    * 6503, 6505, 6506
          o 12 Bit Adressbus (4 KiB)
    * 6504, 6507
          o 13 Bit Adressbus (8 KiB), eingesetzt z. B. in Commodore-Tastaturen (Amiga 1000) und in Floppy-Laufwerken (Atari 1050)
          o 6507 eingesetzt im Atari 2600 mit 1,19 MHz-Taktung
    * 6508
          o Eingesetzt im NES
    * 6509
          o 20 Bit Adressbus (1 MiB) durch internes Bankswitching
          o Eingesetzt in den Commodore-PET-II Modellen (CBM 500, 600 und 700).
    * 6510
          o 6502 mit zustzlichem 6-Bit-I/O-Port
          o Eingesetzt im C64 mit 985 kHz (PAL-Version) respektive 1022 kHz (NTSC-Version) Takt
    * 6511
          o Microcontroller mit I/O-Ports, serieller Schnittstelle und RAM, von Rockwell
    * 65F11
          o Variante des 6511 mit integriertem Forth-Interpreter
    * 6512 bis 6518
          o Variante des entsprechenden 650x, aber ohne eingebauten Oszillator.
    * 65C00/21, 65C29
          o Multiplizier-Befehl
          o von Rockwell
    * 6570, 6571
          o Eingesetzt in Amiga-Tastaturen
    * 6280
          o Entwickelt von NEC auf Basis der 65SC02
          o incl. MMU (2 MiB adressierbar)
          o Eingesetzt in der PC Engine
    * 6702
          o eingesetzt nur im Plug-in Board des Commodore SuperPET
    * 740
          o Microcontrollerfamilie von Renesas Technology (vormals Mitsubishi Electric)
          o Basierend auf der 65C02
          o mehr als 100 Varianten
          o bis 60 KiB ROM/PROM/Flash onchip
          o bis 2 KiB RAM onchip
          o erweiterter Befehlssatz
                + Multiplikation
                + Division
                + Erweiterte Bitbefehle
                + Stop/Wait
          o Neue Adressierungsarten
                + Transfer (Speicher Speicher Befehle)
                + Special Page
                + Bit-Relativ
          o Bis 17 MHz
    * 7501
          o 6502 in HMOS-Technologie
          o Eingesetzt im C16 und Plus/4
    * 8500
          o 6510 in CMOS-Technologie
    * 8502
          o 6510 umschaltbar auf 2 MHz
          o 7-Bit-I/O-Port
          o Eingesetzt im C128
    * 65802 (65C802)
          o Variante des 65816, die pinkompatibel zum 6502 ist, Adressraum daher wie dieser nur 64 KiB
          o Zum direkten Austausch des 6502 in bereits bestehenden Schaltungen gedacht
          o Bis zu 16 MHz
    * 65816 (65C816)
          o Entwickelt von Western Design Center
          o Eingesetzt u. a. im Apple IIgs, Nintendo SNES, den meisten Beschleunigungskarten fr 6502-Rechner
          o 16-Bit-Register und ALU
          o 24-Bit-Adressbus (16 MiB)
          o Bis zu 24 MHz
          o Braucht im Vergleich zum 6502 (wohl wegen des zustzlichen Adressbytes) fr viele Befehle einen Takt lnger

Trivia [Bearbeiten]

Der fiktive Roboter Bender aus der Zeichentrickserie Futurama hat einen 6502-Prozessor als CPU.

In dem Spielfilm Terminator (1984) wird aus Sicht des Terminators ein 6502-Assembler-Programm angezeigt (vermutlich vom Apple IIe). Weiterhin wird das Ergebnis des Prfsummen-Programms KEY PERFECT 4.0, das im Nibble magazine verffentlicht wurde, angezeigt.

Literatur [Bearbeiten]

    * Bagnall, Brian: On The Edge: The Spectacular Rise and Fall of Commodore, ISBN 0973864907
    * Rodnay Zaks: Programmierung des 6502. Jetzt auch mit 6510, 65C02, 65SC02, ISBN 3887456009
    * Lance A. Leventhal: 6502. Programmieren in ASSEMBLER, ISBN 3921803101

Weblinks [Bearbeiten]

    * 6502.org - Informationen zum 6502-Prozessor
    * Western Design Center - Entwickler der 65C02/65816
    * DEMA - Distributor fr WDC in Deutschland

        * Datenblatt von Dema

    * CCOM - Commodore Computer Online Museum
    * 6502-Seite von Homecomputermuseum.de
    * 6502 Prozessoren und Varianten: Bilder und Beschreibungen auf cpu-collection.de
    * CPU-World - berblick ber die verschiedenen Hersteller

Von "http://de.wikipedia.org/wiki/MOS_Technology_6502"

Kategorien: Mikroprozessor 

