If your XS650 with standard Yamaha electronic ignition has no spark.
As always, test the alternator rotor to be sure it hasn't failed. It must read 4 ohms or more between the slip rings. If this tests OK, move on to testing the ignition system.
A quick overview of system. A magnet imbedded in the alternator rotor passes the pick-up coil unit, it's actually two coils, and creates a magnetic force field around these coils. As the magnet passes and the force field collapses it generates a current. This current activates the TCI (Transistor Controlled Ignition) ignitor unit which sends a momentary current to the ignition primary coil of few but heavy wire windings. This creates a force field around the secondary coil of many but thin wire windings, and as this force field collapses it generates a very high voltage current that creates the spark in both plugs at once. One fires on the top of the compression stroke, the other fires without effect on the top of the exhaust stroke.
All of these items can be tested with the exception of the TCI ignitor unit; if all else tests OK then the TCI is presumed faulty.
(1) Check the fuse box to ensure the 10 AMP ignition fuse is not blown and rotate it to make sure it is making good contact. Test there is 12V coming to one side of this fuse when the ignition is "on". If your labels are gone, it's the fuse with the red/white wires
(2) Use an ohm meter make sure both the engine and the battery negative post are fully grounded to the frame, that is zero ohms reading.
(3) Ensure good sparkplugs and fully charged battery. Test battery voltage. Remember a fully charged battery is 12.6 V if conventional acid filled, 13 V if maintenance free. 12.4 is 75%, 12.2 is 50% 12 is 25% 11.9 is completely dead.
(4) Make sure the engine stop switch is on "run", and that the plug to this switch is OK. This plug is in the headlight shell and has 4 wires, two for the starter switch and two for the kill switch. The starter switch wires are black and blue/white, ignore them. The kill switch ones are both red/white. Check that there is continuity on the two coming from the switch when it is on "run", that is zero ohms reading, and that one of the these red/whites on the harness side of the plug has 12v power when the ignition is on.
(5) If your bike is an 82 (XS650 SJ) or 83 (XS650 SK) it has a sidestand switch which operates a sidestand relay. This relay is normally closed and the sidestand switch is open when the sidestand is down. This relay being normally closed will short the TCI ignitor unit's control current to ground, and prevent the bike from running. When you put the sidestand up, it closes the sidestand switch which grounds the relay solenoid, energizing it, and so the sidestand relay opens it's internal relay switch ungrounding the TCI control current, and allows the TCI to operate and trigger the ignition coils. This circuit is further complicated in that there is also a lead coming off the same contact on the sidestand relay solenoid coil as the sidestand switch does, and passes through a diode to the neutral light circuit, the neutral light switch will therefore also ground and energize the sidestand solenoid as long as the bike is in neutral, even though the side stand is down. This is so the bike will stop if the side stand is lowered while in gear, but will run with the sidestand up or down if the bike is in neutral. As you can see from this, if the relay solenoid is defective, the TCI will be shorted to ground at all times and give the same result as a defective TCI. If the diode on the circuit is defective, the bike will not run if the stand is down even if it is in neutral and the neutral light is on. Test this by unplugging the sidestand relay once you find it (can't help you, don't know where it is on an 83, but it will have four wires coming to it's plug, black, red/white, black/white, blue/yellow). If it's faulty the bike will run without it, it was added as a safety feature in the last two years of the XS650.
(6) With ignition off, disconnect the pick up coil (which is at 12 o'clock on the alternator stator cage in case you need to change it) at the plug between the airboxes, and test with ohm meter.
'80 to 81- Measure between black/white and the white/red leads and between black/white and white/green leads Both should measure 550-850 ohms
'82 to '83. Measure between grey and black leads and between orange and black leads. Both should measure 630-770 ohms.
(7) Test all connections to make sure all are tight and clean.
(8) Remove fuel tank to expose ignition coils, and test ignition coils.
(i) Primary resistance - Between red/white and gray or orange (it can be either) leads must be 2.25 to 2.75 ohms.
(ii) Secondary resistance, between two the spark plug leads tested at the spark plug caps. Should be 10,500 to 15,500 ohms. But if the bike has resistor caps, which is highly probable, these will add 5,000 ohm per cap to this figure. This will not affect operation of the bike.
(9) If all above is OK, a presumptive diagnosis can be made that theTCI ignitor unit is faulty.
If you don't have spark after the bike has been stored for a while, it's usually a corroded harness plug connection or a bad ground.