IDE-Port (40-way)
40 39    180
GRN 38 37 CIA 6526
BLU 36 35 BRN 1  GND  U  CNT    40
34 33 2  PA0    SP    39
32 31 YEL 3  PA1  A0    38
30 29 GRN 4  PA2  A1    37
   10k 28 27           3.3k BRN BLK 5  PA3  A2    36
26 25 BLK BLK 6  PA4  A3    35
24 23 BLK BLU 7  PA5 /RESET    34
22 21           3.3k BRN ORA 8  PA6  D0    33
  20 19 RED RED 9  PA7  D1    32
18 17 ORA 10 PB0  D2    31
16 15 YEL 11 PB1  D3    30
14 13   GRN 12 PB2  D4    29
12 11 BLU 13 PB3  D5    28 U3
10 9 PUR 14 PB4  D6    27
8 7 GRY 15 PB5  D7    26 9   8
6 5 WHT 16 PB6 PHI2    25 10 74LS138 7
4 3 CRM 17 PB7    /FLAG    24 11 6
2 1 LBL 18 /PC   /CS    23 BLU 12 5
19 TOD R/W    22 13 4
PUR 20 5v   IRQ    21 14 3
15 2
16
1
Top View   = Cable-2 (small)
Pin-20 Missing & Notch opposite   = Cable-1 (wide)
  = Not used
Note: Pin 38 on IDE is connected to Pin-4 on 6526 (No connecting lines are drawn for pins 38 & 36 because it would make 
Pin 36 on IDE is connected to Pin-7 on 6526 the layout too messy)