---------------------------------------------------------------------------- [GTE] Microcircuits CMOS 8/16-Bit Microprocessor Family 65sc802 is both software and pin-to-pin compatible with 6502. G65SC802 / G65SC816 Data Sheets * Features * AC/DC Characteristics * Functional Description * Addressing Modes * Notes on Instructions * Interrupts * Table 4. List of Mnemonics * Table 5-7. Instructions * Table 8. Opcode Matrix * Table 9. Detailed Instruction Operation * Figure 1. Block Diagram ---------------------------------------------------------------------------- Jouko Valta (jopi@stekt.oulu.fi). GTE G 65 SC 802 / G 65 SC 816 Microcircuits CMOS 8/16-Bit Microprocessor Family Features Advanced CMOS design for low power consumption and increased noise immunity Emulation mode for total software compatibility with 6502 designs Full 16-bit ALU, Accumulator, Stack Pointer, and Index Registers Direct Register for ''zero page'' addressing 24 addressing modes (including 13 original 6502 modes) Wait for Interrupt (WAI) and Stop the Clock (STP) instructions for reduced power consumption and decreased interrupt latency 91 instructions with 255 opcodes Co-Processor (COP) instruction and associated vector Powerful Block Move instructions Features (G65SC802 Only) 8-Bit Mode with both software and hardware (pin-to-pin) compatibility with 6502 designs (64 KByte memory space) Program selectable 16-bit operation Choice of external or on-board clock generation Features (G65SC816 Only) Full 16-bit operation with 24 address lines for 16 MByte memory Program selectable 8-Bit Mode for 6502 coding compatibility. Valid Program Address (VPA) and Valid Data Address (VDA) outputs for dual cache and DMA cycle steal implementation Vector Pull (VP) output indicates when interrupt vectors are being fetched. May be used for vectoring/prioritizing interrupts. Abort interrupt and associated vector for interrupting any instruction without modifying internal registers Memory Lock (ML) for multiprocessor system implementation General Description The G65SC802 and G65SC816 are ADV-CMOS (ADVanced CMOS) 16-bit microprocessors featuring total software compatibility with 8-bit NMOS and CMOS 6500 series microprocessors. The G65SC802 is pin-to-pin compatible with 8-bit 6502 devices currently available, while also providing full 16-bit internal operation. The G65SC816 provides 24 address lines for 16 MByte addressing, while providing both 8-bit and 16-bit operation. Each microprocessor contains an Emulation (E) mode for emulating 8-bit NMOS and CMOS 6500-Series microprocessors. A software switch determines whether the processor is in the 8-bit ernulation mode or in the Native 16-bit mode. This allows existing 8-bit system designs to use the many powerful features of the G65SC802 and G65SC816. The G65SC802 and G65SC816 provide the system engineer with many powerful features and options. A 16-bit Direct Page Register is provided to augment the Direct Page addressing mode, and there are separate Prograrn Bank Registers for 24-bit memory addressing. Other valuable features Include: * An Abort input which can interrupt the current instruction without modifying internal registers * Valid Data Address (VDA) and Valid Prograrn Address (VPA) output swhich facilitate dual cache memory by indicating whether a data or program segment is being accessed. * Vector modification by simply monitoring the Vector Pull (VP) output. * Block Move Instructions G65SC802 and G65SC816 microprocessors offer the design engineer a new freedom of design and application, and the many advantages of state-of-the-art ADV-CMOS technology. This is advanced information and specifications are subject to change without notice. Absolute Maximum Ratings: (Note 1) Rating Symbol Value Supply Voltage VDD -0.3V to +7.0V Input Voltage Vin -0.3V to VDD +0.3V Operating Temperature TA 0 °C to +70 °C 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. Notes: 1. Exceeding these ratings may cause permanent damage. Functional operation under these conditions is not implied. DC Chararacteristics (All Devices): VDD = 5.0V +-5%, VSS = OV, TA = 0 °C to +70 °C Parameter Symbol Min Max Unit Input High Voltage Vih /RES, RDY, /IRQ, Data, /SO, BE 2.0 Vdd+0.3 V /ABORT, /NMI, Phi2 (IN) 0.7Vdd Vdd+0.3 V Input Low Voltage Vil /RES, RDY, /IRQ, Data, /SO, BE -0.3 0.8 V /ABORT, /NMI, Phi2 (IN) -0.3 0.2 V Input Leakage Current (Vin = 0 to VDD) Iin /RES, /NMI, /IRQ, /SO, BE /ABORT (Internal Pullup) -100 1 uA RDY (Internal Pullup, Open Drain) -100 10 uA Phi2 (IN) -1 1 uA Address, Data, R/W (Off State, BE = 0) -10 10 uA Output High Voltage (Ioh = -100 uA) Voh SYNC, Data, Address, R/W, ML, VP, M/X, E, VDA, VPA, Phi1 (out), Phi2 (out) 0.7Vdd - V Output Low Voltage (Ioh = -100 uA) Vol SYNC, Data, Address, R/W, ML, VP, M/X, E, VDA, VPA, Phi1 (out), Phi2 (out) - 0.4 V Supply Current (No Load) Idd f = 2 MHz - 10 mA f = 4 MHz - 20 mA f = 6 MHz - 30 mA f = 8 MHz - 40 mA Standby Current (No Load; Data Bus = Vss or VDD) Phi2 (in) = /ABORT = /RES = /NMI = /IRQ = /SO = BE = VDD) Isb - 10 uA Capasitance (Vin = 0V, TA = 25°C, f = 2 MHz) Logic, Phi2 (in) Cin - 10 pF Address, Data, R/W (Off State) Cts - 15 pF AC Chararacteristics (G65SC802): VDD = 5.0V +-5%, VSS = OV, TA = 0 °C to +70 °C 2 MHz 4 MHz 6 MHz 8 MHz Parameter Symbol Min Max Min Max Min Max Min Max Unit Cycle Time tCYC 500 DC 250 DC 167 DC 125 DC nS Clock Pulse Width Low tPWL 0.240 10 0.120 10 0.080 10 0.060 10 uS Clock Pulse Width High tPWH 240 inf 120 inf 80 inf 60 inf nS Fall Time, Rise Time tF,tR - 10 - 10 - 5 - 5 nS Delay Time, Ph2 to Ph1 tDphi1 - 40 - 40 - 40 - 40 nS Delay Time, Ph2 to Ph2 tDphi2 - 40 - 40 - 40 - 40 nS A0-A15 Hold Time tAH 10 - 10 - 10 - 10 - nS A0-A15 Setup Time tADS - 100 - 75 - 60 - 40 nS Access Time tACC 365 - 130 - 87 - 70 - nS Read Data Hold Time tDHR 10 - 10 - 10 - 10 - nS Read Data Setup Time tDSR 40 - 30 - 20 - 15 - nS Write Data Delay Time tMDS - 100 - 70 - 60 - 40 nS Write Data Hold Time tDHW 10 - 10 - 10 - 10 - nS CPU Control Setup Time tPCS 40 - 30 - 20 - 15 - nS CPU Control Hold Time tPCH 10 - 10 - 10 - 10 - nS E,MX Output Hold Time tEH 10 - 10 - 5 - 5 - nS E,MX Output Setup Time tES 50 - 50 - 25 - 15 - nS Capacitive Load (Address, Data, and R/W) CEXT - 100 - 100 - 35 - 35 pF Timing Notes: 1 Typical output load = 100 pF 2 Voltage levels are VL < 0.4V, VH > 2.4V 3 Timing measurement points are 0.8V and 2.0V AC Chararacteristics (G65SC816): VDD = 5.0V +-5%, VSS = OV, TA = 0 °C to +70 °C 2 MHz 4 MHz 6 MHz 8 MHz Parameter Symbol Min Max Min Max Min Max Min Max Unit Cycle Time tCYC 500 DC 250 DC 167 DC 125 DC nS Clock Pulse Width Low tPWL 0.240 10 0.120 10 0.080 10 0.060 10 uS Clock Pulse Width High tPWH 240 inf 120 inf 80 inf 60 inf nS Fall Time, Rise Time tF,tR - 10 - 10 - 5 - 5 nS A0-A15 Hold Time tAH 10 - 10 - 10 - 10 - nS A0-A15 Setup Time tADS - 100 - 75 - 60 - 40 nS BA0-BA7 Hold Time tBH 10 - 10 - 10 - 10 - nS BA0-BA7 Setup Time tBAS - 100 - 90 - 65 - 45 nS Access Time tACC 365 - 130 - 87 - 70 - nS Read Data Hold Time tDHR 10 - 10 - 10 - 10 - nS Read Data Setup Time tDSR 40 - 30 - 20 - 15 - nS Write Data Delay Time tMDS - 100 - 70 - 60 - 40 nS Write Data Hold Time tDHW 10 - 10 - 10 - 10 - nS CPU Control Setup Time tPCS 40 - 30 - 20 - 15 - nS CPU Control Hold Time tPCH 10 - 10 - 10 - 10 - nS E,MX Output Hold Time tEH 10 - 10 - 5 - 5 - nS E,MX Output Setup Time tES 50 - 50 - 25 - 15 - nS Capacitive Load (Address, Data, and R/W) CEXT - 100 - 100 - 35 - 35 pF BE to High Imp. State tBHZ - 30 - 30 - 30 - 30 nS BE to Valid Data tBVD - 30 - 30 - 30 - 30 nS Timing Notes: 1 Typical output load = 100 pF 2 Voltage levels are VL < 0.4V, VH > 2.4V 3 Timing measurement points are 0.8V and 2.0V Functional Description The G65SC802 offers the design engineer the opportunity to utilize both existing software programs and hardware configurations, while also achieving the added advantages of increased register lengths and faster execution times. The G65SC802's "ease of use" design and implementation features provide the designer with increased flexibility and reduced implementation costs In the Emulation mode, the G65SC802 not only offers software compatibility, but is also hardware (pin-to-pin) compatible with 6502 designs plus it provides the advantages of 16-bit internal operation in 6502-compatible applications. The G65SC802 is an excellent direct replacement microprocessor for 6502 designs. The G65SC816 provides the design engineer with upward mobility and software compatibility in applications where a 16-bit system configuration is desired. The G65SC816's 16-bit hardware configuration, coupled with current software allows a wide selection of system applications. In the Emulation mode, the G65SC816 ofters many advantages, including full software compatibility with 6502 coding. In addition, the G65SC816's powerful instruction set and addressing modes make it an excellent choice for new 16-bit designs. Internal organization of the G65SC802 and G65SC816 can be divided into two parts: 1) The Register Section, and 2) The Control Section Instructions (or opcodes) obtained from program memory are executed by implementing a series of data transfers within the Register Section. Signals that cause data transfers to be executed are generated within the Control Section. Both the G65SC802 and the G65SC816 have a 16-bit internal architecture with an 8-bit external data bus. Instructlon Register and Decode An opcode enters the processor on the Data Bus, and is latched into the Instruction Register during the instruction fetch cycle. This instruction is then decoded, along with timing and interrupt signals, to generate the various Instruction Register control signals. Timing Control Unit (TCU) The Timing Control Unit keeps track of each instruction cycle as it is executed. The TCU is set to zero each time an instruction fetch is executed, and is advanced at the beginning of each cycle for as many cycles as is required to complete the instruction Each data transfer between registers depends upon decoding the contents of both the Instruction Register and the Timing Control Unit. Arithmetic and Logic Unit (ALU) All arithmetic and logic operations take place within the 16-bit ALU. In addition to data operations, the ALU also calculates the effective address for relative and indexed addressing modes. The result of a data operation is stored in either memory or an internal register. Carry, Negative, Over- flow and Zero flags may be updated following the ALU data operation. Internal Registers (Refer to Figure 2, Programming Model) Accumulator (A) The Accumulator is a general purpose register which stores one of the operands, or the result of most arithmetic and logical operations. In the Native mode (E=0), when the Accumulator Select Bit (M) equals zero, the Accumulator is established as 16 bits wide. When the Accumulator Select Bit (M) equals one, the Accumulator is 8 bits wide. In this case, the upper 8 bits (AH) may be used for temporary storage in conjunction with the Exchange AH and AL instruction. Data Bank (DB) During the Native mode (E=0), the 8-bit Data Bank Register holds the default bank address for memory transfers. The 24-bit address is composed of the 16-bit instruction effective address and the 8-bit Data Bank address. The register value is multiplexed with the data value and is present on the Data/Address lines during the first half of a data transfer memory cycle for the G65SC816. The Data Bank Register is initialized to zero during Reset. Direct (D) The 16-bit Direct Register provides an address offset for all instructions using direct addressing. The effective bank zero address is formed by adding the 8-bit instruction operand address to the Direct Register. The Direct Register is initialized to zero during Reset. Index (X and Y) There are two 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. Pre-indexing or postindexing of Indirect addresses may be selected. In the Native mode (E=0), both Index Registers are 16 bits wide (providing the Index Select Bit (X) equals zero). If the Index Select Bit (X) equals one, both registers will be 8 bits wide. Processor Status (P) The 8-bit Processor Status Register contains status flags and mode select bits. The Carry (C), Negative (N). Overflow (V), and Zero (Z) status flags serve to report the status ot most ALU operations. These status flags are tested by use of Conditional Branch instructions. The Decimal (D), IRQ Disable (I), Memory, Accumuiator (M), and Index (X) bits are used as mode select flags. These flags are set by the program to change microprocessor operations. The Emulation (E) select and the Break (B) flags are accessible only through the Processor Status Register. The Emulation mode select flag is selected by the Exchange Carry and Emulation Bits (XCE) instruction. Table 2, G65SC802 and G65SC816 Mode Comparison, illustrates the features of the Native (E=0) and Emulation (E=1) modes. The M and X flags are always equal to one in the Emulation mode. When an interrupt occurs during the Emulation mode, the Break flag is written to stack memory as bit 4 of the Processor Status Register. Program Bank (PB) The 8-bit Program Bank Register holds the bank address for all instruction fetches. The 24-bit address consists of the 16-bit instruction effective address and the 8-bit Program Bank address. The register value is multiplexed with the data value and presented on the Data/Address lines during the first half of a program memory read cycle. The Program Bank Register is initialized to zero during Reset. Program Counter (PC) The 16-bit Program Counter Register provides the addresses which are used to step the microprocessor through sequential program instructions. The register is incremented each time an instruction or operand is fetched from program memory. Stack Pointer (S) The Stack Pointer is a 16-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. The Stack Pointer allows simple implementation of nested subroutines and multiple- level interrupts. During the Emulation mode, the Stack Pointer high-order byte (SH) is always equal to 01. The Bank Address is 00 for all Stack operations. Signal Description The following Signal Description applies to both the G65SC802 and the SSC816 except as otherwise noted. Abort (/ABORT) -- G65SC816 The Abort input prevents modification of any internal registers during execution of the current instruction. Upon completion of this instruction, an interrupt sequence is initiated. The location of the aborted opcode is stored as the return address in Stack memory. The Abort vector address is 00FFF8, 9 (Emulation mode) or 00FFE8, 9 (Native mode). Abort is asserted whenever there is a low level on the Abort input. and the Phi2 clock is high. The Abort internal latch is cleared during the second cycle of the interrupt sequence. This signal may be used to handle out-of-bounds memory references in virtual memory systems. Address Bus (A0-A15) These sixteen output lines form the Address Bus for memory and I/O exchange on the Data Bus. When using the G65SC816, the address lines may be set to the high impedance state by the Bus Enable (BE) signal. Bus Enable (BE) The Bus Enable input signal allows external control of the Address and Data Buffers, as well as the R/W signal With Bus Enable high, the R/W and Address Buffers are active. The Data/Address Buffers are active during the first half of every cycle and the second half of a write cycle. When BE is low, these buffers are disabled. Bus Enable is an asynchronous signal. Data Bus (D0-D7) -- G65SC802 The eight Data Bus lines provide an 8-bit bidirectional Data Bus for use during data exchanges between the microprocessor and external memory or peripherals. Two memory cycles are required for the transfer of 16-bit values. Data/Address Bus (D0/BA0-D7/BA7) -- G65SC816 These eight lines multiplex bits BAO-BA7 with the data value. The Bank Address is present during the first half of a memory cycle, and the data value is read or written during the second half of the memory cycle. The Bank address external transparent latch should be latched when the Phi2 clock is high or RDY is low. Two memory cycles are required to transfer 16-bit values. These lines may be set to the high impedance state by the Bus Enable (BE) signal. Emulation Status (E) -- G65SC816 (Also Applies to G65SC802, 44-Pin Version) The Emulation Status output reflects the state of the Emulation (E) mode flag in the Processor Status (P) Register. This signal may be thought of an opcode extension and used for memory and system management. Interrupt Request (/IRQ) The Interrupt Request input signal is used to request that an interrupt sequence be initiated. When the IRQ Disable (I) flag is cleared, a low input logic level initiates an interrupt sequence after the current instruction is completed. The Wait for Interrupt (WAI) instruction may be executed to ensure the interrupt will be recognized immediately. The Interrupt Request vector address is 00FFFE,F (Emulation mode) or 00FFEE,F (Native mode). Since IRQ is a level-sensitive input, an interrupt will occur if the interrupt source was not cleared since the last interrupt. Also, no interrupt will occur if the interrupt source is cleared prior to interrupt recognition. Memory Lock (/ML) -- G65SC816 (Also Applies to G65SC802, 44-Pin Version) The Memory Lock 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 next bus cycle. Memory Lock is low during the last three or five cycles of ASL, DEC, INC, LSR, ROL, ROR, TRB, and TSB memory referencing instructions, depending the state of the M flag. Memory/Index Select Status (M/X) -- G65SC816 This multiplexed output reflects the state ot the Accumulator (M) and index (X) select flags (bits 5 and 4 of the Processor Status (P) Register). Flag M is valid during the Phi2 clock positive transition. Instructions PLP, REP, RTI and SEP may change the state of these bits. Note that the M/X output may be invalid in the cycle following a change in the M or X bits. These bits may be thought of as opcode extensions and may be used for memory and system management. Non-Maskable Interrupt (/NMI) A high-to-low transition initiates an intenupt sequence after the current instruction is completed. The Wait for Interrupt (WAI) instruction may be executed to ensure that the interrupt will be recognized immediately. The Non-Maskable Interrupt vector address is 00FFFA,B (Emulation mode) or 00FFEA,B (Native mode). Since NMI is an edge-sensitive Input, an interrupt will occur if there is a negative transition while servicing a previous interrupt. Also, no interrupt will occur if NMI remains low. Phase 1 Out (Phi1 (OUT)) -- G65SC802 This inverted clock output signal provides timing for external read and write operations. Executing the Stop (STP) instruction holds this clock in the low state. Phase 2 In (Phi2 (IN)) This is the system clock input to the microprocessor internal clock generator (equivalent to Phi0 (IN) on the 6502). During the low power Standby Mode, Phi2 (IN) should be held in the high state to preserve the contents of internal registers. Phase 2 Out (Phi2 (OUT)) -- G65SC802 This clock output signal provides timing for external read and write operations. Addresses are valid (after the Address Setup Time (TADS)) following the negative transition of Phase 2 Out. Executing the Stop (STP) instruction holds Phase 2 Out in the High state. Read/Write (R/W) When the R/W output signal is 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 from the microprocessor which is to be stored at the addressed memory location. When using the G65SC816, the R/W signal may be set to the high impedance state by Bus Enable (BE). Ready (RDY) This bidirectional signal indicates that a Wait for Interrupt (WAI) instruction has been executed allowing the user to halt operation of the microprocessor. A low input logic level will halt the microprocessor in its current state (note that when in the Emulation mode, the G65SC802 stops only during a read cycle). Returning RDY to the active high state allows the microprocessor to continue following the next Phase 2 In Clock negative transition. The RDY signal is internally pulled low following the execution of a Wait for Interrupt (WAI) instruction, and then returned to the high state when a /RES, /ABORT, /NMI, or /IRQ external interrupt is provided. This feature may be used to eliminate interrupt latency by placing the WAI instruction at the beginning of the IRQ servicing routine. If the IRQ Disable flag has been set, the next instruction will be executed when the IRQ occurs. The processor will not stop after a WAI instruction if RDY has been forced to a high state. The Stop (STP) instruction has no effect on RDY. Reset (/RES) The Reset input is used to initialize the microprocessor and start program execution. The Reset input buffer has hysteresis such that a simple R-C timing circuit may be used with the internal pullup device. The /RES signal must be held low for at least two clock cycles after VDD reaches operating voltage. Ready (RDY) has no effect while RES is being held low. During this Reset conditioning period, the following processor initialization takes place: Registers D = 0000 SH = 01 DB = 00 XH = 00 PB = 00 YH = 00 N V M X D I Z C/E P = * * 1 1 0 1 * */1 * = Not Initialized STP and WAI instructions are cleared. Signals E = 1 VDA = 0 M/X = 1 /VP = 1 R/W = 1 VPA = 0 SYNC = 0 When Reset is brought high, an interrupt sequence is initiated: * R/W remains in the high stale during the stack address cycles. * The Reset vector address is 00FFFC,D. Set Overtlow (/SO) -- G65SC802 A negative transition on this input sets the Overflow (V) flag, bit 6 of the Processor Status (P) Register. Synchronlze (SYNC) -- G65SC802 The SYNC output is provided to identify those cycles during which the microprocessor is fetching an opcode. The SYNC signal is high during an opcode fetch cycle, and when combined with Ready (RDY), can be used for single instruction execution. Valid Data Address (VDA) and Valid Program Address (VPA) -- G65SC816 These two output signals indicate the type of memory being accessed by the address bus. The following coding applies: VDA VPA 0 0 Internal Operation -- Address and Data Bus available. Address outputs may be invalid due to low byte additions only. 0 1 Valid program address -- may be used for program cache control. 1 0 Valid data address -- may be used for data cache control. 1 1 Opcode fetch -- may be used for program cache control and single step control. VDD and Vss VDD Vss the positive supply voltage and Vss is system ground. When using only one ground on the G65SC802 DIP package, pin 21 preferred. Vector Pull (VP) -- G65SC816 (Also Applies to G65SC802 44-Pin Version) The Vector Pull output indicates that a vector location is being addressed during an interrupt sequence. /VP is low during the last two interrupt sequence cycles, during which time the processor reads the interrupt vector. The /VP signal may be used to select and prioritize interrupts from several sources by modifying the vector addresses. -------------------------------------------------------------------------- 8 bits 8 bits 8 bits DB DB Data Bank Register XH XL Index Register (X) YH YL Index Register (Y) 00 SH SL Stack Pointer (S) AH AL Accumulator (A) PB PCH PCL Program Counter (PC) Program Bank Register (PB) 00 DH DL Direct Register (D) L = Low, H = High Processor Status Register (P) ____________________________ | 1 B E | |__________________________| | N V M X D I Z C | |__________________________| 1 Always 1 if E=1 B Break 0 on Stack after interupt if E=1 E Emulation Bit 0= Native mode, 1= 6502 emulation N Negative 1= Negative V Overflow 1= True M Memory/Acc. Select 1= 8 bit, 0= 16 bit X Index Register Select 1= 8 bit, 0= 16 bit D Decimal mode 1= Decimal Mode I IRQ Disable 1= Disable Z Zero 1= Result Zero C Carry 1= True Figure 2. Programming model -------------------------------------------------------------------------- Table 1. G65SC802 and G65SC816 Compability Function G65SC802/816 G65SC02 NMOS 6502 Emulation Decimal Mode: * After Interrupts 0 -> D 0 -> D Not initialized * N, Z Flags Valid Valid Undefined * ADC, SBC No added cycle Add 1 cycle No added cycle Read-Modify-Write: * Absolute Indexed, No Page Crossing 7 cycles 6 cycles 7 cycles * Write Last 2 cycles Last cycle Last 2 cycles * Memory Lock Last 3 cycles Last 2 cycles Not available Jump Indirect: * Cycles 5 cycles 6 cycles 5 cycles * Jump Address, operand = xxFF Correct Correct Invalid Branch or Index Across Page Boundary Read last Read last Read invalid program byte program byte address 0 -> RDY During Write G65SC802: Ignored Processor Ignored until until read stops read G65SC816: Processor stops Write During Reset No Yes No Unused Opcodes No operation No operation Undefined Phi1 (OUT), Phi2 (OUT), /SO, SYNC Signals Available with Available Available G65SC802 only RDY Signal Bidirectional Input Input -------------------------------------------------------------------------- Table 2. G65SC802 and G65SC816 Mode Comparison Function Emulation (E = 1) Native (E = 0) Stack Pointer (S) 8 bits in page 1 16 bits Direct Index Address Wrap within page Crosses page boundary Processor Status (P): * Bit 4 Always one, except zero X flag (8/16-bit Index) in stack after hardware interrupt * Bit 5 Always one M flag (8/16-bit Accumulator) Branch Across Paqe Boundary 4 cycles 3 cycles Vector Locations: ABORT 00FFF8,9 00FFF8,9 BRK 00FFFE,F 00FFF6,7 COP 00FFF4,5 00FFF4,5 IRQ 00FFFE,F 00FFFE,F NMI 00FFFA,B 00FFFA,B RES 00FFFC,D 00FFFC,D (1 -> E) Program Bank (PB) During Interrupt, RTI Not pushed, pulled Pushed and pulled 0 -> RDY During Write G65SC802: Ignored until read Processor stops G65SC816: Processor stops Write During Read-Modify-Write Last 2 cycles Last 1 or 2 cycles depending on M flag G65SC802 and G65SC816 Microprocessor Addressing modes The G65SC816 is capable of directly addressing 16 MBytes of memory. This address space has special significance within certain addressing modes, as follows: Reset and Interrupt Vectors The Reset and Interrupt vectors use the majority of the fixed addresses between 00FFE0 and 00FFFF. Stack The Native mode Stack address will always be within the range 000000 to 00FFFF. In the Emulation mode, the Stack address range is 000100 to 0001FF. The following opcodes and addressing modes can increment or decrement beyond this range when accessing two or three bytes: JSL; JSR (a,x); PEA; PEI; PER; PHD; PLD; RTL; d,s; (d,s),y. Direct The Direct addressing modes are often used to access memory registers and pointers. The contents of the Direct Register (D) is added to the offset contained in the instruction operand to produce an address in the range 000000 to 00FFFF. Note that in the Emulation mode, [Direct] and [Direct],y addressing modes and the PEI instruction will increment from 0000FE or 0000FF into the Stack area, even if D=0. Program Address Space The Program Bank register is not affected by the Relative, Relative Long, Absolute, Absolute Indirect, and Absolute Indexed Indirect addressing modes or by incrementing the Program Counter from FFFF. The only instructions that affect the Program Bank register are: RTI, RTL, JML, JSL, and JMP Absolute Long. Program code may exceed 64K bytes altough code segments may not span bank boundaries. Data Address Space The data address space is contiguous throughout the 16 MByte address space. Words, arrays, records, or any data structures may span 64K byte bank boundaries with no compromise in code efficiency. As a result, indexing from page FF in the G65SC802 may result in data accessed in page zero. The following addressing modes generate 24-bit effective addresses. * Direct Indexed Indirect (d,x) * Direct Indirect Indexed (d),y * Direct Indirect (d) * Direct Indirect Long [d] * Direct Indirect Indexed Long [d],y * Absolute * Absolute,x * Absolute,y * Absolute long * Absolute long indexed * Stack Relative Indirect Indexed (d,s),y The following addressing mode descriptions provide additional detail as to how effective addresses are calculated. Twenty-four addressing modes are available for use with the G65SC802 and G65SC816 microprocessors. The "long" addressing modes may be used with the G65SC802; however, the high byte of the address is not available to the hardware. Detailed descriptions of the 24 addressing modes are as follows: 1. Immediate Addressing -- # The operand is the second byte (second and third bytes when in the 16-bit mode) of the instruction. 2. Absolute -- a With Absolute addressing the second and third bytes of the instruction form the low-order 16 bits of the effective address. The Data Bank Register contains the high-order 8 bits of the operand address. __________________________ Instruction: | opcode | addrl | addrh | ~~~~~~~~~~~~~~~~~~~~~~~~~~ Operand Address: | DB | addrh | addrl | 3. Absolute Long -- al The second, third, and fourth byte of the instruction form the 24-bit effective address. __________________________________ Instruction: | opcode | addrl | addrh | baddr | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Operand Address: | baddr | addrh | addrl | 4. Direct -- d The second byte of the instruction is added to the Direct Register (D) to form the effective address. An additional cycle is required when the Direct Register is not page aligned (DL not equal 0). The Bank register is always 0. ___________________ Instruction: | opcode | offset | ~~~~~~~~~~~~~~~~~~~ | Direct Register | + | offset | --------------------- Operand Address: | 00 | effective address | 5. Accumulator -- A This form of addressing always uses a single byte instruction. The operand is the Accumulator. 6. Implied -- i Implie