-
Notifications
You must be signed in to change notification settings - Fork 182
/
Copy path65c816.txt
2584 lines (1959 loc) · 91 KB
/
65c816.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
----------------------------------------------------------------------------
[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 ([email protected]).
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
Implied addressing uses a single byte instruction. The operand is implicitly
defined by the instruction.
7. Direct Indirect Indexed -- (d),y
This address mode is often referred to as Indirect,Y. The second byte of the
instruction is added to the Direct Register (D). The 16-bit contents of this
memory location is then combined with the Data Bank register to form a 24-bit
base address. The Y Index Register is added to the base address to form the
effective address.
___________________
Instruction: | opcode | offset |
~~~~~~~~~~~~~~~~~~~
| Direct Register |
+ | offset |
---------------------
| 00 | direct address |
then:
| 00 | (direct address) |
+ | DB |
-------------------------------
| base address |
+ | | Y Reg |
------------------------------
Operand
Address: | effective address |
8. Direct Indirect Indexed Long -- [d],y
With this addressing mode the 24-bit base address is pointed to by
the sum of the second byte of the instruction and the Direct
Register The effective address is this 24-bit base address plus the Y
Index Register
___________________
Instruction: | opcode | offset |
~~~~~~~~~~~~~~~~~~~
| Direct Register |
+ | offset |
---------------------
| 00 | direct address |
then:
| (direct address) |
+ | | Y Reg |
------------------------------
Operand
Address: | effective address |
9. Direct Indexed Indirect -- (d,x)
This address mode is often referred to as Indirect X The second
byte of the Instruction is added to the sum of the Direct Register
and the X Index Register. The result points to the low-order 16 bits
of the effective address. The Data Bank Register contains the high-
order 8 bits of the effective address.
___________________
Instruction: | opcode | offset |
~~~~~~~~~~~~~~~~~~~
| Direct Register |
+ | offset |
---------------------
| direct address |
+ | | X Reg |
---------------------
| 00 | address |
then:
| 00 | (address) |
+ | DB |
-------------------------------
Operand
Address: | effective address |
10. Direct Indexed With X -- d,x
The second byte of the instruction is added to the sum of the Direct Register
and the X Index Register to form the 16-bit effective address. The operand is
always in Bank 0.
___________________
Instruction: | opcode | offset |
~~~~~~~~~~~~~~~~~~~
| Direct Register |
+ | offset |
---------------------
| direct address |
+ | | X Reg |
-------------------------------
Operand
Address: | 00 | effective address |
11. Direct Indexed With Y -- d,y
The second byte of the instruction is added to the sum of the Direct Register
and the Y Index Register to form the 16-bit effective address. The operand is
always in Bank 0.
___________________
Instruction: | opcode | offset |
~~~~~~~~~~~~~~~~~~~
| Direct Register |
+ | offset |
---------------------
| direct address |
+ | | Y Reg |
-------------------------------
Operand
Address: | 00 | effective address |
12. Absolute Indexed With X -- a,x
The second and third bytes of the instruction are added to the
X Index Register to form the low-order 16 bits of the ef~ective ad-
dress The Data Bank Register contains the high-order 8 bits of the
effective address
____________________________
Instruction: | opcode | addrl | addrh |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| DB | addrrh | addrl |
+ | | X Reg |
-------------------------------
Operand
Address: | effective address |
13. Absolute Indexed With Y -- a,y
The second and third bytes of the instruction are added to the
Y Index Register to form the low-order 16 bits of the eftective ad-
dress The Data Bank Register contains the high-order 8 bits of tne
effective address.
____________________________
Instruction: | opcode | addrl | addrh |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| DB | addrrh | addrl |
+ | | Y Reg |
-------------------------------
Operand
Address: | effective address |
14. Absolute Long Indexed With X -- al,x
The second third and fourth bytes ot the instruction form a 24-bit base
address. The effective address is the sum of this 24-bit address and the
X Index Register.
____________________________________
Instruction: | opcode | addrl | addrh | baddr |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| baddr | addrrh | addrl |
+ | | X Reg |
-------------------------------
Operand
Address: | effective address |
15. Program Counter Relative -- r