Part Number Hot Search : 
74F244SC 102BM SSG9922E DB101 PQ20VZ5U 1SMB160A 44BDR2G 100EA
Product Description
Full Text Search
 

To Download W65C02S Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  the western design center, inc. february 2004 W65C02S data sheet ? the western design cente r, inc., 2003. all rights reserved wdc W65C02S microprocessor data sheet
the western design center, inc. february 2004 W65C02S data sheet the western design center, inc. W65C02S data sheet 2 wdc reserves the right to make changes at any time without notice in order to improve design and supply the best possible product. information contained herein is provided gratuitously and without liability, to an y user. reasonable efforts have been made to verify the accuracy of the information but no guarantee whatsoever is given as to the accuracy or as to its applicability to particular uses. in every instance, it must be the responsibility of the user to det ermine the suitability of the products for each application. wdc products are not authorized for use as critical components in life support devices or systems. nothing contained herein shall be construed as a recommendation to use any product in violatio n of existing patents or other rights of third parties. the sale of any wdc product is subject to all wdc terms and conditions of sales and sales policies, copies of which are available upon request. copyright 1981 - 2004 by the western design center, inc . all rights reserved, including the right of reproduction, in whole, or in part, in any form.
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 3 table of contents 1 introduction ................................ ................................ ................................ ................................ ................................ ................ 5 1.1 f eatures of the W65C02S ................................ ................................ ................................ ................................ ..................... 5 2 functional descrip tion ................................ ................................ ................................ ................................ ...................... 6 2.1 i nstruction r egister (ir) and d ecode ................................ ................................ ................................ ........................... 6 2.2 t iming c ontrol u nit (tcu) ................................ ................................ ................................ ................................ ................. 6 2.3 a rithmetic and l ogic u nit (alu) ................................ ................................ ................................ ................................ ..... 6 2.4 a ccumulator r egi ster (a) ................................ ................................ ................................ ................................ ................... 6 2.5 i ndex r egisters (x and y) ................................ ................................ ................................ ................................ ...................... 6 2.6 p rocessor s tatus r egister (p) ................................ ................................ ................................ ................................ ........... 6 2.7 p rogram c ounter r egister (pc) ................................ ................................ ................................ ................................ ....... 6 2.8 s tack p ointer r egiste r (s) ................................ ................................ ................................ ................................ .................. 7 3 pin function descrip tion ................................ ................................ ................................ ................................ ................... 9 3.1 a ddress b us (a0 - a15) ................................ ................................ ................................ ................................ ............................... 9 3.2 b us e nable (be) ................................ ................................ ................................ ................................ ................................ .......... 9 3.3 d ata b us (d0 - d7) ................................ ................................ ................................ ................................ ................................ ........ 9 3. 4 i nterrupt r equest (irqb) ................................ ................................ ................................ ................................ .................... 9 3.5 m emory l ock (mlb) ................................ ................................ ................................ ................................ ............................... 9 3.6 n on - m askable i nterrupt (nmib) ................................ ................................ ................................ ................................ ...... 9 3.7 n o c onnect (nc) ................................ ................................ ................................ ................................ ................................ ..... 10 3.8 p hase 2 i n (phi2), p hase 2 o ut (phi2o) and p hase 1 o ut (phi1o) ................................ ................................ ...... 10 3.9 r ead /w rite (rwb) ................................ ................................ ................................ ................................ ................................ . 10 3.10 r eady (rdy) ................................ ................................ ................................ ................................ ................................ .............. 10 3.11 r eset (resb) ................................ ................................ ................................ ................................ ................................ ............. 11 3.12 s et o verflow (sob) ................................ ................................ ................................ ................................ .............................. 11 3.13 sync hronize with o p c ode fetch (sync) ................................ ................................ ................................ ................... 11 3.14 p ower (vdd) and g round (vss) ................................ ................................ ................................ ................................ ........ 11 3.15 v ector p ull (vpb) ................................ ................................ ................................ ................................ ................................ . 11 4 addressing modes ................................ ................................ ................................ ................................ ................................ ... 16 4.1 a bsolute a ................................ ................................ ................................ ................................ ................................ .................. 16 4.2 a bsolute i ndexed i ndirect ( a , x ) ................................ ................................ ................................ ................................ ...... 16 4.3 a bsolute i ndexed with x a , x ................................ ................................ ................................ ................................ ............. 16 4.4 a bsolute i ndexed with y a , y ................................ ................................ ................................ ................................ ............ 17 4.5 a bsolute i ndirect ( a ) ................................ ................................ ................................ ................................ ............................ 17 4.6 a ccumulator a ................................ ................................ ................................ ................................ ................................ ....... 17 4.7 i mmediate a ddressing # ................................ ................................ ................................ ................................ ....................... 17 4.8 i mplied i ................................ ................................ ................................ ................................ ................................ ....................... 17 4.9 p rogram c ounter r elative r ................................ ................................ ................................ ................................ ........... 18 4.10 s tack s ................................ ................................ ................................ ................................ ................................ ......................... 18 4.11 z ero p age zp ................................ ................................ ................................ ................................ ................................ .............. 18 4.12 z ero p age i ndexed i ndirect ( zp , x ) ................................ ................................ ................................ ................................ .. 18 4.13 z ero p age i ndexed with x zp , x ................................ ................................ ................................ ................................ ......... 19 4. 14 z ero p age i ndexed with y zp , y ................................ ................................ ................................ ................................ ........ 19 4.15 z ero p age i ndirect ( zp ) ................................ ................................ ................................ ................................ ........................ 19 4.16 z ero p age i ndirect i ndexed with y ( zp ), y ................................ ................................ ................................ .................. 19 5 operation tables ................................ ................................ ................................ ................................ ................................ .... 21 6 dc, ac and timing ch aracteristics ................................ ................................ ................................ ......................... 23
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 4 6.1 dc c haracteristics ta = - 40 c to +85 c (plcc, qfp) ta= 0 c to 70 c (dip) ................................ .......... 24 6.2 ac c haracteristics ta = - 40 c to +85 c (plcc, qfp) ta= 0 c to 70 c (dip) ................................ .......... 25 7 caveats ................................ ................................ ................................ ................................ ................................ ............................ 36 8 w65c02db developer board and ................................ ................................ ................................ ................................ . 37 in - circuit emulator (ic e) ................................ ................................ ................................ ................................ .......................... 37 8.1 f eatures : ................................ ................................ ................................ ................................ ................................ .................... 38 8.2 m emory map : ................................ ................................ ................................ ................................ ................................ ............. 38 8.3 c ross - d ebugging m onitor p rogram ................................ ................................ ................................ ............................. 38 8.4 building ................................ ................................ ................................ ................................ ................................ ................... 38 9 hard core model ................................ ................................ ................................ ................................ ................................ ..... 39 9.1 f eatures of the W65C02S h ard c ore m odel ................................ ................................ ................................ ................. 39 10 soft core rtl model ................................ ................................ ................................ ................................ ........................ 39 10.1 w65c02 s ynthesizable rtl - c ode in v erilog hdl ................................ ................................ ................................ . 39 table of tables table 3 - 1 vector locations ................................ ................................ ................................ ................................ .................... 12 table 3 - 2 pin function tabl e ................................ ................................ ................................ ................................ .................. 12 table 4 - 1 addressing mode t able ................................ ................................ ................................ ................................ ...... 20 table 5 - 1 instruction set t able ................................ ................................ ................................ ................................ ......... 21 table 5 - 2 W65C02S opcode ma trix ................................ ................................ ................................ ................................ ........ 22 table 6 - 1 absolute maximum rat ings ................................ ................................ ................................ ............................ 23 table 6 - 2 dc characteristics ................................ ................................ ................................ ................................ ................ 24 table 6 - 3 ac characteristics ................................ ................................ ................................ ................................ .............. 25 table 6 - 4 operation, operat ion codes and status register ................................ ................................ ..... 28 table 6 - 5 instruction timin g chart ................................ ................................ ................................ ............................... 32 table 7 - 1 microprocessor opera tional enhancements ................................ ................................ .............. 36 table of figures figure 2 - 1 W65C02S internal architecture simplif ied block diagram ................................ ............. 7 figure 2 - 2 W65C02S microproc essor programming mo del ................................ ................................ ............ 8 figure 3 - 1 w6 5c02s 40 pin pdip pi nout ................................ ................................ ................................ ................................ . 13 figure 3 - 2 W65C02S 44 pin pl cc pinout ................................ ................................ ................................ ............................... 14 figure 3 - 3 W65C02S 44 pin qf p pinout ................................ ................................ ................................ ................................ .. 15 figure 6 - 1 idd vs vdd ................................ ................................ ................................ ................................ ................................ ..... 24 figure 6 - 2 f max vs vdd ................................ ................................ ................................ ................................ ............................... 24 figure 6 - 3 general timing di agram ................................ ................................ ................................ ................................ 26
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 5 1 introduction the W65C02S is a low power cost sensitive 8 - bit microprocessor. the W65C02S is a fully static core and the phi2 clock can be stopped when it is in the high (logic 1) or low (logic 0) state. the variable length instruction set and manually optimized core size makes the W65C02S an excellent choice for low power system - on - chip (soc) designs. the verilog rtl model is available for asic design flows. wdc, a fabless semiconductor company, provides packaged c hips for evaluation or volume production. to aid in system development, wdc provides a development system that includes a w65c02db developer board, an in - circuit emulator (ice) and the w65csds software development system, see www.westerndesigncenter.com fo r more information. 1.1 features of the W65C02S 8 - bit data bus 16 - bit address bus provides access to 65,536 bytes of memory space 8 - bit alu, accumulator, stack pointer, index registers, processor status register 16 - bit program counter 69 instructions 16 addressing modes 212 operation codes (opcodes) vector pull (vpb) output indicates when interrupt vectors are being addressed wait - for - interrupt (wai) and stop (stp) instructions reduce power consumption, decrease interrupt latency and provide synchro nization with external events variable length instruction set provides for lower power and smaller code optimization over fixed length instruction set processors fully static circuitry wide operating voltage range, 1.8+/ - 5%, 2.5+/ - 5%, 3.0+/ - 5%, 3.3+/ - 10%, 5.0+/ - 5% specified low power consumption, 150ua@1mhz
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 6 2 functional description the internal organization of the W65C02S is divided into two parts: 1) register section and 2) control section. instructions obtained from program memory are exec uted by implementing a series of data transfers within the register section. signals that cause data transfers are generated within the control section. 2.1 instruction register (ir) and decode the operation code (opcode) portion of the instruction is lo aded into the instruction register from the data bus and is latched during the opcode fetch cycle. the opcode is then decoded, along with timing and interrupt signals, to generate various control signals for program execution. 2.2 timing control unit (tcu) the timing control unit (tcu) provides timing for each instruction cycle that is executed. the tcu is set to zero for each instruction fetch, and is advanced at the beginning of each cycle for as many cycles as is required to complete the instruction. dat a transfers between registers depend upon decoding the contents of both the ir and the tcu. 2.3 arithmetic and logic unit (alu) all arithmetic and logic operations take place within the alu. in addition to data operations, the alu also calculates the effect ive address for relative and indexed addressing modes. the result of a data operation is stored in either memory or an internal register. carry, negative, overflow and zero flags are updated following the alu data operation. 2.4 accumulator register (a) th e accumulator register (a) is an 8 - bit general purpose register which holds one of the operands and the result of arithmetic and logical operations. reconfigured versions of this processor family could have additional accumulators. 2.5 index registers (x an d y) there are two 8 - bit index registers (x and y) which may be used as general purpose registers or to provide an index value for calculation of the effective address. when executing an instruction with indexed addressing, the microprocessor fetches the opcode and the base address, and then modifies the address by adding the index register contents to the address prior to performing the desired operation. 2.6 processor status register (p) the 8 - bit processor status register (p) contains status flags and m ode select bits. the carry (c), negative (n), overflow (v) and zero (z) status flags serve to report the status of alu operations. these status flags are tested with conditional branch instructions. the decimal (d) and irqb disable (i) are used as mode s elect flags. these flags are set by the program to change microprocessor operations. bit 5 is available for a user status or mode bit. 2.7 program counter register (pc)
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 7 the 16 - bit program counter register (pc) provides the addresses which are used to step the microprocessor through sequential program instructions. this register is incremented each time an instruction or operand is fetched from program memory. 2.8 stack pointer register (s) the stack pointer register (s) is an 8 - bit register which is used to indicate the next available location in the stack memory area. it serves as the effective address in stack addressing modes as well as subroutine and interrupt processing. irqb nmib resb a0 - a15 phi2 d0 - d7 figure 2 - 1 W65C02S internal architecture simplified block diagram internal address bus (16 bits) address buffer index x (8 bits) index y (8 bits) stack pointer (s) (8 bits) alu (8 bits) accumulator (a) ( 8bits) prog. counter (pc) (16 bits) processor status (p) 8 bits data latch be instruction register (8 bits) instruction decode interrupt logic timing control be internal data bus (8 bits) data bus buffer system control be rwb rdy vpb sync
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 8 a acc umulator a y index register y x index register x pch pcl program counter pc 1 s stack pointer s n v 1 b d i z c processor status register "p" carry 1 = true zero 1 = result irqb disable 1 = disable decimal mode 1= true brk command 1 = brk, 0 = irqb overflow 1 = true negative 1 = neg. figure 2 - 2 W65C02S microprocessor programming model 15 0 0 0 0 7 8 7 7 7 7 0
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 9 3 pin function description 3.1 address bus (a0 - a15) the sixteen bit address bus formed by a0 - a15, address memory and i/o registers that exchange data on the data bus. the add ress lines can be set to the high impedance state by the bus enable (be) signal. 3.2 bus enable (be) the bus enable (be) input signal provides external control of the address, data and the rwb buffers. when bus enable is high, the address, data and rwb buff ers are active. when be is low, these buffers are set to the high impedance status. bus enable is an asynchronous signal. 3.3 data bus (d0 - d7) the eight data bus lines d0 - d7 are used to provide instructions, data and addresses to the microprocessor and exc hange data with memory and i/o registers. these lines may be set to the high impedance state by the bus enable (be) signal. 3.4 interrupt request (irqb) the interrupt request (irqb) input signal is used to request that an interrupt sequence be initiated. th e program counter (pc) and processor status register (p) are pushed onto the stack and the irqb disable (i) flag is set to a ?1? disabling further interrupts before jumping to the interrupt handler. these values are used to return the processor to its ori ginal state prior to the irqb interrupt. the irqb low level should be held until the interrupt handler clears the interrupt request source. when return from interrupt (rti) is executed the (i) flag is restored and a new interrupt can be handled. if the (i) flag is cleared in an interrupt handler, nested interrupts can occur. the wait - for - interrupt (wai) instruction may be used to reduce power and synchronize with, as an example timer interrupt requests. 3.5 memory lock (mlb) the memory lock (mlb) output may be used to ensure the integrity of read - modify - write instructions in a multiprocessor system. memory lock indicates the need to defer arbitration of the bus cycle when mlb is low. memory lock is low during the last three cycles of asl, dec, inc, lsr, rol, ror, trb, and tsb memory referencing instructions. 3.6 non - maskable interrupt (nmib) a negative transition on the non - maskable interrupt (nmib) input initiates an interrupt sequence after the current instruction is completed. since nmib is an edge - sen sitive input, an interrupt will occur if there is a negative transition while servicing a previous interrupt. also, after the edge interrupt occurs no further interrupts will occur if nmib remains low. the nmib signal going low causes the program counter (pc) and processor status register information to be pushed onto the stack before jumping to the interrupt handler. these values are used to return the processor to it's original state prior to the nmib interrupt.
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 10 3.7 no connect (nc) the no connect (nc) p ins are not connected internally and should not be connected externally. 3.8 phase 2 in (phi2), phase 2 out (phi2o) and phase 1 out (phi1o) phase 2 in (phi2) is the system clock input to the microprocessor internal clock. during the low power standby mode, phi2 can be held in either high or low state to preserve the contents of internal registers since the microprocessor is a fully static design. the phase 2 out (phi2o) signal is generated from phi2. phase 1 out (phi1o) is the inverted phi2 signal. an ext ernal oscillator is recommended for driving phi2 and used for the main system clock. all production test timing is based on phi2. phi2o and phi1o were used in older systems for system timing and internal oscillators when an external crystal was used. 3.9 read/write (rwb) the read/write (rwb) output signal is used to control data transfer. when in the high state, the microprocessor is reading data from memory or i/o. when in the low state, the data bus contains valid data to be written from the microproce ssor and stored at the addressed memory or i/o location. the rwb signal is set to the high impedance state when bus enable (be) is low. 3.10 ready (rdy) a low input logic level on the ready (rdy) will halt the microprocessor in its current state. returning rdy to the high state allows the microprocessor to continue operation following the next phi2 negative transition. this bi - directional signal allows the user to single - cycle the microprocessor on all cycles including write cycles. a negative transition to the low state prior to the falling edge of phi2 will halt the microprocessor with the output address lines reflecting the current address being fetched. this assumes the processor setup time is met. this condition will remain through a subsequent phi2 in which the ready signal is low. this feature allows microprocessor interfacing with low - speed memory as well as direct memory access (dma). the wai instruction pulls rdy low signaling the wait - for - interrupt condition, thus rdy is a bi - directional pin. on the w65c02 hard core there is a wait output signal that can be used in asic's thus removing the bi - directional signal and rdy becomes only the input. in such a situation the wai instruction will pull wait low and must be used external of the core to pull rdy low or the processor will continue as if the wai never happened. the microprocessor will be released when rdy is high and a falling edge of phi2 occurs. this again assumes the processor control setup time is met. the rdy pin has an active pull - up , when outputting a low level, the pull - up is disabled. the rdy pin can still be wire ored.
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 11 3.11 reset (resb) the reset (resb) input is used to initialize the microprocessor and start program execution. the resb signal must be held low for at least two cloc k cycles after vdd reaches operating voltage. ready (rdy) has no effect while resb is being held low. all registers are initialized by software except the decimal and interrupt disable mode select bits of the processor status register (p) are initialized by hardware. when a positive edge is detected, there will be a reset sequence lasting seven clock cycles. the program counter is loaded with the reset vector from locations fffc (low byte) and fffd (high byte). this is the start location for program con trol. resb should be held high after reset for normal operation. processor status register (p) 7 6 5 4 3 2 1 0 * * 1 1 0 1 * * n v b d i z c *=software initialized 3.12 set overflow (sob) a negative transition on the set overflow (sob) pin sets the overflow bit (v) in the status code register. the signal is sampled on the rising edge of phi2. sob was originally intended for fast input recognition because it can be tested with a branch instruction; however, it is not recommended in new system design and was seldom used in the past. 3.13 synchronize with opcode fetch (sync) the opcode fetch cycle of the microprocessor instruction is indicated with sync high. the sync output is provided to identify those cycles during which the microprocessor is fetching an opcode. the sync line goes high during the clock cycle of an opcode fetch and stays high for the entire cycle. if the rdy line is pulled low during the clock cycle in which sync went high, the processor will stop in its current state and will remain i n the state until the rdy line goes high. in this manner, the sync signal can be used to control rdy to cause single instruction execution. 3.14 power (vdd) and ground (vss) vdd is the positive power supply voltage and vss is system logic ground. 3.15 vector pul l (vpb) the vector pull (vpb) output indicates that a vector location is being addressed during an interrupt sequence. vpb is low during the last interrupt sequence cycles, during which time the processor reads the interrupt vector. the vpb signal may b e used to select and prioritize interrupts from several sources by modifying the vector addresses.
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 12 table 3 - 1 vector locations fffe, f brk/irqb software/hardware fffc, d resb hardware fffa, b n mib hardware table 3 - 2 pin function table pin description a0 - a15 address bus be bus enable d0 - d7 data bus irqb interrupt request mlb memory lock nc no connection nmib non - maskable interrupt ph i1o phase 1 out clock phi2 phase 2 in clock phi2o phase 2 out clock rdy ready resb reset rwb read/write sob set overflow sync synchronize vdd positive power supply vpb vector pull vss internal logic ground
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 13 vpb rdy phi1o irqb mlb nmib sync vdd a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 resb phi2c sob phi2 be nc rwb d0 d1 d2 d3 d4 d5 d6 d7 a15 a14 a13 a12 vss figure 3 - 1 W65C02S 40 pin pdip pinout
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 14 figure 3 - 2 W65C02S 44 pin plcc pinout nc rwb vdd d0 d1 d2 d3 d4 d5 d6 d7 nmib sync vdd a0 a1 nc a2 a3 a4 a5 a6 7 8 9 10 11 12 13 14 15 16 17 39 38 37 36 35 34 33 32 31 30 29 mlb irqb phi1o rdy vpb vss resb phi2o sob phi2 be a7 a8 a9 a10 a11 vss vss a12 a13 a14 a15 w65c02 18 19 20 21 22 23 24 25 26 27 28 6 5 4 3 2 1 44 43 42 41 40
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 15 figure 3 - 3 W65C02S 44 pin qfp pinout nmib sync vdd a0 a1 nc a2 a3 a4 a5 a6 1 2 3 4 5 6 7 8 9 10 11 mlb irqb phi1o rdy vpb vss resb phi2o sob phi2 be 44 43 42 41 40 39 38 37 36 35 34 nc rwb vdd d0 d1 d2 d3 d4 d5 d6 d7 33 32 31 30 29 28 27 26 25 24 23 12 13 14 15 16 17 18 1 9 20 21 22 a7 a8 a9 a10 a11 vss vss a12 a13 a14 a15
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 16 4 address ing modes the W65C02S is capable of directly addressing 65,536 bytes of memory. the program address and data address space is contiguous throughout the 65,536 byte address space. words, arrays, records, or any data structures may span the 65,536 byte ad dress space. the following addressing mode descriptions provide additional detail as to how effective addresses are calculated. sixteen addressing modes are available for the W65C02S. this address space has special significance within certain addressing modes. 4.1 absolute a with absolute addressing the second and third bytes of the instruction form the 16 - bit address. byte: 2 1 0 instruction: adh adl opcode operand address: adh adl 4.2 absolute indexed indirect (a,x) with the absolute indexed indi rect addressing mode, the x index register is added to the second and third byes of the instruction to form an address to a pointer. this address mode is only used with the jmp instruction and the program counter is loaded with the first and second bytes at this pointer. byte: 2 1 0 instruction: adh adl opcode indirect base address: adh adl + x indirect address: effective address new pc value: indirect address 4.3 absolute indexed with x a,x with the absolute indexed with x addressing mode, the x index register is added to the second and third bytes of the instruction to form the 16 - bits of the effective address. byte: 2 1 0 instruction: adh adl opcode adh adl + x operand address: effective address
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 17 4.4 absolute indexed with y a , y with the absolute indexed with y addressing mode, the y index register is added to the second and third bytes of the instruction to form the 16 - bit effective address. byte: 2 1 0 instruction: adh adl opcode adh adl + y operand address: effective address 4.5 absolute indirect (a) with the absolute indirect addressing mode, the second and third bytes of the instruction form an address to a pointer. this address mode is only used with the jmp instruction and the program counter is loaded wi th the first and second bytes at this pointer. byte: 2 1 0 instruction: adh adl opcode indirect address: adh adl new pc value: indirect address 4.6 accumulator a with accumulator addressing the operand is implied as the accumulator and theref ore only a single byte forms the instruction.. byte: 2 1 0 instruction: opcode operand: accumulator 4.7 immediate addressing # with immediate addressing the operand is the second byte of the instruction. byte: 2 1 0 instruction: operand opcode operand: operand 4.8 implied i implied addressing uses a single byte instruction. the operand is implicitly defined by the instruction. byte: 2 1 0 instruction: opcode operand address: implied
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 18 4.9 program counter relative r the program c ounter relative addressing mode, sometimes referred to as relative addressing, is used with the branch instructions. if the condition being tested is met, the second byte of the instruction is added to the program counter and program control is transferre d to this new memory location. byte: 2 1 0 instruction: offset opcode pch pcl + offset new pc value effective address 4.10 stack s the stack may use memory from 0100 to 01ff and the effective address of the stack address mode will always be within this range. stack addressing refers to all instructions that push or pull data from the stack, such as push, pull, jump to subroutine, return from subroutine, interrupts and return from interrupt. byte: 2 1 0 instruction: opcode operand address: 1 s 4.11 zero page zp with zero page (zp) addressing the second byte of the instruction is the address of the operand in page zero. byte: 2 1 0 instruction: zp opcode operand address: 0 zp 4.12 zero page indexed indirect (zp,x) the zero p age indexed indirect addressing mode is often referred to as indirect,x. the second byte of the instruction is the zero page address to which the x index register is added and the result points to the low byte of the indirect address. byte: 2 1 0 instru ction: zp opcode base address: zp + x indirect address: 0 address operand address: indirect address
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 19 4.13 zero page indexed with x zp,x with zero page indexed with x addressing mode, the x index register is added to the second byte of instruction to form the effective address. byte: 2 1 0 instruction: zp opcode base address: zp + x operand address: 0 effective address 4.14 zero page indexed with y zp, y with zero page indexed with y addressing, the second byte of the inst ruction is the zero page address to which the y index register is added to form the page zero effective address. byte: 2 1 0 instruction: zp opcode base address: zp + y operand address: 0 effective address 4.15 zero page indirect (zp) with z ero page indirect addressing mode, the second byte of the instruction is a zero page indirect address that points to the low byte of a two byte effective address. byte: 2 1 0 instruction: zp opcode indirect address: 0 zp operand address: indirect address 4.16 zero page indirect indexed with y (zp), y the zero page indirect indexed with y addressing mode is often referred to as indirect y. the second byte of the instruction points to the low byte of a two byte (16 - bit) base address in page z ero. y index register is added to the base address to form the effective address. byte: 2 1 0 instruction: zp opcode indirect base address: 0 zp indirect base address + y operand address: effective address
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 20 table 4 - 1 addressing mode table address mode instruction times in memory cycle memory utilization in number of program sequence bytes original nmos 6502 W65C02S original nmos 6502 W65C02S 1. absolute a 4 (3) 4 (3) 3 3 2. absolut e indexed indirect (a,x) 5 5 3 3 3. absolute indexed with x a,x 4 (1,3) 4 (1,3) 3 3 4. absolute indexed with y a,y 4 (1) 4 (1) 3 3 5. absolute indirect (a) 4 (3) 4 (3) 3 3 6. accumulator a 2 2 1 1 7. immediate # 2 2 2 2 8. implied i 2 2 1 1 9. program counter relative r 2 (2) 2 (2) 2 2 10. stack s 3 - 7 3 - 7 1 - 3 1 - 4 11. zero page zp 3 (3) 3 (3) 2 2 12. zero page indexed indirect (zp,x) 6 6 2 2 13. zero page indexed with x zp,x 4 (3) 4 (3) 2 2 14. zero page indexed with y zp,y 4 4 2 2 15. zero page indirect (zp) - 5 - 2 16. zero page indire ct indexed with y (zp),y 5 5 2 2 notes: (indicated in parenthesis) 1. page boundary, add 1 cycle if page boundary is crossed when forming address 2. branch taken, add 1 cycle if branch is taken 3. read - modify - write, add 2 cycles
the western design center, inc. W65C02S data sheet the western design center, inc. W65C02S data sheet 21 5 operation tables table 5 - 1 instruction set table 1. adc add memory to accumulator with carry 2. and "and" memory with accumulator 3. asl arithmetic shift one bit left, memory or accumulator 4. bbr branch on bit reset 5. bbs branch of bit set 6. bcc branch on carry clear (pc=0) 7. bcs branch on carry set (pc=1) 8. beq branch if equal (pz=1) 9. bit bit test 10. bmi branch if result minus (pn=1) 11. bne branch if not equal (pz=0) 12. bpl branch if result plus (pn=0) 13. bra branch always 14. brk break instruc tion 15. bvc branch on overflow clear (pv=0) 16. bvs branch on overflow set (pv=1) 17. clc clear cary flag 18. cld clear decimal mode 19. cli clear interrupt disable bit 20. clv clear overflow flag 21. cmp compare memory and accumulator 22. cpx compare memory and x regist er 23. cpy compare memory and y register 24. dec decrement memory or accumulate by one 25. dex decrement x by one 26. dey decrement y by one 27. eor "exclusive or" memory with accumulate 28. inc increment memory or accumulate by one 29. inx increment x register by one 30. iny increment y register by one 31. jmp jump to new location 32. jsr jump to new location saving return (jump to subroutine) 33. lda load accumulator with memory 34. ldx load the x register with memory 35. ldy load the y register with memory 36. lsr logical shift one bit right memory or accumulator 37. nop no operation 38. ora "or" memory with accumulator 39. pha push accumulator on stack 40. php push processor status on stack 41. phx push x register on stack 42. phy push y register on stack 43. pla pull accumulator from stack 44. pl p pull processor status from stack 45. plx pull x register from stack 46. ply pull y register from stack 47. rmb reset memory bit 48. rol rotate one bit left memory or accumulator 49. ror rotate one bit right memory or accumulator 50. rti return from interrupt 51. r ts return from subroutine 52. sbc subtract memory from accumulator with borrow (carry bit) 53. sed set decimal mode 54. sei set interrupt disable status 55. smb set memory bit 56. sta store accumulator in memory 57. stp stop mode 58. stx store the x register in memory 59. sty store the y register in memory 60. stz store zero in memory 61. tax transfer the accumulator to the x register 62. tay transfer the accumulator to the y register 63. trb test and reset memory bit 64. tsb test and set memory bit 65. tsx transfer the stack poi nter to the x register 66. txa transfer the x register to the accumulator 67. txs transfer the x register to the stack pointer register 68. tya transfer y register to the accumulator 69. wai wait for interrupt note: =new instruction
the western design center, inc. W65C02S datasheet the western design center, inc., W65C02S datasheet 22 table 5 - 2 W65C02S opcode matrix m s d 0 1 2 3 4 5 6 7 8 9 a b c d e f f bbr0 r 5,3 bbr1 r 5,3 bbr2 r 5,3 bbr3 r 5,3 bbr4 r 5,3 bbr5 r 5,3 bbr6 r 5,3 bbr7 r 5,3 bbs0 r 5,3 bbs1 r 5,3 bbs2 r 5,3 bbs3 r 5,3 bbs4 r 5,3 bbs5 r 5,3 bbs6 r 5,3 bbs7 r 5,3 f e asl a 6,3 asl a,x 6,3 rol a 6,3 rol a,x 6,3 lsr a 6,3 lsr a,x 6,3 ror a 6,3 ror a,x 6,3 stx a 4,3 stz a,x 5,3 ldx a 4,3 ldx a,y 4,3 dec a 6,3 dec a,x 6,3 inc a 6,3 inc a,x 6,3 e d ora a 4,3 ora a,x 4,3 and a 4,3 and a,x 4,3 eor a 4,3 eor a,x 4,3 adc a 4,3 adc a,x 4,3 sta a 4,3 sta a,x 4,3 lda a 4,3 lda a,x 4,3 cmp a 4,3 cmp a,x 4,3 sbc a 4,3 sbc a,x 4,3 d c tsb a 6,3 trb a 6,3 bit a 4,3 bit a,x 4,3 * jmp a 3,3 jmp (a) 6,3 jmp (a,x) 6,3 * sty a 4,3 stz a 4,3 ldy a 4,3 ldy a,x 4,3 cpy a 4,3 cpx a 4,3 c b wai i 3,1 stp i 3,1 b a asl a 2,1 inc a 2,1 * rol a 2, 1 dec a 2,1 * lsr a 2,1 phy s 3,1 ror a 2,1 ply s 4,1 txa i 2,1 txs i 2,1 tax i 2,1 tsx i 2,1 dex i 2,1 phx s 3,1 nop i 2,1 plx s 4,1 a 9 ora # 2,2 ora a,y 4,3 and # 2,2 and a,y 4,3 eor # 2,2 eor a,y 4,3 adc # 2,2 adc a,y 4,3 bit # 2, 2 sta a,y 5,3 lda # 2,2 lda a,y 4,3 cmp # 2,2 cmp a,y 4,3 sbc # 2,2 sbc a,y 4,3 9 8 php s 3,1 clc i 2,1 plp s 4,1 sec i 2,1 pha s 3,1 cli i 2,1 pla s 4,1 sei i 2,1 dey i 2,1 tya i 2,1 tay i 2,1 clv i 2,1 iny i 2,1 cld i 2,1 inx i 2,1 sed i 2,1 8 7 rmb0 zp 5,2 rmb1 zp 5,2 rmb2 zp 5,2 rmb3 zp 5,2 rmb4 zp 5,2 rmb5 zp 5,2 rmb6 zp 5,2 rmb7 zp 5,2 smb0 zp 5,2 smb1 zp 5,2 smb2 zp 5,2 smb3 zp 5,2 smb4 zp 5,2 smb5 zp 5,2 smb6 zp 5,2 smb7 zp 5,2 7 6 asl zp 5,2 asl zp,x 6,2 rol zp 5,2 rol zp,x 6,2 lsr zp 5,2 lsr zp,x 6,2 ror zp 5,2 ror zp,x 6,2 stx zp 3,2 stx zp,y 4,2 ldx zp 3,2 ldx zp,y 4,2 dec zp 5,2 dec zp,x 6,2 inc zp 5,2 inc zp,x 6,2 6 5 ora zp 3,2 ora zp,x 4,2 and zp 3,2 and zp,x 4,2 eor zp 3,2 eor zp,x 4,2 adc zp 3,2 adc zp,x 4,2 sta zp 3,2 sta zp,x 4,2 lda zp 3,2 lda zp,x 4,2 cmp zp 3,2 cmp zp,x 4,2 sbc zp 3,2 sbc zp,x 4,2 5 4 tsb zp 5,2 trb zp 5,2 bit zp 3,2 bit zp,x 4,2 * stz zp 3,2 stz zp,x 4,2 sty zp 3,2 sty zp,x 4,2 ldy zp 3,2 ldy zp,x 4,2 cpy zp 3,2 cpx zp 3,2 4 3 3 2 ora (zp) 5,2 * and (zp) 5,2 * eor (zp) 5,2 * adc (zp) 5,2 * sta (zp) 5,2 * ldx # 2,2 lda (zp) 5, 2 * cmp (zp) 5,2 * sbc (zp) 5,2 * 2 1 ora (zp,x) 6,2 ora (zp),y 5,2 and (zp,x) 6,2 and (zp),y 5,2 eor (zp,x) 6,2 eor (zp),y 5,2 adc (zp,x) 6,2 adc (zp),y 5,2 sta (zp,x) 6,2 sta (zp),y 6,2 lda (zp,x) 6,2 lda (zp),y 5,2 cmp (zp,x) 6,2 cmp (zp) ,y 5,2 sbc (zp,x) 6,2 sbc (zp),y 5,2 1 W65C02S opcode matrix 0 brk s 7,1 bpl r 2,2 jsr a 6,3 bmi r 2,2 rti s 6,1 bvc r 2,2 rts s 6,1 bvs r 2,2 bra r 3,2 bcc r 2,2 ldy # 2,2 bcs r 2,2 cpy # 2,2 bne r 2,2 cpx # 2,2 beq r 2,2 0 m s d 0 1 2 3 4 5 6 7 8 9 a b c d e f * = old instruction with new addres sing modes = new instruction
the western design center, inc. W65C02S datasheet the western design center, inc. W65C02S datasheet 23 6 dc , ac and timing characteristics table 6 - 1 absolute maximum ratings rating symbol value supply voltage vdd - 0.3 to +7.0v input voltage vin - 0.3 to vdd +0.3v storage temperature ts - 55 c to +150 c this device contains input protection against damage due to high static voltages or electric fields; however, precautions should be taken to avoid application of voltages higher than the maximum rating. note: exceeding these ratings may result in permanent damage. functional operation under these conditions is not implied.
the western design center, inc. W65C02S datasheet the western design center, inc. W65C02S datasheet 24 6.1 dc characteristics ta = - 40 c to +85 c (plcc, qfp) ta= 0 c to 70 c (dip) table 6 - 2 dc characteristics 5.0 +/ - 5% 3.3 +/ - 10% 3.0 +/ - 5% 2.5 +/ - 5% 1.8 +/ - 5% units sy mbol min max min max min max min max min max vdd supply voltage 4.75 5.25 3.0 3.6 2.85 3.15 2.37 2.63 1.71 1.89 v vih input high voltage (1) be, d0 - d7, rdy, sob irqb, nmib, phi2, resb vddx0.7 vdd - 0.4 vdd+0.3 vdd+0.3 vddx0.7 vdd - 0.4 vdd+0.3 vdd+0.3 vddx0.7 vdd - 0.4 vdd+0.3 vdd+0.3 vddx0.7 vdd - 0.4 vdd+0.3 vdd+0.3 vddx0.7 vdd - 0.4 vdd+0.3 vdd+0.3 v vil input low voltage (1) be, d0 - d7, rdy, sob, irqb, nmib, phi2, resb vss - 0.3 vss - 0.3 vddx0.3 vss+0.4 vss - 0.3 vs s - 0.3 vddx0.3 vss+0.4 vss - 0.3 vss - 0.3 vddx0.3 vss+0.4 vss - 0.3 vss - 0.3 vddx0.3 vss+0.4 vss - 0.3 vss - 0.3 vddx0.3 vss+0.1 v iin input leakage current (vin=0.4 to 2.4, vdd=max) be, irqb, nmib, phi2, resb, sob - 20 20 - 20 20 - 20 20 - 20 20 - 20 20 na ipup rdy input pull - up current (vin=vdd - 0.4v (min) vin=0.4(max)) - 1 - 20 - 1 - 20 - 1 - 10 - 1 - 10 - 0.25 - 2.0 a iin d0 - d7 (off state) - 20 20 - 20 20 - 20 20 - 20 20 - 20 20 na ioh output high current (voh=vdd - .4, vdd=min) a0 - a15, d0 - d7, mlb, phi1o, phi2o, rwb, sync, vpb 700 - 350 - 300 - 200 - 100 - ua iol output low current (vol=0.4, vdd=min) a0 - a15, d0 - d7, mlb, phi1o, phi2o, rwb, sync, vpb 1.6 - 1.6 - 1.6 - 1.0 - 0.5 - ma idd supply current (with tester loading) supply current (core) - - 1.5 0.5 - - 1.0 0.3 - - 1.0 0.25 - - 0.75 0.2 - - 0.5 0.15 ma/ mhz isby standby current outputs unloaded be, irqb, nmib, phi2, sob=vdd - 1 - 1 - 1 - 1 - 1 ua cin cts *capacitance (vin=0v, ta=25 c, f - 1mhz) be, irqb, nmib, phi2, resb, rdy, sob a0 - a15, d0 - d7, rwb *not insp ected during production test; verified on a sample basis. - 5 - 5 - 5 - 5 - 5 pf (1) for high speed tests, vih and vil are set for vdd - .2v and vss+.2v. the input ?1? and ?0? thresholds are tested at 1 mhz. vdd (volts) figure 6 - 1 idd vs vdd figure 6 - 2 f max vs vdd 1.5 1 mhz operation@85 c 0.4 0.0 0.1 0.2 0.3 0.5 0.6 0.7 0.9 1.1 1.2 1.0 0.8 0 1 2 3 4 5 6 idd (ma) (with tester loading) (core power only) 6.0 5.5 4.5 4.0 3.5 3.0 2.5 1. 0 2 4 8 12 16 20 vdd (volts) f max (mhz) 18 14 10 6 0 0.0 typical 0.6u processed device typical 0.6u processed device @85 c 2.0 5.0
the western design center, inc. W65C02S datasheet the western design center, inc., W65C02S datasheet 25 6.2 ac characteristics ta = - 40 c to +85 c (plc c, qfp) ta= 0 c to 70 c (dip) table 6 - 3 ac characteristics 5.0 +/ - 5% 3.3 +/ - 10% 3.0 +/ - 5% 2.5 +/ - 5% 1.8 +/ - 5% 14mhz 8mhz 8mhz 4mhz 2mhz symbol parameter min max min max min max min max min m ax units vdd supply voltage 4.75 5.25 3.0 3.6 2.85 3.15 2.375 2.675 1.71 1.89 v tacc access time 30 - 70 - 70 - 145 - 290 - ns tah address hold time 10 - 10 - 10 - 10 - 10 - ns tads address setup time - 30 - 40 - 40 - 75 - 150 ns tbvd be to valid data (1) - 25 - 30 - 30 - 30 - 30 ns cext capacitive load (2) - 35 - 35 - 35 - 35 - 35 pf tpwh clock pulse width high 35 - 62 - 62 - 125 - 250 - ns tpwl clock pulse width low 35 - 63 - 63 - 125 - 250 - ns tcyc cycle time (3) 70 - 125 - 125 - 250 - 500 - ns tf ,tr fall time, rise time - 5 - 5 - 5 - 5 - 5 ns tpch processor control hold time 10 - 10 - 10 - 10 - 10 - ns tpcs processor control setup time 10 - 15 - 15 - 30 - 60 - ns tdhr read data hold time 10 - 10 - 10 - 10 - 10 - ns tdsr read data setup time 1 0 - 15 - 15 - 30 - 60 - ns tmds write data delay time - 25 - 40 - 40 - 70 - 140 ns tdhw write data hold time 10 - 10 - 10 - 10 - 10 - ns 1. be to high impedance state is not testable but should be the same amount of time as be to valid data 2. ate or l oading on all outputs 3. since this is a static design, the maximum cycle time could be infinite.
the western design center, inc. W65C02S datasheet the western design center, inc. W65C02S datasheet 26 tf tr phi2 tpwl tpwh tah tah see note 1 a 0 - a15. mlb, r/w, sync, vpb tads tacc tdsr read data tdhr tmds tdhr write data write data tdhw tpcs tdhw sob tpch tpch irqb, nmib rdy, resb tpcs sob data tbvd figure 6 - 3 general timing diagram timing notes: 1. timing measurement points are 50% vdd. 2. phi1o and phi2o clock delay from phi2 is no longer specified or tested and wdc recommends using an oscillator for system time base and phi2 processor input clock.
the western design center, inc. W65C02S datasheet the western design center, inc. W65C02S datasheet 27 the page left blank intentionally
the western design center, inc. W65C02S datasheet the western design cente r, inc. W65C02S datasheet 28 table 6 - 4 operation, operation codes and status register operation # immediate data ~ not ^ and processor status register (p) *user defined v or a (a,x) a,x a,y (a) a # i r s zp (zp,x) zp,x zp,y (zp) (zp),y 7 6 5 4 3 2 1 0 mnemomic v exclusive or 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 n v 1 1 d i z c adc a+m+c ? a 6d 7d 79 69 65 61 75 72 71 n v . . . . z c and a ^ m ? a 2d 3d 39 29 25 21 35 32 31 n . . . . . z . asl c ? 7 6 5 4 3 2 1 0 ? 0 0e 1e 0a 06 16 n . . . . . z c bbr0 branch on bit 0 reset 0f . . . . . . . . bbr1 branch on bit 1 reset 1f . . . . . . . . bbr2 branch on bit 2 reset 2f . . . . . . . . bbr3 b ranch on bit 3 reset 3f . . . . . . . . bbr4 branch on bit 4 reset 4f . . . . . . . . bbr5 branch on bit 5 reset 5f . . . . . . . . bbr6 branch on bit 6 reset 6f . . . . . . . . bbr7 branch on bit 7 reset 7f . . . . . . . . bbs0 branch on bit 0 set 8f . . . . . . . . bbs1 branch on bit 1 set 9f . . . . . . . . bbs2 branch on bit 2 set af . . . . . . . . bbs3 branch on bit 3 set bf . . . . . . . bbs4 branch on bit 4 set cf . . . . . . . . bbs5 branch on bit 5 set df . . . . . . . . bbs6 branch on bit 6 set ef . . . . . . . . bbs7 branch on bit 7 set ff . . . . . . . . bcc branch c = 0 90 . . . . . . . . bcs branch if c = 1 b0 . . . . . . . . beq branch if z = 1 f0 . . . . . . . . bit a ^ m 2c 3c 89 24 34 m 7 m 6 . . . z . bmi branch if n = 0 30 . . . . . . . . bne branch if z = 0 d0 bpl branch if n = 0 10 . . . . . . . . bra branch always 80 . . . . . . . .
the western design ce nter, inc. W65C02S datasheet the western design center, inc. W65C02S datasheet 29 operation # immediate data ~ not ^ and processor status register (p) *user defined v or a (a,x) a,x a,y (a) a # i r s zp (zp,x) zp,x zp,y (zp) (zp ).y 7 6 5 4 3 2 1 0 mnemomic v exclusive or 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 n v 1 1 d i z c b rk break 00 . . . 1 0 1 . . bvc branch if v = 0 50 . . . . . . . . bvs branch if v = 1 70 . . . . . . . . clc c ? 0 18 . . . . . . . 0 cld 0 ? d d8 . . . . 0 . . . cli 0 ? 1 58 . . . . . 0 . . clv 0 ? v b8 . 0 . . . . . . cmp a - m cd dd d9 c9 c5 c1 d5 d2 d1 n . . . . . z c cpx x - m ec e0 e4 n . . . . . z c cpy y - m cc c0 c4 n . . . . . z c dec decrement ce de 3a c6 d6 n . . . . . z . dex x - 1 ? a ca n . . . . . z . dey y - 1 ? y 88 n . . . . . z . eor a v m ? a 4d 5d 59 49 45 41 55 52 51 n . . . . . z . inc increments ee fe 1a e6 f6 n . . . . . z . inx x+1 ? x e8 n . . . . . z . iny y+1 ? y c8 n . . . . . z . jmp jump to new location 4c 7c 6c . . . . . . . . jsr jump to subroutine 20 n . . . . . z . lda m ? a ad bd b9 a9 a5 a1 b5 b2 b1 n . . . . . z . ldx m ? x ae be a2 a6 b6 n . . . . . z . ldy m ? y ac bc a0 a4 b4 n . . . . . z . lsr 0 ? 7 6 5 4 3 2 1 0 ? c 4e 5e 4a 46 56 0 . . . . . z c nop no operation ea . . . . . . . .
the western design ce nter, inc. W65C02S datasheet the western design center, inc. W65C02S datasheet 30 operat ion # immediate data ~ not ^ and processor status register (p) *user defined v or a (a,x) a,x a,y (a) a # i r s zp (zp,x) zp,x zp,y (zp) (zp),y 7 6 5 4 3 2 1 0 mnemomic v exclusiv e or 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 n v 1 1 d i z c ora a v m ? a 0d 1d 19 09 05 01 15 12 11 n . . . . . z . pha a ? ms, s - 1 ? s 48 . . . . . . . . php p ? ms, s - 1 ? s 08 . . . . . . . . phx x ? ms, s - 1 ? s da . . . . . . . . phy y ? ms, s - 1 ? s 5a . . . . . . . . pla s + 1 ? s, ms ? a 68 n . . . . . z . plp s + 1 ? s, ms ? p 28 n v . 1 d i z c plx s + 1 ? s, ms ? x fa n . . . . . z . ply s + 1 ? s, ms ? y 7a n . . . . . z . rmb0 reset memory bit 0 . . . . . . . . rmb1 reset memory bit 1 . . . . . . . . rmb2 reset memory bit 2 . . . . . . . . rmb3 reset memory bit 3 . . . . . . . . rmb4 reset memory bit 4 . . . . . . . . rmb5 reset memory bit 5 . . . . . . . . rmb6 reset memory bit 6 . . . . . . . . rmb7 reset memory bit 7 . . . . . . . rol c ? 7 6 5 4 3 2 1 0 ? c 2e 3e 2a 26 36 n . . . . . z c ror c ? 7 6 5 4 3 2 1 0 ? c 6e 7e 6a 66 76 n . . . . . z c rti return from interrupt 40 n v . 1. d i z c rts return from subroutine 60 . . . . . . . . sbc a - m - (~c) ? a ed fd f9 e9 e5 e1 f5 f2 f1 n v . . . . z c sec 1 ? c 38 . . . . . . . 1 sed 1 ? d f8 . . . . 1 . . .
the western design ce nter, inc. W65C02S datasheet the western design center, inc. W65C02S datasheet 31 operation # immediate data ~ not ^ and pro cessor status register (p) *user defined v or a (a,x) a,x a,y (a) a # i r s zp (zp,x) zp,x zp,y (zp) (zp),y 7 6 5 4 3 2 1 0 mnemomic v exclusive or 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 n v 1 1 d i z c sei 1 ? i 78 . . . . . 1 . . smb0 set memory bit 0 87 . . . . . . . . smb1 set memory bit 1 97 . . . . . . . . smb2 set memory bit 2 a7 . . . . . . . . smb3 set memory bit 3 b7 . . . . . . . . smb4 set memory bit 4 c7 . . . . . . . . smb5 set memory bit 5 d7 . . . . . . . . smb6 set memory bit 6 e7 . . . . . . . . smb7 set memory bit 7 f7 . . . . . . . . sta a ? m 8d 9d 9 9 85 81 95 92 91 . . . . . . . . stp stop (1 ? phi2) db . . . . . . . . stx x ? m 8e 86 96 . . . . . . . . sty y ? m 8c 84 94 . . . . . . . . stz 00 ? m 9c 9e 64 74 . . . . . . . . tax a ? y aa n . . . . . z . tay a ? x ab n . . . . . z . trb ~a ^ m ? m 1c 14 . . . . . z . tsb avm ? m 0c 04 . . . . . . z . tsx s ? x ba n . . . . . z . txa x ? a 8a n . . . . . z . txs x ? s 9a . . . . . . . . tya y ? a 98 n . . . . . z . wai 0 ? rdy cb . . . . . . . .
the western design center, inc. W65C02S datasheet the western design center, inc. W65C02S datasheet 32 table 6 - 5 instruction timing chart address mode note cyc le vpb mlb sync address bus data bus rwb 1a. absolute a adc, and, bit, cmp, cpx, cpy, eor, lda, ldx, ldy, ora, sbc, sta, stx, sty, stz 16 opcodes, 3 bytes, 4&5 cycles (6) 1 2 3 4 1 1 1 1 1 1 1 1 1 0 0 0 pc pc+1 pc+2 aa opcode aal aah data 1 1 1 1/0 1 b. absolute (r - m - w) a asl, dec, inc, lsr, rol, ror, trb, tsb 8 opcodes, 3 bytes, 6 cycles 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 pc pc+1 pc+2 aa aa aa opcode aal aah data io data 1 1 1 1 1 0 1c. absolute (jump) a jmp (4c) 1 opcode, 3 bytes, 3 cycles 1 2 3 1 1 1 1 1 1 1 1 1 1 0 0 1 pc pc+1 pc+2 new pc opcode new pcl new pch new opcode 1 1 1 1 1d. absolute (jump to subroutine) a jsr (20) 1 opcode, 3 bytes, 3 cycles (different order from n6502) 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 pc pc+1 s s s+1 pc+2 new pc opcode new pcl io pch pcl new pch new opcode 1 1 1 0 0 1 1 2. absolute indexed indirect (a, x) jmp (7c) 1 opcode, 3 bytes, 6 cycles (1) 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 pc pc+1 pc+2 pc+2 aa+x a a+x+1 new pc opcode aal aah io new pcl new pch opcode 1 1 1 1 1 1 1 3a. absolute , x a, x adc, and, bit, cmp, eor, lda, ldy, ora, sbc, sta, stz 11 opcodes, 3 bytes, 4,5 and 6 cycles (1) (6) 1 2 3 4 1 1 1 1 1 1 1 1 1 0 0 0 pc pc+1 pc+2 aa+x opcode aal aah data 1 1 1 1/0 3b. absolute, x(r - m - w) a, x asl, dec, inc, lsr, rol, ror 6 opcodes, 3 bytes, 7 cycles (1) 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 pc pc+1 pc+2 aah,aal+x aa+x aa+x+1 aa+x opcode aal aah io data io data 1 1 1 1 1 1 0 4 . absolute, y a, y adc, and, cmp, eor, lda, ldx, ora, sbc, sta 9 opcodes, 3 bytes, 4,5 and 6 cycles (1) (6) 1 2 3 4 1 1 1 1 1 1 1 1 1 0 0 0 pc pc+1 pc+2 aa+y opcode aal aah data 1 1 1 1/0 5. absolute indirect (a) jmp (6c) 1 opcode, 3 bytes, 6 cycles 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 pc pc+1 pc+2 pc+2 0,aa 0,aa+1 new pc opcode aal aah io new pcl new pch opcode 1 1 1 1 1 1 1 6. accumulator a asl, dec, inc, lsr, rol, ror 6 opcodes, 1 byte, 2 cycles 1 2 1 1 1 1 1 0 pc pc+1 opcod e io 1 1 7. immediate # adc, and, bit, clr, cmp, cpy, cpx, eor, lda, ldx, ldy, ora, sbc 13 opcodes, 2 bytes, 2 and 5 cycles (6) 1 2 1 1 1 1 1 0 pc pc+1 opcode id 1 1 8a. implied i clc, cld, cli, clv, dex, dey, inx, iny, nop, sec, sed, sei, tax. tay, txa. tsx. txs, tya 18 opcodes, 1 byte, 2 cycles 1 2 1 1 1 1 1 0 pc pc+1 opcode io 1 1
the western design center, inc. w65c 02s datasheet the western design center, inc. W65C02S datasheet 33 address mode note cycle vpb mlb sync address bus data bus rwb 8b. stop the clock i stp 1 opcode, 1 byte, 3 cycles resb=1 resb=0 resb=0 resb=1 1 2 3 1 c 1b 1a 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 pc pc+1 pc+1 pc+1 pc+1 pc+1 pc+1 opcode io io res(brk) res(brk) res(brk) begin 1 1 1 1 1 1 1 8c. wait for interrupt i wai 1 opcode, 1 byte, 3 cycles irqb nmib (4) 1 2 3 1 1 1 1 1 1 1 1 1 1 0 0 1 pc pc+ 1 pc+1 pc+1 opcode io io irq(brk) 1 1 1 1 9a. relative r bcc, bcs, beq, bmi, bne, bpl, bra, bvc, bvs 9 opcodes, 2 bytes, 2,3 and 4 cycles (2) (3) 1 2 1 1 1 1 1 1 1 1 0 1 pc pc+1 new pc opcode offset opcode 1 1 1 9b. relative bit branch r bbrx, bbsx 1 6 opcodes, 3 bytes, 5,6 and 7 cycles (2) (3) 1 2 3 4 5 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 pc pc+1 0,zp pc+2 pc+offset opcode zp data offset new opcode 1 1 1 1 1 10a. stack s abortb, irqb, nmib, resb 4 hardware interrupts, 0 bytes, 7 cycles (5) 1 2 3 4 5 6 7 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 pc pc 01,s 01,s - 1 01,s - 2 va va+1 new pc not used not used return pch return pcl return p new pcl new pch new opcode 1 1 0 0 0 1 1 1 10b. stack (software interrupts) s brk 1 opcode, 2 bytes, 7 cycles 1 2 3 4 5 6 7 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 pc pc+1 s s - 1 s - 2 va va+1 new pc opcode not used return pch return pcl+2 return p new pcl new pch new opcode 1 1 0 0 0 1 1 1 10c. stack (return from interrupt) s rti 1 opcode, 1 byte, 6 cycles 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 pc pc+1 s+1 s+2 s+3 pc+1 return pc opcode not used return p return pcl return pch io new opcode 1 1 1 1 1 1 1 10d. stack (return from subroutine) s rts 1 opcode, 1 byte, 6 cycles 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 pc pc+1 pc+1 s+1 s+2 pc+1 return pc opcode not used not used return pcl return pch io new opcode 1 1 1 1 1 1 1 10e. stack s pha, php, phx, phy 4 opcodes, 1 byte, 3 cycles 1 2 3 1 1 1 1 1 1 1 1 1 1 0 0 1 pc pc+1 s pc+1 opcode not used register value new opcode 1 1 0 1 10f. stack s pla, plp, plx, ply 4 opcodes, 1 byte, 4 cycles 1 2 3 4 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 pc pc+1 pc+1 s+1 pc+1 opcode not used not used register value new opcode 1 1 1 1 1 11a. zero page zp adc, and, bit, cmp, cpx, cpy, eor, lda, ldx, ldy, ora, sbc, sta, stx, sty, stz 16 opcodes, 2 bytes, 3 and 4 cycles 1 2 3 1 1 1 1 1 1 1 1 1 1 0 0 1 pc pc+1 0,zp pc+2 opcode zp data new opcode 1 1 1/0 1
the western design center, inc. w65c 02s datasheet the western design center, inc. W65C02S datasheet 34 address mode note cycle vpb mlb sync address bus data bus rwb 11b. zero page zp asl, dec, inc, rol, ror, trb, tsb 7 opcodes 1 2 3 4 5 1 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 pc pc+1 pc+1 zp zp pc+2 opcode zp data not used data new opcode 1 1 1 1 0 1 11c. zero page zp rmbx, smbx 16 opcodes, 2 bytes, 5 cycles 1 2 3 4 5 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 pc pc+1 zp zp zp opcode zp data not used data 1 1 1 1 0 11d. zero page zp bbrx, bbsx 16 opcodes, 3 bytes, 5 cycles 1 2 3 4 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 pc pc+1 zp pc+2 pc+3 pc+2+0offset opcod e zp data offset not used new opcode 1 1 1 1 1 1 12. zero page indexed indirect (zp,x) adc, and, cmp, eor, lda, ora, sbc, sta 8 opcodes, 1 byte, 5 cycles 1 2 3 4 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 pc pc+1 pc+1 0,zp+x indirect address pc+1 opcode zp not used indirect address data new opcode 1 1 1 1 1 1 13a. zero page indexed with x zp,x adc, and, bit, cmp, eor, lda, ora, ldy, sbc, sta, sty, stz 12 opcodes, 1 byte, 4 cycles 1 2 3 4 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 pc pc+1 pc+1 0,zp+x pc+1 opcode zp not used data new opcode 1 1 1 1/0 1 13b. zerp page indexed with x zp,x asl, dec, inc, lsr, rol, ror 6 opcodes, 1 byte, 6 cycles 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 1 pc pc+1 pc+1 0,zp+x 0,zp+x 0,zp+x pc+1 opcode zp not used data not used data new opcode 1 1 1 1 1 0 1 14. zero page indexed with y zp,y adc, and, cmp, eor, lda, ldx, ora, sbc, sta, stx 10 opcodes, 1 byte, 4 cycles 1 2 3 4 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 pc pc+1 pc+1 0,zp+y pc+1 opcode zp not used data new opcode 1 1 1 1/0 1 15. zero page indirect (zp) adc, and, cmp, eor, lda, ora, sbc, sta 8 opcodes, 1 byte, 4 cycles 1 2 3 4 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 pc pc+1 0,zp indirect address pc+1 opcode zp indirect address data new opcode 1 1 1 1/0 1 16.. zero page indirect indexed with y (zp),y adc, and, cmp, eor, lda, ora, sbc, sta 8 opcodes, 1 byte, 4, 5 and 6 cycles (6) (1) 1 2 3 4 5 5a 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 pc pc+1 0,zp 0,zp+1 indirect address+y pc+2 opcode zp indirect address high indirect add ress low data new opcode 1 1 1 1 1/0 i
the western design center, inc. w65c 02s datasheet the western design center, inc. W65C02S datasheet 35 notes: 1. add 1 cycle for indexing across page boundaries, or write. this cycle contains invalid addresses. 2. add 1 cycle if branch is taken. 3. add 1 cycle if branch is taken across page boundaries. 4. wait at cycle 2 for 2 cycles after nmib or irqb active input. 5. rwb remains high during reset. 6. add 1 cycle for decimal mode aah absolute address pc program counter aah absolute address high pch program counter high aal absolute address low pcl program counter low aavh absolute address vector high r - m - w read - modify - write aavl absolute address vector low reg register c accumulator s stack address dest destination src source id immediate data so stack offset io internal operat ion v vector address p status register x,y index register zp zero page address
the western design center, inc. w65c 02s datasheet the western design center, inc. W65C02S datasheet 36 7 caveats table 7 - 1 microprocessor operational enhancements function nmos 6502 W65C02S indexed addressing across page boundary extra read of invalid address. extra read of last instruction byte. execution of invalid opcodes. some terminate only by reset. results are undefined. all are nop's (reserved for future use). opcode bytes cycles 0 2,22,42,62,82 2 2 c2, e2 x3,ob - bb,eb,fb 1 1 44 2 3 54,d4,f4 2 4 5c 3 8 dc,fc 3 4 jump indirect, operand = xxff. page address does not increment. page address increments, one additional cycle. read/modify/write instru ction at effective address. one read and two write cycles. two read and one write cycle. decimal flag. indeterminate after reset. initialized to binary mode (d=0) after reset and interrupts. flags after decimal operation. invalid n, v and z flags. valid flags. one additional cycle. interrupt after fetch of brk instruction interrupt vector is loaded; brk vector is ignored. brk is executed, and then interrupt is executed. ready. input. bi - directional, wai instruction pulls low. read/modify/write instruc tions absolute indexed in same page. seven cycles. six cycles. oscillator. requires external active components. crystal or rc network will oscillate when connected between phi2 and phi10. assertion of ready (rdy) during write operations. ignored. stops p rocessor during phi2, and wai instruction pulls rdy low. clock inputs. phi2 is the only required clock. phi2 is the only required clock. unused input - only pins. must be tied to vdd. must be tied to vdd. the brk instruction for both the nmos 6502 and 6 5c02 is a 2 byte instruction. the nmos and cmos devices simply skips the second byte (i.e. doesn?t care about the second byte) by incrementing the program counter twice. it is important to realize that if a return from interrupt is used it will return to the location after the second or signature byte.
the western design center, inc. w65c 02s datasheet the western design center, inc. W65C02S datasheet 37 memory bus eprom ram i/o matrix jtag oscillator reset circuit phi2 resb mpu control bus address buss data buss chip set pld ports pc parallel port i/o i/o 8 w65c02db developer board and in - circuit emulator (ice) the w65c02db is us ed for w65c02 core microprocessor system - chip development, W65C02S (chip) system development, or embedded w65c02db (board) development. programable i/o buss
the western design center, inc. w65c 02s datasheet the western design center, inc. W65C02S datasheet 38 8.1 features: W65C02S 8 - bit mpu, total access to all control lines, memory bus, programmable i/o bus, pc interface, 20 i /o lines, easy oscillator change, 32k sram, 32k eprom, w65c22s versatile interface adapter via peripheral chip, on - board matrix, cpld for memory map decoding, hardware breakpoints and asic design. the cpld chip is a xilinx xc95108 for changing the chip se lect and i/o functions if required. to change the cpld chip to suit your own setup, you need xilinx data manager for the xc95108 cpld chip. the w65c02db includes an on - board programming header for jtag configuration. for more details refer to the circui t diagram. the on - board W65C02S and the w65c22s devices have measurement points for core power consumption. power input is provided by an optional power board which plugs into the 10 pin power header. an eprom programmer or an eprom emulator is requir ed to reprogram the eprom. wdc?s (w65sds) software development system includes a W65C02S assembler and linker, W65C02S c - compiler and optimizer, and W65C02S simulator/debugger. wdc?s pc io daughter board can be used to connect the developer board to the parallel port of a pc for in - circuit debugging. 8.2 memory map: cs1b: 8000 - ffff t eprom (27c256) cs3b: 0000 - 00ef & 0100 - 7fff t sram (62c256) cs2b: 00f0 - 00ff t via(w65c22s) 8.3 cross - debugging monitor program the cross - debugging monitor programs of the deve loper boards are located in the directory : \ wdc_sds \ debug \ wdcmon \ this directory contains the source and the batch files for all of the monitor programs. these programs can be burned into an eprom and used with the wdc evaluation boards (developer boards) and the wdc io (or zio - 1) daughter board to interface to the parallel port of a pc. then, the wdcdb.exe debugger can be used to download programs, single step, set breakpoints, examine memory, etc for in - circuit debugging (icd). the monitors hav e been designed to run correctly with a w65c02 mpu (wdcmon_1), w65c816 mpu (wdcmon_2), w65c134 mcu (wdc134), or w65c265 mcu (wdc265). it detects the appropriate cpu type on reset and operates accordingly. 8.4 building the batch files assemble the program an d link it producing motorola s - record output. this can be changed by using a different option with the wdcln linker
the western design center, inc. w65c 02s datasheet the western design center, inc. W65C02S datasheet 39 9 hard core model 9.1 features of the W65C02S hard core model the W65C02S core uses the same instruction set as the W65C02S. the only functio nal difference between the W65C02S and W65C02S core is the rdy pin. the W65C02S rdy pin is bi - directional utilizing an active pull - up. the W65C02S core rdy function is split into 2 pins, rdy, waitn and waitp. the waitn output goes low and waitp goes hig h when a wai instruction is executed. the esd and latch - up buffers have been removed. the output from the core is the buffer n - channel and the p - channel transistor drivers. the following inputs, if not used, must be pulled to the high state: rdy, ir qb, nmib, be and sob. the timing of the W65C02S core is the same as the W65C02S. 10 soft core rtl model 10.1 w65c02 synthesizable rtl - code in verilog hdl the rtl - code ( r egister t ransfer l evel) in verilog is a synthesizable model. the behavior of this model is equivalent to the original W65C02S hardcore. the w65c02 rtl - code is available as the core model and the W65C02S standard chip model. the standard chip model includes the soft - core and the buffer ring in rtl - code.
the western design center, inc. w65c 02s datasheet the western design center, inc. W65C02S datasheet 40 ordering information W65C02S6pl - 14 description w65c w65c = standard product product identification number 02s foundry process 6 blank = 1.2u 8=.8u, 6=.6u package pl p = plastic dual - in - line, 40 pins pl = plastic leaded chip carrier, 44 pins q = quad flat pack, 44 pins temp erature/processing blank = - 40 c to + 85 c (plcc and qfp) 0 c to 70 c (dip) speed designator - 14 - 14 = 14mhz ____________________________________________________________________________________ to receive general sales or technical support on stan dard product or information about our module library licenses, contact us at: the western design center, inc. 2166 east brown road mesa, arizona 85213 usa phone: 480 - 962 - 4545 fax: 480 - 835 - 6442 information@westerndesigncenter.com www.westerndesignc enter.com _______________________________________________________________________________________ warning: mos circuits are subject to damage from static discharge internal static discharge circuits are provided to minimize part damage due to environ mental static electrical charge build - ups. industry established recommendations for handling mos circuits include: 1. ship and store product in conductive shipping tubes or conductive foam plastic. never ship or store product in non - conductive plastic c ontainers or non - conductive plastic foam material. 2. handle mos parts only at conductive work stations. 3. ground all assembly and repair tools.


▲Up To Search▲   

 
Price & Availability of W65C02S

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X